home *** CD-ROM | disk | FTP | other *** search
- "Eingabe der Formeln"
-
- Start ->
- Lesen(nil,i)
- /;
-
- Lesen(nil,i) -> in(i) in-char(c) Lesen(i,i');
- Lesen(P,i) -> in(i) in-char(c) Weiter(P,i);
-
- Weiter(P,SCHLUSS) -> in(f) in-char(c) Folgt(P,f);
- Weiter(P,i) -> Lesen(UND(i,P),i');
-
- "Hauptaufrufe"
-
- Folgt(P,k) ->
- reset-cpu-time
- Infix(P,i)
- DNF(i,d)
- Check(d)
- ]berpr}fung(k,d)
- cpu-time(t)
- outl(t)
- /;
-
- Check(nil) ->
- /
- outm("Die Pr{missen widersprechen einander!")
- fail;
- Check(x) ->;
-
- Antwort(k,wahr) -> outm("So ist es: ") out(k) outm(" folgt.") /;
- Antwort(k,falsch) ->
- outm("Ganz im Gegenteil: NICHT(")
- out(k)
- outm(") folgt!");
- Antwort(k,unbestimmt) ->
- out(k)
- outm(" folgt nicht, aber NICHT(")
- out(k)
- outm(") folgt auch nicht.");
-
- "Elimination von Junktoren und Verschiebung der Negation"
-
- Infix(NICHT(UND(p-hi,p-si)),ODER(p-hi',p-si')) ->
- /
- Infix(NICHT(p-hi),p-hi')
- Infix(NICHT(p-si),p-si');
- Infix(NICHT(ODER(p-hi,p-si)),UND(p-hi',p-si')) ->
- /
- Infix(NICHT(p-hi),p-hi')
- Infix(NICHT(p-si),p-si');
- Infix(NICHT(WENN(p-hi,p-si)),y) ->
- /
- Infix(UND(p-hi,NICHT(p-si)),y);
- Infix(NICHT(NICHT(p-hi)),x) -> / Infix(p-hi,x);
- Infix(WENN(p-hi,p-si),ODER(p-hi',p-si')) ->
- /
- Infix(NICHT(p-hi),p-hi')
- Infix(p-si,p-si');
- Infix(GDW(p-hi,p-si),ODER(UND(p-hi',p-si'),UND(p-hi'',p-si''))) ->
- /
- Infix(p-hi,p-hi')
- Infix(p-si,p-si')
- Infix(NICHT(p-hi),p-hi'')
- Infix(NICHT(p-si),p-si'');
- Infix(NICHT(GDW(p-hi,p-si)),ODER(UND(p-hi',p-si''),UND(p-hi'',p-si'))) ->
- /
- Infix(p-hi,p-hi')
- Infix(p-si,p-si')
- Infix(NICHT(p-hi),p-hi'')
- Infix(NICHT(p-si),p-si'');
- Infix(UND(p-hi,p-si),UND(p-hi',p-si')) ->
- /
- Infix(p-hi,p-hi')
- Infix(p-si,p-si');
- Infix(ODER(p-hi,p-si),ODER(p-hi',p-si')) ->
- /
- Infix(p-hi,p-hi')
- Infix(p-si,p-si');
- Infix(x,x) -> /;
-
- "Distributive (Listen-)Normalform"
-
- DNF(ODER(p-hi,p-si),l) ->
- /
- DNF(p-hi,p-hi')
- DNF(p-si,p-si')
- append(p-hi',p-si',l);
- DNF(UND(p-hi,p-si),f) ->
- /
- DNF(p-hi,p-hi')
- DNF(p-si,p-si')
- Distr(p-hi',p-si',f);
- DNF(NICHT(p-hi),<nil,p-hi.nil>.nil) -> /;
- DNF(f,<f.nil,nil>.nil) -> /;
-
- Distr(x,nil,nil) -> /;
- Distr(<p,n>.nil,<p',n'>.r',r'') ->
- ]berlappung(p,n')
- /
- Distr(<p,n>.nil,r',r'');
- Distr(<p,n>.nil,<p',n'>.r',r'') ->
- ]berlappung(p',n)
- /
- Distr(<p,n>.nil,r',r'');
- Distr(<p,n>.nil,<p',n'>.r',r-neu) ->
- Distr(<p,n>.nil,r',r'')
- append(p,p',p'')
- append(n,n',n'')
- Disjunkte-Vereinigung(<p'',n''>,r'',r-neu)
- /;
- Distr(x.r,l,l'') ->
- /
- Distr(r,l,l')
- Distr(x.nil,l,x')
- append(x',l',l'');
- Distr(nil,x,x) -> /;
-
- "Logik"
-
- ]berpr}fung(f,d) -> Positiv(f,d) / Antwort(f,wahr);
- ]berpr}fung(f,d) ->
- Negativ(f,d)
- /
- Antwort(f,falsch)
- /;
- ]berpr}fung(f,d) ->
- /
- Antwort(f,unbestimmt);
-
- Positiv(f,<p,n>.r) ->
- Ele(f,p)
- /
- Positiv(f,r);
- Positiv(f,nil) ->;
-
- Negativ(f,<p,n>.r) ->
- Ele(f,n)
- /
- Negativ(f,r);
- Negativ(f,nil) ->;
-
- "Hilfspr{dikate"
-
- disjunkt(f.p,n) -> disjunkt(p,n) NEle(f,n);
- disjunkt(nil,n) ->;
-
- ]berlappung(x.r,l) -> Ele(x,l) /;
- ]berlappung(x.r,l) -> ]berlappung(r,l);
-
- append(nil,l,l) ->;
- append(x.l,l',x.e) -> append(l,l',e);
-
- Ele(x,x.r) -> /;
- Ele(x,y.r) -> Ele(x,r);
-
- NEle(x,y.l) -> dif(x,y) NEle(x,l);
- NEle(x,nil) ->;
-
- Neu(<p,n>,<p',n'>.l) ->
- NSub(<p,n>,<p',n'>)
- Neu(<p,n>,l);
- Neu(x,nil) ->;
-
- NSub(<p,n>,<p',n'>) -> NSub(p,p') /;
- NSub(<p,n>,<p',n'>) -> NSub(n,n');
- NSub(x.r,l) -> NEle(x,l) /;
- NSub(x.r,l) -> NSub(r,l);
-
- Disjunkte-Vereinigung(x,l,x.l) -> Neu(x,l) /;
- Disjunkte-Vereinigung(x,l,l) -> /;
-
-
-