MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

https://about.gitlab.com/releases/2022/01/11/security-release-gitlab-14-6-2-released/
https://about.gitlab.com/releases/2022/01/04/gitlab-14-6-1-released/

Commit 12767ac5 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

C++ API in __load_solver()

parent 6cdd8c95
......@@ -46,9 +46,15 @@ from pycryptosat import Solver as CryptoMS
from cadbiom.models.biosignal.translators.gt_visitors import compile_cond, compile_event
from cadbiom.models.clause_constraints.CLDynSys import Clause, Literal
from cadbiom.models.clause_constraints.mcl.MCLSolutions import RawSolution, MCLException
from cadbiom import commons as cm
# C++ API
from _cadbiom import shift_clause, shift_dynamic, forward_code, \
forward_init_dynamic
# Standard imports
from logging import DEBUG
import itertools as it
LOGGER = cm.logger()
......@@ -803,28 +809,38 @@ class CLUnfolder(object):
"""
add all the current clauses in solver solv
"""
# New API via C++ module
solv.add_clauses(self.__final_constraints)
solv.add_clauses(it.chain(*self.__invariant_constraints))
solv.add_clauses(self.__variant_constraints)
solv.add_clauses(it.chain(*self.__dynamic_constraints))
solv.add_clauses(self.__initial_constraints)
# Less efficient alternative
# solv.add_clauses([clause for lcl in self.__invariant_constraints
# for clause in lcl])
# solv.add_clauses([clause for lcl in self.__dynamic_constraints
# for clause in lcl])
# Old API
# Clauses are added one by one
# final
[solv.add_clause(clause) for clause in self.__final_constraints]
#[solv.add_clause(clause) for clause in self.__final_constraints]
# trajectory invariant
[solv.add_clause(clause) for lcl in self.__invariant_constraints
for clause in lcl]
#[solv.add_clause(clause) for lcl in self.__invariant_constraints
# for clause in lcl]
# trajectory variant
[solv.add_clause(clause) for clause in self.__variant_constraints]
#[solv.add_clause(clause) for clause in self.__variant_constraints]
# dynamics
[solv.add_clause(clause) for lcl in self.__dynamic_constraints
for clause in lcl]
# Debug:
#lvars = []
#for lcl in self.__dynamic_constraints:
# for clause in lcl:
# solv.add_clause(clause)
# lvars.append(self.vars_in_clause(clause))
#[solv.add_clause(clause) for lcl in self.__dynamic_constraints
# for clause in lcl]
# initial
[solv.add_clause(clause) for clause in self.__initial_constraints]
#[solv.add_clause(clause) for clause in self.__initial_constraints]
# LOGGING
if LOGGER.getEffectiveLevel() == DEBUG:
......
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