@@ -14,7 +14,7 @@ public import Mathlib
1414/-!
1515# Examples of Progs for Circuits
1616
17- This file contains examples and tests of circuits written in the Prog Model
17+ This file contains examples and tests of fan-in 2 circuits written in the Prog Model
1818-/
1919namespace CslibTests
2020
@@ -28,17 +28,17 @@ def exCircuit1 : Prog (Circuit Bool) Bool := do
2828 let w := mul 3 x y
2929 add 4 z w
3030
31- /--
32- info: true
33- -/
34- #guard_msgs in
35- #eval exCircuit1.eval circModel
31+ -- /--
32+ -- info: true
33+ -- - /
34+ -- #guard_msgs in
35+ -- #eval exCircuit1.eval circModel
3636
37- /--
38- info: { depth := 2, size := 5 }
39- -/
40- #guard_msgs in
41- #eval exCircuit1.time circModel
37+ -- /--
38+ -- info: { depth := 2, size := 5 }
39+ -- - /
40+ -- #guard_msgs in
41+ -- #eval exCircuit1.time circModel
4242
4343open Circuit in
4444def exCircuit2 : Prog (Circuit ℚ) ℚ := do
@@ -47,35 +47,35 @@ def exCircuit2 : Prog (Circuit ℚ) ℚ := do
4747 let z := add 2 x y
4848 mul 4 z z
4949
50- /--
51- info: 9
52- -/
53- #guard_msgs in
54- #eval exCircuit2.eval circModel
50+ -- /--
51+ -- info: 9
52+ -- - /
53+ -- #guard_msgs in
54+ -- #eval exCircuit2.eval circModel
5555
56- /--
57- info: true
58- -/
59- #guard_msgs in
60- #eval exCircuit2.time circModel == ⟨2 ,4 ⟩
56+ -- /--
57+ -- info: true
58+ -- - /
59+ -- #guard_msgs in
60+ -- #eval exCircuit2.time circModel == ⟨2,4⟩
6161
6262open Circuit in
6363def exCircuit3 (x y : Circuit ℚ ℚ) : Prog (Circuit ℚ) ℚ := do
6464 let z := add 2 x y
6565 let w := mul 3 x y
6666 mul 4 z w
6767
68- /--
69- info: true
70- -/
71- #guard_msgs in
72- #eval (exCircuit3 (.const 0 (1 : ℚ)) (.const 1 (21 : ℚ))).eval circModel == 462
68+ -- /--
69+ -- info: true
70+ -- - /
71+ -- #guard_msgs in
72+ -- #eval (exCircuit3 (.const 0 (1 : ℚ)) (.const 1 (21 : ℚ))).eval circModel == 462
7373
74- /--
75- info: true
76- -/
77- #guard_msgs in
78- #eval (exCircuit3 (.const 0 (1 : ℚ)) (.const 1 (21 : ℚ))).time circModel == ⟨2 ,5 ⟩
74+ -- /--
75+ -- info: true
76+ -- - /
77+ -- #guard_msgs in
78+ -- #eval (exCircuit3 (.const 0 (1 : ℚ)) (.const 1 (21 : ℚ))).time circModel == ⟨2,5⟩
7979
8080
8181open Circuit in
@@ -90,17 +90,17 @@ def CircAnd (n : ℕ) (x : Fin n → Circuit Bool Bool) : Circuit Bool Bool :=
9090def execCircAnd (x : Fin n → Circuit Bool Bool) : Prog (Circuit Bool) Bool := do
9191 CircAnd n x
9292
93- /--
94- info: true
95- -/
96- #guard_msgs in
97- #eval (execCircAnd ![.const 0 true , .const 1 true , .const 2 true ]).eval circModel == true
98-
99- /--
100- info: true
101- -/
102- #guard_msgs in
103- #eval (execCircAnd ![.const 0 true , .const 1 true , .const 2 true ]).time circModel == ⟨3 ,5 ⟩
93+ -- /--
94+ -- info: true
95+ -- - /
96+ -- #guard_msgs in
97+ -- #eval (execCircAnd ![.const 0 true, .const 1 true, .const 2 true]).eval circModel == true
98+
99+ -- /--
100+ -- info: true
101+ -- - /
102+ -- #guard_msgs in
103+ -- #eval (execCircAnd ![.const 0 true, .const 1 true, .const 2 true]).time circModel == ⟨3,5⟩
104104
105105
106106end CslibTests
0 commit comments