src/HOL/Prolog/Type.ML
author oheimb
Wed Jan 31 10:15:55 2001 +0100 (2001-01-31)
changeset 11008 f7333f055ef6
parent 9015 8006e9009621
child 11701 3d51fbf81c17
permissions -rw-r--r--
improved theory reference in comment
oheimb@9015
     1
val prog_Type = prog_Func @ [good_typeof,common_typeof];
oheimb@9015
     2
fun pgoal s = (case Goal s of _ => by(prolog_tac prog_Type));
oheimb@9015
     3
val p = ptac prog_Type 1;
oheimb@9015
     4
oheimb@9015
     5
pgoal "typeof (abs(%n. abs(%m. abs(%p. p and (n eq m))))) ?T";
oheimb@9015
     6
oheimb@9015
     7
pgoal "typeof (fix (%x. x)) ?T";
oheimb@9015
     8
oheimb@9015
     9
pgoal "typeof (fix (%fact. abs(%n. (app fact (n-0))))) ?T";
oheimb@9015
    10
oheimb@9015
    11
pgoal "typeof (fix (%fact. abs(%n. cond (n eq 0) (S 0) \
oheimb@9015
    12
				\(n * (app fact (n - (S 0))))))) ?T";
oheimb@9015
    13
oheimb@9015
    14
pgoal "typeof (abs(%v. 0)) ?T"; (*correct only solution (?A1 -> nat) *)
oheimb@9015
    15
Goal "typeof (abs(%v. 0)) ?T";
oheimb@9015
    16
by (prolog_tac [bad1_typeof,common_typeof]); (* 1st result ok*)
oheimb@9015
    17
back(); (* 2nd result (?A1 -> ?A1) wrong *)
oheimb@9015
    18
oheimb@9015
    19
(*pgoal "typeof (abs(%v. abs(%v. app v v))) ?T"; correctly fails*)
oheimb@9015
    20
Goal "typeof (abs(%v. abs(%v. app v v))) ?T";
oheimb@9015
    21
by (prolog_tac [bad2_typeof,common_typeof]); 
oheimb@9015
    22
	(* wrong result ((?A3 -> ?B3) -> ?A3 -> ?B3)*)