Unification We can represent any substitution by a set of ordered pairs: s = { t 1 /v 1, t 2 /v 2, …, t n /v n } where: t i /v i means that the term i.

Slides:



Advertisements
Similar presentations
Biointelligence Lab School of Computer Sci. & Eng.
Advertisements

10 October 2006 Foundations of Logic and Constraint Programming 1 Unification ­An overview Need for Unification Ranked alfabeths and terms. Substitutions.
Causal-link Planning II José Luis Ambite. 2 CS 541 Causal Link Planning II Planning as Search State SpacePlan Space AlgorithmProgression, Regression POP.
AR for Horn clause logic Introducing: Unification.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.
Standard Logical Equivalences
Resolution.
First Order Logic Resolution
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
Predicate Calculus Russell and Norvig: Chapter 8,9.
LISP Programming. LISP – simple and powerful mid-1950’s by John McCarthy at M.I.T. “ LIS t P rocessing language” Artificial Intelligence programs LISP.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
Inference and Resolution for Problem Solving
Catriel Beeri Pls/Winter 2004/5 type reconstruction 1 Type Reconstruction & Parametric Polymorphism  Introduction  Unification and type reconstruction.
Type Inference David Walker COS 441. Criticisms of Typed Languages Types overly constrain functions & data polymorphism makes typed constructs useful.
CSE (c) S. Tanimoto, 2007 Unification 1 Unification Predicate calculus rules are sometimes so general that we need to create specializations of.
All rights reservedL. Manevitz Lecture 51 Artificial Intelligence Logic Part 2 L. Manevitz.
CSC411Artificial intelligence 1 Chapter 2 The Predicate Calculus Contents The Propositional Calculus The Predicate Calculus Using Inference Rules to Produce.
Introduction to Logic for Artificial Intelligence Lecture 2 Erik Sandewall 2010.
HAWKES LEARNING SYSTEMS Students Matter. Success Counts. Copyright © 2013 by Hawkes Learning Systems/Quant Systems, Inc. All rights reserved. Section 2.3.
Chapter 4.1 Solving Systems of Linear Equations in two variables.
Conjunctive normal form: any formula of the predicate calculus can be transformed into a conjunctive normal form. Def. A formula is said to be in conjunctive.
1 Chapter 8 Inference and Resolution for Problem Solving.
2.8 – Graph Linear Inequalities in Two Variables A linear inequality in two variables can be written in one of these forms: Ax + By < C Ax + By > C An.
CE Statics Lecture 5. Contents Position Vectors Force Vector Directed along a Line.
GOAL: MULTIPLY TWO POLYNOMIALS TOGETHER USING THE DISTRIBUTIVE PROPERTY ELIGIBLE CONTENT: A Multiplying Polynomials.
Unification Algorithm Input: a finite set Σ of simple expressions Output: a mgu for Σ (if Σ is unifiable) 1. Set k = 0 and  0 = . 2. If Σ  k is a singleton,
Systems of Equations 7-4 Learn to solve systems of equations.
Lisp Functional Language or Applicative Language –Achieves its effect by applying functions, either recursively or through composition Powerful, expressive,
Web Science & Technologies University of Koblenz ▪ Landau, Germany Procedural Semantics Soundness of SLD-Resolution.
第 1 6 章 谓词演算中的归结. 2 Outline Unification Predicate-Calculus Resolution Completeness and Soundness Converting Arbitrary wffs to Clause Form Using Resolution.
Splash Screen. Over Lesson 1–4 5-Minute Check 2 A.24x + 5 B.24x + 30 C.10x + 5 D.10x + 30 Simplify 6(4x + 5).
CSE (c) S. Tanimoto, 2008 Predicate Calculus II 1 Predicate Calculus 2 Outline: Unification: definitions, algorithm Formal interpretations and satisfiability.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
Systems of Equations: Substitution
Copyright © 2014, 2010, and 2006 Pearson Education, Inc. 8-1 Copyright © 2014, 2010, and 2006 Pearson Education, Inc. Chapter 8 Systems of Linear Equations.
SOLVING SYSTEMS USING ELIMINATION 6-3. Solve the linear system using elimination. 5x – 6y = -32 3x + 6y = 48 (2, 7)
Warm-up. Systems of Equations: Substitution Solving by Substitution 1)Solve one of the equations for a variable. 2)Substitute the expression from step.
Converting arbitrary wffs to CNF A wff is in prenex form iff it consists of a string of quantifiers (called a prefix) followed by a quantifier free formula.
ELIMINATION on a 3x3 1. Line up equations. 2. Perform “elimination” TWICE on the SAME variable using two DIFFERENT pairs of equations. 3. With the 2 equations.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Objectives: 1)Students will be able to find the inverse of a function or relation. 2)Students will be able to determine whether two functions or relations.
Arvind Computer Science and Artificial Intelligence Laboratory M.I.T. L05-1 September 21, 2006http:// Types and Simple Type.
CS5205: Foundation in Programming Languages Type Reconstruction
Copyright © 2013, 2009, 2006 Pearson Education, Inc.
Introduction to Logic for Artificial Intelligence Lecture 2
3-2: Solving Systems of Equations using Substitution
6-2 Solving Systems using Substitution
Solving Systems using Substitution
3-2: Solving Systems of Equations using Substitution
Solving Systems of Equations using Substitution
3-2: Solving Systems of Equations using Substitution
Soundness of SLD-Resolution
Systems of Linear Equations and Problem Solving
Scheme: Basic Functionality
CSE (c) S. Tanimoto, 2004 Unification
CSE S. Tanimoto Unification
Practice session #4: Static Type Correctness Algorithms:
CSE (c) S. Tanimoto, 2002 Unification
3-2: Solving Systems of Equations using Substitution
Chapter 4: Prolog (Substitution, Unification and Resolution)
3-2: Solving Systems of Equations using Substitution
3-2: Solving Systems of Equations using Substitution
3-2: Solving Systems of Equations using Substitution
3-2: Solving Systems of Equations using Substitution
Solving Systems by ELIMINATION
Soundness of SLD-Resolution
The Substitution Method
Presentation transcript:

Unification We can represent any substitution by a set of ordered pairs: s = { t 1 /v 1, t 2 /v 2, …, t n /v n } where: t i /v i means that the term i substitutes variable i throughout the expression. e.g. s1 = {b/x, a/y, a/z} Note: - every occurrence of a variable should be substituted by the same term. - no variable can be replaced by a term that contains the same variable. Def. To denote a substitution instance of an expression E, using a substitution s, we write: Es.

Def. Finding substitutions of terms for variables to make two or more expressions identical is called unification. e.g. {p(g(x,f(y)),a), p(g(b,f(z)),y)} ==> p(g(b,f(a)),a) Def. A substitution instance of an expression is obtained by substituting terms for variables in that expression. Def. A ground instance of an expression is one in which there are no variables (and consequently, no quantifiers). Def. An instance of an expression which results from changing just the names of the variables in it, is called an alphabetic variant of the original. e.g.  x.p(x,f(x,b)) ==>  z.p(z,f(z,b)) Unification

Def. A composition of two substitutions s1 and s2 is written s1s2, and it is accomplished following the steps: - apply s2 to the elements of s1. - add any pairs of s2 having variables not occurring in s1. e.g. s1={g(x,y)/z}, s2={a/x, b/y, c/w, d/z} s1s2 ==> {g(a,b)/z, a/x, b/y, c/w} s2s1 ==> {a/x, b/y, c/w, d/z} = s2 Some properties of composition are: 1.(Es1)s2=E(s1s2) 2. s1(s2s3)=(s1s2)s3 Unification

Def. We say that a set {E i } of expressions is unifiable if there exists a substitution s that makes: E 1 s=E 2 s=…=E n s. Def. If a substitution g has the property that if s is a unifier of {E i } yielding {E i } s, then there exists a substitution s’ such that {E i } s={E i } gs’, then g is called the most general unifier mgu. For the unify procedure presented next, it is assumed that its arguments are two lists of expressions. e.g. g(r(x,f(z)),y) ==> [g, [r, x, [f, z ]], y] g(r(a, y), u) ==> [g, [r, a, y], u] Unification

Procedure UNIFIY (E1, E2) If either E1 or E2 is an atom { if E1 and E2 are identical, return NIL if E1 is a variable, do: { if E1 occurs in E2, return FAIL return {E2/E1} } if E2 is a variable, return {E1/E2} return FAIL } F1  the first element of E1 T1  the rest of E1 F2  the first element of E2 T2  the rest of E2 Z1  UNIFY(F1, F2) If Z1 = FAIL, return FAIL G1  result of applying Z1 to T1 G2  result of applying Z1 to T2 Z2  UNIFY(G1, G2) If Z2 = FAIL, return FAIL Return the composition of Z1 and Z2 ________________________ Procedure taken from Nilsson N.J. “Principles of Artificial Intelligence”, Tioga Publishing, California Unification Algorithm