I am new to Mathematica(v8) and am using it to program propositional logic.
I'm wondering what the difference is between the If
and the Implies
operators. For example,
both If[p,q]
and Implies[p,q]
return q
for p=True
(as expected).
But when I try to obtain SatisfiabilityInstances, I get the following:
SatisfiabilityInstances[If[p, q], {p, q}]
(*
{{True, True}}
*)
unless I ask it for more instances:
SatisfiabilityInstances[If[p, q], {p, q}, All]
SatisfiabilityInstances::boolv: "If[p,q] is not Boolean valued at {False,True}.
However:
SatisfiabilityInstances[Implies[p, q], {p, q}, All]
returns the expected out of:
(* {{True, True}, {False, True}, {False, False}} *)
What is causing this difference in the outputs?