6. Control questions and tasks / Контрольні запитання і завдання
Propositions and connectives
- What is a proposition? Give an example of a sentence that is a proposition
and one that is not.
- Write the truth tables of ¬A, A∧B, and A∨B.
- State the precedence of
NOT, AND, and OR. How do parentheses change
the reading of an expression? Fully parenthesise NOT A AND B OR C.
Evaluation and truth tables
- How many rows does the truth table of a formula with n distinct variables
have? Why?
- Define a tautology, a contradiction, and a contingency in terms of
a formula’s truth table.
- Two formulas are logically equivalent when their truth tables are
identical. Are
NOT (A AND B) and (NOT A) OR (NOT B) equivalent? Justify
your answer. (This is one of De Morgan’s laws.)
Implementation
- Why should you not use the host language’s
eval to solve Task 1? Name
one risk and one limitation.
- Outline how a recursive-descent parser encodes the precedence of
NOT,
AND, and OR. Which grammar rule handles the lowest-precedence operator?
- Describe an algorithm that enumerates all 2n assignments of n
variables. How can counting in binary from 0 to 2n−1 help?
- What is the time complexity of generating a full truth table for an
expression of size m with n variables?
Tasks by hand
- Evaluate
(A AND B) OR (NOT C) under A=F, B=T, C=F. Show each step.
- Build the complete truth table of
A OR (NOT B).
- Determine, by building its truth table, whether
(A AND B) OR (NOT A) is a
tautology, a contradiction, or a contingency.
Laboratory/Laboratory4/6questions.md · 1.7 KB · updated 2026-07-31 21:14