author | Christian Urban <urbanc@in.tum.de> |
Thu, 01 Jul 2010 01:53:00 +0100 | |
changeset 2342 | f296ef291ca9 |
parent 2337 | b151399bd2c3 |
child 2346 | 4c5881455923 |
permissions | -rw-r--r-- |
1159
3c6bee89d826
Ported Stefan's permutation code, still needs some localizing.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1 |
theory Perm |
2288
3b83960f9544
new fv/fv_bn function (supp breaks now); exported raw perms and raw funs into separate ML-files
Christian Urban <urbanc@in.tum.de>
parents:
2163
diff
changeset
|
2 |
imports |
3b83960f9544
new fv/fv_bn function (supp breaks now); exported raw perms and raw funs into separate ML-files
Christian Urban <urbanc@in.tum.de>
parents:
2163
diff
changeset
|
3 |
"../Nominal-General/Nominal2_Base" |
2296 | 4 |
"../Nominal-General/Nominal2_Atoms" |
2302 | 5 |
"../Nominal-General/Nominal2_Eqvt" |
6 |
"Nominal2_FSet" |
|
7 |
"Abs" |
|
2305
93ab397f5980
smaller code for raw-eqvt proofs
Christian Urban <urbanc@in.tum.de>
parents:
2302
diff
changeset
|
8 |
uses ("nominal_dt_rawperm.ML") |
2296 | 9 |
("nominal_dt_rawfuns.ML") |
2305
93ab397f5980
smaller code for raw-eqvt proofs
Christian Urban <urbanc@in.tum.de>
parents:
2302
diff
changeset
|
10 |
("nominal_dt_alpha.ML") |
2337
b151399bd2c3
fixed according to changes in quotient
Christian Urban <urbanc@in.tum.de>
parents:
2335
diff
changeset
|
11 |
("nominal_dt_quot.ML") |
1159
3c6bee89d826
Ported Stefan's permutation code, still needs some localizing.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
12 |
begin |
3c6bee89d826
Ported Stefan's permutation code, still needs some localizing.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
13 |
|
2296 | 14 |
use "nominal_dt_rawperm.ML" |
2297 | 15 |
ML {* open Nominal_Dt_RawPerm *} |
2296 | 16 |
|
2297 | 17 |
use "nominal_dt_rawfuns.ML" |
18 |
ML {* open Nominal_Dt_RawFuns *} |
|
2296 | 19 |
|
2297 | 20 |
use "nominal_dt_alpha.ML" |
21 |
ML {* open Nominal_Dt_Alpha *} |
|
2296 | 22 |
|
2337
b151399bd2c3
fixed according to changes in quotient
Christian Urban <urbanc@in.tum.de>
parents:
2335
diff
changeset
|
23 |
use "nominal_dt_quot.ML" |
b151399bd2c3
fixed according to changes in quotient
Christian Urban <urbanc@in.tum.de>
parents:
2335
diff
changeset
|
24 |
ML {* open Nominal_Dt_Quot *} |
b151399bd2c3
fixed according to changes in quotient
Christian Urban <urbanc@in.tum.de>
parents:
2335
diff
changeset
|
25 |
|
b151399bd2c3
fixed according to changes in quotient
Christian Urban <urbanc@in.tum.de>
parents:
2335
diff
changeset
|
26 |
|
1910 | 27 |
(* permutations for quotient types *) |
1899
8e0bfb14f6bf
optimised the code of define_raw_perm
Christian Urban <urbanc@in.tum.de>
parents:
1896
diff
changeset
|
28 |
|
1253 | 29 |
ML {* |
1903 | 30 |
fun quotient_lift_consts_export qtys spec ctxt = |
31 |
let |
|
2335
558c823f96aa
fixed according to changes in quotient
Christian Urban <urbanc@in.tum.de>
parents:
2305
diff
changeset
|
32 |
val (result, ctxt') = fold_map (Quotient_Def.lift_raw_const qtys) spec ctxt; |
558c823f96aa
fixed according to changes in quotient
Christian Urban <urbanc@in.tum.de>
parents:
2305
diff
changeset
|
33 |
val (ts_loc, defs_loc) = split_list (map (fn info => (#qconst info, #def info)) result); |
1903 | 34 |
val morphism = ProofContext.export_morphism ctxt' ctxt; |
35 |
val ts = map (Morphism.term morphism) ts_loc |
|
36 |
val defs = Morphism.fact morphism defs_loc |
|
37 |
in |
|
38 |
(ts, defs, ctxt') |
|
39 |
end |
|
40 |
*} |
|
41 |
||
2337
b151399bd2c3
fixed according to changes in quotient
Christian Urban <urbanc@in.tum.de>
parents:
2335
diff
changeset
|
42 |
|
b151399bd2c3
fixed according to changes in quotient
Christian Urban <urbanc@in.tum.de>
parents:
2335
diff
changeset
|
43 |
|
1903 | 44 |
ML {* |
1683
f78c820f67c3
Automatically lift theorems and constants only using the new quotient types. Requires new Isabelle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1503
diff
changeset
|
45 |
fun define_lifted_perms qtys full_tnames name_term_pairs thms thy = |
1253 | 46 |
let |
47 |
val lthy = |
|
48 |
Theory_Target.instantiation (full_tnames, [], @{sort pt}) thy; |
|
1683
f78c820f67c3
Automatically lift theorems and constants only using the new quotient types. Requires new Isabelle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1503
diff
changeset
|
49 |
val (_, _, lthy') = quotient_lift_consts_export qtys name_term_pairs lthy; |
f78c820f67c3
Automatically lift theorems and constants only using the new quotient types. Requires new Isabelle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1503
diff
changeset
|
50 |
val lifted_thms = map (Quotient_Tacs.lifted qtys lthy') thms; |
1253 | 51 |
fun tac _ = |
52 |
Class.intro_classes_tac [] THEN |
|
53 |
(ALLGOALS (resolve_tac lifted_thms)) |
|
54 |
val lthy'' = Class.prove_instantiation_instance tac lthy' |
|
55 |
in |
|
56 |
Local_Theory.exit_global lthy'' |
|
57 |
end |
|
58 |
*} |
|
59 |
||
1342 | 60 |
|
1899
8e0bfb14f6bf
optimised the code of define_raw_perm
Christian Urban <urbanc@in.tum.de>
parents:
1896
diff
changeset
|
61 |
end |