Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Anti-unification

From Wikipedia, the free encyclopedia
(Redirected fromAnti-unification (computer science))
Logical generalization for symbolic expressions
For solving systems of inequalities, seeDis-unification.

Anti-unification is the process of constructing a generalization common to two given symbolic expressions. As inunification, several frameworks are distinguished depending on which expressions (also called terms) are allowed, and which expressions are considered equal. If variables representing functions are allowed in an expression, the process is called "higher-order anti-unification", otherwise "first-order anti-unification". If the generalization is required to have an instance literally equal to each input expression, the process is called "syntactical anti-unification", otherwise "E-anti-unification", or "anti-unification modulo theory".

An anti-unification algorithm should compute for given expressions a complete and minimal generalization set, that is, a set covering all generalizations and containing no redundant members, respectively. Depending on the framework, a complete and minimal generalization set may have one, finitely many, or possibly infinitely many members, or may not exist at all;[note 1] it cannot be empty, since a trivial generalization exists in any case. For first-order syntactical anti-unification,Gordon Plotkin[1][2] gave an algorithm that computes a complete and minimal singleton generalization set containing the so-called "least general generalization" (lgg).

Anti-unification should not be confused withdis-unification. The latter means the process of solving systems ofinequations, that is of finding values for the variables such that all given inequations are satisfied.[note 2] This task is quite different from finding generalizations.

Prerequisites

[edit]

Formally, an anti-unification approach presupposes

First-order term

[edit]
Main article:Term (logic)

Given a setV{\displaystyle V} of variable symbols, a setC{\displaystyle C} of constant symbols and setsFn{\displaystyle F_{n}} ofn{\displaystyle n}-ary function symbols, also called operator symbols, for each natural numbern1{\displaystyle n\geq 1}, the set of (unsorted first-order) termsT{\displaystyle T} isrecursively defined to be the smallest set with the following properties:[3]

  • every variable symbol is a term:VT,
  • every constant symbol is a term:CT,
  • from everyn termst1,...,tn, and everyn-ary function symbolfFn, a larger termf(t1,,tn){\displaystyle f(t_{1},\ldots ,t_{n})} can be built.

For example, ifx ∈V is a variable symbol, 1 ∈C is a constant symbol, and add ∈F2 is a binary function symbol, thenx ∈T, 1 ∈T, and (hence) add(x,1) ∈T by the first, second, and third term building rule, respectively. The latter term is usually written asx+1, usingInfix notation and the more common operator symbol + for convenience.

Higher-order term

[edit]
Main article:Lambda calculus

Substitution

[edit]
Main article:Substitution (logic)

Asubstitution is a mappingσ:VT{\displaystyle \sigma :V\longrightarrow T} from variables to terms; the notation{x1t1,,xktk}{\displaystyle \{x_{1}\mapsto t_{1},\ldots ,x_{k}\mapsto t_{k}\}} refers to a substitution mapping each variablexi{\displaystyle x_{i}} to the termti{\displaystyle t_{i}}, fori=1,,k{\displaystyle i=1,\ldots ,k}, and every other variable to itself. Applying that substitution to a termt is written in postfix notation ast{x1t1,,xktk}{\displaystyle t\{x_{1}\mapsto t_{1},\ldots ,x_{k}\mapsto t_{k}\}}; it means to (simultaneously) replace every occurrence of each variablexi{\displaystyle x_{i}} in the termt byti{\displaystyle t_{i}}. The result of applying a substitutionσ to a termt is called aninstance of that termt.As a first-order example, applying the substitution{xh(a,y),zb}{\displaystyle \{x\mapsto h(a,y),z\mapsto b\}} to the term

f(x,a,g(z),y)yields
f(h(a,y),a,g(b),y).

Generalization, specialization

[edit]

If a termt{\displaystyle t} has an instance equivalent to a termu{\displaystyle u}, that is, iftσu{\displaystyle t\sigma \equiv u} for some substitutionσ{\displaystyle \sigma }, thent{\displaystyle t} is calledmore general thanu{\displaystyle u}, andu{\displaystyle u} is calledmore special than, orsubsumed by,t{\displaystyle t}. For example,xa{\displaystyle x\oplus a} is more general thanab{\displaystyle a\oplus b} if{\displaystyle \oplus } iscommutative, since then(xa){xb}=baab{\displaystyle (x\oplus a)\{x\mapsto b\}=b\oplus a\equiv a\oplus b}.

If{\displaystyle \equiv } is literal (syntactic) identity of terms, a term may be both more general and more special than another one only if both terms differ just in their variable names, not in their syntactic structure; such terms are calledvariants, orrenamings of each other.For example,f(x1,a,g(z1),y1){\displaystyle f(x_{1},a,g(z_{1}),y_{1})} is a variant off(x2,a,g(z2),y2){\displaystyle f(x_{2},a,g(z_{2}),y_{2})}, sincef(x1,a,g(z1),y1){x1x2,y1y2,z1z2}=f(x2,a,g(z2),y2){\displaystyle f(x_{1},a,g(z_{1}),y_{1})\{x_{1}\mapsto x_{2},y_{1}\mapsto y_{2},z_{1}\mapsto z_{2}\}=f(x_{2},a,g(z_{2}),y_{2})} andf(x2,a,g(z2),y2){x2x1,y2y1,z2z1}=f(x1,a,g(z1),y1){\displaystyle f(x_{2},a,g(z_{2}),y_{2})\{x_{2}\mapsto x_{1},y_{2}\mapsto y_{1},z_{2}\mapsto z_{1}\}=f(x_{1},a,g(z_{1}),y_{1})}.However,f(x1,a,g(z1),y1){\displaystyle f(x_{1},a,g(z_{1}),y_{1})} isnot a variant off(x2,a,g(x2),x2){\displaystyle f(x_{2},a,g(x_{2}),x_{2})}, since no substitution can transform the latter term into the former one, although{x1x2,z1x2,y1x2}{\displaystyle \{x_{1}\mapsto x_{2},z_{1}\mapsto x_{2},y_{1}\mapsto x_{2}\}} achieves the reverse direction.The latter term is hence properly more special than the former one.

A substitutionσ{\displaystyle \sigma } ismore special than, orsubsumed by, a substitutionτ{\displaystyle \tau } ifxσ{\displaystyle x\sigma } is more special thanxτ{\displaystyle x\tau } for each variablex{\displaystyle x}.For example,{xf(u),yf(f(u))}{\displaystyle \{x\mapsto f(u),y\mapsto f(f(u))\}} is more special than{xz,yf(z)}{\displaystyle \{x\mapsto z,y\mapsto f(z)\}}, sincef(u){\displaystyle f(u)} andf(f(u)){\displaystyle f(f(u))} is more special thanz{\displaystyle z} andf(z){\displaystyle f(z)}, respectively.

Anti-unification problem, generalization set

[edit]

Ananti-unification problem is a pairt1,t2{\displaystyle \langle t_{1},t_{2}\rangle } of terms.A termt{\displaystyle t} is a commongeneralization, oranti-unifier, oft1{\displaystyle t_{1}} andt2{\displaystyle t_{2}} iftσ1t1{\displaystyle t\sigma _{1}\equiv t_{1}} andtσ2t2{\displaystyle t\sigma _{2}\equiv t_{2}} for some substitutionsσ1,σ2{\displaystyle \sigma _{1},\sigma _{2}}.For a given anti-unification problem, a setS{\displaystyle S} of anti-unifiers is calledcomplete if each generalization subsumes some termtS{\displaystyle t\in S}; the setS{\displaystyle S} is calledminimal if none of its members subsumes another one.

First-order syntactical anti-unification

[edit]

The framework of first-order syntactical anti-unification is based onT{\displaystyle T} being the set offirst-order terms (over some given setV{\displaystyle V} of variables,C{\displaystyle C} of constants andFn{\displaystyle F_{n}} ofn{\displaystyle n}-ary function symbols) and on{\displaystyle \equiv } beingsyntactic equality.In this framework, each anti-unification problemt1,t2{\displaystyle \langle t_{1},t_{2}\rangle } has a complete, and obviously minimal,singleton solution set{t}{\displaystyle \{t\}}. Its membert{\displaystyle t} is called theleast general generalization (lgg) of the problem, it has an instance syntactically equal tot1{\displaystyle t_{1}} and another one syntactically equal tot2{\displaystyle t_{2}}.Any common generalization oft1{\displaystyle t_{1}} andt2{\displaystyle t_{2}} subsumest{\displaystyle t}.The lgg is unique up to variants: ifS1{\displaystyle S_{1}} andS2{\displaystyle S_{2}} are both complete and minimal solution sets of the same syntactical anti-unification problem, thenS1={s1}{\displaystyle S_{1}=\{s_{1}\}} andS2={s2}{\displaystyle S_{2}=\{s_{2}\}} for some termss1{\displaystyle s_{1}} ands2{\displaystyle s_{2}}, that arerenamings of each other.

Plotkin[1][2] has given an algorithm to compute the lgg of two given terms.It presupposes aninjective mappingϕ:T×TV{\displaystyle \phi :T\times T\longrightarrow V}, that is, a mapping assigning each pairs,t{\displaystyle s,t} of terms an own variableϕ(s,t){\displaystyle \phi (s,t)}, such that no two pairs share the same variable.[note 4]The algorithm consists of two rules:

f(s1,,sn)f(t1,,tn){\displaystyle f(s_{1},\dots ,s_{n})\sqcup f(t_{1},\ldots ,t_{n})}{\displaystyle \rightsquigarrow }f(s1t1,,sntn){\displaystyle f(s_{1}\sqcup t_{1},\ldots ,s_{n}\sqcup t_{n})}
st{\displaystyle s\sqcup t}{\displaystyle \rightsquigarrow }ϕ(s,t){\displaystyle \phi (s,t)}if previous rule not applicable

For example,(00)(44)(04)(04)ϕ(0,4)ϕ(0,4)xx{\displaystyle (0*0)\sqcup (4*4)\rightsquigarrow (0\sqcup 4)*(0\sqcup 4)\rightsquigarrow \phi (0,4)*\phi (0,4)\rightsquigarrow x*x}; this least general generalization reflects the common property of both inputs of being square numbers.

Plotkin used his algorithm to compute the "relative least general generalization (rlgg)" of two clause sets in first-order logic, which was the basis of theGolem approach toinductive logic programming.

First-order anti-unification modulo theory

[edit]
[icon]
This sectionneeds expansion with: explain main results from papers below, relate their approaches to each other. You can help byadding to it.(June 2020)

Equational theories

[edit]

First-order sorted anti-unification

[edit]

Nominal anti-unification

[edit]
  • Baumgartner, Alexander; Kutsia, Temur; Levy, Jordi; Villaret, Mateu (Jun 2013).Nominal Anti-Unification. Proc. RTA 2015. Vol. 36 of LIPIcs. Schloss Dagstuhl, 57-73.Software.

Applications

[edit]

Higher-order anti-unification

[edit]
[icon]
This sectionneeds expansion with: (as above). You can help byadding to it.(June 2020)

Notes

[edit]
  1. ^Complete generalization sets always exist, but it may be the case that every complete generalization set is non-minimal.
  2. ^Comon referred in 1986 to inequation-solving as "anti-unification", which nowadays has become quite unusual.Comon, Hubert (1986). "Sufficient Completeness, Term Rewriting Systems and 'Anti-Unification'".Proc. 8th International Conference on Automated Deduction. LNCS. Vol. 230. Springer. pp. 128–140.
  3. ^E.g.a(bf(x))a(f(x)b)(bf(x))a(f(x)b)a{\displaystyle a\oplus (b\oplus f(x))\equiv a\oplus (f(x)\oplus b)\equiv (b\oplus f(x))\oplus a\equiv (f(x)\oplus b)\oplus a}
  4. ^From a theoretical viewpoint, such a mapping exists, since bothV{\displaystyle V} andT×T{\displaystyle T\times T} arecountably infinite sets; for practical purposes,ϕ{\displaystyle \phi } can be built up as needed, remembering assigned mappingss,t,ϕ(s,t){\displaystyle \langle s,t,\phi (s,t)\rangle } in ahash table.

References

[edit]
  1. ^abPlotkin, Gordon D. (1970). Meltzer, B.; Michie, D. (eds.). "A Note on Inductive Generalization".Machine Intelligence.5:153–163.
  2. ^abPlotkin, Gordon D. (1971). Meltzer, B.; Michie, D. (eds.). "A Further Note on Inductive Generalization".Machine Intelligence.6:101–124.
  3. ^C.C. Chang; H. Jerome Keisler (1977). A. Heyting; H.J. Keisler; A. Mostowski; A. Robinson; P. Suppes (eds.).Model Theory. Studies in Logic and the Foundation of Mathematics. Vol. 73. North Holland.; here: Sect.1.3
Retrieved from "https://en.wikipedia.org/w/index.php?title=Anti-unification&oldid=1299237700"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp