2.1.5: Main operator of a Formula
It is often useful to talk about the last operator used in constructing a formula \(A\) . This operator is called the main operator of \(A\) . Intuitively, it is the “outermost” operator of \(A\) . For example, the main operator of \(\lnot A\) is \(\lnot\) , the main operator of \((A \lor B)\) is \(\lor\) , etc.
The main operator of a formula \(A\) is defined as follows:
- \(\indcaseA{A}{A}\) \(\indfrm\) has no main operator.
- \(\indcase{A}{\lnot B}\) the main operator of \(\indfrm\) is \(\lnot\) .
- \(\indcase{A}{(B \land C)}\) the main operator of \(\indfrm\) is \(\land\) .
- \(\indcase{A}{(B \lor C)}\) the main operator of \(\indfrm\) is \(\lor\) .
- \(\indcase{A}{(B \lif C)}\) the main operator of \(\indfrm\) is \(\lif\) .
- \(\indcase{A}{\lforall{x}{B}}\) the main operator of \(\indfrm\) is \(\lforall{}{}\) .
- \(\indcase{A}{\lexists{x}{B}}\) the main operator of \(\indfrm\) is \(\lexists{}{}\) .
In each case, we intend the specific indicated occurrence of the main operator in the formula. For instance, since the formula \(((D \lif E) \lif (E \lif D))\) is of the form \((B \lif C)\) where \(B\) is \((D \lif E)\) and \(C\) is \((E \lif D)\) , the second occurrence of \(\lif\) is the main operator.
This is a recursive definition of a function which maps all non-atomic formulas to their main operator occurrence. Because of the way formulas are defined inductively, every formula \(A\) satisfies one of the cases in Definition \(\PageIndex{1}\) . This guarantees that for each non-atomic formula \(A\) a main operator exists. Because each formula satisfies only one of these conditions, and because the smaller formulas from which \(A\) is constructed are uniquely determined in each case, the main operator occurrence of \(A\) is unique, and so we have defined a function.
We call formulas by the following names depending on which symbol their main operator is:
| Main operator | Type of formula | Example |
|---|---|---|
| none | atomic (formula) | \(\lfalse\) , \(\Atom{R}{t_1, \dots, t_n}\) , \(\eq[t_1][t_2]\) |
| \(\lnot\) | negation | \(\lnot A\) |
| \(\land\) | conjunction | \((A \land B\) ) |
| \(\lor\) | disjunction | \((A \lor B\) ) |
| \(\lif\) | conditional | \((A \lif B\) ) |
| \(\lforall{}{}\) | universal (formula) | \(\lforall{x}{A}\) |
| \(\lexists{}{}\) | existential (formula) | \(\lexists{x}{A}\) |