# GetWiki

*term (logic)*

ARTICLE SUBJECTS

being →

database →

ethics →

fiction →

history →

internet →

language →

linux →

logic →

method →

news →

policy →

purpose →

religion →

science →

software →

truth →

unix →

wiki →

ARTICLE TYPES

essay →

feed →

help →

system →

wiki →

ARTICLE ORIGINS

critical →

forked →

imported →

original →

term (logic)

[ temporary import ]

**please note:**

- the content below is remote from Wikipedia

- it has been imported raw for GetWiki

**term**denotes a mathematical object and a formula denotes a mathematical fact. In particular, terms appear as components of a formula.A first-order term is recursively constructed from constant symbols, variables and function symbols.An expression formed by applying a predicate symbol to an appropriate number of terms is called an atomic formula, which evaluates to true or false in bivalent logics, given an interpretation.For example, {{tmath|(x+1)*(x+1)}} is a term built from the constant 1, the variable {{mvar|x}}, and the binary function symbols {{tmath|+}} and {{tmath|*}}; it is part of the atomic formula {{tmath|(x+1)*(x+1) ge 0}} which evaluates to true for each real-numbered value of {{mvar|x}}.Besides in logic, terms play important roles in universal algebra, and rewriting systems.

## Elementary mathematics

In the context of polynomials, sometimes*term*is used for a monomial with a coefficient: to 'collect like terms' in a polynomial is the operation of making it a linear combination of distinct monomials. Terms, in this sense, are things that are added or subtracted.A series is often represented as the sum of a sequence of terms. Individual factors in an expression representing a product are multiplicative terms. For example, in {{math|6 + 3

*x*− 2}}, we have that {{math|6, 3

*x*}}, and {{math|−2}} are all terms.In elementary mathematics,BOOK, Steven, Schwartzman, The words of mathematics: An etymological dictionary of mathematical terms used in English, 219, The Mathematical Association of America, 1994, 0-88385-511-9,

- each argument term of the addition operator + is called an
*addend*, - the first and second argument term of the subtraction operator - is called a
*minuend*and*subtrahend*, respectively, - each argument term of the multiplication operator â‹… is called a
*factor*, the first and second argument term is also called*multiplicand*and*multiplier*, respectively, - the first and second argument term of the division operator / is called
*dividend*and*divisor*, respectively, - if the division operator is written as fraction bar, the top and bottom terms are called
*numerator*and*denominator*, respectively.

## Formal definition

(File:Tree structure of mathematical first-order terms svg.svg|thumb|Tree structure of terms (*n*â‹…(

*n*+1))/2 and

*n*â‹…((

*n*+1)/2))Given a set

*V*of variable symbols, a set

*C*of constant symbols and sets

*F*

*n*of

*n*-ary function symbols, also called operator symbols, for each natural number

*n*â‰¥ 1, the set of (unsorted first-order) terms

*T*is recursively defined to be the smallest set with the following properties:BOOK, C.C. Chang, H. Jerome Keisler, Chen Chung Chang, H. Jerome Keisler, Model Theory, 1977, 73, North Holland, Studies in Logic and the Foundation of Mathematics, ; here: Sect.1.3

- every variable symbol is a term:
*V*âŠ†*T*, - every constant symbol is a term:
*C*âŠ†*T*, - from every
*n*terms*t*1,...,*t***'n****, and every***n*-ary function symbol*f*âˆˆ*F**'n*, a larger term*f*(*t*1, ...,*t**n*) can be built.

*t*::=

*x*|

*c*|

*f*(

*t*1, ...,

*t*

*n*).Usually, only the first few function symbol sets

*F*

*n*are inhabited. Well-known examples are the unary function symbols

*sin*,

*cos*âˆˆ

*F*1, and the binary function symbols +, âˆ’, â‹…, / âˆˆ

*F*2, while ternary operations are less known, let alone higher-arity functions. Many authors consider constant symbols as 0-ary function symbols

*F*0, thus needing no special syntactic class for them.A term denotes a mathematical object from the domain of discourse. A constant

*c*denotes a named object from that domain, a variable

*x*ranges over the objects in that domain, and an

*n*-ary function

*f*maps

*n*-tuples of objects to objects. For example, if

*n*âˆˆ

*V*is a variable symbol, 1 âˆˆ

*C*is a constant symbol, and

*add*âˆˆ

*F*2 is a binary function symbol, then

*n*âˆˆ

*T*, 1 âˆˆ

*T*, and (hence)

*add*(

*n*, 1) âˆˆ

*T*by the first, second, and third term building rule, respectively. The latter term is usually written as

*n*+1, using infix notation and the more common operator symbol + for convenience.

### Term structure vs. representation

Originally, logicians defined a term to be a*character string*adhering to certain building rules.BOOK, Hans, Hermes, Hans Hermes, Introduction to Mathematical Logic, Springer London, 1431-4657, 3540058192, 1973, ; here: Sect.II.1.3 However, since the concept of tree became popular in computer science, it turned out to be more convenient to think of a term as a tree. For example, several distinct character strings, like "{{math|(

*n*â‹…(

*n*+1))/2}}", "{{math|((

*n*â‹…(

*n*+1)))/2}}", and "frac{n(n+1)}{2}", denote the same term and correspond to the same tree, viz. the left tree in the above picture.Separating the tree structure of a term from its graphical representation on paper, it is also easy to account for parentheses (being only representation, not structure) and invisible multiplication operators (existing only in structure, not in representation).

### Structural equality

Two terms are said to be**structurally**,

**literally**, or

**syntactically**equal if they correspond to the same tree. For example, the left and the right tree in the above picture are structurally

**un**equal terms, although they might be considered "

**semantically equal**" as they always evaluate to the same value in rational arithmetic. While structural equality can be checked without any knowledge about the meaning of the symbols, semantic equality cannot. If the function / is e.g. interpreted not as rational but as truncating integer division, then at

*n*=2 the left and right term evaluates to 3 and 2, respectively.Structural equal terms need to agree in their variable names.In contrast, a term

*t*is called a

**renaming**, or a

**variant**, of a term

*u*if the latter resulted from consistently renaming all variables of the former, i.e. if

*u*=

*tÏƒ*for some renaming substitution Ïƒ. In that case,

*u*is a renaming of

*t*, too, since a renaming substitution Ïƒ has an inverse Ïƒâˆ’1, and

*t*= uÏƒâˆ’1. Both terms are then also said to be

**equal modulo renaming**. In many contexts, the particular variable names in a term don't matter, e.g. the commutativity axiom for addition can be stated as

*x*+

*y*=

*y*+

*x*or as

*a*+

*b*=

*b*+

*a*; in such cases the whole formula may be renamed, while an arbitrary subterm usually may not, e.g.

*x*+

*y*=

*b*+

*a*is not a valid version of the commutativity axiom.Since atomic formulas can be viewed as trees, too, and renaming is essentially a concept on trees, atomic (and, more generally, quantifier-free) formulas can be renamed in a similar way as terms. In fact, some authors consider a quantifier-free formula as a term (of type

*bool*rather than e.g.

*int*, cf. #Sorted terms below).Renaming of the commutativity axiom can be viewed as alpha-conversion on the universal closure of the axiom: "

*x*+

*y*=

*y*+

*x*" actually means "âˆ€

*x*,

*y*:

*x*+

*y*=

*y*+

*x*", which is synonymous to "âˆ€

*a*,

*b*:

*a*+

*b*=

*b*+

*a*"; see also #Lambda terms below.

### Ground and linear terms

The set of variables of a term*t*is denoted by

*vars*(

*t*).A term that doesn't contain any variables is called a

**ground term**; a term that doesn't contain multiple occurrences of a variable is called a

**linear term**.For example, 2+2 is a ground term and hence also a linear term,

*x*â‹…(

*n*+1) is a linear term,

*n*â‹…(

*n*+1) is a non-linear term. These properties are important in, for example, term rewriting.Given a signature for the function symbols, the set of all terms forms the

**free term algebra**. The set of all ground terms forms the

**initial term algebra**.Abbreviating the number of constants as

*f*0, and the number of

*i*-ary function symbols as

*f*

**'i****, the**number Î¸

*h*of distinct ground terms

*' of a height up to*h'' can be computed by the following recursion formula:

- Î¸0 =
*f*0, since a ground term of height 0 can only be a constant, - theta_{h+1} = sum_{i=0}^infty f_i cdot theta_h^i, since a ground term of height up to
*h*+1 can be obtained by composing any*i*ground terms of height up to*h*, using an*i*-ary root function symbol. The sum has a finite value if there is only a finite number of constants and function symbols, which is usually the case.

### Building formulas from terms

Given a set*R*

**'n****of**

*n*-ary relation symbols for each natural number*n*â‰¥ 1, an (unsorted first-order) atomic formula is obtained by applying an*n*-ary relation symbol to*n*terms. As for function symbols, a relation symbol set*R**'n*is usually non-empty only for small

*n*. In mathematical logic, more complex formulas are built from atomic formulas using logical connectives and quantifiers. For example, letting â„ denote the set of real numbers, âˆ€

*x*:

*x*âˆˆ â„ â‡’ (

*x*+1)â‹…(

*x*+1) â‰¥ 0 is a mathematical formula evaluating to true in the algebra of complex numbers.An atomic formula is called ground if it is built entirely from ground terms; all ground atomic formulas composable from a given set of function and predicate symbols make up the Herbrand base for these symbol sets.

## Operations with terms

(File:Example term for position, path, depth, match svg.svg|thumb|Tree structure of black example term frac{a*((a+1)*(a+2))}{1*(2*3)}, with blue redex {{tmath|x*(y*z)}})- Since a term has the structure of a tree hierarchy, to each of its nodes a
**position**, or**path**, can be assigned, that is, a string of natural numbers indicating the node's place in the hierarchy. The empty string, commonly denoted by Îµ, is assigned to the root node. Position strings within the black term are indicated in red in the picture. - At each position
*p*of a term*t*, a unique**subterm**starts, which is commonly denoted by {{math|*t*{{!}}*p*}}. For example, at position 122 of the black term in the picture, the subterm*a*+2 has its root. The relation*"is a subterm of"*is a partial order on the set of terms; it is reflexive since each term is trivially a subterm of itself. - The term obtained by
**replacing**in a term*t*the subterm at a position*p*by a new term*u*is commonly denoted by {{math|*t*[*u*]*p*}}. The term {{math|*t*[*u*]*p*}} can also be viewed as resulting from a generalized concatenation of the term*u*with a term-like object {{math|*t*[.]}}; the latter is called a**context**, or a**term with a hole**(indicated by "."; its position being*p*), in which*u*is said to be**embedded**. For example, if*t*is the black term in the picture, then {{math|*t*[*b*+1]12}} results in the term frac{a(b+1)}{1(23)}. The latter term also results from embedding the term {{math|*b*+1}} into the context frac{a(; . ;)}{1(23)}. In an informal sense, the operations of instantiating and embedding are converse to each other: while the former appends function symbols at the bottom of the term, the latter appends them at the top. The encompassment ordering relates a term and any result of appends on both sides. - To each node of a term, its
**depth**(called**height**by some authors) can be assigned, i.e. its distance (number of edges) from the root. In this setting, the depth of a node always equals the length of its position string. In the picture, depth levels in the black term are indicated in green. - The
**size**of a term commonly refers to the number of its nodes, or, equivalently, to the length of the term's written representation, counting symbols without parentheses. The black and the blue term in the picture has the size 15 and 5, respectively. - A term
*u***matches**a term*t*, if a substitution instance of*u*structurally equals a subterm of*t*, or formally, if {{math|1=*u*Ïƒ =*t*{{!}}*p*}} for some position*p*in*t*and some substitution Ïƒ. In this case,*u*,*t*, and Ïƒ are called the**pattern term**, the**subject term**, and the**matching substitution**, respectively. In the picture, the blue pattern term {{tmath|x(yz)}} matches the black subject term at position 1, with the matching substitution {{math| {*x*â†¦*a*,*y*â†¦*a*+1, z â†¦*a*+2 } }} indicated by blue variables immediately left to their black substitutes. Intuitively, the pattern, except for its variables, must be contained in the subject; if a variable occurs multiply in the pattern, equal subterms are required at the respective positions of the subject. - unifying terms
- term rewriting

## Related concepts

### Sorted terms

When the domain of discourse contains elements of basically different kinds, it is useful to split the set of all terms accordingly. To this end, a**sort**(sometimes also called

**type**) is assigned to each variable and each constant symbol, and a declaration I.e., "symbol type" in the Many-sorted signatures section of the Signature (logic) article. of domain sorts and range sort to each function symbol. A

**sorted term**

*f*(

*t*1,...,

*t*

**'n****) may be composed from sorted subterms**

*t*1,...,*t**'n*only if the {{mvar|i}}th subterm's sort matches the declared {{mvar|i}}th domain sort of

*f*. Such a term is also called

**well-sorted**; any other term (i.e. obeying the unsorted rules only) is called

**ill-sorted**.For example, a vector space comes with an associated field of scalar numbers. Let

*W*and

*N*denote the sort of vectors and numbers, respectively, let

*V*

**'W****and**

*V**'N*be the set of vector and number variables, respectively, and

*C*

**'W****and**

*C**'N*the set of vector and number constants, respectively. Then e.g. vec{0} in C_W and {{math|0 âˆˆ

*C*

**'N****}}, and the vector addition, the scalar multiplication, and the inner product is declared as {{tmath|+:W times W to W, *:W times N to W}}, and {{tmath|langle .,. rangle: W times W to N}}, respectively. Assuming variable symbols vec{v},vec{w} in V_W and {{math|**

*a*,*b*âˆˆ*V**'N*}}, the term langle (vec{v}+vec{0})*a,vec{w}*b rangle is well-sorted, while vec{v}+a is not (since + doesn't accept a term of sort

*N*as 2nd argument). In order to make a*vec{v} a well-sorted term, an additional declaration {{tmath|*:N times W to W}} is required. Function symbols having several declarations are called

**overloaded**.See many-sorted logic for more information, including extensions of the

**many-sorted framework**described here.

### Lambda terms

{| class="wikitable" style="float: right;"|+ Terms with bound variables ! Notation example !! Bound variables !! Free variables !! Written as lambda-term{{underset | nâ†’âˆž>lim}} x/n}} | n | x | limit(Î»n. div(x,n)) |

i > | n >| sum(1,n,Î»i. power(i,2)) |

t > | a, b, k >| integral(a,b,Î»t. sin(kâ‹…t)) |

#### Motivation

Mathematical notations as shown in the table do not fit into the scheme of a first-order term as defined above, as they all introduce an own**local**, or

**bound**, variable that may not appear outside the notation's scope, e.g. t cdot int_a^b sin(k cdot t) ; dt doesn't make sense. In contrast, the other variables, referred to as

**free**, behave like ordinary first-order term variables, e.g. k cdot int_a^b sin(k cdot t) ; dt does make sense.All these operators can be viewed as taking a function rather than a value term as one of their arguments. For example, the

*lim*operator is applied to a sequence, i.e. to a mapping from positive integer to e.g. real numbers. As another example, a C function to implement the second example from the table, âˆ‘, would have a function pointer argument (see box below).

**Lambda terms**can be used to denote

**anonymous functions**to be supplied as arguments to

*lim*, âˆ‘, âˆ«, etc.For example, the function

*square*from the C program below can be written anonymously as a lambda term Î»

*i*.

*i*2. The general sum operator âˆ‘ can then be considered as a ternary function symbol taking a lower bound value, an upper bound value and a function to be summed-up. Due to its latter argument, the âˆ‘ operator is called a

**second-order function symbol**.As another example, the lambda term Î»

*n*.

*x*/

*n*denotes a function that maps 1, 2, 3, ... to

*x*/1,

*x*/2,

*x*/3, ..., respectively, that is, it denotes the sequence (

*x*/1,

*x*/2,

*x*/3, ...). The

*lim*operator takes such a sequence and returns its limit (if defined).The rightmost column of the table indicates how each mathematical notation example can be represented by a lambda term, also converting common infix operators into prefix form.int sum(int lwb, int upb, int fct(int)) { // implements general sum operator

int res = 0;

for (int i=lwb; i

for (int i=lwb; i

**- content above as imported from Wikipedia**

- "

- time: 11:45pm EST - Mon, Dec 10 2018

- "

__term (logic)__" does not exist on GetWiki (yet)- time: 11:45pm EST - Mon, Dec 10 2018

[ this remote article is provided by Wikipedia ]

LATEST EDITS [ see all ]

GETWIKI 09 MAY 2016

GETWIKI 18 OCT 2015

GETWIKI 20 AUG 2014

GETWIKI 19 AUG 2014

GETWIKI 18 AUG 2014

© 2018 M.R.M. PARROTT | ALL RIGHTS RESERVED