Skip to content

Commit 752ea70

Browse files
committed
Check that there are not other solutions other than the first given
1 parent c3fbdc6 commit 752ea70

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/functional/single_cells/vcd_harness_smt.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
# Load and execute the SMT file
4242
with open(smt_file_path, 'r') as smt_file:
4343
for line in smt_file:
44-
smt_io.write(line.strip())
44+
smt_io.write(line.strip())
4545
smt_io.check_sat()
4646
# Read and parse the SMT file line by line
4747
with open(smt_file_path, 'r') as smt_file:
@@ -161,6 +161,17 @@ def hex_to_bin(value):
161161
value = hex_to_bin(value[1:])
162162
print(f" {output_name}: {value}")
163163
signals[output_name].append((step, value))
164+
smt_io.write(f'(push 1)')
165+
smt_io.write(f'(assert (not (= ({output_name} test_outputs_step_n{step}) #{value})))')
166+
result = smt_io.check_sat(["unsat"])
167+
if result != 'unsat':
168+
smt_io.p_close()
169+
sys.exit(1)
170+
smt_io.write(f'(pop 1)')
171+
result = smt_io.check_sat(["sat"])
172+
if result != 'sat':
173+
smt_io.p_close()
174+
sys.exit(1)
164175

165176
smt_io.p_close()
166177

0 commit comments

Comments
 (0)