Facts

W dziedzinie sztucznej inteligencji jednym z problemów jest repezentacja wiedzy, którą można określić jako symboliczny opis otaczającego nas świata.

Jess language allows the representation of knowledge of the facts, which are defined as working memory. Collection of information is represented in the form of facts in working memory. Facts like most structures in JESS are stored in the list. The fact is the smallest piece of information that can be added or removed from the working memory expert system. For system that supports decision of purchase a car, engine capacity or price can be example of fact.

The basic operations that are performed on facts includes:

  • reset - initiation of working memory
  • assert - adding a new fact
  • retract - removing fact
  • facts - displays the contents of working memory (facts)
  • clear - removing everything from the working memory

(assert (student (Dawid Informatics ))

Example of adding new fact.

deffacts auta "Capacity"
(car 1 polo "1.4")
(car 2 golf "1.6")
(car 3 passat "2.0")
(car 4 scirocco "2.5")

Another example - this time adding a few facts. We can do it collectively, as in this case, engine capacity for cars.

Facts are divided to ordered and unordered

;ordered:
(jan kowalski)
;unordered:
(deftemplate person(name Jan Kowalski))

Jess allows you to create different types of unstructured facts. Note, that in order to add some disordered fact we have to first define the template.

(deftemplate person "People"
(slot name)
(slot height)
(slot weight))

(assert (person(name Mark)
(wiek 23 )
(wzrost 178)
(waga 69)))

More examples of using the facts you will find in source codes on my website.