can we OR the clauses for satisfying the rule??
From: xunitinmullik (nitin_mullik_at_yahoo.com)
Date: 12/10/03
- Next message: kym_at_kymhorsell.com: "Re: can we OR the clauses for satisfying the rule??"
- Previous message: Paul Singleton: "Re: Mercury <-> PDC Prolog"
- Next in thread: kym_at_kymhorsell.com: "Re: can we OR the clauses for satisfying the rule??"
- Reply: kym_at_kymhorsell.com: "Re: can we OR the clauses for satisfying the rule??"
- Reply: Benjamin Johnston: "Re: can we OR the clauses for satisfying the rule??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 9 Dec 2003 17:19:29 -0800
I am a network programer trying prolog for leisure and analysing its
use in network scenerios.
I want to know if v can define logic rule in prolog which is true if
even one of the clauses defining it is true.To be more specific
consider the scenerio wherein a query enroute(X,Y) run on a router
returns true if router X occurs in the route from the origin router to
router Y. The basic predicates are in the form of static routes that
exist in the network topology i.e. static_route(X,Y) if the routers X
and Y are directly connected.
I tried using
enroute(X,Y):-static_route(X,Z),
enroute(Z,Y),
X\=Y.
But then the traced execution showed that it ended up doing
static_route(A,A) and ending up giving 'no' as output.
Any help will be of great help.
Nitin Mullik
Sr. Network Programmer
www.infosys.com
- Next message: kym_at_kymhorsell.com: "Re: can we OR the clauses for satisfying the rule??"
- Previous message: Paul Singleton: "Re: Mercury <-> PDC Prolog"
- Next in thread: kym_at_kymhorsell.com: "Re: can we OR the clauses for satisfying the rule??"
- Reply: kym_at_kymhorsell.com: "Re: can we OR the clauses for satisfying the rule??"
- Reply: Benjamin Johnston: "Re: can we OR the clauses for satisfying the rule??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|