In the formal language of propositional logic, a well-formed formula is one that obeys a strict set of rules so that it is unambiguous to evaluate.
Also see general well-formed formulae, under arbitrary formal languages.
Definition
Well-formed Formula (Propositional Logic) ^definition
In the formal language of propositional logic, a well-formed formula is defined, recursively in Backus-Naur form as:
- : Is defined to be
- : The set of all atoms (not just !)
- : True and False respectively
- We can interpret any ’s in the right hand side as some other well-formed formula (hence the recursive defitinition)
- See logical connectives for the remaining symbols
Formal Syntax - The parenthesis must be added
This is precisely why wffs are considered extremely strict. Even extremely trivial propositions like are not wffs unless they have the accompanying parenthesis (in this case, it should be )
Alternatively, a well-formed formula is one that can be interpreted unambiguously as an expression tree.
Evaluation
For example, if we want to evaluate whether the following proposition is a wff:
we can do so by splitting it up into valid wffs:
- : Need to check if and are wff’s
- : Need to check if and are wff’s
- is an atom, therefore a wff.
- is an atom, therefore a wff.
- is an atom, therefore wff.
- : Need to check if and are wff’s
Examples
Examples
- : Any atom is a wff
- is a wff
- is a wff
Non-examples
- is not a wff, as it is missing the parenthesis
- is not a wff, again because of missing parentheses
- is missing outer parenthesis