Created
October 24, 2012 15:45
-
-
Save max-te/3946851 to your computer and use it in GitHub Desktop.
SE3 - Übung 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% mutter_von( Mutter , Kind ). | |
% 'Mutter' und 'Kind' sind Argumentpositionen, | |
% so da"s 'Mutter' die Mutter von 'Kind' ist. | |
:- dynamic mutter_von/2, vater_von/2. % ermoeglicht dynamische Veraenderung | |
%:- multifile mutter_von/2, vater_von/2. % ermoeglicht verteilte Definition in mehreren Files | |
mutter_von( marie , hans ). | |
mutter_von( marie , helga ). | |
mutter_von( julia , otto ). | |
mutter_von( barbara , klaus ). | |
mutter_von( barbara , andrea ). | |
mutter_von( charlotte , barbara ). | |
mutter_von( charlotte , magdalena ). | |
% vater_von( Vater , Kind ). | |
% 'Vater' und 'Kind' sind Argumentpositionen, | |
% so da"s 'Vater' die Vater von 'Kind' ist. | |
vater_von( otto , hans ). | |
vater_von( otto , helga ). | |
vater_von( gerd , otto ). | |
vater_von( johannes , klaus ). | |
vater_von( johannes , andrea). | |
vater_von( walter , barbara ). | |
vater_von( walter , magdalena ). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%Datenbasis laden | |
?- [familie]. | |
%Wer ist der Vater von Johannes? | |
?- vater_von(A, johannes). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment