A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Well-Formed Formulas (WFF) in Propositional and First-Order Logic

College Depth 71 in the knowledge graph ☐ I know this ☆ Set as goal
663topics build on this
322prerequisites beneath it
See this on the map →
Propositional ConnectivesPropositional Logic Syntax→→Atomic and Complex FormulasFormulas and Well-Formed Expressions+3 more
syntax propositional-logic first-order-logic wff

Core Idea

A well-formed formula (WFF) is a syntactically valid string following the grammar rules of propositional or first-order logic. In propositional logic, WFFs are built from atomic propositions and connectives (¬, ∧, ∨, →, ↔). In first-order logic, WFFs also include terms, predicates, and quantifiers (∀, ∃), with strict rules about variable binding and scope. Understanding what counts as a valid formula is foundational to defining logical consequence, proof systems, and semantics.

How It's Best Learned

Start with propositional WFFs using simple examples and counterexamples (e.g., 'P ∧ Q' is WFF, but '∧ P' is not). Progress to first-order by adding terms and quantifiers with exercises on spotting syntactic errors. Use recursive grammar definitions and parse trees to visualize structure.

Common Misconceptions

Explainer

You already know the propositional connectives — ¬, ∧, ∨, →, ↔ — and the basic syntax of propositional logic. A well-formed formula (WFF) is the precise definition of what counts as a grammatically legal string in a logical language. The point is that not every sequence of symbols is meaningful: "∧ P Q ¬" is not a formula any more than "the cat sat the" is a sentence. WFFs are defined by an inductive grammar that tells you exactly which strings are legal.

For propositional logic, the grammar is simple. Every atomic proposition (P, Q, R, …) is a WFF. If φ is a WFF, then ¬φ is a WFF. If φ and ψ are WFFs, then (φ ∧ ψ), (φ ∨ ψ), (φ → ψ), and (φ ↔ ψ) are WFFs. That's it — nothing else is a WFF. This inductive definition is powerful because it gives every formula a unique parse tree: a tree whose leaves are atomic propositions and whose internal nodes are connectives. The parse tree makes the meaning of a formula unambiguous and is the structure used when evaluating formulas with truth tables.

First-order logic extends this with three new ingredients: terms (built from variables, constants, and function symbols), predicates (applied to terms to make atomic formulas), and quantifiers (∀x and ∃x, which bind the variable x). An atomic formula in FOL is something like P(f(x), c) — a predicate applied to terms. Complex FOL formulas are then built by applying connectives and quantifiers: ∀x ∃y (R(x,y) ∧ ¬P(y)) is a WFF; ∀P(x) is not (you cannot quantify over predicates in first-order logic).

The subtlest new concept in FOL WFFs is variable binding and scope. In ∀x (P(x) → Q(x)), both occurrences of x are *bound* by the universal quantifier — they are not free variables, just formal placeholders. In ∀x P(x) ∧ Q(y), the variable y is *free* — it is not bound by any quantifier and acts like an unspecified parameter. A formula with no free variables is called a sentence (or closed formula); it is either true or false in a given structure. A formula with free variables has a truth value only once the free variables are assigned specific elements from the domain. This distinction matters enormously: sentences express propositions about a structure, while open formulas express properties of elements.

Understanding WFFs is foundational because every subsequent concept in logic — truth, satisfaction, proof, consequence — is defined by induction on the structure of WFFs. When you evaluate a formula's truth value, you recurse through its parse tree. When you define what a proof is, you build it up from WFFs step by step. The grammar of WFFs is the backbone on which all of logic hangs.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Introduction to Propositional Logic → Propositional Connectives → Well-Formed Formulas (WFF) in Propositional and First-Order Logic

Longest path: 72 steps · 322 total prerequisite topics

Prerequisites (2)

Leads To (5)