11 exception FAILURE of string |
11 exception FAILURE of string |
12 end = |
12 end = |
13 struct |
13 struct |
14 |
14 |
15 (* Some certified types *) |
15 (* Some certified types *) |
16 val cbT = ctyp_of (the_context()) HOLogic.boolT; |
16 val cbT = @{ctyp bool}; |
17 val rT = Type("RealDef.real",[]); |
17 val rT = @{typ RealDef.real}; |
18 val crT = ctyp_of (the_context()) (Type("RealDef.real",[])); |
18 val crT = @{ctyp RealDef.real}; |
19 (* Normalization*) |
19 |
|
20 (* Normalization*) |
20 |
21 |
21 |
22 |
22 (* Computation of uset *) |
23 (* Computation of uset *) |
23 fun uset x fm = |
24 fun uset x fm = |
24 case fm of |
25 case fm of |
25 Const("op &",_)$p$q => (uset x p) union (uset x q) |
26 Const("op &",_)$p$q => fold (insert (op =)) (uset x p) (uset x q) |
26 | Const("op |",_)$p$q => (uset x p) union (uset x q) |
27 | Const("op |",_)$p$q => fold (insert (op =)) (uset x p) (uset x q) |
27 | Const(@{const_name Orderings.less},_)$s$t => if s=x then [t] |
28 | Const(@{const_name Orderings.less},_)$s$t => if s=x then [t] |
28 else if t = x then [s] |
29 else if t = x then [s] |
29 else [] |
30 else [] |
30 | Const(@{const_name Orderings.less_eq},_)$s$t => if s=x then [t] |
31 | Const(@{const_name Orderings.less_eq},_)$s$t => if s=x then [t] |
31 else if t = x then [s] |
32 else if t = x then [s] |
33 | Const("op =",_)$s$t => if s=x then [t] |
34 | Const("op =",_)$s$t => if s=x then [t] |
34 else [] |
35 else [] |
35 | Const("Not",_)$ (Const("op =",_)$s$t) => if s=x then [t] |
36 | Const("Not",_)$ (Const("op =",_)$s$t) => if s=x then [t] |
36 else [] |
37 else [] |
37 | _ => []; |
38 | _ => []; |
38 val rsT = Type("set",[rT]); |
39 |
39 fun holrealset [] = Const("{}",rsT) |
40 val rsT = @{typ "RealDef.real set"}; |
40 | holrealset (x::xs) = Const("insert",[rT,rsT] ---> rsT)$x$(holrealset xs); |
41 |
|
42 fun holrealset [] = @{term "{} :: RealDef.real set"} |
|
43 | holrealset (x::xs) = @{term "insert :: RealDef.real => RealDef.real set => RealDef.real set"} |
|
44 $ x $ holrealset xs; |
41 fun prove_bysimp thy ss t = Goal.prove (ProofContext.init thy) [] [] |
45 fun prove_bysimp thy ss t = Goal.prove (ProofContext.init thy) [] [] |
42 (HOLogic.mk_Trueprop t) (fn _ => simp_tac ss 1); |
46 (HOLogic.mk_Trueprop t) (fn _ => simp_tac ss 1); |
43 |
47 |
44 fun inusetthms sg x fm = |
48 fun inusetthms sg x fm = |
45 let val U = uset x fm |
49 let val U = uset x fm |