Also see general well-formed formulae, under arbitrary formal languages.

Definition

Well-formed Formula ^definition-wff

A formula, , is well-formed if belongs to some formal language, :

Alternatively, a well-formed formula is one that can be interpreted unambiguously as an expression tree.

Formal Syntax - The parenthesis must be added

For both the definitions below, the parenthesis cannot be ignored! 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 )

Propositional Logic

Well-formed Formula (Propositional Logic) ^definition

In the formal language of propositional logic, a well-formed formula (i.e. a well-formed proposition) 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
Predicate Logic

Well-formed Formula (Predicate Logic) ^definition

In the formal language of predicate logic, a well-formed formula is defined, recursively in Backus-Naur form as:

  • : Is defined to be
  • : Any atomic predicate
    • (without any inputs) : Can be thought of as a proposition (technically a 0-ary, nullary predicate)
    • : A predicate consisting of one or more terms
  • : A term
  • : A variable
  • : 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 definitions of
  • See logical quantifiers for definitions of

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:

  1. : Need to check if and are wff’s
    1. : Need to check if and are wff’s
      1. is an atom, therefore a wff.
      2. is an atom, therefore a wff.
    2. is an atom, therefore wff.

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