Is it possible to ask Mathematica to give us the boolean value of a proposition assuming the boolean value of some parts of it?
For instance, give the boolean value of $p\vee q$ assuming that $p$ is true and $q$ is false.
Simplify handles this.
Simplify[And[p, q], Not[q]]
returns False.
Simplify[And[p, q], q]
returns p.
You can use BooleanTable or simply rule replace:
TableForm[BooleanTable[{p, q, Or[p, q]}],
TableHeadings -> {None, {"p", "q", "p \[Or] q"}}]
p \[Or] q /. {p -> True, q -> False}
yields True
Some other examples:
ex1 = a \[Or] b /. {a -> True, b -> False}
ex2 = ex1 && c /. {c -> True}
ex3 = ex1 \[Implies] d /. {d -> False}
yielding True,True, False respectively.
Simplify[Or[p, q], Not[q]]outputsp, for instance.Simplify[Or[p, q], p && Not[q]]outputs True. – Patrick Stevens Sep 18 '15 at 12:13Simplifycould make boolean inferences. – DavidC Sep 18 '15 at 12:32Simplify[Or[p, q], p && ! q]yieldsTrue. In fact it was stated in this post Solve for when two symbolic complex numbers are equal – Artes Sep 18 '15 at 12:48Simplify[And[p,q], p && Not[q]]it outputsq, it's not really doing the right thing, because I know, and I wanted Mathematica to know, thatqis false, I believe it's not clear in that instruction that that is a fact. – Concept7 Sep 18 '15 at 13:59Simplify[And[p, q], Not[q]], which returnsFalse? – Patrick Stevens Sep 18 '15 at 14:43pis true. Is there a way to give more than one assumption? – Concept7 Sep 18 '15 at 14:47Simplify[expr, p && Not[q]]. I don't understand your question. – Patrick Stevens Sep 18 '15 at 15:39pis true andqis false, aren't you assuming onlyp && Not[q], I mean aren't you assuming something about the conjunction instead of the atomic propositions? – Concept7 Sep 18 '15 at 16:19Simplify[Or[p, q], Not[q]]givesp, butSimplify[Or[p,q], Not[q] == True]givesOr[p, q]... I like this approach though:With[{q = True}, And[p, q]]– LLlAMnYP Sep 19 '15 at 10:19