At some time I was playing with Duckburgers :-)
Perhaps that's what you have in mind?
-W

(clear)
(deftemplate duck
   (slot name (type STRING)))
(deftemplate likes
   (slot name (type STRING))
   (slot what (type SYMBOL)))

(deffacts facts-1
    "On ducks and ponds"
    (duck (name "Donald"))
    (duck (name "Daisy"))
    (duck (name "Huey"))
    (duck (name "Dewey"))
    (duck (name "Louie"))

    (likes (name "Donald") (what pond))
    (likes (name "Donald") (what Daisy))
    (likes (name "Daisy")  (what pond))
    (likes (name "Daisy")  (what Donald))
    (likes (name "Huey")   (what pond))
    (likes (name "Dewey")  (what pond))
    (likes (name "Louie")  (what pond))

    (duck (name "Scrooge"))
    (likes (name "Scrooge")(what pond))
)

(reset)
(facts)

;;
;; There is a duck that likes the pond.
;; exists x : duck(x) & likes(x,pond)
;;
(defrule exist-duck-likes-pond
    (duck (name ?dName))
    (likes (name ?dName) (what pond))
    =>
    (printout t "There exists a duck (" ?dName ") that likes the pond." crlf)
)

;;
;; There is no duck that likes money.
;; forall x : duck(x) => ! likes(x,money)
;;
(defrule no-duck-likes-money
    (forall (duck (name ?dName))
            (not (likes (name ?dName) (what money))))
    =>
    (printout t "No duck likes money." crlf)
)


;;
;; All ducks like the pond.
;; forall x : duck(x) => likes(x,pond)
;;
(defrule all-ducks-like-pond
    (forall (duck (name ?dName))
            (likes (name ?dName) (what pond)))
    =>
    (printout t "All ducks like the pond." crlf)
)

(run)

(printout t "Scrooge is different..." crlf)
(assert (likes (name "Scrooge")(what money)))
(run)



On Wed, Oct 8, 2008 at 7:34 PM, Jason Morris <[EMAIL PROTECTED]> wrote:
> On Wed, Oct 8, 2008 at 11:50 AM, Ernest Friedman-Hill <[EMAIL PROTECTED]>
> wrote:
>
>>> I think the real answer is that the detailed semantics of the Jess
>>> language don't map directly onto FOPC concepts.
>
> Hi All & Ernest,
>
>
>
> I'm dragging an ear to this thread, and I've been wondering for some time
> now if there is any value to creating a wiki topic on FOPC equivalents in
> Jess for people who are interested in structuring their logic that way.
>
>
>
> Ernest: You've given several implicit examples in Jess's various
> documentation sources about this, but nothing explicit.  For example, it's
> clear that the (exists) CE is related to the existential qualifier; and, as
> you've shown in this thread, the universal qualifier is implicit in Jess's
> pattern syntax.
>
>
>
> It might be nice to have a topic that gives sufficient examples of these
> basic equivalents and also indicates where Jess's expressiveness diverges
> from FOPC.  Perhaps it takes the form of a collection of "recipes" that map
> common FOPC pattens into their Jess equivalents (if they exist).  Something
> that includes all the caveats and exceptions, too.
>
>
>
> I'm happy to let someone else own this topic or develop it with someone.
>
> Any takers?
>
>
>
> Cheers,
>
> Jason
>
> -----------------------------------------------------------
> Morris Technical Solutions LLC
> [EMAIL PROTECTED]
> (517) 304-5883
>


--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to