ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 14 Aug 2014 21:17:54 +0200Solving boolean variables symbolicallyhttps://ask.sagemath.org/question/23783/solving-boolean-variables-symbolically/ I need to solve some boolean variables symbolically (in terms of the other symbols):
Suppose we are given an expression like `expr = (xy == 0) `, then I would like to have
> solve(expr, x)
>
> ~y
Is it possible to do in sage? *Something like [this](http://www.sagemath.org/doc/reference/calculus/sage/symbolic/relation.html), but in boolean variables.*Thu, 14 Aug 2014 15:46:30 +0200https://ask.sagemath.org/question/23783/solving-boolean-variables-symbolically/Answer by kcrisman for <p>I need to solve some boolean variables symbolically (in terms of the other symbols):</p>
<p>Suppose we are given an expression like <code>expr = (xy == 0)</code>, then I would like to have</p>
<blockquote>
<p>solve(expr, x)</p>
<p>~y</p>
</blockquote>
<p>Is it possible to do in sage? <em>Something like <a href="http://www.sagemath.org/doc/reference/calculus/sage/symbolic/relation.html">this</a>, but in boolean variables.</em></p>
https://ask.sagemath.org/question/23783/solving-boolean-variables-symbolically/?answer=23786#post-id-23786Maybe [PolyBoRi](http://www.sagemath.org/doc/reference/polynomial_rings/sage/rings/polynomial/pbori.html) would be useful, since you seem to have polynomials?Thu, 14 Aug 2014 18:33:45 +0200https://ask.sagemath.org/question/23783/solving-boolean-variables-symbolically/?answer=23786#post-id-23786Comment by pp for <p>Maybe <a href="http://www.sagemath.org/doc/reference/polynomial_rings/sage/rings/polynomial/pbori.html">PolyBoRi</a> would be useful, since you seem to have polynomials?</p>
https://ask.sagemath.org/question/23783/solving-boolean-variables-symbolically/?comment=23791#post-id-23791Yes. These expressions are polynomials.Thu, 14 Aug 2014 21:17:54 +0200https://ask.sagemath.org/question/23783/solving-boolean-variables-symbolically/?comment=23791#post-id-23791