Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
VIGNET Pierre
cadbiom
Commits
70c909d5
Commit
70c909d5
authored
Nov 19, 2019
by
VIGNET Pierre
Browse files
[lib] CLUnfolder: fix typos
parent
57d24c58
Changes
1
Hide whitespace changes
Inline
Side-by-side
library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py
View file @
70c909d5
...
@@ -311,8 +311,8 @@ class CLUnfolder(object):
...
@@ -311,8 +311,8 @@ class CLUnfolder(object):
self
.
__final_constraints
self
.
__final_constraints
## Variables management ####################################################
## Variables management ####################################################
def
vars_in_clause
(
self
,
clause
):
def
var
_name
s_in_clause
(
self
,
clause
):
"""Return variables
names
from values in the given clause
"""Return
the names of the
variables from values in the given
numeric
clause
(DEBUG never used)
(DEBUG never used)
"""
"""
return
[
self
.
get_var_indexed_name
(
var
)
for
var
in
clause
]
return
[
self
.
get_var_indexed_name
(
var
)
for
var
in
clause
]
...
@@ -426,7 +426,7 @@ class CLUnfolder(object):
...
@@ -426,7 +426,7 @@ class CLUnfolder(object):
## Translation from names to num codes #####################################
## Translation from names to num codes #####################################
#
t
he translation depends on the shift direction
#
# T
he translation depends on the shift direction
def
__forward_code
(
self
,
clause
):
def
__forward_code
(
self
,
clause
):
"""(deprecated, directly included in C++ module: forward_init_dynamic())
"""(deprecated, directly included in C++ module: forward_init_dynamic())
...
@@ -527,10 +527,14 @@ class CLUnfolder(object):
...
@@ -527,10 +527,14 @@ class CLUnfolder(object):
"""Dynamics initialisations.
"""Dynamics initialisations.
Set dynamic constraints for a forward one step: X1 = f(X0)
Set dynamic constraints for a forward one step: X1 = f(X0)
Numerically code
a
clause with the numeric code found in
Numerically code clause
s
with the numeric code
s
found in
self.__var_code_table for a base variable x,
self.__var_code_table for a base variable x,
and numeric_code + shift_step for x' variable integer coding increases
and numeric_code + shift_step for x' variable integer coding increases
in futur steps
in future steps.
__dynamic_constraints is a list of lists of numeric clauses (lists of ints)
Each sublist of __dynamic_constraints corresponds to a step in the unfolder;
the last step is the last element.
.. note:: Called by init_forward_unfolding()
.. note:: Called by init_forward_unfolding()
...
@@ -911,10 +915,9 @@ class CLUnfolder(object):
...
@@ -911,10 +915,9 @@ class CLUnfolder(object):
## Whole initialisations ###################################################
## Whole initialisations ###################################################
def
init_forward_unfolding
(
self
):
def
init_forward_unfolding
(
self
):
"""
"""Initialisation before generating constraints - forward trajectory
initialisation before generating constraints - forward trajectory
Called at the begining of squery_is_satisfied and squery_solve
Called at the begining of squery_is_satisfied
()
and squery_solve
()
"""
"""
self
.
__shift_direction
=
'FORWARD'
self
.
__shift_direction
=
'FORWARD'
self
.
__current_step
=
1
self
.
__current_step
=
1
...
@@ -935,8 +938,8 @@ class CLUnfolder(object):
...
@@ -935,8 +938,8 @@ class CLUnfolder(object):
def
init_backward_unfolding
(
self
):
def
init_backward_unfolding
(
self
):
"""
Never used (and backward not implemented in __init_variant_constraints_0)
"""
Initialisation before generating constraints - backward trajectory
initialisation before generating constraints - backward trajectory
Never used (and backward not implemented in __init_variant_constraints_0)
"""
"""
self
.
__shift_direction
=
'BACKWARD'
self
.
__shift_direction
=
'BACKWARD'
self
.
__current_step
=
0
self
.
__current_step
=
0
...
@@ -1055,7 +1058,6 @@ class CLUnfolder(object):
...
@@ -1055,7 +1058,6 @@ class CLUnfolder(object):
return
tuple
(
RawSolution
(
solint
,
self
)
return
tuple
(
RawSolution
(
solint
,
self
)
for
solint
in
solver
.
msolve_selected
(
max_sol
,
vvars
))
for
solint
in
solver
.
msolve_selected
(
max_sol
,
vvars
))
# dynamic properties
def
squery_is_satisfied
(
self
,
max_step
):
def
squery_is_satisfied
(
self
,
max_step
):
"""Ask the SAT solver if the query/unfolding is satisfiable in the given
"""Ask the SAT solver if the query/unfolding is satisfiable in the given
number of steps.
number of steps.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment