Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

Propositional Logic Syntax




Introduction to Propositional Logic Syntax

In formal logic, syntax refers to the structural formation rules that determine how logical expressions are properly formed. Much like grammar in natural language, syntax focuses purely on the arrangement of symbols — not their meaning. In contrast, semantics is concerned with the interpretation and truth value of these expressions, while proof systems operate within this structure to establish logical conclusions. Syntax itself answers a simpler but essential question: is the statement written in a correct and recognizable way, regardless of whether it is true or false.
This section introduces the basic elements of propositional logic syntax, beginning with the alphabet of atomic propositions and the connectives used to combine them. It outlines how well-formed formulas (WFFs) are built according to formation rules and explains the importance of parentheses in maintaining clarity. Along the way, tools like syntax trees for visualizing expression structure and structural induction for proving properties about formulas will also be discussed, all of which together form the foundation for working with logical systems in a precise and systematic way.

Syntax Definition

Formally, syntax is defined as the set of rules specifying the correct formation of symbolic expressions within a logical system. These expressions, when constructed according to these rules, are called well-formed formulas (WFFs). A formula is considered well-formed if it adheres strictly to the prescribed combinations of atomic propositions, logical connectives, and grouping symbols such as parentheses.
Fact: Ten arrows, 16,796 groupings
Written without brackets, P1→P2→⋯→P11P_1 \to P_2 \to \cdots \to P_{11} can be grouped in 16,796 different ways, one for each binary tree with 10 inner nodes. Three letters allow only 2 groupings, five letters already 14.
This distinction between syntax and semantics is foundational. While semantics is dealing with the question: "Is this statement true or false?", syntax first asks the more basic but necessary subject: "Is this statement properly formed?" Only when an expression is syntactically correct does it make sense to discuss its truth value or include it in formal proofs.

The importance of syntax lies in its role as the starting point for logical reasoning. Without clear structural rules, logical statements could be ambiguous or meaningless. Syntax ensures that expressions are built consistently and unambiguously, allowing for reliable analysis, proof construction, and formal reasoning.

In the context of propositional logic, understanding syntax involves recognizing:
Additionally, visual tools such as syntax trees help to represent the internal structure of complex formulas, and methods like structural induction are used to formally prove properties about these syntactic structures — for example, showing that all well-formed formulas are finite in depth.
By mastering these syntactic principles, we establish the framework necessary for formal logic to operate as a precise and reliable system for reasoning.
Well-Formed FormulasValid expressions in logicFormation RulesVisual representation of formula structureSyntax TreesGuidelines for combining symbolsProof technique for logical structuresStructural InductionBasic building blocks of logicPropositional Logic HierarchySymbols
Syntax only asks whether a string is a formula at all; whether it is true is a later question for semantics.

Propositional Logic Alphabet

The syntax of propositional logic begins with the definition of its alphabet, which specifies the complete set of symbols allowed in the language. These symbols serve as the basic elements from which all logical expressions are constructed. The alphabet in propositional logic consists of three primary categories: atomic propositions, logical connectives, and parentheses.

Atomic propositions are the most fundamental units of the language. They are typically represented by uppercase letters such as P, Q, R, and may also include indexed forms like P₁, P₂, etc. Each atomic proposition stands as an indivisible statement that can be either true or false but is not further analyzed within propositional logic itself.

Fact: Brackets become unnecessary
Writing each connective before its operands, as Łukasiewicz did in the 1920s, removes the need for parentheses: ((P∧Q)→¬R)((P \wedge Q) \to \neg R) becomes CKpqNr, and every such string reads one way only. Reversed, with the connective last, the idea became the entry method of Hewlett-Packard calculators.
Logical connectives are the symbols used to combine atomic propositions into more complex expressions. The standard set of connectives includes negation (¬), conjunction (∧), disjunction (∨), implication (→), and biconditional (↔). Each connective corresponds to a specific logical operation, determining how the truth values of simpler components relate to one another in compound statements.

Parentheses (( and )) are included to ensure proper grouping and eliminate ambiguity in the structure of expressions. They clarify the intended order of operations when multiple connectives are present. The precise use of these symbols provides the necessary foundation for the formation rules that govern the construction of well-formed formulas.
Propositional Logic AlphabetParenthesesSymbols used to group and prioritize expressionsLogical ConnectivesSymbols that combine or modify propositionsAtomic PropositionsBasic statements that can be true or false

Formation Rules

The Construction of Formulas in Propositional Logic


In propositional logic, the process of constructing valid formulas is governed by formation rules. These rules specify how to generate well-formed formulas (WFFs) systematically from the elements of the alphabet. The alphabet consists of atomic propositions, logical connectives, and parentheses. Formation rules ensure that every formula is built in a strictly defined manner, maintaining structural correctness without any ambiguity.

The process of formation proceeds as follows:

1. Atomic Propositions:
Every atomic proposition, such as P, Q, or R, is by itself a well-formed formula. This constitutes the base case of the formation process.

2. Application of Negation:
If φ is already a well-formed formula, then the expression ¬φ is also a well-formed formula. The negation operator is unary and applies to a single formula.

3. Application of Binary Connectives:
If φ and ψ are well-formed formulas, then the following are also well-formed formulas:
- (φ ∧ ψ) (conjunction),
- (φ ∨ ψ) (disjunction),
- (φ → ψ) (implication),
- (φ ↔ ψ) (biconditional).

Each binary connective combines exactly two previously formed formulas, and parentheses are mandatory to explicitly indicate the grouping and the structure of the new formula.

4. Recursion:
This process is inherently recursive. Once new formulas are constructed through the application of negation or binary connectives, they themselves may serve as components for further construction according to the same rules.

Pitfall: Reading the negation as covering the whole formula
Reading (¬P∧Q)(\neg P \wedge Q) as ¬(P∧Q)\neg(P \wedge Q) changes the formula: at P=TP = T, Q=FQ = F the first is F and the second is T. By rule 2 the negation applies to PP alone, and rule 3 then joins ¬P\neg P with QQ.
At this basic level, every formula must be fully parenthesized to make its structure explicit. Parentheses are not optional: they are integral to the definition of the formula under the formation rules. No precedence between connectives is assumed at this stage; every operation's scope must be determined explicitly through parentheses.

Precedence and associativity conventions are introduced only later, as practical tools to simplify the writing and reading of formulas when parentheses are omitted. They are not part of the formation rules themselves but are auxiliary syntactic conventions used in the presentation of formulas.

This construction algorithm defines the internal structure of propositional expressions. It establishes that every formula is built in a finite number of steps, starting from atomic propositions and proceeding through regulated applications of connectives. These principles of formation are the foundation upon which the method of structural induction is later based, since they determine the way complex formulas are composed from simpler components.
Parse tree of ((P and Q) implies not R): leaves P, Q, R; rule 3 joins P and Q with and, rule 2 negates R, rule 3 joins both with the arrow ((P ∧ Q) → ¬R)(P ∧ Q)¬RPQRrule 3: binary connectiverule 2: negationrule 3rule 1: atomsEvery WFF is built from atoms up, one rule per node
How ((P ∧ Q) → ¬R) is built

Reading the tree from the bottom: rule 1 makes the atoms P, Q and R formulas; rule 3 joins P and Q into (P ∧ Q); rule 2 negates R into ¬R; and rule 3 joins those two with → into the whole formula. Each inner node is one application of a formation rule, and the parentheses record exactly this structure. Build trees for your own formulas on the proposition tree builder.

A string that cannot be split this way, such as P ∧ ∨ Q, is not a WFF.

Propositional Logic Notation

Notation

Propositional Logic Notation

The alphabet's marks, formalized: the capital letters that stand for statements, the five connectives that combine them, the Greek letters that stand for whole formulas, and the parentheses that hold everything together. Every symbol is catalogued among the logic symbols.
The equivalence and consequence marks (≡\equiv, ⊨\vDash) belong to the semantics pages; ⊤\top, ⊥\bot and ⊢\vdash to the tautology and contradiction pages.
P,Q,RP, Q, R · P1,P2P_1, P_2
atomic proposition letters
Capital letters name atomic propositions — indivisible statements that are true or false, as Propositional Logic Alphabet above defines. Subscripts extend the supply when three letters run out: P1,P2,…P_1, P_2, \ldots — the same enumeration job subscripts do everywhere.
CasesLowercase p,q,rp, q, r is an equally standard dialect — many texts, and parts of this site, use it; case is convention, not meaning.
Do not confuseFree algebra variables. PP holds a truth value, not a number — substituting 55 for PP is a category error; the letters range over statements, never quantities.
¬    ∧    ∨    →    ↔\neg \;\; \wedge \;\; \vee \;\; \to \;\; \leftrightarrow
not; and; or; implies; if and only if
The five standard connectives: negation, conjunction, disjunction, implication, biconditional — the complete combining toolkit of Propositional Logic Alphabet above. Only ¬\neg is unary; the rest join exactly two formulas.
CasesThe shapes deliberately mirror set operations — ∧\wedge with ∩\cap, ∨\vee with ∪\cup — because "and" filters and "or" collects in both worlds; code and tool inputs use the ASCII stand-ins !, &&, ||, ->, <->.
Also writtenOlder and neighboring dialects: ∼ ⁣P\sim\!P for negation, P′P' or Pˉ\bar{P} in Boolean algebra, ⊃\supset for implication in Principia-era texts, &\& for conjunction — all still met in the literature.
Do not confuseArithmetic on truth values. P∧QP \wedge Q computes nothing numeric — the connectives build formulas whose truth is settled later, by the semantics; syntax only checks the grammar.
φ,ψ\varphi, \psi
phi and psi — formula placeholders
Greek letters stand for whole formulas, known or unknown: the rule "if φ\varphi is well-formed, so is ¬φ\neg\varphi" of Formation Rules below quantifies over every possible formula at once. Latin letters name atoms; Greek letters name anything.
CasesThe split keeps levels apart — P∧QP \wedge Q is one concrete formula, φ∧ψ\varphi \wedge \psi a template matching infinitely many; formation rules, laws and proofs are all stated in the Greek layer.
Do not confuseMore proposition letters. Reading φ\varphi as "just another atom" collapses the template into one instance — the rule stops generating and the recursion of Formation Rules below loses its engine.
(φ∧ψ)(\varphi \wedge \psi)
parenthesized conjunction
At the formation level, parentheses are mandatory grammar — every binary connective brings its own pair, and no precedence exists, as Formation Rules below insists. Bare P∧Q∨RP \wedge Q \vee R is not yet a formula.
CasesPrecedence arrives later as a reading convention: ¬\neg binds tightest, then ∧\wedge, ∨\vee, →\to, ↔\leftrightarrow — an auxiliary shorthand for dropping brackets, not a formation rule; the site's tools parse by exactly this hierarchy.
Do not confuseOptional decoration. Dropping parentheses "because the meaning is obvious" trades a well-formed formula for an ambiguous string — P→Q→RP \to Q \to R has two incompatible readings until convention or brackets decide.
DownloadPNG2×PDF
Notation · Cheat sheet
Propositional Logic Notation at a Glance
The marks from the notation cards across the propositional-logic pages: how each is read and what it means. Every group links to the full card on its page.
SyntaxThis page
P,Q,RP, Q, R · P1,P2P_1, P_2
proposition letters
Capital letters name atomic propositions; subscripts extend the supply.
¬  ∧  ∨  →  ↔\neg \; \wedge \; \vee \; \to \; \leftrightarrow
not; and; or; implies; if and only if
The five connectives: negation, conjunction, disjunction, implication, biconditional.
φ,ψ\varphi, \psi
phi and psi
Placeholders for whole formulas in the formation rules.
(φ∧ψ)(\varphi \wedge \psi)
parenthesised conjunction
Every binary connective brings its own parentheses; no precedence at this level.
Implication
p→qp \to q
if p then q; p implies q
The conditional connective: antecedent pp, consequent qq.
p⇒qp \Rightarrow q
p implies q, in the meta sense
The double shaft claims the implication holds in every case; older texts write p⊃qp \supset q.
p→qp \to q in words
the English phrasings of one arrow
"if pp, then qq"; "pp is sufficient for qq"; "qq is necessary for pp"; "pp only if qq".
Equivalences
P≡QP \equiv Q
P is logically equivalent to Q
A claim about formulas: PP and QQ agree in every case.
P⇔QP \Leftrightarrow Q
P if and only if Q, in the meta sense
The double-shafted spelling of the same claim.
P=QP = Q
P equals Q
Boolean algebra’s spelling, where formulas denote values in {0,1}\{0, 1\}.
Tautology
⊤\top
top; verum; the true constant
Truth itself: a formula true under every assignment.
⊢P\vdash P
turnstile P; P is provable
The single turnstile: a derivation of PP exists in the proof system.
⊨P\vDash P
double turnstile P; P is valid
The double turnstile: PP is true under every assignment.
P≡⊤P \equiv \top
P is equivalent to the true constant
The third way to say that PP is a tautology.
Contradiction
⊥\bot
bottom; falsum; the false constant
Falsehood itself: a formula false under every assignment.
⊢¬P\vdash \neg P
the negation of P is provable
The proof-side way to declare PP a contradiction.
P≡⊥P \equiv \bot
P is equivalent to the false constant
The equivalence spelling of "contradiction".
Same marks, different job
→\to vs ⇒\RightarrowA connective inside a formula; a claim about formulas.
↔\leftrightarrow vs ≡\equivThe biconditional connective; logical equivalence in the metalanguage.
⊢\vdash vs ⊨\vDashProvable by the rules; true in every case.
⊃\supsetImplication in older logic texts; superset in set theory.
⊥\botThe false constant here; perpendicular in geometry.
Propositional Logic Notation at a Glance·/logic/propositional-logicLearn Math Class
DownloadPNG2×PDF
Before you read
A reading convention, not a rule
At the formation level every binary connective brings its own parentheses. Precedence comes later, as a shorthand for dropping brackets.
binds tightestprecedencebinds loosest
¬\neg negation
∧\wedge conjunction
∨\vee disjunction
→\to implication
↔\leftrightarrow biconditional
Takeaway
When in doubt, bracket
A string like P→Q→RP \to Q \to R has two incompatible readings until convention or brackets decide. The site's tree builder parses by exactly this order.
Precedence of the connectives·/logic/propositional-logic/syntaxLearn Math Class
Pitfall: Reading the connectives left to right
Grouping P∨Q∧RP \vee Q \wedge R as (P∨Q)∧R(P \vee Q) \wedge R ignores that ∧\wedge binds tighter: at P=TP = T, Q=FQ = F, R=FR = F that grouping is F, while the formula is T. The correct reading is P∨(Q∧R)P \vee (Q \wedge R).
To restore the brackets of a formula written without them, go down the pyramid from the top. The connective that binds tightest takes its operands first, and the one that binds loosest is applied last and becomes the main connective of the formula. In P∧Q→RP \wedge Q \to R the conjunction is formed first and the implication then joins it with RR, so the full form is ((P∧Q)→R)((P \wedge Q) \to R).

Well Formed Formulas (WFF)


In propositional logic, a Well-Formed Formula (WFF) is any syntactically valid expression constructed from propositional alphabet elements according to specific grammar formation rules. These expressions are the foundational elements of the logical system, allowing us to represent and reason about truth-functional statements.
Once the formation rules were followed correctly and no other symbols except those from the propositional alphabet were used, the expression should be a valid WFF. But we still need to validate it to ensure it adheres strictly to the syntactic rules of propositional logic. This involves checking the structural correctness of the formula — things like how operators are used, how subformulas are arranged, and whether the formula can be interpreted unambiguously.
We don't rebuild the formula but rather analyze its structure. This means verifying that parentheses are balanced, operators appear in valid configurations, and no extraneous or malformed expressions are present. The validation process can be summarized by the following practical checks:


</table>

Pitfall: Confusing well-formed with true
Rejecting (P∧¬P)(P \wedge \neg P) as ill-formed because it is F at P=TP = T and at P=FP = F mixes syntax with truth. The formation rules build it from PP and ¬P\neg P, so it is a WFF, and a contradiction.
Each rule in the table identifies a specific structural constraint. If any one of these constraints is violated, the formula cannot be considered well-formed, regardless of whether it uses the correct symbols.

This validation process can also be performed using a syntax tree, which visually represents the hierarchical structure of the formula. If the formula can be fully parsed into a well-formed tree—with each operator applied to the correct number and type of subformulas—it is syntactically valid. You can experiment with this using our Syntax Tree Builder , which helps visualize whether a formula conforms to the WFF rules.

Once a formula is well-formed, we can then examine or transform it into various normal forms, which are standardized representations of logical formulas. This transformation does not change the formula's meaning (i.e. its semantics), but it does organize the formula in a way that is more amenable to analysis, algorithmic manipulation, or implementation in digital logic circuits.

Normal Forms

What Are Normal Forms?
In propositional logic, normal forms are standardized ways of rewriting logical formulas. They ensure that formulas follow a uniform structure while preserving logical equivalence — meaning they represent the same truth function as the original formula.
1. Conjunctive Normal Form (CNF)
A formula is in CNF if it is a conjunction of one or more clauses, where each clause is a disjunction of literals. For example:

(P∨¬Q)∧(R∨S∨T)(P∨¬Q)∧(R∨S∨T)

This form is particularly useful in satisfiability checking (e.g., for SAT solvers) and logic proof systems.

2. Disjunctive Normal Form (DNF)
A formula is in DNF if it is a disjunction of one or more terms, where each term is a conjunction of literals. For example:

(P∧¬Q)∨(R∧S)(P∧¬Q)∨(R∧S)

DNF is frequently used when constructing logical functions from truth tables or for analyzing the structure of logical consequences.
Learn more about normal forms and practice your skills and understanding of this topic by using our interactive normal form converter .

DownloadPNG2×PDF
Before you read
Two standard shapes for a formula
Every formula of propositional logic can be rewritten in either normal form. They are mirror images of each other.
Normal forms2 forms
CNFconjunctive normal form
Shapean AND of clauses, each an OR of literals
Example(P∨¬Q)∧(R∨S∨T)(P \vee \neg Q) \wedge (R \vee S \vee T)
Used bySAT solvers
DNFdisjunctive normal form
Shapean OR of terms, each an AND of literals
Example(P∧¬Q)∨(R∧S)(P \wedge \neg Q) \vee (R \wedge S)
Built fromtruth tables
Takeaway
Same formula, different jobs
CNF is what SAT solvers take as input; DNF falls straight out of a truth table. See normal forms.
CNF and DNF·/logic/propositional-logic/syntaxLearn Math Class
Pitfall: Swapping AND and OR to change the form
Swapping the connectives of the CNF (P∨Q)∧R(P \vee Q) \wedge R gives (P∧Q)∨R(P \wedge Q) \vee R, which is T at P=Q=FP = Q = F, R=TR = T, where the original is F. Distributing gives the DNF (P∧R)∨(Q∧R)(P \wedge R) \vee (Q \wedge R).
In a CNF the conjunction is the main connective and the disjunctions sit inside the clauses; in a DNF the roles are reversed. A CNF and a DNF of the same formula are both equivalent to it, so all three agree in every row of the truth table. Moving from one form to the other goes through the laws of equivalence or through the truth table, as the normal form converter does.
Normal forms change a formula's shape, never its truth table: every formula has both a CNF and a DNF.

Common Pitfalls

Four slips cause many wrong answers on the topics of this page. Each is marked where it happens in the sections above; here each is worked through in full, with the wrong and the right working side by side.

Reading the negation as covering the whole formula

In a formula such as (¬P∧Q)(\neg P \wedge Q) the negation sign stands at the front, and it is taken to negate everything after it. The formula is then read as ¬(P∧Q)\neg(P \wedge Q), which is a different formula.

Wrong working: (¬P∧Q)(\neg P \wedge Q) is read as "not (PP and QQ)". At P=TP = T, Q=FQ = F, the conjunction P∧QP \wedge Q is F, so its negation is T.

Right working: by rule 2 the negation is applied to PP alone, giving ¬P\neg P; rule 3 then joins ¬P\neg P and QQ. At P=TP = T, Q=FQ = F, both ¬P\neg P and QQ are F, so (¬P∧Q)(\neg P \wedge Q) is F. The two readings differ in this row, so they are not the same formula.

Why it happens: in everyday speech "not P and Q" often means "not both", and a sign at the front of a line looks as if it governs the whole line. The formation rules attach ¬\neg to a single formula, and only parentheses can make that formula larger.

How to check: draw the parse tree. The node for ¬\neg has exactly one child; if that child is the leaf PP, the negation covers PP only. To negate the conjunction, the formula must be written ¬(P∧Q)\neg(P \wedge Q).

Reading the connectives left to right

A formula written without all its brackets is grouped in the order the symbols appear, and the precedence of the connectives is ignored. When ∧\wedge and ∨\vee are mixed, this produces a different formula.

Wrong working: P∨Q∧RP \vee Q \wedge R is grouped as (P∨Q)∧R(P \vee Q) \wedge R. At P=TP = T, Q=FQ = F, R=FR = F, the disjunction P∨QP \vee Q is T and RR is F, so the result is F.

Right working: ∧\wedge binds tighter than ∨\vee, so the formula is P∨(Q∧R)P \vee (Q \wedge R). In the same row Q∧RQ \wedge R is F and PP is T, so the formula is T. The left-to-right grouping gives F where the formula is T.

Why it happens: the eye reads the symbols in order, and ∧\wedge and ∨\vee look like equal partners. Their ranking is a convention that has to be learned, much like multiplication before addition in arithmetic.

How to check: before evaluating, write the formula out with all its brackets, going down the precedence pyramid: ¬\neg first, then ∧\wedge, ∨\vee, →\to and ↔\leftrightarrow. The connective placed last is the main connective, and it must match the reading you evaluate.

Confusing well-formed with true

A formula that is always false is rejected as not well-formed. Well-formedness is a question of syntax only: it asks how the string is built, not in which rows it is true.

Wrong working: (P∧¬P)(P \wedge \neg P) is F at P=TP = T and F at P=FP = F. It can never be true, so it is called an invalid formula and not a WFF.

Right working: rule 1 makes PP a formula, rule 2 makes ¬P\neg P a formula, and rule 3 joins them into (P∧¬P)(P \wedge \neg P). Every step follows a formation rule, so the string is a WFF. That it is F in every row is a fact of semantics: it is a contradiction.

Why it happens: the word "valid" is used in two senses. A formula that is valid in the sense of syntax is simply well-formed, while in semantics a valid formula is a tautology, and the two meanings get mixed.

How to check: answer the two questions separately. First test the string against the formation rules or the table of checks, without giving any letter a truth value. Only after it passes, build its truth table to see where it is true.

Swapping AND and OR to change the form

Because CNF and DNF look like mirror images, a CNF is turned into a DNF by exchanging every ∧\wedge with ∨\vee and every ∨\vee with ∧\wedge. The result is the dual of the formula, and in general it is not equivalent to it.

Wrong working: from the CNF (P∨Q)∧R(P \vee Q) \wedge R, swapping the connectives gives (P∧Q)∨R(P \wedge Q) \vee R. At P=FP = F, Q=FQ = F, R=TR = T, the new formula is T because RR is T, while the original is F because P∨QP \vee Q is F.

Right working: distribute ∧\wedge over ∨\vee: (P∨Q)∧R≡(P∧R)∨(Q∧R)(P \vee Q) \wedge R \equiv (P \wedge R) \vee (Q \wedge R). This DNF agrees with the original in all eight rows; at P=FP = F, Q=FQ = F, R=TR = T both are F.

Why it happens: the two shapes are mirror images in their outline, with the main connective and the inner connective trading places, and that outline is taken as a rule for rewriting. A rewrite has to keep the truth value of every row, and swapping connectives does not.

How to check: pick a row and evaluate both the original and the result. One row where they differ shows the conversion is wrong; a correct CNF and DNF of the same formula agree in every row.

Logic Syntax FAQ

What is the difference between syntax and semantics in logic?

+
Syntax governs form: it asks whether an expression is properly built from the allowed symbols, before any question of meaning arises. Semantics governs truth: it interprets a well-formed expression and asks whether it is true or false. The order matters — only a syntactically correct formula can be given a truth value at all, which is why formal logic defines its grammar first.Read more →

What is the order of precedence for logical operators?

+
Negation ¬ binds tightest, then conjunction ∧, disjunction ∨, implication →, and biconditional ↔ loosest. So ¬P ∧ Q ∨ R reads ((¬P) ∧ Q) ∨ R. Strictly, precedence is only a reading convention for dropping parentheses — at the formation-rule level every binary connective requires its own pair. See how a formula parses in the syntax tree builder.Read more →

What are the five logical connectives?

+
The five standard connectives of propositional logic are negation ¬ ('not'), conjunction ∧ ('and'), disjunction ∨ ('or'), implication → ('if… then'), and biconditional ↔ ('if and only if'). Negation is unary — it applies to a single formula — while the other four each join exactly two formulas. Keyboards and code often use the ASCII stand-ins !, &&, ||, -> and <->.Read more →

What do φ and ψ mean in logic?

+
φ (phi) and ψ (psi) are metavariables: Greek letters that stand for whole formulas rather than atomic propositions. A rule like 'if φ is well-formed, so is ¬φ' is a template quantifying over every possible formula at once, which is what powers the recursive formation rules. Latin letters P, Q, R name single atomic statements; Greek letters can stand for anything the grammar generates.Read more →

Does P → Q → R need parentheses?

+
Yes, because the bare string has two readings that are different formulas. At P=FP = F, Q=TQ = T, R=FR = F, the grouping (P→Q)→R(P \to Q) \to R is T→FT \to F, which is F, while P→(Q→R)P \to (Q \to R) is T because its antecedent is false. Precedence cannot choose between them, since both connectives are the same, so brackets or an agreed convention must say which is meant.Read more →

What is Polish notation in logic?

+
Polish notation writes each connective before its operands, as Jan Łukasiewicz did in the 1920s. Every such string can be read in only one way, so parentheses are no longer needed: ((P∧Q)→¬R)((P \wedge Q) \to \neg R) becomes CKpqNr, with C for implication, K for conjunction and N for negation. Reversed, with the connective last, the idea became the entry method of Hewlett-Packard calculators.Read more →

Is a contradiction a well-formed formula?

+
Yes. Well-formedness is a question of syntax: it asks only how the string is built, not in which rows it is true. (P∧¬P)(P \wedge \neg P) follows the formation rules, with rule 1 giving PP, rule 2 giving ¬P\neg P and rule 3 joining them, so it is a WFF. That it is F in every row is a separate fact of semantics, and it makes the formula a contradiction.Read more →



RuleValid ExampleInvalid Example
1. Parentheses are balanced and properly nested(P ∨ Q)(P ∨ Q or P ∨ Q)
2. Only allowed symbols are used (propositional letters, connectives, and parentheses)¬(P ∧ Q)¬(P & Q)
3. Unary connective ¬ is applied directly to a valid subformula¬P or ¬(P ∧ Q)P¬, ¬∧P, or ¬()
4. Binary connectives (∧, ∨, →, ↔) occur between two valid WFFs(P → Q)(→ P Q) or (P ∧)
5. Atomic propositions appear as standalone symbolsP, (P ∧ Q)PQ or P¬Q
6. No two connectives appear consecutively without valid operands(¬P ∧ Q)(P ∧ ∨ Q)
7. The full string forms one complete formula (no leftovers)((P ∧ Q) ∨ R)((P ∧ Q) ∨ R) ∧