1 / 4

Examples of the Unification Algorithm

Examples of the Unification Algorithm. { X = int, Y = X X }. unify ({ X = int, Y = X X } ) S=X, T=int, C’={Y = X X} = [ X  int ] ; unify ({ Y = int int }) S=Y, T=int int, C’={ } = [ X  int ] ; [ Y  int int ] ; unify ({ })

alva
Télécharger la présentation

Examples of the Unification Algorithm

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Examples of the Unification Algorithm { X = int, Y = XX } unify({ X = int, Y = XX }) S=X, T=int, C’={Y = XX} = [ X  int ] ; unify({ Y = intint }) S=Y, T=intint, C’={ } = [ X  int ] ; [ Y  intint ] ; unify({ }) = [ X  int ] ; [ Y  intint ] ; [ ] = [ X  int, Y  intint ] { intint = XY } unify({ intint = XY }) S=intint, T=XY, C’={ } = unify({ int = X, int = Y }) S=int, T=X, C’={ int = Y } = [ X  int ] ; unify({ int = Y }) S=int, T=Y, C’={ } = [ X  int ] ; [ Y  int ] ; unify({ }) = [ X  int, Y  int ]

  2. Examples of the Unification Algorithm { XY = YZ, Z = UW } unify({ XY = YZ, Z = UW }) S=XY, T= YZ, C’={Z = UW} = unify({ Z = UW, X = Y, Y = Z }) S=Z, T=UW, C’={ X = Y, Y = Z } = [ Z  UW ] ; unify({ X = Y, Y = UW }) = [ Z  UW ] ; [ X  Y ] ; unify({ Y = UW }) = [ Z  UW ] ; [ X  Y ] ; [ Y  UW ] = [ Z  UW, X  Y ] ; [ Y  UW ] = [ Z  UW, X  UW, Y  UW ]

  3. Examples of the Unification Algorithm { int = intY } unify({ int = intY }) S=int, T= intY, C’={ } fails { Y = intY } unify({ Y = intY }) S=Y, T= intY, C’={ } fails { } unify({ }) = [ ]

  4. Reference http://www.dcs.gla.ac.uk/~simon/teaching/tpl/

More Related