#14180: SatSolver.clauses
--------------------------------------+-------------------------------------
       Reporter:  malb                |         Owner:  jason       
           Type:  PLEASE CHANGE       |        Status:  needs_review
       Priority:  major               |     Milestone:  sage-5.8    
      Component:  misc                |    Resolution:              
       Keywords:  sat, cryptominisat  |   Work issues:              
Report Upstream:  N/A                 |     Reviewers:              
        Authors:  Martin Albrecht     |     Merged in:              
   Dependencies:  #14198              |      Stopgaps:              
--------------------------------------+-------------------------------------

Comment (by ncohen):

 HMmmmmmmmm... I've got some questions about your patch :
 * You do not seem to accept as input a DIMACS file with `is_xor` clauses
 with `clauses()`, while you WRITE such files with `render_dimacs()` ?...
 * I do not get what this does... It's meant to store `is_xor` clauses but
 I don't get it `^^;`
 {{{
 closing = lits[-1] if rhs else -lits[-1]
 fh.write("x" + " ".join(map(str, lits[:-1])) + " %d 0\n"%closing)
 }}}
 * I do not get this either
 {{{
 +    def __getattr__(self, name):
 +        """
 +        EXAMPLE::
 +
 +            sage: from sage.sat.solvers.satsolver import SatSolver
 +            sage: solver = SatSolver()
 +            sage: solver.gens() # __getattr__ points this to clauses
 +            Traceback (most recent call last):
 +            ...
 +            NotImplementedError
 +        """
 +        if name == "gens":
 +            return self.clauses
 +        else:
 +            raise AttributeError("'%s' object has no attribute
 '%s'"%(self.__class__.__name__,name))
 +
 +    def trait_names(self):
 +        """
 +        Allow alias to appear in tab completion.
 +
 +        EXAMPLE::
 +
 +            sage: from sage.sat.solvers.satsolver import SatSolver
 +            sage: solver = SatSolver()
 +            sage: solver.trait_names()
 +            ['gens']
 +        """
 +        return ["gens"]
 }}}
     Why don't you just create a gens method ? Why would you need one by
 the way, as it is an alias to `clauses` anyway ?

 Have fuuuuuuuuuuuuuuuuuuuuuuuunnn !!

 Nathann

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14180#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to