Formula
Let be a formal language with a signature consisting of constant symbols, function symbols (each with a specified arity), relation symbols (each with a specified arity), and a countable set of variables.
Definition. The set of well-formed formulas (or simply formulas) of is the smallest set satisfying:
- Atomic formulas. If is an -ary relation symbol and are terms of , then . In particular, .
- Connectives. If , then , , , and are in .
- Quantifiers. If and is a variable, then and are in .
A term of is built from variables and constant symbols by iterated application of function symbols.
Proposition. Every formula has a unique parse tree.
Proof sketch. By structural induction on the definition, using the fact that the outermost constructor (connective, quantifier, or atomic predicate) is uniquely determined by the formula’s syntax.
Definition. A variable occurs free in if it is not in the scope of any quantifier or within . A sentence (or closed formula) is a formula with no free variables. An open formula defines a property or relation depending on the values assigned to its free variables.
Examples.
- Propositional logic. has no function or relation symbols beyond nullary propositional variables and no quantifiers. Formulas are built by clauses (1) and (2) alone.
- First-order arithmetic. . The sentence is a closed formula; is an open formula with free variables and .
A formula is a purely syntactic object. It becomes a proposition only when interpreted in a model. The study of which formulas are satisfied by which models is model theory.