Ask Your Question

How to convert boolean polynomials to DIMACS format?

asked 2019-01-04 10:29:14 +0200

Hridya gravatar image

In sage, boolean polynomials can be solved by solvers supporting the DIMACS input. Can we convert boolean polynomials to DIMACS format using sage?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-01-04 12:17:02 +0200

rburing gravatar image

Yes, see the documentation Sat » Converters.

edit flag offensive delete link more



I have very large number of clauses in a list. Is there any other method to add clauses other than repeating the following for each clause? e.clauses_sparse(a*b + a + 1)

Hridya gravatar imageHridya ( 2019-01-04 12:38:52 +0200 )edit

From the documentation of CNFEncoder it seems that you can do e(F) where F is an iterable (e.g. list) of boolean polynomials.

rburing gravatar imagerburing ( 2019-01-04 13:42:52 +0200 )edit

This gives a DIMACS file but how can we figure out boolean variables corresponding to the variable numbers in the DIMACS format?

Hridya gravatar imageHridya ( 2019-01-09 06:41:37 +0200 )edit

From the same documentation: see e.phi.

rburing gravatar imagerburing ( 2019-01-09 08:13:45 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-01-04 10:29:14 +0200

Seen: 266 times

Last updated: Jan 04 '19