Jess Programming Language
   HOME

TheInfoList



OR:

Jess is a
rule engine A business rules engine is a software system that executes one or more business rules in a runtime production environment. The rules might come from legal regulation ("An employee can be fired for any reason or no reason but not for an illegal rea ...
for the
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
platform that was developed by Ernest Friedman-Hill of
Sandia National Labs Sandia National Laboratories (SNL), also known as Sandia, is one of three research and development laboratories of the United States Department of Energy's National Nuclear Security Administration (NNSA). Headquartered in Kirtland Air Force B ...
. It is a
superset In mathematics, set ''A'' is a subset of a set ''B'' if all elements of ''A'' are also elements of ''B''; ''B'' is then a superset of ''A''. It is possible for ''A'' and ''B'' to be equal; if they are unequal, then ''A'' is a proper subset of ...
of the CLIPS programming language. It was first written in late 1995. The language provides
rule-based programming Logic programming is a programming paradigm which is largely based on formal logic. Any program written in a logic programming language is a set of sentences in logical form, expressing facts and rules about some problem domain. Major logic prog ...
for the automation of an
expert system In artificial intelligence, an expert system is a computer system emulating the decision-making ability of a human expert. Expert systems are designed to solve complex problems by reasoning through bodies of knowledge, represented mainly as if†...
, and is frequently termed as an ''expert system shell''. In recent years,
intelligent agent In artificial intelligence, an intelligent agent (IA) is anything which perceives its environment, takes actions autonomously in order to achieve goals, and may improve its performance with learning or may use knowledge. They may be simple or c ...
systems have also developed, which depend on a similar capability. Rather than a procedural paradigm, where a single program has a loop that is activated only one time, the declarative paradigm used by Jess continuously applies a collection of rules to a collection of facts by a process called ''pattern matching''. Rules can modify the collection of facts, or they can execute any Java code. It uses the
Rete algorithm The Rete algorithm ( , , rarely , ) is a pattern matching algorithm for implementing rule-based systems. The algorithm was developed to efficiently apply many rules or patterns to many objects, or facts, in a knowledge base. It is used to deter ...
to execute rules.


License

While CLIPS is licensed as
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
, Jess is not open source. JESS is free for educational and government use but a license is required to use JESS for commercial systems.


Code examples

Code examples: ; 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))) Sample code: (clear) (deftemplate blood-donor (slot name) (slot type)) (deffacts blood-bank ; put names & their types into
working memory Working memory is a cognitive system with a limited capacity that can hold information temporarily. It is important for reasoning and the guidance of decision-making and behavior. Working memory is often used synonymously with short-term 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)


See also

* JSR-94 *
Decision Model and Notation In business analysis, the Decision Model and Notation (DMN) is a standard published by the Object Management Group.OMG standard "Decision Model and Notation (DMN)"current version/ref> It is a standard approach for describing and modeling repeatable ...


Related systems

*
CLIPS CLIPS is a public domain software tool for building expert systems. The name is an acronym for "C Language Integrated Production System." The syntax and name were inspired by Charles Forgy's OPS5. The first versions of CLIPS were developed st ...
:
public domain software Public-domain software is software that has been placed in the public domain, in other words, software for which there is absolutely no ownership such as copyright, trademark, or patent. Software in the public domain can be modified, distributed, ...
tool for building expert systems. * ILOG rules: a business rule management system. * JBoss Drools: a business rule management system (BRMS). *
Prolog Prolog is a logic programming language associated with artificial intelligence and computational linguistics. Prolog has its roots in first-order logic, a formal logic, and unlike many other programming languages, Prolog is intended primarily ...
: a general purpose logic programming language. *
OpenL Tablets OpenL Tablets is a business rule management system (BRMS) and a business rules engine (BRE) based on table representation of rules. Engine implements optimized sequential algorithm. OpenL includes such table types as decision table, decision tre ...
: business centric rules and BRMS. * DTRules: a
decision table Decision tables are a concise visual representation for specifying which actions to perform depending on given conditions. They are algorithms whose output is a set of actions. The information expressed in decision tables could also be represented ...
based, open-sourced rule engine for Java.


References


Additional sources

* {{ISBN, 1-930110-89-8


External links


Official Website
Expert systems Rule engines Knowledge representation languages Java APIs Sandia National Laboratories