Part ofa series on |
Formal languages |
---|
Inmathematical logic,propositional logic andpredicate logic, awell-formed formula, abbreviatedWFF orwff, often simplyformula, is a finitesequence ofsymbols from a givenalphabet that is part of aformal language.[1]
The abbreviationwff is pronounced "woof", or sometimes "wiff", "weff", or "whiff".[12]
A formal language can be identified with the set of formulas in the language. A formula is asyntactic object that can be given a semanticmeaning by means of aninterpretation. Two key uses of formulas are in propositional logic and predicate logic.
A key use of formulas is inpropositional logic andpredicate logic such asfirst-order logic. In those contexts, a formula is a string of symbols φ for which it makes sense to ask "is φ true?", once anyfree variables in φ have been instantiated. In formal logic,proofs can be represented by sequences of formulas with certain properties, and the final formula in the sequence is what is proven.
Although the term "formula" may be used for written marks (for instance, on a piece of paper or chalkboard), it is more precisely understood as the sequence of symbols being expressed, with the marks being atoken instance of formula. This distinction between the vague notion of "property" and the inductively-defined notion of well-formed formula has roots in Weyl's 1910 paper "Uber die Definitionen der mathematischen Grundbegriffe".[13] Thus the same formula may be written more than once, and a formula might in principle be so long that it cannot be written at all within the physical universe.
Formulas themselves are syntactic objects. They are given meanings by interpretations. For example, in a propositional formula, each propositional variable may be interpreted as a concrete proposition, so that the overall formula expresses a relationship between these propositions. A formula need not be interpreted, however, to be considered solely as a formula.
The formulas ofpropositional calculus, also calledpropositional formulas,[14] are expressions such as. Their definition begins with the arbitrary choice of a setV ofpropositional variables. The alphabet consists of the letters inV along with the symbols for thepropositional connectives and parentheses "(" and ")", all of which are assumed to not be inV. The formulas will be certain expressions (that is, strings of symbols) over this alphabet.
The formulas areinductively defined as follows:
This definition can also be written as aformal grammar inBackus–Naur form, provided the set of variables is finite:
<alpha set>::= p | q | r | s | t | u | ... (the arbitrary finite set of propositional variables)<form>::=<alpha set> | ¬<form> | (<form>∧<form>) | (<form>∨<form>) | (<form>→<form>) | (<form>↔<form>)
Using this grammar, the sequence of symbols
is a formula, because it is grammatically correct. The sequence of symbols
is not a formula, because it does not conform to the grammar.
A complex formula may be difficult to read, owing to, for example, the proliferation of parentheses. To alleviate this last phenomenon, precedence rules (akin to thestandard mathematical order of operations) are assumed among the operators, making some operators more binding than others. For example, assuming the precedence (from most binding to least binding) 1. ¬ 2. → 3. ∧ 4. ∨. Then the formula
may be abbreviated as
This is, however, only a convention used to simplify the written representation of a formula. If the precedence was assumed, for example, to be left-right associative, in following order: 1. ¬ 2. ∧ 3. ∨ 4. →, then the same formula above (without parentheses) would be rewritten as
The definition of a formula infirst-order logic is relative to thesignature of the theory at hand. This signature specifies the constant symbols, predicate symbols, and function symbols of the theory at hand, along with thearities of the function and predicate symbols.
The definition of a formula comes in several parts. First, the set ofterms is defined recursively. Terms, informally, are expressions that represent objects from thedomain of discourse.
The next step is to define theatomic formulas.
Finally, the set of formulas is defined to be the smallest set containing the set of atomic formulas such that the following holds:
If a formula has no occurrences of or, for any variable, then it is calledquantifier-free. Anexistential formula is a formula starting with a sequence ofexistential quantification followed by a quantifier-free formula.
Anatomic formula is a formula that contains nological connectives norquantifiers, or equivalently a formula that has no strict subformulas.The precise form of atomic formulas depends on the formal system under consideration; forpropositional logic, for example, the atomic formulas are thepropositional variables. Forpredicate logic, the atoms are predicate symbols together with their arguments, each argument being aterm.
According to some terminology, anopen formula is formed by combining atomic formulas using only logical connectives, to the exclusion of quantifiers.[15] This is not to be confused with a formula which is not closed.
Aclosed formula, alsoground formula orsentence, is a formula in which there are nofree occurrences of anyvariable. IfA is a formula of a first-order language in which the variablesv1, …,vn have free occurrences, thenA preceded by∀v1 ⋯ ∀vn is auniversal closure ofA.
In earlier works on mathematical logic (e.g. byChurch[16]), formulas referred to any strings of symbols and among these strings, well-formed formulas were the strings that followed the formation rules of (correct) formulas.
Several authors simply say formula.[17][18][19][20] Modern usages (especially in the context of computer science with mathematical software such asmodel checkers,automated theorem provers,interactive theorem provers) tend to retain of the notion of formula only the algebraic concept and to leave the question ofwell-formedness, i.e. of the concrete string representation of formulas (using this or that symbol for connectives and quantifiers, using this or thatparenthesizing convention, usingPolish orinfix notation, etc.) as a mere notational problem.
The expression "well-formed formulas" (WFF) also crept into popular culture.WFF is part of an esoteric pun used in the name of the academic game "WFF 'N PROOF: The Game of Modern Logic", by Layman Allen,[21] developed while he was atYale Law School (he was later a professor at theUniversity of Michigan). The suite of games is designed to teach the principles of symbolic logic to children (inPolish notation).[22] Its name is an echo ofwhiffenpoof, anonsense word used as acheer atYale University made popular inThe Whiffenpoof Song andThe Whiffenpoofs.[23]