Re: Boolean algebra
- To: mathgroup at smc.vnet.net
- Subject: [mg69395] Re: Boolean algebra
- From: p-valko at tamu.edu
- Date: Sun, 10 Sep 2006 07:20:23 -0400 (EDT)
- References: <edtrbb$lcb$1@smc.vnet.net>
I am not sure Simplify is up to the task, but for not too large problems you may find useful the following: prelims = {(a1 && a2) == False, (a1 || a2) == True}; f = (b1 || a1 || c1) && (b2 || a2 || a1); vars = DeleteCases[DeleteCases[Union[Cases[prelims, x_Symbol, Infinity]], True], False]; ins = FindInstance[prelims, vars, Booleans, 2^30]; {f /. ins, ins} // TableForm The result is: { {True, {a1->True,a2->False}}, {b1||c1, {a1->False,a2->True}} } so you can conclude that either a1||b1||c1 or Not[a2] || b1 || c1 is a good representation. Regards Peter Menace wrote: > I'd like to solve the following problem in Mathematica, > > Given are the following preliminaries: > (a1 || a2)=True > (a1 && a2) = False > > Then, given the following conjunctive normal form: > > (b1 || a1) && (b1 || a2) > > This can be simpliefied to: b1 || (a1 && a2) > > Given the prelininaries I'd like Mathematica to simplify this to: b1. > However, I cant figure out how to do this. I tried the following: > > prelims := {(a1 && a2) -> False, (a1 || a2) -> True}; > f1 := (b1 || a2) && (b1 || a1); > Simplify[f1] /. prelims > > and this seems to work. However > > f2 := (b1 || a1 || c1) && (b2 || a2 || a1); > Simplify[f2] /. prelims > > evaluates to: (b1 || a1 || c1) && (b2 || a2 || a1) instead of b1 || a1 > || c1. > The reason of this seems to be the order in which a2 and a1 occur in > f2. How can I make sure it works regardless of the order of a1 and a2?