Understanding :<= vs :<<= etc.
Srini Ram <[email protected]> Fri, 12 Sep 2008 08:24:29 -0700 (PDT)
| Newsgroups | gmane.comp.ai.powerloom |
|---|---|
| Message-ID | <[email protected]> |
I am trying to understand the compiler directives: :=> v/s :=>> or the reverse :<<= vs :<=. Also, <=> vs <<=> OR <=>>. 1. Take the inital code: (defconcept person (?x)) (defrelation alive (?x)) (defconcept live-person (?x person) :<=> (alive ?x) ) Print out the internal form: (print-rules live-person) (FORALL (?x1) (<= (PERSON ?x1) (LIVE-PERSON ?x1))) ; sub-concept rule, ignore (FORALL (?x1) (<= (ALIVE ?x1) (LIVE-PERSON ?x1))) ;; compare with the second version below (FORALL (?x1) (<= (LIVE-PERSON ?x1) ;; compare with third version below (ALIVE ?x1))) 2. Change the definition of live-person to use the compiler directive :forward-only (defconcept live-person (?x person) :<=>> (alive ?x) ) Print out the internal form: (print-rules live-person) (FORALL (?x1) (<= (PERSON ?x1) (LIVE-PERSON ?x1))) ; sub-concept rule, ignore (FORALL (?x1) (=>> (LIVE-PERSON ?x1) ; only difference from previous form (ALIVE ?x1))) (FORALL (?x1) (<= (LIVE-PERSON ?x1) ; same as before (ALIVE ?x1))) I guess the difference is that, in the second version -- alive can be deduced if liveperson is given as a fact but not the reverse -- When live-person is given as a fact, alive is also asserted via forward-chaining. this does not happen in the first, which has to find alive at query time. Am I correct? 3. Change the definition of live-person to use the compiler directive :backward-only (defconcept live-person (?x person) :<<=> (alive ?x) ) Now see the expansion: (print-rules live-person) (FORALL (?x1) (<= (PERSON ?x1) (LIVE-PERSON ?x1))) ; sub-concept rule, ignore (FORALL (?x1) (<= (ALIVE ?x1) (LIVE-PERSON ?x1))) ; same as first version (FORALL (?x1) (<<= (LIVE-PERSON ?x1) (ALIVE ?x1))) What is the difference between the highlighted rule above and the one in the very first version: (FORALL (?x1) (<= (LIVE-PERSON ?x1) (ALIVE ?x1))) Thanks Srini. _______________________________________________ powerloom-forum mailing list [email protected] http://mailman.isi.edu/mailman/listinfo/powerloom-forum