Commit 56b0923f authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[lib] Tests: CLUnfolder: fix typos

parent 54b6b905
......@@ -414,6 +414,7 @@ def test_init_unfolder(feed_mclanalyser):
# __var_list is built on casted set; MCLAnalyser is un debug mode
# so the list is sorted
# 47 elems but max id for literals is 46
expected = [
'##',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'P',
......@@ -539,6 +540,7 @@ def test_init_forward_unfolding_solution_3(feed_mclanalyser, textual_properties,
# Note: The second set creates auxiliary clauses that we could not insert
# in DIMACS form in the query so we use the text form for it.
# DIMACS data comes from the simple first numeric_properties ([[13]], [[12]], [[3]])
query = MCLSimpleQuery(*textual_properties[1])
query.dim_start, query.dim_inv, query.dim_final = numeric_properties[0]
mcla.unfolder.init_with_query(query)
......@@ -573,11 +575,11 @@ def init_forward_unfolding_solution_1(mcla):
init_forward_unfolding_part_1(mcla.unfolder)
print(unfolder.dynamic_constraints)
print(unfolder.initial_constraints)
print(unfolder.invariant_constraints)
print(unfolder.variant_constraints)
print(unfolder.final_constraints)
print("dynamic_constraints:", unfolder.dynamic_constraints)
print("initial_constraints:", unfolder.initial_constraints)
print("invariant_constraints:", unfolder.invariant_constraints)
print("variant_constraints:", unfolder.variant_constraints)
print("final_constraints:", unfolder.final_constraints)
# No auxiliary variables
assert unfolder._CLUnfolder__aux_code_table == dict()
......@@ -604,9 +606,9 @@ def init_forward_unfolding_solution_1(mcla):
init_forward_unfolding_part_2(unfolder)
print(unfolder.dynamic_constraints)
print(unfolder.invariant_constraints)
print(unfolder.final_constraints)
print("dynamic_constraints:", unfolder.dynamic_constraints)
print("invariant_constraints:", unfolder.invariant_constraints)
print("final_constraints:", unfolder.final_constraints)
# Shift of the system clauses and auxiliary clauses is made now.
expected = [
......@@ -660,11 +662,11 @@ def init_forward_unfolding_solution_2(mcla):
init_forward_unfolding_part_1(mcla.unfolder)
print(unfolder.dynamic_constraints)
print(unfolder.initial_constraints)
print(unfolder.invariant_constraints)
print(unfolder.variant_constraints)
print(unfolder.final_constraints)
print("dynamic_constraints:", unfolder.dynamic_constraints)
print("initial_constraints:", unfolder.initial_constraints)
print("invariant_constraints:", unfolder.invariant_constraints)
print("variant_constraints:", unfolder.variant_constraints)
print("final_constraints:", unfolder.final_constraints)
# Auxiliary variables: "C and K" property is added
assert unfolder._CLUnfolder__aux_code_table == {'_lit47': 47}
......@@ -703,12 +705,15 @@ def init_forward_unfolding_solution_2(mcla):
init_forward_unfolding_part_2(unfolder)
print(unfolder.dynamic_constraints)
print(unfolder.invariant_constraints)
print(unfolder.final_constraints)
print("dynamic_constraints:", unfolder.dynamic_constraints)
print("initial_constraints:", unfolder.initial_constraints)
print("invariant_constraints:", unfolder.invariant_constraints)
print("final_constraints:", unfolder.final_constraints)
# Shift of the system clauses (and syst aux clauses)
# The maximum value is now 48 since there is 47 literals
# System variables: max id is 46
# Max value in the initial constraints: 47
# => This last one is an auxiliary variable
assert unfolder.get_var_number() == 46
assert unfolder.shift_step == 47
expected = [
......@@ -765,10 +770,10 @@ def init_forward_unfolding_solution_3(mcla):
init_forward_unfolding_part_1(mcla.unfolder)
print(1, unfolder.dynamic_constraints)
print(2, unfolder.initial_constraints)
print(3, unfolder.invariant_constraints)
print(5, unfolder.final_constraints)
print("dynamic_constraints:", unfolder.dynamic_constraints)
print("initial_constraints:", unfolder.initial_constraints)
print("invariant_constraints:", unfolder.invariant_constraints)
print("final_constraints:", unfolder.final_constraints)
assert unfolder.shift_step == 47
......@@ -945,18 +950,16 @@ def test_shift(feed_mclanalyser, textual_properties):
query = MCLSimpleQuery(start, invariant, final)
unfolder.init_with_query(query)
init_forward_unfolding_part_1(mcla.unfolder)
init_forward_unfolding_part_2(unfolder)
unfolder.init_forward_unfolding()
unfolder.shift()
print(unfolder.dynamic_constraints)
print(unfolder.initial_constraints) # Not changed
print(unfolder.invariant_constraints)
print(unfolder.variant_constraints) # No data for this test
print(unfolder.final_constraints)
print("dynamic_constraints:", unfolder.dynamic_constraints)
print("initial_constraints:", unfolder.initial_constraints) # Not changed
print("invariant_constraints:", unfolder.invariant_constraints)
print("variant_constraints:", unfolder.variant_constraints) # No data for this test
print("final_constraints:", unfolder.final_constraints)
expected = [
# Initial step
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment