Document( Base() Prefix(pred ) Group ( :verheiratet(:Daniel :Daniela) :verheiratet(:Peter :Petra) :verheiratet(:Paula :Paul) :verheiratet(:Inga :Klaus) :verheiratet(:Josef :Josefine) :verheiratet(:Herbert :Ida) :verheiratet(:Fritz :Marianne) :KindVon(:Josef :Inga) :KindVon(:Josef :Klaus) :KindVon(:Paul :Inga) :KindVon(:Paul :Klaus) :KindVon(:Inga :Peter) :KindVon(:Inga :Petra) :KindVon(:Daniel :Paul) :KindVon(:Daniel :Marianne) :KindVon(:Marianne :Ida) :KindVon(:Marianne :Herbert) :KindVon(:Sabine :Eva) :KindVon(:Sabine :Egon) Forall ?x ?y( :verheiratet(?x ?y):-:verheiratet(?y ?x) ) (* Alle Großeltern: *) Forall ?x ?y ?z( :grosseltern(?x):- And( :KindVon(?y ?z) :KindVon(?z ?x)) ) (* Alle Vorfahren *) Forall ?x ?y( :Vorfahr(?x ?y):-:KindVon(?y ?x) ) Forall ?x ?y ?z( :Vorfahr(?x ?y):- And( :KindVon(?z ?x) :Vorfahr(?z ?y) ) ) (* Alle Nachfahren: *) Forall ?x ?y( :Nachfahr(?x ?y):-:Vorfahr(?y ?x) ) (* Alle Verwandten von :Paul *) :verwandtPaul(:Paul) Forall ?x ?y( :verwandtPaul(?x) :- And( :verwandtPaul(?y) Or( :KindVon(?y ?x) :KindVon(?x ?y) :verheiratet(?y ?x) ) ) ) (* Hilfsprädikat: Alle Vorfahren von :Paul und :Paul selbst *) ForAll ?x ( :VorfahrPaulUndPaulSelbst(?x) :- Or( :Vorfahr(?x :Paul) ?x = :Paul ) ) (* Hilfsprädikat: Alle Nachfahren von :Paul und seine Vorfahren *) ForAll ?x ?y( :NachfahrenVonPaulUndSeinenVorfahren(?x):- And( :VorfahrPaulUndPaulSelbst(?y) :Nachfahr(?x ?y) ) ) (* Alle Blutsverwandten von :Paul *) Forall ?x( :blutsverwandtPaul(?x):- Or( :VorfahrPaulUndPaulSelbst(?x) :NachfahrenVonPaulUndSeinenVorfahren(?x) ) ) (* Alle ehelichen Kinder *) Forall ?x ?y ?z( :ehelichesKind(?x):- And( :KindVon(?x ?y) :KindVon(?x ?z) :verheiratet(?y ?z) ) ) (* Alle unverheirateten Personen *) (* geht nicht, da Negation nicht in RIF BLD! *) ) )