Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Remove duplicate entry in README.md

  • Loading branch information...
commit 8f3093bf30f4bfb28334a4ed0894902523cca635 1 parent 883746c
Eric Merritt authored December 12, 2011

Showing 1 changed file with 0 additions and 92 deletions. Show diff stats Hide diff stats

  1. 92  README.md
92  README.md
Source Rendered
@@ -429,98 +429,6 @@ and Anna's brothers, we can use the following function call:
429 429
     [{brother,bob,alice},{brother,mark,alice},{brother,caesar,anna}]
430 430
     8>
431 431
 
432  
-Deriving new concepts by means of rules
433  
----------------------------------------
434  
-
435  
-#### Concept: 'mother'
436  
-
437  
-The rule to derive the concept of mother is quite straightforward:
438  
-
439  
-    if X is female and X is Y's parent then X is Y's mother.
440  
-
441  
-From the point of view of SERESYE, since knowledge is stored in the
442  
-*knowledge base* of the engine, the rule above is translated into the
443  
-following one: *<u>if the facts *{female, X}* and *{parent, X, Y}* are
444  
-**asserted** in the knowledge base, then we assert the fact *{mother,
445  
-X, Y}*.</u>*
446  
-
447  
-The rule *mother* can be thus written as follows:
448  
-
449  
-
450  
-    %%
451  
-    %% if (X is female) and (X is Y's parent) then (X is Y's mother)
452  
-    %%
453  
-    mother(Engine, {female, X}, {parent, X, Y}) ->
454  
-      seresye:assert(Engine, {mother, X, Y}).
455  
-
456  
-#### Concept: 'father'
457  
-
458  
-This concept can be easily derived by means of the following rule:
459  
-
460  
-    %%
461  
-    %% if (X is male) and (X is Y's parent) then (X is Y's father)
462  
-    %%
463  
-    father(Engine, {male, X}, {parent, X, Y}) ->
464  
-      seresye:assert(Engine, {father, X, Y}).
465  
-
466  
-
467  
-#### Concept: 'sister'
468  
-
469  
-This concept can be expressed by the following rule:
470  
-
471  
-    if Y and Z have the same parent and Z is female, then Z is the Y's
472  
-    sister.
473  
-
474  
-The SERESYE rule used to map this concept is:
475  
-
476  
-    %%
477  
-    %% if (Y and Z have the same parent X) and (Z is female)
478  
-    %%    then (Z is Y's sister)
479  
-    %%
480  
-    sister(Engine, {parent, X, Y}, {parent, X, Z}, {female, Z}) when Y =/= Z ->
481  
-      seresye:assert(Engine, {sister, Z, Y}).
482  
-
483  
-Please note the guard, which is needed to ensure that when Y and Z are
484  
-bound to the same value, the rule is not activated (indeed this is possible
485  
-since the same fact can match both the first and second
486  
-'parent' pattern).
487  
-
488  
-#### Concept: 'brother'
489  
-
490  
- Given the previous one, this concept is now quite simple to
491  
-implement:
492  
-
493  
-    %%
494  
-    %% if (Y and Z have the same parent X) and (Z is male)
495  
-    %%    then (Z is Y's brother)
496  
-    %%
497  
-    brother(Engine, {parent, X, Y}, {parent, X, Z}, {male, Z}) when Y =/= Z ->
498  
-      seresye:assert(Engine, {brother, Z, Y}).
499  
-
500  
-
501  
-#### Concepts: 'grandmother' and 'grandfather'
502  
-
503  
-The former concept can be expressed by means of the rule:
504  
-
505  
-    if X is Y's mother and Y is Z's parent, then X is Z's grandmother.
506  
-
507  
-The latter concept is now obvious. Both can be implemented using the
508  
-following SERESYE rules:
509  
-
510  
-    %%
511  
-    %% if (X is Y's mother) and (Y is Z's parent)
512  
-    %%    then (X is Z's grandmother)
513  
-    %%
514  
-    grandmother(Engine, {mother, X, Y}, {parent, Y, Z}) ->
515  
-      seresye:assert(Engine, {grandmother, X, Z}).
516  
-
517  
-    %%
518  
-    %% if (X is Y's father) and (Y is Z's parent)
519  
-    %%    then (X is Z's grandfather)
520  
-    %%
521  
-    grandfather(Engine, {father, X, Y}, {parent, Y, Z}) ->
522  
-      seresye:assert(Engine, {grandfather, X, Z}).
523  
-
524 432
 
525 433
 Conclusions
526 434
 -----------

0 notes on commit 8f3093b

Please sign in to comment.
Something went wrong with that request. Please try again.