Ask Your Question
1

Using SageMath to solve Simultaneous equations in a Boolean Ring

asked 2019-01-03 09:20:02 +0100

Stockfish3709 gravatar image

I'm trying to get SageMath to solve a system of equations in a Boolean Ring. Here is my code.

P.<x,y,z> = BooleanPolynomialRing(3, order= 'lex')
equations = [1+x+y+z, x+y, x*y+1, x+y]
zeros = [0,0,0,0]

I know that there are equation solvers for Sage, but I do not know how to have the answers of the equation be only in the Boolean Ring (ie. only 1 or 0). Obviously I can solve the equation by hand, but that's not the point here. Is there a way to have SageMath only output 0 or 1 as the answer?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-01-03 11:19:21 +0100

rburing gravatar image

updated 2019-01-04 12:18:41 +0100

You can do

P.ideal(equations).variety()

Edit: If you have the optional cryptominisat package installed, then you can also do:

from sage.sat.boolean_polynomials import solve as solve_sat
solve_sat(equations, n=infinity)

See the SAT documentation.

edit flag offensive delete link more

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-03 09:20:02 +0100

Seen: 582 times

Last updated: Jan 04 '19