Skip to content

Commit

Permalink
Merge branch 'develop' into fix/change_default_trail_search_behavior
Browse files Browse the repository at this point in the history
# Conflicts:
#	tests/unit/cipher_modules/models/cp/cp_models/cp_xor_linear_model_test.py
#	tests/unit/cipher_modules/models/smt/smt_models/smt_xor_differential_model_test.py
#	tests/unit/cipher_modules/models/smt/smt_models/smt_xor_linear_model_test.py
  • Loading branch information
p-huynh committed Mar 19, 2024
1 parent d1d68cd commit 2ff651f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion claasp/cipher_modules/models/milp/utils/utils.py
Original file line number Diff line number Diff line change
@@ -710,4 +710,13 @@ def _string_to_hex( string):
value = "0b" + value.bin
except Exception:
value = string
return value
return value

def _filter_fixed_variables(fixed_values, fixed_variable, id):
fixed_values_to_keep = [variable for variable in fixed_values if variable["constraint_type"] == "equal"]
if id in [value["component_id"] for value in fixed_values_to_keep]:
input_index = [value["component_id"] for value in fixed_values_to_keep].index(id)
for bit in fixed_values_to_keep[input_index]["bit_positions"]:
bit_index = fixed_variable["bit_positions"].index(bit)
del fixed_variable["bit_values"][bit_index]
del fixed_variable["bit_positions"][bit_index]

0 comments on commit 2ff651f

Please sign in to comment.