Skip to content

Commit

Permalink
Update doctests and pytests
Browse files Browse the repository at this point in the history
  • Loading branch information
p-huynh committed Jun 10, 2024
1 parent 18d028f commit 33b464c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions claasp/components/linear_layer_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,12 +607,11 @@ def milp_wordwise_deterministic_truncated_xor_differential_constraints(self, mod
('x[mix_column_0_21_14]', x_46),
('x[mix_column_0_21_15]', x_47)]
sage: constraints
[1 <= 2 - x_6 - x_12 + x_25,
1 <= 3 - x_8 + x_9 + x_10 + x_11 - x_14 + x_15 + x_16 + x_17 + x_19 - x_25,
1 <= 3 + x_8 - x_9 + x_10 + x_11 + x_14 - x_15 + x_16 + x_17 + x_19 - x_25,
[1 <= 1 + x_6 + x_8 + x_9 + x_10 + x_11 + x_13 + x_18 + x_19 - x_25,
1 <= 1 + x_6 + x_8 + x_9 + x_10 + x_11 + x_12 + x_13 + x_19 - x_25,
...
1 <= 1 + x_1 - x_2,
1 <= 1 + x_7 - x_8]
1 <= 1 + x_7 - x_8,
1 <= 1 + x_1 - x_2]
"""
x = model.binary_variable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ def test_generate_valid_points_for_xor_between_n_input_words():
def test_update_dictionary_that_contains_wordwise_truncated_xor_inequalities_between_n_inputs():
update_dictionary_that_contains_wordwise_truncated_xor_inequalities_between_n_inputs(3, 3)
dictio = output_dictionary_that_contains_wordwise_truncated_xor_inequalities()
assert dictio[3][3][:2] == ['1----1----------0---', '--100--100-0----1---']
assert dictio[3][3][-2:] == ['------01------------', '----------1----0----']
assert dictio[3][3][:2] == ['0-000-0---00----1---', '0-00000----0----1---']
assert dictio[3][3][-2:] == ['-----1---------0----', '1--------------0----']

0 comments on commit 33b464c

Please sign in to comment.