Jess程式語言

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書
Jess
開發者桑迪亞國家實驗室
平台Java
許可協定專有軟件 / 公有領域
網站www.jessrules.com

Jess是Java平台上的規則引擎英語rule engine,它是CLIPS程式語言英語CLIPS programming language的超集,由桑迪亞國家實驗室Ernest Friedman-Hill英語Ernest Friedman-Hill開發。它的第一個版本寫於1995年晚期。

Jess提供適合自動化專家系統邏輯編程,它常被稱作「專家系統外殼」。近年來,智能代理系統也在相似的能力上發展起來。

與一個程式中有一個只執行一次的迴圈的指令式編程語言不同,Jess使用的宣告式編程通過一個名為「模式匹配」的過程連續的對一個事實的集合運用一系列規則。規則可以修改事實集合,或者執行任何Java代碼。

Jess可以被用來構建使用規則定義形式的知識來推倒結論和推論的Java ServletEJBApplet和應用程式。因為不同的規則匹配不同的輸入,所以有了一些有效的通用匹配演算法。Jess規則引擎使用Rete演算法英語Rete algorithm

許可證[編輯]

Jess不是開源軟件,而CLIPS英語CLIPS是。

代碼實例[編輯]

代碼實例:

(deftemplate male   "" (declare (ordered TRUE)))
(deftemplate female "" (declare (ordered TRUE)))
(deftemplate parent "" (declare (ordered TRUE)))
(deftemplate father "" (declare (ordered TRUE)))
(deftemplate mother "" (declare (ordered TRUE)))

(deffacts initialFacts
  (male bill)
  (female jane)
  (female sally)
  (parent bill sally)
  (parent jane sally)
  )

(defrule father
  (parent ?x ?y)
  (male ?x)
  =>
  (printout t crlf ?x " is the father of " ?y crlf)
  )

(defrule mother
  (parent ?x ?y)
  (female ?x)
  =>
  (printout t crlf ?x " is the mother of " ?y crlf)
  )

(reset)
(facts)
(run)

(printout t crlf)

書籍[編輯]

參見[編輯]

參考檔案[編輯]


外部連結[編輯]