Anyone familiar with Jess?

Please support our Legacy and Other Languages advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2006
Posts: 2
Reputation: Indymaestro is an unknown quantity at this point 
Solved Threads: 0
Indymaestro Indymaestro is offline Offline
Newbie Poster

Anyone familiar with Jess?

 
0
  #1
Nov 29th, 2006
Hello to all!

I've been parusing this site for awhile now, must say that its very helpful for tips and learning about coding in general.

Anyways, here is my first foray into posting and of course, it begins with a question.

I have to emulate a blood bank in Jess and i'm running into some problems with the output. Here's what I have so far:

(deftemplate person "the person template"
    (slot name)
    (slot blood)
)

(deftemplate blood "the blood type template"
    (slot kind)
    (slot is-compatible-with)
    (slot not-compatible)
)
    
(deffacts blood-bank-clients
    (person (name John)(blood O))
    (person (name Paul)(blood A))
    (person (name George)(blood B))
    (person (name Ringo)(blood AB))
    (blood (kind O) (is-compatible-with O) 
        (kind O)(not-compatible A)
        (kind O)(not-compatible B)
        (kind O)(not-compatible AB) )
    (blood (kind A) (is-compatible-with O)
    (kind O)(is-compatible-with A)
            (kind A)(not-compatible B)
            (kind A)(not-compatible AB) )
    (blood (kind B) (is-compatible-with O)
    (kind B)(is-compatible-with B)
            (kind B)(not-compatible A)
            (kind B)(not-compatible AB) )
    (blood (kind AB) (is-compatible-with O)
    (kind AB)(is-compatible-with A)
    (kind AB)(is-compatible-with B)
    (kind AB)(is-compatible-with AB) )
)

(defrule compatible
        (person (name ?person1) (blood ?kind1))
        (person (name ?person2) (blood ?kind2))
        (blood (kind ?kind1) (is-compatible-with ?kind2))
        =>
        (assert (compatible ?person1 ?person2))
)

(defrule match
         (compatible ?person1 ?person2)
         (compatible ?person2 ?person1)
         (test (neq ?person1 ?person2))
         =>
         (printout t " is compatible with " ?person1 " to " ?person2 crlf) 
)
I'm having major problems understanding what's going on because our professor's material on Jess is quite sparse and useless. I can get the facts to load properly, but for some reason it's not printing out who is compatible with who based on blood type.

Any help would be great!

- Indy
Last edited by Indymaestro; Nov 29th, 2006 at 7:24 pm.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,057
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 128
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: Anyone familiar with Jess?

 
0
  #2
Nov 29th, 2006
Welcome out of the world of the lurkers and into the world of the posters! Never heard of Jess but kinda looks like scheme to me.
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 2
Reputation: Indymaestro is an unknown quantity at this point 
Solved Threads: 0
Indymaestro Indymaestro is offline Offline
Newbie Poster

Re: Anyone familiar with Jess?

 
0
  #3
Nov 29th, 2006
Thanks for the greeting.

From what I can garner, Jess is a rule-based programming language used for expert systems.

Wow, going to lectures *are* really paying off!
Last edited by Indymaestro; Nov 29th, 2006 at 7:39 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2118 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Legacy and Other Languages
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC