Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

Both sides previous revision Poprzednia wersja
Nowa wersja
Poprzednia wersja
pl:dydaktyka:dss:rules:intro [2017/11/28 14:59]
msl
pl:dydaktyka:dss:rules:intro [2019/06/27 15:50] (aktualna)
Linia 107: Linia 107:
   siblings(X, Y),   siblings(X, Y),
   man(X).</​code>​   man(X).</​code>​
-Define ​two additional ​rules: +Define ​the following ​rules: 
-  * siblings(X,​Y) --- two different people with a common parent+  * siblings(X,​Y) --- two different people with a common parent;  
 +    * tip: ** (test (neq ?x ?y)) ** checks inequality of variables. 
 +    * question: why do you have to use ** test ** keyword?
   * sister(X,Y)   * sister(X,Y)
   * grandfather(X,​Y)   * grandfather(X,​Y)
Linia 114: Linia 116:
   * grandparent(X,​Y) --- tip: use ** OR **   * grandparent(X,​Y) --- tip: use ** OR **
   * cousins(X,​Y) --- two different people with a common grandparent. You can check this rule in Prolog with a query: <​code>​cousins(X,​Y),​ parent(R,​X),​ parent(R, Y)</​code>,​ it should return **false**   * cousins(X,​Y) --- two different people with a common grandparent. You can check this rule in Prolog with a query: <​code>​cousins(X,​Y),​ parent(R,​X),​ parent(R, Y)</​code>,​ it should return **false**
 +    * remember: siblings are not cousins! ​
   * aunt(X,Y) and uncle(X,Y) in terms of sister, brother and parent.   * aunt(X,Y) and uncle(X,Y) in terms of sister, brother and parent.
   * half-orphan(X) --- a person with only one parent. TIP: celina is the only half-orphan in the KB   * half-orphan(X) --- a person with only one parent. TIP: celina is the only half-orphan in the KB
Linia 138: Linia 141:
  
 Allows tracking of rules: firing, activation. Allows tracking of rules: firing, activation.
-  - Because we did learn anything ​interesting tracing the fact, we will follow the **widow** rule and all the rules it depends on: **parent**, **marriage**:​ <​code>​+  - Because we did learn nothing ​interesting tracing the fact, we will follow the **widow** rule and all the rules it depends on: **parent**, **marriage**:​ <​code>​
 (unwatch all) (unwatch all)
-(watch ​parents ​widow parent)+(watch ​rules marriage ​widow parent)
 </​code>​ </​code>​
   - Now we reset the fact base: <​code>​ (reset) </​code>​   - Now we reset the fact base: <​code>​ (reset) </​code>​
pl/dydaktyka/dss/rules/intro.1511877545.txt.gz · ostatnio zmienione: 2019/06/27 15:57 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0