SlideShare a Scribd company logo
1 of 16
Download to read offline
UNIFICATION / ANTI-UNIFICATION
OVERVIEW
¡ Basics
¡ Unification
¡ Anti-Unification
BASICS
¡ term: variable, constant symbol, function symbol
¡ equation: <term> = <term>
¡ ex. f(x, g(z)) = f(a, y)
¡ function symbol (arity)
¡ constant symbol arity 0 function symbol
¡ equation set E
¡ grounding substitution: variable ground term
¡ ground term: variable
¡ ex. {x <- f(g(a)), y <- b}
¡ solution: E equation grounding
substitution
¡ ex. E={f(x, g(z)) = f(a, y)} {x <- a, y <- g(b), z <- b} solution
UNIFICATION
UNIFICATION PROBLEM
¡ Input: equation E
¡ Output: E equivalent Solved form equation set
¡ equation
¡ Solved form: equation variable variable
equation
¡ equivalent: solution
g(x) = g(g(z))
f(a, z) = f(a, y)
x = g(y)
z = y
Problem E Solved Form
equivalent
UNIFICATION ALGORITHM [LASSEZ ET AL.]
Input: equation set E
E equation
s, t , x variable, f, g function symbol
1. f(t1, ..., tn) = f(s1, ..., sn)
→ t1=s1, ..., tn=sn
2. f(t1, ..., tn) = g(s1, ..., sm) f ≠g
→
3. x = x
→ equation
( )
UNIFICATION ALGORITHM [LASSEZ ET AL.]
4. t = x t variable
→ x = t
5. x = t t x equation x
i. x t
→
ii. x t
→ equation x t
EXAMPLE
g(x) = g(g(z))
f(a, z) = f(a, y)
x = g(z)
f(a, z) = f(a, y)
1
x = g(z)
a = a
z = y
1
1x = g(z)
z = y
5.ii
x = g(y)
z = y
1. f(t1, ..., tn) = f(s1, ..., sn)
→ t1=s1, ..., tn=sn
2. f(t1, ..., tn) = g(s1, ..., sm) f ≠g
→
3. x = x
→ equation
4. t = x t variable
→ x = t
f
equation
5. x = t t x equation
x
i. x t
→
ii. x t
→ equation x t
variable function symbol
1 variable 1
1, 3, 4 5
5.ii
ANTI-UNIFICATION
ANTI-UNIFICATION PROBLEM
¡ θ = { v1 -> t1, ..., vn -> tn }
¡ tθ t vi ti term
¡ t s instance ⇔ s t anti-instance ⇔ s ≧ t
⇔ inst(s) ⊇ inst(t) ⇔ θ t = sθ
¡ inst(t): t instance
¡ variable renaming
≧ complete lattice (inst(⊥)=∅ ⊥ )
¡ ex. f(x, y) f(y, z)
¡ lattice least upper bound anti-unification
complete lattice
poset subset
greatest lower bound least
upper bound
EXAMPLE
f(a, g(a, y), a)
f(x, g(x, y), a)
f(x, g(x, b), a)
f(b, g(b, b), a)
x=a y=b
x=b
f(x, g(x, x), a)
y=x
x=b
anti-unification
f(x, g(x, x), y)
y=a
f(x, g(x, y), x)
x=a
... ...
...
ANTI-UNIFICATION ALGORITHM
¡ φ: T × T -> V': bijection term variable
¡ T: term , V': variable
¡ λ: Anti-unification
¡ λ( f(s1, ..., sm), f(t1, ..., tm) ) = f( λ(s1, t1), ..., λ(sm, tm) )
¡ λ( s, t ) = φ( s, t )
EXAMPLE
λ( f(a, g(a, y), a), f(b, g(b, b), a) )
= f( λ(a, b), λ(g(a, y), g(b, b)), g(a, a) )
= f( x, g( λ(a, b), λ(y, b) ), a )
= f( x, g( x, y ), a )
φ(a, b) = x
φ(y, b) = y

More Related Content

What's hot

Intro to derivatives
Intro to derivativesIntro to derivatives
Intro to derivatives
Tyler Murphy
 
A1 11 functions
A1 11 functionsA1 11 functions
A1 11 functions
vhiggins1
 
X2 T04 03 cuve sketching - addition, subtraction, multiplication and division
X2 T04 03 cuve sketching - addition, subtraction,  multiplication and divisionX2 T04 03 cuve sketching - addition, subtraction,  multiplication and division
X2 T04 03 cuve sketching - addition, subtraction, multiplication and division
Nigel Simmons
 
Maple Code for Steepest Descent
Maple Code for Steepest DescentMaple Code for Steepest Descent
Maple Code for Steepest Descent
Jeremy Lane
 
Day 6 examples u3f13
Day 6 examples u3f13Day 6 examples u3f13
Day 6 examples u3f13
jchartiersjsd
 
X2 T07 02 transformations (2011)
X2 T07 02 transformations (2011)X2 T07 02 transformations (2011)
X2 T07 02 transformations (2011)
Nigel Simmons
 
PYTHON. AM CALL Pricing Trees
PYTHON. AM CALL Pricing TreesPYTHON. AM CALL Pricing Trees
PYTHON. AM CALL Pricing Trees
Tianqi Huang, CFA
 

What's hot (20)

Εφαπτομένη Ευθεία ΕΠΑΛ
Εφαπτομένη Ευθεία ΕΠΑΛΕφαπτομένη Ευθεία ΕΠΑΛ
Εφαπτομένη Ευθεία ΕΠΑΛ
 
Functions
FunctionsFunctions
Functions
 
Pre-Cal 40S Slides February 29, 2008
Pre-Cal 40S Slides February 29, 2008Pre-Cal 40S Slides February 29, 2008
Pre-Cal 40S Slides February 29, 2008
 
Matlab code for secant method
Matlab code for secant methodMatlab code for secant method
Matlab code for secant method
 
Intro to derivatives
Intro to derivativesIntro to derivatives
Intro to derivatives
 
1.6 all notes
1.6 all notes1.6 all notes
1.6 all notes
 
A1 11 functions
A1 11 functionsA1 11 functions
A1 11 functions
 
7.2 abs value function
7.2 abs value function7.2 abs value function
7.2 abs value function
 
X2 T04 03 cuve sketching - addition, subtraction, multiplication and division
X2 T04 03 cuve sketching - addition, subtraction,  multiplication and divisionX2 T04 03 cuve sketching - addition, subtraction,  multiplication and division
X2 T04 03 cuve sketching - addition, subtraction, multiplication and division
 
Function Math 8
Function Math 8Function Math 8
Function Math 8
 
Maple Code for Steepest Descent
Maple Code for Steepest DescentMaple Code for Steepest Descent
Maple Code for Steepest Descent
 
Turunan Fungsi Aljabar
Turunan Fungsi AljabarTurunan Fungsi Aljabar
Turunan Fungsi Aljabar
 
Functions
FunctionsFunctions
Functions
 
Integrals
IntegralsIntegrals
Integrals
 
Derivadas
DerivadasDerivadas
Derivadas
 
Day 6 examples u3f13
Day 6 examples u3f13Day 6 examples u3f13
Day 6 examples u3f13
 
X2 T07 02 transformations (2011)
X2 T07 02 transformations (2011)X2 T07 02 transformations (2011)
X2 T07 02 transformations (2011)
 
Infrome 7 matlab
Infrome 7 matlabInfrome 7 matlab
Infrome 7 matlab
 
PYTHON. AM CALL Pricing Trees
PYTHON. AM CALL Pricing TreesPYTHON. AM CALL Pricing Trees
PYTHON. AM CALL Pricing Trees
 
5.3 Basic functions. A handout.
5.3 Basic functions. A handout.5.3 Basic functions. A handout.
5.3 Basic functions. A handout.
 

Similar to Unification and Anti-Unification Algorithm

Functions for Grade 10
Functions for Grade 10Functions for Grade 10
Functions for Grade 10
Boipelo Radebe
 
lesson10-thechainrule034slides-091006133832-phpapp01.pptx
lesson10-thechainrule034slides-091006133832-phpapp01.pptxlesson10-thechainrule034slides-091006133832-phpapp01.pptx
lesson10-thechainrule034slides-091006133832-phpapp01.pptx
JohnReyManzano2
 
THE CHORD GAP DIVERGENCE AND A GENERALIZATION OF THE BHATTACHARYYA DISTANCE
THE CHORD GAP DIVERGENCE AND A GENERALIZATION OF THE BHATTACHARYYA DISTANCETHE CHORD GAP DIVERGENCE AND A GENERALIZATION OF THE BHATTACHARYYA DISTANCE
THE CHORD GAP DIVERGENCE AND A GENERALIZATION OF THE BHATTACHARYYA DISTANCE
Frank Nielsen
 
Indefinite Integral
Indefinite IntegralIndefinite Integral
Indefinite Integral
JelaiAujero
 
Difrentiation
DifrentiationDifrentiation
Difrentiation
lecturer
 

Similar to Unification and Anti-Unification Algorithm (20)

2 integration and the substitution methods x
2 integration and the substitution methods x2 integration and the substitution methods x
2 integration and the substitution methods x
 
Functions
FunctionsFunctions
Functions
 
Algebra 2 Section 5-1
Algebra 2 Section 5-1Algebra 2 Section 5-1
Algebra 2 Section 5-1
 
Functions for Grade 10
Functions for Grade 10Functions for Grade 10
Functions for Grade 10
 
lesson10-thechainrule034slides-091006133832-phpapp01.pptx
lesson10-thechainrule034slides-091006133832-phpapp01.pptxlesson10-thechainrule034slides-091006133832-phpapp01.pptx
lesson10-thechainrule034slides-091006133832-phpapp01.pptx
 
3.5 Transformation of Functions
3.5 Transformation of Functions3.5 Transformation of Functions
3.5 Transformation of Functions
 
THE CHORD GAP DIVERGENCE AND A GENERALIZATION OF THE BHATTACHARYYA DISTANCE
THE CHORD GAP DIVERGENCE AND A GENERALIZATION OF THE BHATTACHARYYA DISTANCETHE CHORD GAP DIVERGENCE AND A GENERALIZATION OF THE BHATTACHARYYA DISTANCE
THE CHORD GAP DIVERGENCE AND A GENERALIZATION OF THE BHATTACHARYYA DISTANCE
 
Basic Calculus.docx
Basic Calculus.docxBasic Calculus.docx
Basic Calculus.docx
 
Evaluating definite integrals
Evaluating definite integralsEvaluating definite integrals
Evaluating definite integrals
 
Compiler Construction | Lecture 9 | Constraint Resolution
Compiler Construction | Lecture 9 | Constraint ResolutionCompiler Construction | Lecture 9 | Constraint Resolution
Compiler Construction | Lecture 9 | Constraint Resolution
 
03 convexfunctions
03 convexfunctions03 convexfunctions
03 convexfunctions
 
Calculusseveralvariables.ppt
Calculusseveralvariables.pptCalculusseveralvariables.ppt
Calculusseveralvariables.ppt
 
2 evaluating functions
2 evaluating functions2 evaluating functions
2 evaluating functions
 
Lesson 4- Math 10 - W4Q1_General Form of a Polynomial Function.pptx
Lesson 4- Math 10 - W4Q1_General Form of a Polynomial Function.pptxLesson 4- Math 10 - W4Q1_General Form of a Polynomial Function.pptx
Lesson 4- Math 10 - W4Q1_General Form of a Polynomial Function.pptx
 
Introduccio al calculo vectorial
Introduccio  al calculo vectorialIntroduccio  al calculo vectorial
Introduccio al calculo vectorial
 
functions.pdf
functions.pdffunctions.pdf
functions.pdf
 
Indefinite Integral
Indefinite IntegralIndefinite Integral
Indefinite Integral
 
Lesson 1: Functions
Lesson 1: FunctionsLesson 1: Functions
Lesson 1: Functions
 
Murphy: Machine learning A probabilistic perspective: Ch.9
Murphy: Machine learning A probabilistic perspective: Ch.9Murphy: Machine learning A probabilistic perspective: Ch.9
Murphy: Machine learning A probabilistic perspective: Ch.9
 
Difrentiation
DifrentiationDifrentiation
Difrentiation
 

Recently uploaded

CYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptxCYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptx
Cherry
 
ONLINE VOTING SYSTEM SE Project for vote
ONLINE VOTING SYSTEM SE Project for voteONLINE VOTING SYSTEM SE Project for vote
ONLINE VOTING SYSTEM SE Project for vote
RaunakRastogi4
 
Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.
Cherry
 
Pteris : features, anatomy, morphology and lifecycle
Pteris : features, anatomy, morphology and lifecyclePteris : features, anatomy, morphology and lifecycle
Pteris : features, anatomy, morphology and lifecycle
Cherry
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learning
levieagacer
 
PODOCARPUS...........................pptx
PODOCARPUS...........................pptxPODOCARPUS...........................pptx
PODOCARPUS...........................pptx
Cherry
 
Digital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptxDigital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptx
MohamedFarag457087
 
Cyathodium bryophyte: morphology, anatomy, reproduction etc.
Cyathodium bryophyte: morphology, anatomy, reproduction etc.Cyathodium bryophyte: morphology, anatomy, reproduction etc.
Cyathodium bryophyte: morphology, anatomy, reproduction etc.
Cherry
 
Reboulia: features, anatomy, morphology etc.
Reboulia: features, anatomy, morphology etc.Reboulia: features, anatomy, morphology etc.
Reboulia: features, anatomy, morphology etc.
Cherry
 

Recently uploaded (20)

Selaginella: features, morphology ,anatomy and reproduction.
Selaginella: features, morphology ,anatomy and reproduction.Selaginella: features, morphology ,anatomy and reproduction.
Selaginella: features, morphology ,anatomy and reproduction.
 
TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRings
TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRingsTransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRings
TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRings
 
Genome Projects : Human, Rice,Wheat,E coli and Arabidopsis.
Genome Projects : Human, Rice,Wheat,E coli and Arabidopsis.Genome Projects : Human, Rice,Wheat,E coli and Arabidopsis.
Genome Projects : Human, Rice,Wheat,E coli and Arabidopsis.
 
CYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptxCYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptx
 
ONLINE VOTING SYSTEM SE Project for vote
ONLINE VOTING SYSTEM SE Project for voteONLINE VOTING SYSTEM SE Project for vote
ONLINE VOTING SYSTEM SE Project for vote
 
Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.Porella : features, morphology, anatomy, reproduction etc.
Porella : features, morphology, anatomy, reproduction etc.
 
Pteris : features, anatomy, morphology and lifecycle
Pteris : features, anatomy, morphology and lifecyclePteris : features, anatomy, morphology and lifecycle
Pteris : features, anatomy, morphology and lifecycle
 
ABHISHEK ANTIBIOTICS PPT MICROBIOLOGY // USES OF ANTIOBIOTICS TYPES OF ANTIB...
ABHISHEK ANTIBIOTICS PPT MICROBIOLOGY  // USES OF ANTIOBIOTICS TYPES OF ANTIB...ABHISHEK ANTIBIOTICS PPT MICROBIOLOGY  // USES OF ANTIOBIOTICS TYPES OF ANTIB...
ABHISHEK ANTIBIOTICS PPT MICROBIOLOGY // USES OF ANTIOBIOTICS TYPES OF ANTIB...
 
Genome sequencing,shotgun sequencing.pptx
Genome sequencing,shotgun sequencing.pptxGenome sequencing,shotgun sequencing.pptx
Genome sequencing,shotgun sequencing.pptx
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learning
 
PODOCARPUS...........................pptx
PODOCARPUS...........................pptxPODOCARPUS...........................pptx
PODOCARPUS...........................pptx
 
Use of mutants in understanding seedling development.pptx
Use of mutants in understanding seedling development.pptxUse of mutants in understanding seedling development.pptx
Use of mutants in understanding seedling development.pptx
 
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and SpectrometryFAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
 
BHUBANESHWAR ODIA CALL GIRL SEIRVEC ❣️ 72051//37929❣️ CALL GIRL IN ODIA HAND ...
BHUBANESHWAR ODIA CALL GIRL SEIRVEC ❣️ 72051//37929❣️ CALL GIRL IN ODIA HAND ...BHUBANESHWAR ODIA CALL GIRL SEIRVEC ❣️ 72051//37929❣️ CALL GIRL IN ODIA HAND ...
BHUBANESHWAR ODIA CALL GIRL SEIRVEC ❣️ 72051//37929❣️ CALL GIRL IN ODIA HAND ...
 
Digital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptxDigital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptx
 
Cyathodium bryophyte: morphology, anatomy, reproduction etc.
Cyathodium bryophyte: morphology, anatomy, reproduction etc.Cyathodium bryophyte: morphology, anatomy, reproduction etc.
Cyathodium bryophyte: morphology, anatomy, reproduction etc.
 
Cot curve, melting temperature, unique and repetitive DNA
Cot curve, melting temperature, unique and repetitive DNACot curve, melting temperature, unique and repetitive DNA
Cot curve, melting temperature, unique and repetitive DNA
 
