Unification algorithm - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Unification algorithm

Description:

The DAG representation for a simple feature structure: [Number SG] CONTENT. POINTER ... CONTENT. POINTER. SG. NULL. NULL. Example 3 ... – PowerPoint PPT presentation

Number of Views:1030
Avg rating:3.0/5.0
Slides: 11
Provided by: alph8
Category:

less

Transcript and Presenter's Notes

Title: Unification algorithm


1
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

2
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)

3
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

SG
CONTENT
NULL
NUMBER
POINTER
PERSON
CONTENT
3
POINTER
NULL
NULL
4
Example 2
  • The DAG representation for a simple feature
    structure Number SG

SG
CONTENT
NULL
NUMBER
POINTER
NULL
5
Example 3
  • The DAG representation for a simple feature
    structure Person 3

3
CONTENT
NULL
PERSON
POINTER
NULL
6
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

7
Example 4, initial state
  • Number SG ? Person 3

SG
CONTENT
NULL
NUMBER
POINTER
f1
NULL
CONTENT
3
PERSON
POINTER
NULL
f2
NULL
8
Example 4, part 2
  • Number SG ? Person 3 (note sharing!)

SG
CONTENT
NULL
NUMBER
POINTER
CONTENT
POINTER
NULL
CONTENT
3
PERSON
POINTER
POINTER
NULL
CONTENT
9
Example 4, part 3
  • Number SG ? Person 3 (note sharing!)

SG
CONTENT
NULL
NUMBER
POINTER
CONTENT
PERSON
CONTENT
NULL
POINTER
POINTER
NULL
CONTENT
3
PERSON
POINTER
POINTER
NULL
CONTENT
10
Another example?
  • We can work through example on page 424 of text
    if youd like.
Write a Comment
User Comments (0)
About PowerShow.com