Appendix C
Tools
Here are the book’s apps in one place. Use them to try your own examples or check your work. The links take you back to the chapters for the explanations.
Formal languages
Parsing with full brackets
Start with the grammar from the parsing section . Click through the steps to see how the formula breaks down into its parts, or use the pencil to enter a formula of your own.
Full brackets: each binary formula has its own pair of brackets.
Enable JavaScript to step through the tree. The grammar and worked example remain available in the chapter.
Parsing with bracket conventions
This version uses the conventions for omitting brackets . Try the same expression in both apps. Which brackets can you leave out here? The exercise on omitted brackets practices translating between the two notations. The guided grammar exercise then develops a parser for conventional notation.
Conventional notation: ¬, ∧, ∨, →, ↔ in decreasing priority; ∧ and ∨ group left, → groups right. Bracket repeated ↔ explicitly.
Enable JavaScript to step through the tree. The grammar and worked example remain available in the chapter.
Shunting yard
Convert infix formulas to postfix notation, watching the operator stack and output at each step. The shunting-yard exercises explain the rules and provide worked examples.
Use p, q, and r. LaTeX cheat sheet
- Unread input
- —
- Stack (top at right)
- —
- Output
- —
Sets and valid inference
Explore set membership , then use intersections to test deductive consequence . The buttons highlight regions and explain the same finite sets.
Two collections in one space Follow each outline to see which objects it contains. An object can belong to both sets. The members of S
and
belong to S. Membership in T does not prevent
from belonging to S too. The members of T
, the
and the
belong to T. The same
appears in both sets, but only once in the picture. What they have in common S ∩ T Keep only the objects inside both outlines.
is the common member. The hatched overlap is S ∩ T. One exception is enough S ⊈ T
belongs to S but not T. This witness shows that S is not a subset of T. S contains Mr. Sir and Little Jimmy. T contains Little Jimmy, a beer and a soda. Little Jimmy belongs to both sets. Possible reasoning situations Each little world is one model. The outlines collect the models where each formula is true. Where P is true [P] Highlight the models of this premise. A model satisfying this premise alone need not satisfy the other premise. Where Q is true [Q] Highlight the models of this premise. A model satisfying this premise alone need not satisfy the other premise. All premises true together [P] ∩ [Q] Keep only the worlds in both premise regions. A world outside this intersection cannot be a countermodel to the inference. Where C is true [C] The green outline contains the models in which the conclusion is true. Compare it with the premise region. A world that defeats the inference P, Q ⊭ C M₂ satisfies both premises but not C. One such world is enough to make the inference invalid. M₂ satisfies both premises but not C.Read the diagram as text
Read the diagram as text