Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java Expert System Shell JESS 報告者 : 江梓安. Why we need an expert systems? Conventional programming languages Conventional programming languages Complex.

Similar presentations


Presentation on theme: "Java Expert System Shell JESS 報告者 : 江梓安. Why we need an expert systems? Conventional programming languages Conventional programming languages Complex."— Presentation transcript:

1 Java Expert System Shell JESS 報告者 : 江梓安

2 Why we need an expert systems? Conventional programming languages Conventional programming languages Complex problems using very abstract, symbolic approaches Complex problems using very abstract, symbolic approaches Expert systems can be built that closely resemble human logic in their implementation Expert systems can be built that closely resemble human logic in their implementation

3 JESS Introduction Rule engine and scripting environment Rule engine and scripting environment CLIPS expert system shell CLIPS expert system shell Rete algorithm Rete algorithm A powerful Java scripting environment A powerful Java scripting environment

4 JESS Rule-based Expert System The whole system structure will not be affected while the deductive rules of JESS are revised or deleted. The whole system structure will not be affected while the deductive rules of JESS are revised or deleted. JESS remembers past test results to reduce inference time. JESS remembers past test results to reduce inference time. The rules are executed at a specific time and in a specific order, according to how the programmer writes them. The rules are executed at a specific time and in a specific order, according to how the programmer writes them. The algorithm makes Jess rules less deterministic than a typical procedural program. The algorithm makes Jess rules less deterministic than a typical procedural program.

5 The Knowledge Base Ordered facts Ordered facts Unordered facts Unordered facts Definstance facts Definstance facts

6 Ordered facts (shopping-list eggs milk bread) (person “ Bob Smith ” Male 35)

7 Unordered facts deftemplate automobile (slot make) (slot model) (slot year (type INTEGER)) (slot color (default white)) Jess>(assert (automobile (make Chrysler) (model LeBaron) (year 1997))

8 Definstance facts JESS has a mechanism for automatically generating templates that represent specific types of Java Beans. JESS has a mechanism for automatically generating templates that represent specific types of Java Beans. JESS can use these templates to store a representation of a Java Bean’s properties on the knowledge base. JESS can use these templates to store a representation of a Java Bean’s properties on the knowledge base. The knowledge base representation of the Bean can be static or dynamic (changing whenever the Bean’s properties change) The knowledge base representation of the Bean can be static or dynamic (changing whenever the Bean’s properties change)

9 Define Rule Jess> (defrule do-change-baby “If baby is wet, change baby’s diaper.” (baby-is-wet)=>(change-baby))

10

11 Define Rule (Basic Pattern 1) Jess> (defrule example Jess> (defrule example (more-than-one-hundred ?m&:(> ?m 100)) => Printout t “Found what I wanted!” crlf))

12 Define Rule (Basic Pattern 2) (defrule example-7 (defrule example-7 (person ?x ) (not (married ?x)) => (printout t ?x “is not married!” crlf))

13

14 Define Rule (Basic Pattern 3) (defrule or-example (defrule or-example (or (and (a) (c)) (and (b) (c)) (and (b) (c))=>)

15 Define Rule (Salience) Jess> (defrule example-6 Jess> (defrule example-6 ( declare (salience – 100)) (command exit-when-idle) => (printout t “ exiting …” crlf))

16 Define Rule (Test) Jess> (deftemplate person (slot age)) Jess> (defrule example-8) (person (age ?x)) (test (> ?x 30)) => (printout t ?x “ is over 30! “crlf))

17

18 Define Rule (Logical) Jess> (defrule rule-1 (logical (faucet-open)) => (assert (water-flowing)))

19 Demo Example If 電梯開門型式為 CG And 導軌規格 = 4k Then 升降道淨寬度 = 800 If 電梯開門型式為 CO And 導軌規格 = 5k Then 升降道淨寬度 = 1100 If 電梯開門型式為 2S And 導軌規格 = 18k Then 升降道淨寬度 = 950 If 升降道淨寬度 = 800 Then 車廂深度 = 400 If 升降道淨寬度 = 950 Then 車廂深度 = 500 If 升降道淨寬度 = 1100 Then 車廂深度 = 950 If 電梯開門型式為 CG And 導軌規格 = 4k Then 升降道淨寬度 = 800 If 電梯開門型式為 CO And 導軌規格 = 5k Then 升降道淨寬度 = 1100 If 電梯開門型式為 2S And 導軌規格 = 18k Then 升降道淨寬度 = 950 If 升降道淨寬度 = 800 Then 車廂深度 = 400 If 升降道淨寬度 = 950 Then 車廂深度 = 500 If 升降道淨寬度 = 1100 Then 車廂深度 = 950


Download ppt "Java Expert System Shell JESS 報告者 : 江梓安. Why we need an expert systems? Conventional programming languages Conventional programming languages Complex."

Similar presentations


Ads by Google