sage: B.<a,b,c> = BooleanPolynomialRing() sage: f=a+b*c sage: from sage.sat.converters.polybori import CNFEncoder sage: from sage.sat.solvers.dimacs import DIMACS sage: solver = DIMACS() sage: ce = CNFEncoder(solver, B) sage: ce([f]) [None, a, b, c] sage: solver.clauses() [((-2, -3, 1), False, None), ((3, -1), False, None), ((2, -1), False, None)]
On Saturday 20 Apr 2013, Santanu Sarkar wrote: > Dear all, > I want to convert the polynomial f into Conjunctive Normal Form (CNF) > in Sage. How can I do this? > > > B.<a,b,c> = BooleanPolynomialRing() > f=a+b*c Cheers, Martin -- name: Martin Albrecht _pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99 _otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF _www: http://martinralbrecht.wordpress.com/ _jab: [email protected] -- You received this message because you are subscribed to the Google Groups "sage-support" 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-support?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
