Template:Refimprove {{#invoke:Infobox|infobox}}Template:Template other{{#invoke:Check for unknown parameters | check | showblankpositional=1 | unknown = Template:Main other | preview = Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y | AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo upright | logo size | logo title | logo_alt | logo_caption | logo_upright | logo_size | logo_title | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot upright | screenshot size | screenshot title | screenshot_alt | screenshot_upright | screenshot_size | screenshot_title | service_name | size | standard | title | ver layout | website | qid }}Template:Main other Jess is a rule engine for the Java computing platform, written in the Java programming language. It was developed by Ernest Friedman-Hill of Sandia National Laboratories.<ref name="ExpertSystems">Template:Cite book Template:ISBN</ref> It is a superset of the CLIPS language.<ref name="ExpertSystems"/> It was first written in late 1995.<ref name="ExpertSystems"/> The language provides rule-based programming for the automation of an expert system, and is often termed as an expert system shell.<ref name="ExpertSystems"/> In recent years, intelligent agent systems have also developed, which depend on a similar ability.

Rather than a procedural paradigm, where one program has a loop that is activated only one time, the declarative paradigm used by Jess applies a set of rules to a set of facts continuously by a process named pattern matching. Rules can modify the set of facts, or can execute any Java code. It uses the Rete algorithm<ref name="ExpertSystems"/> to execute rules.

LicenseEdit

The licensing for Jess is freeware for education and government use, and is proprietary software, needing a license, for commercial use. In contrast, CLIPS, which is the basis and starting code for Jess, is free and open-source software.

Code examplesEdit

Code examples: <syntaxhighlight lang="lisp">

is a comment

(bind ?x 100)

x = 100

(deffunction max (?a ?b)

            (if (> ?a ?b) then ?a else ?b))

(deffacts myroom

         (furniture chair)
         (furniture table)
         (furniture bed)
         )

(deftemplate car

            (slot color)
            (slot mileage)
            (slot value)
            )

(assert (car (color red) (mileage 10000) (value 400))) </syntaxhighlight> Sample code: <syntaxhighlight lang="lisp"> (clear) (deftemplate blood-donor (slot name) (slot type)) (deffacts blood-bank ; put names & their types into working memory

         (blood-donor (name "Alice")(type "A"))
         (blood-donor (name "Agatha")(type "A"))
         (blood-donor (name "Bob")(type "B"))
         (blood-donor (name "Barbara")(type "B"))
         (blood-donor (name "Jess")(type "AB"))
         (blood-donor (name "Karen")(type "AB"))
         (blood-donor (name "Onan")(type "O"))
         (blood-donor (name "Osbert")(type "O"))
         )

(defrule can-give-to-same-type-but-not-self ; handles A > A, B > B, O > O, AB > AB, but not N1 > N1

        (blood-donor (name ?name)(type ?type))
        (blood-donor (name ?name2)(type ?type2 &:(eq ?type ?type2) &: (neq ?name ?name2) ))
        =>
        (printout t ?name " can give blood to " ?name2 crlf)
        )

(defrule O-gives-to-others-but-not-itself ; O to O cover in above rule

        (blood-donor (name ?name)(type ?type &:(eq ?type "O")))
        (blood-donor (name ?name2)(type ?type2 &: (neq ?type ?type2) &: (neq ?name ?name2) ))
        =>
        (printout t ?name " can give blood to " ?name2 crlf)
        )

(defrule A-or-B-gives-to-AB ; case O gives to AB and AB gives to AB already dealt with

        (blood-donor (name ?name)(type ?type &:(or (eq ?type "A") (eq ?type "B" ))))
        (blood-donor (name ?name2)(type ?type2 &: (eq ?type2 "AB") &: (neq ?name ?name2) ))
        =>
        (printout t ?name " can give blood to " ?name2 crlf)
        )
(watch all)

(reset) (run) </syntaxhighlight>

See alsoEdit

Related systemsEdit

ReferencesEdit

Template:Reflist

Further sourcesEdit

External linksEdit