type form =
PAtom of (pred*(var list))
| NAtom of (pred*(var list))
| FConj of form * form
| FDisj of form * form
| FAll of form
| FEx of form
;;
let rec preSuc t = match t with
[] -> []
| (a::list) -> (match a with0 -> preSuc list | sucn -> (sucn-1::preSuc list));;
let rec fv t = match t with
PAtom (p,vs) -> vs
| NAtom (p,vs) -> vs
| FConj (f,g) -> (fv f)@(fv g)
| FDisj (f,g) -> (fv f)@(fv g)
| FAll f -> preSuc (fv f)
| FEx f -> preSuc (fv f);;
let suc x = x+1;;
let bump phi y = match y with0 -> 0 | sucn -> suc (phi (sucn-1));;
let rec subst r f = match f with
PAtom (p,vs) -> PAtom (p,map r vs)
| NAtom (p,vs) -> NAtom (p,map r vs)
| FConj (f,g) -> FConj (subst r f, subst r g)
| FDisj (f,g) -> FDisj (subst r f, subst r g)
| FAll f -> FAll (subst (bump r) f)
| FEx f -> FEx (subst (bump r) f);;
let finst body w = subst (fun v -> match v with0 -> w | sucn -> (sucn-1)) body;;
let s_of_ns ns = map snd ns;;
let sfv s = flatten (map fv s);;
let rec maxvar t = match t with
[] -> 0
| (a::list) -> max a (maxvar list);;
let newvar vs = suc (maxvar vs);;
let subs t = match t with
[] -> [[]]
| (x::xs) -> let (m,f) = x in match f with
PAtom (p,vs) -> if mem (NAtom (p,vs)) (map snd xs) then [] else [xs@[(0,PAtom (p,vs))]]
| NAtom (p,vs) -> if mem (PAtom (p,vs)) (map snd xs) then [] else [xs@[(0,NAtom (p,vs))]]
| FConj (f,g) -> [xs@[(0,f)];xs@[(0,g)]]
| FDisj (f,g) -> [xs@[(0,f);(0,g)]]
| FAll f -> [xs@[(0,finst f (newvar (sfv (s_of_ns (x::xs)))))]]
| FEx f -> [xs@[(0,finst f m);(suc m,FEx f)]];;
let rec prove' l = (if l = [] then true else prove' ((fun x -> flatten (map subs x)) l));;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.