Commit 54b6b905 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[lib] Tests: CLUnfolder: move module doc

parent 7ec538fe
......@@ -39,7 +39,47 @@
##
## Contributor(s):
##
"""Unitary Test of the unfolder"""
"""Unitary Test of the unfolder
Test forward initialization for various models and properties types
Pytest call:
pytest cadbiom/models/clause_constraints/mcl/TestCLUnfolder.py::test_init_forward
Query attributes:
self.dim_start = [] # list<DClause>
self.dim_inv = [] # list<DClause>
self.dim_final = [] # list<DClause>
self.dim_variant = [] # list<list<DClause>>
CLUnfolder attributes that contain query attributes:
self.__initial_property = None # logical formula - literal boolean expression
self.__dimacs_initial = None # list of DIMACS clauses
self.__final_property = None # logical formula
self.__dimacs_final = None # list of DIMACS clauses
self.__invariant_property = None # logical formula
self.__dimacs_invariant = None # list of DIMACS clauses
self.__variant_property = None # list<logic formulas>
self.__dimacs_variant = None # list<list<DIMACS clauses>>
CLUnfolder attributes that contain clauses:
self.__precomputed_variant_constraints = None # list<list<DIMACS clauses>>
dynamic_constraints
initial_constraints
invariant_constraints
variant_constraints
final_constraints
.. note:: Mangling prefix for protected attributes: unfolder._CLUnfolder__*
:Example to get a mapping of numeric clauses to str clauses:
mappings = [[unfolder.get_var_name(value) for value in clause]
for clause in dynamic_constraints[0]]
.. TODO:
- search solutions for the given properties
"""
from __future__ import print_function
import unittest
import pytest
......@@ -442,52 +482,11 @@ def test_init_unfolder(feed_mclanalyser):
assert unfolder._CLUnfolder__inputs == frozenset()
# Not frontiers: A B C H J K M P
found = unfolder._CLUnfolder__no_frontier_init
found = unfolder.no_frontier_values
print("Places that are not frontiers", found)
assert found == [[-1], [-2], [-3], [-8], [-10], [-11], [-13], [-15]]
def test_init_forward(feed_mclanalyser, textual_properties, numeric_properties):
"""Test forward initialization for various models and properties types
Specific call:
pytest cadbiom/models/clause_constraints/mcl/TestCLUnfolder.py::test_init_forward
Query attributes:
self.dim_start = [] # list<DClause>
self.dim_inv = [] # list<DClause>
self.dim_final = [] # list<DClause>
self.dim_variant = [] # list<list<DClause>>
CLUnfolder attributes that contain query attributes:
self.__initial_property = None # logical formula - literal boolean expression
self.__dimacs_initial = None # list of DIMACS clauses
self.__final_property = None # logical formula
self.__dimacs_final = None # list of DIMACS clauses
self.__invariant_property = None # logical formula
self.__dimacs_invariant = None # list of DIMACS clauses
self.__variant_property = None # list<logic formulas>
self.__dimacs_variant = None # list<list<DIMACS clauses>>
CLUnfolder attributes that contain clauses:
self.__precomputed_variant_constraints = None # list<list<DIMACS clauses>>
dynamic_constraints => __dynamic_constraints
initial_constraints => __initial_constraints
invariant_constraints => __invariant_constraints
variant_constraints => __variant_constraints
final_constraints => __final_constraints
Mangling prefix: unfolder._CLUnfolder
TODO:
- search solutions for the given properties
- test variant properties
"""
mcla = feed_mclanalyser
pass
def test_init_forward_unfolding_solution_1(feed_mclanalyser, textual_properties, numeric_properties):
mcla = feed_mclanalyser
......
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