Comment
Author: Admin | 2025-04-28
Predicate> "(" term> "," term> ")" | ternary predicate> "(" term> "," term> "," term> ")"formula> ::= atomic formula> | "¬" formula> | formula> "∧" formula> | formula> "∨" formula> | formula> "⇒" formula> | formula> "⇔" formula> | "(" formula> ")" | "∀" variable> formula> | "∃" variable> formula>The above context-free grammar in Backus-Naur form defines the language of syntactically valid first-order formulas with function symbols and predicate symbols up to arity 3. For higher arities, it needs to be adapted accordingly.[15][citation needed]The example formula ∀x ∃x' (¬x=c) ⇒ f2(x,x')=c' describes multiplicative inverses when f2', c, and c' are interpreted as multiplication, zero, and one, respectively.The formation rules define the terms and formulas of first-order logic.[16] When terms and formulas are represented as strings of symbols, these rules can be used to write a formal grammar for terms and formulas. These rules are generally context-free (each production has a single symbol on the left side), except that the set of symbols may be allowed to be infinite and there may be many start symbols, for example the variables in the case of terms.The set of terms is inductively defined by the following rules:[17]Variables. Any variable symbol is a term.Functions. If f is an n-ary function symbol, and t1, ..., tn are terms, then f(t1,...,tn) is a term. In particular, symbols denoting individual constants are nullary function symbols, and thus are terms.Only expressions which can be obtained by finitely many applications of rules 1 and 2 are terms. For example, no expression involving a predicate symbol is a term.The set of formulas (also called well-formed formulas[18] or WFFs) is inductively defined by the following rules:Predicate symbols. If P is an n-ary predicate symbol and t1, ..., tn are terms then P(t1,...,tn) is a formula.Equality. If the equality symbol is considered part of logic, and t1 and t2 are terms, then t1 = t2 is a formula.Negation. If is a formula, then is a formula.Binary connectives. If and are formulas, then () is a formula. Similar rules apply to other binary logical connectives.Quantifiers. If is a formula and x
Add Comment