Ejemplo n.º 1
0
    def vars_list(self):
        """
        Returns the list of independent variables in the CNF representation.

        :return:the independent variables list in the CNF representation
        """
        return Slist(_be.Be_Cnf_GetVarsList(self._ptr),
                     IntConversion(),
                     freeit=False)
Ejemplo n.º 2
0
    def clauses_list(self):
        """
        :return: a list of lists which contains the CNF-ed formula]

        Each list in the list is a set of integers which represents a single clause.
        Any integer value depends on the variable name and the time which the variable
        is considered in, whereas the integer sign is the variable polarity in
        the CNF-ed representation.
        """
        return Slist(_be.Be_Cnf_GetClausesList(self._ptr),
                     ArrayOfClauses(),
                     freeit=False)
Ejemplo n.º 3
0
    def cnf_to_be_model(self, slist):
        """
        Converts the given CNF model (dimacs obtained from `solver.model` into 
        an equivalent model.

        :param slist: the cnf model in the form of a slist (as is the case from 
          `solver.model`).
        :return: Converts the given CNF model into BE model
        """
        # note: this is never used in NuSMV
        return Slist(_be.Be_CnfModelToBeModel(self._ptr, slist._ptr),
                     IntConversion())
Ejemplo n.º 4
0
Archivo: sat.py Proyecto: yyaan/pynusmv
 def model(self):
     """
     Returns a list of values in dimacs form that satisfy the set of formulas
      
     The previous solving call should have returned SATISFIABLE.
     The returned list is a list of values in dimac form (positive literal
     is included as the variable index, negative literal as the negative
     variable index, if a literal has not been set its value is not included).
     
     :return: a list of values in dimac form that satisfy the set of formulas
     """
     lst = _sat.SatSolver_get_model(self._as_SatSolver_ptr())
     return Slist(lst, IntConversion(), freeit=False)