Ask Your Question
1

How to convert boolean polynomials to DIMACS format?

asked 2019-01-04 03:29:14 -0600

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
1

answered 2019-01-04 05:17:02 -0600

Yes, see the documentation Sat » Converters.

edit flag offensive delete link more

Comments

1

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 05:38:52 -0600 )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 06:42:52 -0600 )edit
1

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-08 23:41:37 -0600 )edit

From the same documentation: see e.phi.

rburing gravatar imagerburing ( 2019-01-09 01:13:45 -0600 )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

Stats

Asked: 2019-01-04 03:29:14 -0600

Seen: 43 times

Last updated: Jan 04