summaryrefslogtreecommitdiff
path: root/lang/prolog/1.8.7/src/prieks
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2019-02-04 13:09:03 +0100
committerLars-Dominik Braun <lars@6xq.net>2019-02-04 13:09:03 +0100
commit04e68443040c7abad84d66477e98f93bed701760 (patch)
tree2b6202afae659e773bf6916157d23e83edfa44e3 /lang/prolog/1.8.7/src/prieks
downloadeumel-src-04e68443040c7abad84d66477e98f93bed701760.tar.gz
eumel-src-04e68443040c7abad84d66477e98f93bed701760.tar.bz2
eumel-src-04e68443040c7abad84d66477e98f93bed701760.zip
Initial import
Diffstat (limited to 'lang/prolog/1.8.7/src/prieks')
-rw-r--r--lang/prolog/1.8.7/src/prieks58
1 files changed, 58 insertions, 0 deletions
diff --git a/lang/prolog/1.8.7/src/prieks b/lang/prolog/1.8.7/src/prieks
new file mode 100644
index 0000000..372ec9d
--- /dev/null
+++ b/lang/prolog/1.8.7/src/prieks
@@ -0,0 +1,58 @@
+
+ist priek (bo priek).
+ist priek (ki priek).
+ist priek (bla priek).
+
+WER GNASELT WEN :- population (B),
+ member ([WEN, WER, _], B),
+ bedingungen (B).
+
+WER KNAUDERT WEN:- population (B),
+ member ([WER, _, WEN], B),
+ bedingungen (B).
+
+population (B):- sind prieks (U, V, W),
+ sind knauderarten (R, S, T),
+ B = [ [drausla puemfe, U, R],
+ [glessla puemfe, V, S],
+ [hapla puemfe, W, T] ].
+
+sind prieks (X,Y,Z):- ist priek (G),
+ ist priek (H), H<>G,
+ ist priek (I), I<>G, I<>H, !,
+ permute ([G,H,I], [X,Y,Z]).
+
+sind knauderarten (X,Y,Z):- ist knauderart (G),
+ ist knauderart (H), H<>G,
+ ist knauderart (I), I<>G, I<>H, !,
+ permute ([G,H,I],[X,Y,Z]).
+
+ist knauderart (an).
+ist knauderart (ab).
+ist knauderart (ueber).
+
+bedingungen (B):- not member ([hapla puemfe,ki priek,_],B) ,
+ not member ([hapla puemfe,_,ueber],B) ,
+ not member ([drausla puemfe,bo priek,_],B) ,
+ not member ([_,bo priek,ab],B) ,
+ noch ne bedingung (B) ,
+ weitere bedingungen (B) , !.
+
+weitere bedingungen (B):- not member([_,ki priek,ueber],B),
+ not member([_,bo priek,ueber],B)
+ ;
+ member([drausla puemfe,_,an],B).
+
+noch ne bedingung (B):- not member ([drausla puemfe,ki priek,_],B)
+ ;
+ not member ([glessla puemfe,_,ueber],B).
+
+permute ([], []).
+permute (X, [Y|Z]):- delete (Y ,X, E), permute (E, Z).
+delete (X, [X|Z], Z).
+delete (X, [Y|Z], [Y|E]):- delete (X, Z, E).
+member (X, [X|Z]).
+member (X, [Y|Z]):- member (X, Z).
+not member (X, []).
+not member (X, [Y|Z]):- X <> Y, not member (X,Z).
+