COMPAMTech23653rArtrAP 26.04.2021
COMPAMTech23653rArtrAP 26.04.2021
Knowledge acquisition 1 / 17
Plan of the lecture
2 Expert systems
3 Knowledge acquisition
4 Decision tables
6 Rules in Java
Knowledge acquisition 2 / 17
Plan of the lecture
Knowledge acquisition 3 / 17
Jess http://herzberg.ca.sandia.gov/jess/
Knowledge acquisition 4 / 17
Development cycle of a knowledge-based system
Expert systems
Knowledge acquisition 6 / 17
Knowledge acquisition
Knowledge acquisition 7 / 17
Knowledge acquisition
Knowledge acquisition 9 / 17
Decision tables
Knowledge acquisition 10 / 17
Decision tables
Decision tables
Knowledge acquisition 11 / 17
Decision tables
Example
Knowledge acquisition 12 / 17
Decision tables
Example: rules
Rule 1: if cash and order > 100 then give 20% discount
Rule 2: if cash and 50 ≤ order ≤ 100 then give 10 % discount Rule
3: if cash and rder < 50 then accept order
Rule 4: if not cash and credit record good then accept order
Rule 5: if not cash and not credit record good then reject order
Else generate an exception report.
Knowledge acquisition 13 / 17
Modern uses of rules: semantic web, business rules
Semantic web
Knowledge acquisition 14 / 17
Modern uses of rules: semantic web, business rules
Rule ML
Knowledge acquisition 15 / 17
Modern uses of rules: semantic web, business rules
Business rules
Knowledge acquisition 16 / 17
Rules in Java
Knowledge acquisition 17 / 17
javax.rules and javax.rules.admin packages.
Knowledge acquisition 18 / 17
Rules in Java
Jess
Jess is an expert system shell (can fill in your own rules, the
engine already exists) written in Java
Implemented using Rete algorithm (efficient incremental rule
matching)
Can be downloaded for free from
http://herzberg.ca.sandia.gov/jess for educational use
Rules can be specified in Jess rule language or XML; rule
language is LISP-like:
(defrule welcome-toddlers
(person {age < 3})
=⇒
(println ”Hello, little one!”))
LHS is a pattern (if a person has age less than 3 years) and RHS
Knowledge acquisition 19 / 17
is an action (function call, in particular can insert new facts).
Knowledge acquisition 20 / 17
Rules in Java
Knowledge acquisition 21 / 17