Reboulia: features, anatomy, morphology etc.
Reboulia: features, anatomy, morphology etc.Reboulia: features, anatomy, morphology etc.
Reboulia: features, anatomy, morphology etc.
 
GBSN - Biochemistry (Unit 2) Basic concept of organic chemistry
GBSN - Biochemistry (Unit 2) Basic concept of organic chemistry GBSN - Biochemistry (Unit 2) Basic concept of organic chemistry
GBSN - Biochemistry (Unit 2) Basic concept of organic chemistry
 
Terpineol and it's characterization pptx
Terpineol and it's characterization pptxTerpineol and it's characterization pptx
Terpineol and it's characterization pptx
 

Unification and Anti-Unification Algorithm

  • 3. BASICS ¡ term: variable, constant symbol, function symbol ¡ equation: <term> = <term> ¡ ex. f(x, g(z)) = f(a, y) ¡ function symbol (arity) ¡ constant symbol arity 0 function symbol ¡ equation set E ¡ grounding substitution: variable ground term ¡ ground term: variable ¡ ex. {x <- f(g(a)), y <- b} ¡ solution: E equation grounding substitution ¡ ex. E={f(x, g(z)) = f(a, y)} {x <- a, y <- g(b), z <- b} solution
  • 5. UNIFICATION PROBLEM ¡ Input: equation E ¡ Output: E equivalent Solved form equation set ¡ equation ¡ Solved form: equation variable variable equation ¡ equivalent: solution g(x) = g(g(z)) f(a, z) = f(a, y) x = g(y) z = y Problem E Solved Form equivalent
  • 6. UNIFICATION ALGORITHM [LASSEZ ET AL.] Input: equation set E E equation s, t , x variable, f, g function symbol 1. f(t1, ..., tn) = f(s1, ..., sn) → t1=s1, ..., tn=sn 2. f(t1, ..., tn) = g(s1, ..., sm) f ≠g → 3. x = x → equation ( )
  • 7. UNIFICATION ALGORITHM [LASSEZ ET AL.] 4. t = x t variable → x = t 5. x = t t x equation x i. x t → ii. x t → equation x t
  • 8. EXAMPLE g(x) = g(g(z)) f(a, z) = f(a, y) x = g(z) f(a, z) = f(a, y) 1 x = g(z) a = a z = y 1 1x = g(z) z = y 5.ii x = g(y) z = y
  • 9. 1. f(t1, ..., tn) = f(s1, ..., sn) → t1=s1, ..., tn=sn 2. f(t1, ..., tn) = g(s1, ..., sm) f ≠g → 3. x = x → equation 4. t = x t variable → x = t f equation
  • 10. 5. x = t t x equation x i. x t → ii. x t → equation x t variable function symbol 1 variable 1
  • 11. 1, 3, 4 5 5.ii
  • 13. ANTI-UNIFICATION PROBLEM ¡ θ = { v1 -> t1, ..., vn -> tn } ¡ tθ t vi ti term ¡ t s instance ⇔ s t anti-instance ⇔ s ≧ t ⇔ inst(s) ⊇ inst(t) ⇔ θ t = sθ ¡ inst(t): t instance ¡ variable renaming ≧ complete lattice (inst(⊥)=∅ ⊥ ) ¡ ex. f(x, y) f(y, z) ¡ lattice least upper bound anti-unification complete lattice poset subset greatest lower bound least upper bound
  • 14. EXAMPLE f(a, g(a, y), a) f(x, g(x, y), a) f(x, g(x, b), a) f(b, g(b, b), a) x=a y=b x=b f(x, g(x, x), a) y=x x=b anti-unification f(x, g(x, x), y) y=a f(x, g(x, y), x) x=a ... ... ...
  • 15. ANTI-UNIFICATION ALGORITHM ¡ φ: T × T -> V': bijection term variable ¡ T: term , V': variable ¡ λ: Anti-unification ¡ λ( f(s1, ..., sm), f(t1, ..., tm) ) = f( λ(s1, t1), ..., λ(sm, tm) ) ¡ λ( s, t ) = φ( s, t )
  • 16. EXAMPLE λ( f(a, g(a, y), a), f(b, g(b, b), a) ) = f( λ(a, b), λ(g(a, y), g(b, b)), g(a, a) ) = f( x, g( λ(a, b), λ(y, b) ), a ) = f( x, g( x, y ), a ) φ(a, b) = x φ(y, b) = y