Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math

Topic: SIMPLE NAVIGATION IN PROLOG
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Graham Cooper

Posts: 4,321
Registered: 5/20/10
SIMPLE NAVIGATION IN PROLOG
Posted: Jul 13, 2013 9:03 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

http://phpprolog.com/demo/NAVIGATION-IN-PROLOG.png



I stole this Nav Program off Apple Maps!



X 5 go FROM TO :-
road FROM TO

X 6 go FROM TO :-
road FROM HERE
go HERE TO

X 7 road a b
X 8 road b c
X 9 road c d




At first the TRACE to go from a - d looks for a direct road and fails


TRACE
go a d ?


HEAD 1
go FROM TO
TAIL 1
road FROM TO
road [ a ] [ d ]
FALSE 1
FAIL

HEAD 2
go FROM TO
TAIL 1
road FROM HERE
road [ a ] HERE
HEAD 1
road a b
MATCH
TRUE 1
TAIL 2
go HERE TO
go [ b ] [ d ]


Then it tries the 2nd option of rule
go FROM TO :-

and finds a road from a - b instead, then tries that!



Check the full color trace here!

http://phpprolog.com/demo/NAVIGATION-IN-PROLOG.png





Herc
--
www.phpPROLOG.com




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.