equal
deleted
inserted
replaced
1964 setup {* |
1964 setup {* |
1965 Value.add_evaluator ("SML", Codegen.eval_term o ProofContext.theory_of) |
1965 Value.add_evaluator ("SML", Codegen.eval_term o ProofContext.theory_of) |
1966 *} |
1966 *} |
1967 |
1967 |
1968 ML {* |
1968 ML {* |
1969 structure Eval_Method = |
1969 structure Eval_Method = Proof_Data( |
1970 struct |
1970 type T = unit -> bool |
1971 |
1971 fun init thy () = error "Eval_Method" |
1972 val eval_ref : (unit -> bool) option Unsynchronized.ref = Unsynchronized.ref NONE; |
1972 ) |
1973 |
|
1974 end; |
|
1975 *} |
1973 *} |
1976 |
1974 |
1977 oracle eval_oracle = {* fn ct => |
1975 oracle eval_oracle = {* fn ct => |
1978 let |
1976 let |
1979 val thy = Thm.theory_of_cterm ct; |
1977 val thy = Thm.theory_of_cterm ct; |
1980 val t = Thm.term_of ct; |
1978 val t = Thm.term_of ct; |
1981 val dummy = @{cprop True}; |
1979 val dummy = @{cprop True}; |
1982 in case try HOLogic.dest_Trueprop t |
1980 in case try HOLogic.dest_Trueprop t |
1983 of SOME t' => if Code_Eval.eval NONE |
1981 of SOME t' => if Code_Eval.eval NONE |
1984 ("Eval_Method.eval_ref", Eval_Method.eval_ref) (K I) thy t' [] |
1982 (Eval_Method.get, Eval_Method.put, "Eval_Method.put") (K I) thy t' [] |
1985 then Thm.capply (Thm.capply @{cterm "op \<equiv> \<Colon> prop \<Rightarrow> prop \<Rightarrow> prop"} ct) dummy |
1983 then Thm.capply (Thm.capply @{cterm "op \<equiv> \<Colon> prop \<Rightarrow> prop \<Rightarrow> prop"} ct) dummy |
1986 else dummy |
1984 else dummy |
1987 | NONE => dummy |
1985 | NONE => dummy |
1988 end |
1986 end |
1989 *} |
1987 *} |