Note: Your browser may not currently support MathML. See our browser support page for additional details. You can always view the correct math in the PDF version.
If we want to develop complicated expressions about breakfast foods like eggs, hashbrowns, and so on, we will want an exact grammar telling us how to connect the propositions, what connections are allowed, and when parentheses are necessary (if at all). We will choose a grammar so that all our formulas are fully parenthesized:
The last two examples illustrate that we can add parentheses
to formulas to make the precedence explicit.
While some parentheses may be unnecessary, over-parenthesizing often
improves clarity.
We introduced the basic connectives in the order of their precedence:
¬ has the highest precedence, while ⇒ has the lowest.
Furthermore, ∧ and ∨ group left-to-right:
We can combine these ways of forming WFFs in arbitrarily complex ways, for example,
While large WFFs are common, and we will use some, ones with this much nesting are not.
Variations of well-formed formulas occur routinely in writing programs. While different languages might vary in details of what connectives are allowed, how to express them, and whether or not all parentheses are required, all languages use WFFs.
When creating the homeworks' web pages, the authors keep the problems and solutions together in one file. Then, a program reads that file, and creates a new one which either excludes the solution (for the problem set), or includes it (for the solution set, and for practice-problems). The condition for deciding whether to include the solutions is a WFF.
;; is-a-solution?: paragraph -> boolean
;; A function to tell if we are looking at a "solution" paragraph.
;; Assume this is provided.
;; is-in-a-practice-prob?: paragraph -> boolean
;; A function to tell if Is the current problem a practice problem?
;; Assume this is provided.
;; include-all-solutions?: boolean
;; A variable for the entire file.
;; Assume this is provided.
;; show-or-hide-soln: paragraph -> paragraph
;; Either return the given paragraph,
;; or (if it shouldn't be revealed) return a string saying so.
;;
(define (show-or-hide-soln a-para)
(if (and (is-a-solution? a-para)
(not (or include-all-solns? (is-in-a-practice-prob? a-para)))
"(see solution set)"
a-para))
Note that the Boolean variable include-all-solutions?
and Boolean values of (is-a-solution? a-para)
and (is-in-a-practice-prob? a-para)
play the part of propositions
(if's condition boils down to
the WFF
Keep in mind that a WFF is purely a syntactic entity. We'll introduce rules later for re-writing or reasoning with WFFs, but it's those rules that will be contrived to preserve our meaning of connectives like ∧ or ¬. The truth value of a WFF depends on the truth values we assign to the propositions it involves.
When writing a program about WFFs, verifying syntactic property,
calculating a value, counting the number of negations or
Is the formula
For the formula
We've used three different symbols to describe “equality” in some sense:
Commonly, people use symbols such as “≡” for multiple purposes. This is problematic when part of what we are studying are the syntactic formulas themselves.
Note that in algebra, there are certainly formulas which
are true (or similarly, false) for all values,
but they don't get special names.
For example, over the real numbers,
any assignment to
Some people use the term contingency to mean formulas in between: things which can be either true or false, depending on the truth assignment. Really, tautologies and unsatisfiable formulas are boring. However, trying to determine whether or not a formula is a tautology (or, unsatisfiable) is of interest. That's what proofs are all about!
![]() |
Identify the following Yogi Berra quotes either as tautologies, unsatisfiable, or neither. (Take these exercises with a grain of salt, since the English statements are open to some interpretation.)
“
Pitching always beats batting
Unsatisfiable.
You can observe a lot just by watchin'.
Tautology, arguably.
Nobody goes there anymore… it's too crowded.
Unsatisfiable, unless of course you interpret “nobody” as “nobody of note”.
It sure gets late early out here.
Neither. If you interpret “gets late” as a social issue but “early” as a clock issue, then the statement might be true, depending on where “here” is.
Always go to other people's funerals; otherwise they won't come to yours.
Unsatisfiable, except perhaps in a karmic sense.
Now that we've seen how to express concepts as precise formulas;
we would like to reason with them.
By “reason”, we mean some automated way
of ascertaining or verifying statements
Is
There are a myriad of domain axioms which express the rules of WaterWorld. Here are a few of them:
A more complete list is here. Whenever we deal with WaterWorld, we implicitly take all these domain axioms as given.