Prolog
PART III - Get-Want
| << Previous | Main | Next >> |
Example #1: Get-Want
| get[X,Y]:-want[X,Y]*at[X,L]*at[Y,L]. want[john,book]. at[john,market]. at[book,library]. want[david,apple]. at[david,market]. at[apple,market]. |
Resolution Trace for Example #1:
| get[X,Y] | want[X,Y] | at[X,L] | at[Y,L] |
| get[A,B] | |||
| want[A,B] | |||
| A=john,B=book. | |||
| at[john,L] | |||
| L=market | |||
| at[book,market] | |||
| FALSE | |||
| at[john,L] (#2) | |||
| FALSE | |||
| want[A,B] (#2) | |||
| A=david,B=apple | |||
| at[david,L] | |||
| L=market | |||
| at[apple,market] | |||
| TRUE | |||
| >>_get[david,apple] | |||
| at[apple,market] (#2) | |||
| FALSE | |||
| at[david,L] (#2) | |||
| FALSE | |||
| want[A,B] (#3) | |||
| FALSE | |||
| get[A,B] (#2) | |||
| FALSE | |||
| <<_get[david,apple] | |||
| >>get[david,apple] | |||
<Under Construction>
| << Previous | Main | Next >> |
Next: Family