Unification algorithm We have seen examples of the use of unification. Now we will see, in detail, one way to implement a unification algorithm which implements.

Slides:



Advertisements
Similar presentations
A Quantum Programming Language
Advertisements

Linked Lists Linked Lists Representation Traversing a Linked List
Lecture 15. Graph Algorithms
Data Structures Intro/Linked List Review CIS 237 – Data Structures.
Feature Structures and Parsing Unification Grammars Algorithms for NLP 18 November 2014.
Slide: 1 The Implementation of Ada 2005 Synchronized Interfaces in the GNAT Compiler Javier Miranda Hristian Kirtchev Edmond Schonberg Presentation cover.
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part R4. Disjoint Sets.
Linked Lists. 2 Merge Sorted Lists Write an algorithm that merges two sorted linked lists The function should return a pointer to a single combined list.
Analysis of programs with pointers. Simple example What are the dependences in this program? Problem: just looking at variable names will not give you.
BİL711 Natural Language Processing1 Problems with CFGs We know that CFGs cannot handle certain things which are available in natural languages. In particular,
1 Union-find. 2 Maintain a collection of disjoint sets under the following two operations S 3 = Union(S 1,S 2 ) Find(x) : returns the set containing x.
1 Pointers (Walls & Mirrors - Beginning of Chapter 4)
Features & Unification Ling 571 Deep Processing Techniques for NLP January 26, 2011.
Features & Unification Ling 571 Deep Processing Techniques for NLP January 31, 2011.
UnInformed Search What to do when you don’t know anything.
1 Testing for Connectedness and Cycles Connectedness of Undirected Graphs Implementation of Connectedness detection Algorithm for Undirected Graphs. Implementation.
Features and Unification
CS344: Lecture 16 S. Muthu Muthukrishnan. Graph Navigation BFS: DFS: DFS numbering by start time or finish time. –tree, back, forward and cross edges.
Lecture 21 Trees. “ A useful data structure for many applications”
Ch.11 Features and Unification Ling 538, 2006 Fall Jiyoung Kim.
Insertion into a B+ Tree Null Tree Ptr Data Pointer * Tree Node Ptr After Adding 8 and then 5… 85 Insert 1 : causes overflow – add a new level * 5 * 158.
Testing for Connectedness & Cycles Connectedness of an Undirected Graph Implementation of Connectedness detection Algorithm. Implementation of Strong Connectedness.
CS 4705 Lecture 11 Feature Structures and Unification Parsing.
Warm-upAnswers Compute (in terms of i) _i, -1, -i, 1.
ARRAYS In this Lecture, we will try to develop understanding of some of the relatively complex concepts. The following are explained in this lecture with.
Factor Graphs Young Ki Baik Computer Vision Lab. Seoul National University.
White Box vs. Black Box Testing Tor Stålhane. What is White Box testing White box testing is testing where we use the info available from the code of.
Trees & Graphs Nell Dale & John Lewis (adaptation by Michael Goldwasser and Erin Chambers)
The Volcano Query Optimization Framework S. Sudarshan (based on description in Prasan Roy’s thesis Chapter 2)
CS162 - Topic #11 Lecture: Recursion –Problem solving with recursion –Work through examples to get used to the recursive process Programming Project –Any.
CSC 252a: Algorithms Pallavi Moorthy 252a-av Smith College December 14, 2000.
Steven Carvellas Anirban Ghosh Pramod Vedantham Rahul Sheth Varun Sarwade.
Rudiments of Trees a Joshua presentation DATA STRUCTURES.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 9.
Section 13  Questions  Graphs. Graphs  A graph representation: –Adjacency matrix. Pros:? Cons:? –Neighbor lists. Pros:? Cons:?
Specialist Mathematics Polynomials Week 3. Graphs of Cubic Polynomials.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Elementary Data Structures Linked Lists Linked Lists Dale.
Chapter 11: Parsing with Unification Grammars Heshaam Faili University of Tehran.
CHAPTER 51 LINKED LISTS. Introduction link list is a linear array collection of data elements called nodes, where the linear order is given by means of.
Procedure FloydWarshall (highway map G): foreach circle u in G do foreach circle v in G do Cost[u,v]  c(u,v) BestRoute[u,v]=u,v if line from u to v NULL.
LINKED LISTS.
© Oxford University Press All rights reserved. Data Structures Using C, 2e Reema Thareja.
Directed Acyclic Graph Tool Alice Robson: UNIGE (with thanks to Colin Bernet)
Spanning Trees Alyce Brady CS 510: Computer Algorithms.
The material in this lecture should be review. If you have not seen it before, you should be able to learn it quickly – and on your own. So we are going.
Parent Pointer Implementation
Stack ADT (Abstract Data Type) N …
Compiler Design – CSE 504 Type Checking
Queue ADT (Abstract Data Type) N …
SC’07 Demo Draft VGrADS Team June 2007.
Module 9: Memory and Resource Management
Data Structures and Algorithms I
Comments on the “Three Piles” Problem
Lectures linked lists Chapter 6 of textbook
5-5 Absolute Value Inequalities
Linked Lists with Tail Pointers
Sorting “Example” with Insertion Sort
What to do when you don’t know anything know nothing
Linked Lists with Tail Pointers
Graph of the derived function
5-5 Absolute Value Inequalities
Mutators for compound data Stack Queue
6.001 SICP Data Mutation Primitive and Compound Data Mutators
(can use two lines for Title if needed)
Error Handling.
Instructor: Dr. Michael Geiger Spring 2019 Lecture 29: Linked queues
Important Problem Types and Fundamental Data Structures
Conference Form Name: ____________ Teacher: ___________ Date/ Time: _____ What behavior stopped the learning of you or someone else? __________________________________________________________________________________________________________________________
Line Graphs.
For More Details:
Presentation transcript:

Unification algorithm We have seen examples of the use of unification. Now we will see, in detail, one way to implement a unification algorithm which implements structure sharing

A data structure to support unification We need a special data structure to allow structure sharing during unification: – each feature structure is represented using two components, a content component and a pointer component. – the representation forms a Directed Acyclic Graph (DAG)

Example 1 The DAG representation for a simple feature structure: [Number SG, Person 3] Expand first to: [Content[Number[Content SG, Pointer NULL], Person[Content 3, Pointer NULL]], Pointer NULL] CONTENT POINTER NUMBER PERSON CONTENT POINTER CONTENT POINTER SG NULL 3

Example 2 The DAG representation for a simple feature structure: [Number SG] CONTENT POINTER NUMBER CONTENT POINTER SG NULL

Example 3 The DAG representation for a simple feature structure: [Person 3] CONTENT POINTER PERSON CONTENT POINTER 3 NULL

Algorithm (pg. 423 of text) function Unify(f1, f2) returns fs or failure f1.real  real contents of f1, *(f1.ptr) if ptr != null f2.real  real contents of f2, *(f2.ptr) if ptr != null if (f1.real is null) { f1.ptr  f2; return f2 } else if (f2.real is null) { f2.ptr  f1; return f1 } else if (f1.real == f2.real) {f1.ptr  f2; return f2 } else if (f1.real is complex and f2.real is complex) { f2.ptr  f1 foreach ftr2 in f2.real { ftr1  find/create feature ftr2 in f1.real if Unify(ftr2.value,ftr1.value) fails {return failure} return f1 else return failure

Example 4, initial state [Number SG]  [Person 3] CONTENT POINTER NUMBER CONTENT POINTER SG NULL CONTENT POINTER PERSON NULL CONTENT POINTER 3 NULL f2: f1:

Example 4, part 2 [Number SG]  [Person 3] (note sharing!) CONTENT POINTER NUMBER CONTENT POINTER SG NULL CONTENT POINTER PERSON CONTENT POINTER 3 NULL

Example 4, part 3 [Number SG]  [Person 3] (note sharing!) CONTENT POINTER NUMBER CONTENT POINTER SG NULL CONTENT PERSON CONTENT POINTER 3 NULL PERSON CONTENT POINTER NULL POINTER

Another example? We can work through example on page 424 of text if you’d like.