mirror of
https://github.com/Jaxan/satuio.git
synced 2025-04-27 14:47:46 +02:00
small change for ads
This commit is contained in:
parent
f1ee29e3f2
commit
9dbe5dee5b
1 changed files with 4 additions and 2 deletions
|
@ -119,6 +119,7 @@ measure_time('Setup solver', args.solver)
|
||||||
# and we also record the outputs along this path. The outputs are later
|
# and we also record the outputs along this path. The outputs are later
|
||||||
# used to decide whether we found a different output.
|
# used to decide whether we found a different output.
|
||||||
possible_outputs = {}
|
possible_outputs = {}
|
||||||
|
possible_states = {}
|
||||||
for s in tqdm(states, desc="CNF paths"):
|
for s in tqdm(states, desc="CNF paths"):
|
||||||
# current set of possible states we're in
|
# current set of possible states we're in
|
||||||
current_set = set([s])
|
current_set = set([s])
|
||||||
|
@ -133,8 +134,9 @@ for s in tqdm(states, desc="CNF paths"):
|
||||||
# For i == 0, this is a single state (s).
|
# For i == 0, this is a single state (s).
|
||||||
unique([svar(s, i, t) for t in current_set])
|
unique([svar(s, i, t) for t in current_set])
|
||||||
|
|
||||||
# We keep track of the possible outputs
|
# We keep track of the possible outputs and states
|
||||||
possible_outputs[(s, i)] = set()
|
possible_outputs[(s, i)] = set()
|
||||||
|
possible_states[(s, i)] = current_set
|
||||||
|
|
||||||
for t in current_set:
|
for t in current_set:
|
||||||
for a in alphabet:
|
for a in alphabet:
|
||||||
|
@ -263,7 +265,7 @@ if solution:
|
||||||
for s in states:
|
for s in states:
|
||||||
console.print(s.rjust(max_state_length, ' '), end=': ', style='bold black')
|
console.print(s.rjust(max_state_length, ' '), end=': ', style='bold black')
|
||||||
for i in range(length):
|
for i in range(length):
|
||||||
for t in all_states:
|
for t in possible_states[(s, i)]:
|
||||||
if svar(s, i, t) in truth:
|
if svar(s, i, t) in truth:
|
||||||
console.print(t, end=' ', style='blue')
|
console.print(t, end=' ', style='blue')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue