Both sides previous revision
Poprzednia wersja
Nowa wersja
|
Poprzednia wersja
|
pl:miw:miw08_dokuviz:testyprolog2 [2008/06/11 01:47] miw |
pl:miw:miw08_dokuviz:testyprolog2 [2008/06/11 18:18] miw |
Testy pluginu prolog. | |
----------------------- | |
<prolog cache="true" goal="zwierze(X),write(X),nl,fail"> | |
zwierze(pies). | |
zwierze(kot). | |
</prolog> | |
---------------------- | |
====== Family Definitions ====== | |
| |
===== Father and Mother ===== | |
| |
A parent and a female is somebody's mother. | |
A parent and a male is somebody's father. | |
| |
<prolog cache="true"> | |
mother(X,Y) :- | |
parent(X,Y), | |
female(X). | |
| |
father(X,Y) :- | |
parent(X,Y), | |
male(X). | |
</prolog> | |
| |
| |
====== Families ====== | |
| |
Info about all families gathered in this namespace. | |
| |
<prolog scope=".:*_family"> | |
</prolog> | |
| |
| |
| |
~~NOCACHE~~ | |
====== Smith Family ====== | |
| |
There is Kate and Liz obviously girls, and a couple of boys: Tom and Bob. | |
Kate is Bob's mom, while Tom is his dad. | |
Tom is also Liz's dad. | |
| |
<prolog cache="true"> | |
female(person(kate,smith)). | |
female(person(liz,smith)). | |
| |
male(person(tom,smith)). | |
male(person(bob,smith)). | |
| |
parent(person(kate,smith),person(bob,smith)). | |
parent(person(tom,smith),person(bob,smith)). | |
parent(person(tom,smith),person(liz,smith)). | |
</prolog> | |
| |
-RESULT- | |
| |
| |
===== Males ===== | |
| |
<prolog goal="male(X),write(X),nl,fail" scope=".*"> | |
</prolog> | |
| |
| |
===== Mothers ===== | |
| |
<prolog goal="mother(X,Y),write(X),nl,fail" scope=".*"> | |
</prolog> | |
| |
===== Fathers ===== | |
| |
<prolog goal="father(X,Y),write(X),nl,fail" scope=".*"> | |
</prolog> | |
| |