Commit 9ddd9ce9 authored by VIGNET Pierre's avatar VIGNET Pierre

[lib] CLU: Fix bug n°2: incorrect shifting of variant constraints due to wrong iteration

parent 08520ef5
......@@ -1088,20 +1088,15 @@ class CLUnfolder(object):
Shift clauses of the current step in __precomputed_variant_constraints,
and append them to __variant_constraints.
.. warning:: Refactor note: unclear function. No apparent reason for
only the first clause to be shifted...
TODO: Test this functionality...
Process:
- Take the clauses (constraint) of the current step
- Shift the first clause
- Append it to __variant_constraints
- Stop ????
- Shift the clauses
- Append them to __variant_constraints
Example:
current_step: 2 (shift for step 3)
[[], [[4], [4]], [[6], [7]], []]
=> Only [6] is shifted and it seems to be a problem...
=> Only [[6], [7]] is shifted
.. note:: Called by shift()
"""
......@@ -1111,13 +1106,10 @@ class CLUnfolder(object):
# Constraint t0 already included from the query during initialisation
current_constraint = self.__precomputed_variant_constraints[self.__current_step]
# Shift constraints at current step and append them to __variant_constraints
for clause in current_constraint:
s_clause = self.__shift_ground_clause(clause, self.__current_step)
self.__variant_constraints.append(s_clause)
## Refactor note:
# with regard to the elements cited in the docstring, the
# following statement is judged to be incorrect and commented.
## return
self.__variant_constraints += [
self.__shift_ground_clause(clause, self.__current_step)
for clause in current_constraint
]
elif self.__shift_direction == "BACKWARD":
raise MCLException("Shift direction 'BACKWARD' is not yet implemented")
else:
......
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