author | Cezary Kaliszyk <kaliszyk@in.tum.de> |
Wed, 21 Apr 2010 10:13:17 +0200 | |
changeset 1914 | c50601bc617e |
parent 1873 | a08eaea622d1 |
child 1916 | c8b31085cb5b |
permissions | -rw-r--r-- |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1 |
theory FSet3 |
1914
c50601bc617e
Remove the part already in FSet and leave the experiments
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1873
diff
changeset
|
2 |
imports "../../../Nominal/FSet" |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
3 |
begin |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
4 |
|
1914
c50601bc617e
Remove the part already in FSet and leave the experiments
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1873
diff
changeset
|
5 |
notation |
c50601bc617e
Remove the part already in FSet and leave the experiments
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1873
diff
changeset
|
6 |
list_eq (infix "\<approx>" 50) |
768
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
7 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
8 |
lemma fset_exhaust[case_names fempty finsert, cases type: fset]: |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
9 |
shows "\<lbrakk>S = {||} \<Longrightarrow> P; \<And>x S'. S = finsert x S' \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
10 |
by (lifting list.exhaust) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
11 |
|
793
09dff5ef8f74
as expected problems occure when lifting concat lemmas
Christian Urban <urbanc@in.tum.de>
parents:
787
diff
changeset
|
12 |
(* PROBLEM: these lemmas needs to be restated, since *) |
09dff5ef8f74
as expected problems occure when lifting concat lemmas
Christian Urban <urbanc@in.tum.de>
parents:
787
diff
changeset
|
13 |
(* concat.simps(1) and concat.simps(2) contain the *) |
09dff5ef8f74
as expected problems occure when lifting concat lemmas
Christian Urban <urbanc@in.tum.de>
parents:
787
diff
changeset
|
14 |
(* type variables ?'a1.0 (which are turned into frees *) |
09dff5ef8f74
as expected problems occure when lifting concat lemmas
Christian Urban <urbanc@in.tum.de>
parents:
787
diff
changeset
|
15 |
(* 'a_1 *) |
1914
c50601bc617e
Remove the part already in FSet and leave the experiments
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1873
diff
changeset
|
16 |
|
830
89d772dae4d4
New_relations, all works again including concat examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
827
diff
changeset
|
17 |
lemma concat1: |
797
35436401f00d
added a functor that allows checking what is added to the theorem lists
Christian Urban <urbanc@in.tum.de>
parents:
796
diff
changeset
|
18 |
shows "concat [] \<approx> []" |
1914
c50601bc617e
Remove the part already in FSet and leave the experiments
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1873
diff
changeset
|
19 |
by (simp) |
793
09dff5ef8f74
as expected problems occure when lifting concat lemmas
Christian Urban <urbanc@in.tum.de>
parents:
787
diff
changeset
|
20 |
|
830
89d772dae4d4
New_relations, all works again including concat examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
827
diff
changeset
|
21 |
lemma concat2: |
89d772dae4d4
New_relations, all works again including concat examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
827
diff
changeset
|
22 |
shows "concat (x # xs) \<approx> x @ concat xs" |
1850 | 23 |
by (simp) |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
24 |
|
1873 | 25 |
lemma concat_rsp: |
26 |
"\<lbrakk>list_rel op \<approx> x x'; x' \<approx> y'; list_rel op \<approx> y' y\<rbrakk> \<Longrightarrow> concat x \<approx> concat y" |
|
27 |
apply (induct x y arbitrary: x' y' rule: list_induct2') |
|
28 |
apply simp |
|
29 |
defer defer |
|
30 |
apply (simp only: concat.simps) |
|
31 |
sorry |
|
32 |
||
33 |
lemma [quot_respect]: |
|
851
e1473b4b2886
Change OO to OOO in FSet3.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
833
diff
changeset
|
34 |
shows "(list_rel op \<approx> OOO op \<approx> ===> op \<approx>) concat concat" |
1873 | 35 |
apply (simp only: fun_rel_def) |
36 |
apply clarify |
|
37 |
apply (rule concat_rsp) |
|
38 |
apply assumption+ |
|
39 |
done |
|
814 | 40 |
|
851
e1473b4b2886
Change OO to OOO in FSet3.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
833
diff
changeset
|
41 |
lemma nil_rsp2[quot_respect]: "(list_rel op \<approx> OOO op \<approx>) [] []" |
1914
c50601bc617e
Remove the part already in FSet and leave the experiments
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1873
diff
changeset
|
42 |
by (metis nil_rsp list_rel.simps(1) pred_compI) |
814 | 43 |
|
824 | 44 |
lemma set_in_eq: "(\<forall>e. ((e \<in> A) \<longleftrightarrow> (e \<in> B))) \<equiv> A = B" |
45 |
apply (rule eq_reflection) |
|
46 |
apply auto |
|
47 |
done |
|
48 |
||
49 |
lemma map_rel_cong: "b \<approx> ba \<Longrightarrow> map f b \<approx> map f ba" |
|
50 |
unfolding list_eq.simps |
|
51 |
apply(simp only: set_map set_in_eq) |
|
52 |
done |
|
53 |
||
54 |
lemma quotient_compose_list_pre: |
|
851
e1473b4b2886
Change OO to OOO in FSet3.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
833
diff
changeset
|
55 |
"(list_rel op \<approx> OOO op \<approx>) r s = |
e1473b4b2886
Change OO to OOO in FSet3.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
833
diff
changeset
|
56 |
((list_rel op \<approx> OOO op \<approx>) r r \<and> (list_rel op \<approx> OOO op \<approx>) s s \<and> |
824 | 57 |
abs_fset (map abs_fset r) = abs_fset (map abs_fset s))" |
58 |
apply rule |
|
59 |
apply rule |
|
60 |
apply rule |
|
61 |
apply (rule list_rel_refl) |
|
62 |
apply (metis equivp_def fset_equivp) |
|
63 |
apply rule |
|
64 |
apply (rule equivp_reflp[OF fset_equivp]) |
|
65 |
apply (rule list_rel_refl) |
|
66 |
apply (metis equivp_def fset_equivp) |
|
67 |
apply(rule) |
|
68 |
apply rule |
|
69 |
apply (rule list_rel_refl) |
|
70 |
apply (metis equivp_def fset_equivp) |
|
71 |
apply rule |
|
72 |
apply (rule equivp_reflp[OF fset_equivp]) |
|
73 |
apply (rule list_rel_refl) |
|
74 |
apply (metis equivp_def fset_equivp) |
|
75 |
apply (subgoal_tac "map abs_fset r \<approx> map abs_fset s") |
|
76 |
apply (metis Quotient_rel[OF Quotient_fset]) |
|
77 |
apply (auto simp only:)[1] |
|
78 |
apply (subgoal_tac "map abs_fset r = map abs_fset b") |
|
79 |
prefer 2 |
|
80 |
apply (metis Quotient_rel[OF list_quotient[OF Quotient_fset]]) |
|
81 |
apply (subgoal_tac "map abs_fset s = map abs_fset ba") |
|
82 |
prefer 2 |
|
83 |
apply (metis Quotient_rel[OF list_quotient[OF Quotient_fset]]) |
|
84 |
apply (simp only: map_rel_cong) |
|
85 |
apply rule |
|
86 |
apply (rule rep_abs_rsp[of "list_rel op \<approx>" "map abs_fset"]) |
|
87 |
apply (tactic {* Quotient_Tacs.quotient_tac @{context} 1 *}) |
|
88 |
apply (rule list_rel_refl) |
|
89 |
apply (metis equivp_def fset_equivp) |
|
90 |
apply rule |
|
91 |
prefer 2 |
|
92 |
apply (rule rep_abs_rsp_left[of "list_rel op \<approx>" "map abs_fset"]) |
|
93 |
apply (tactic {* Quotient_Tacs.quotient_tac @{context} 1 *}) |
|
94 |
apply (rule list_rel_refl) |
|
95 |
apply (metis equivp_def fset_equivp) |
|
96 |
apply (erule conjE)+ |
|
97 |
apply (subgoal_tac "map abs_fset r \<approx> map abs_fset s") |
|
98 |
prefer 2 |
|
99 |
apply (metis Quotient_def Quotient_fset equivp_reflp fset_equivp) |
|
100 |
apply (rule map_rel_cong) |
|
101 |
apply (assumption) |
|
102 |
done |
|
103 |
||
104 |
lemma quotient_compose_list[quot_thm]: |
|
851
e1473b4b2886
Change OO to OOO in FSet3.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
833
diff
changeset
|
105 |
shows "Quotient ((list_rel op \<approx>) OOO (op \<approx>)) |
e1473b4b2886
Change OO to OOO in FSet3.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
833
diff
changeset
|
106 |
(abs_fset \<circ> (map abs_fset)) ((map rep_fset) \<circ> rep_fset)" |
824 | 107 |
unfolding Quotient_def comp_def |
108 |
apply (rule)+ |
|
109 |
apply (simp add: abs_o_rep[OF Quotient_fset] id_simps Quotient_abs_rep[OF Quotient_fset]) |
|
110 |
apply (rule) |
|
111 |
apply (rule) |
|
112 |
apply (rule) |
|
113 |
apply (rule list_rel_refl) |
|
114 |
apply (metis equivp_def fset_equivp) |
|
115 |
apply (rule) |
|
116 |
apply (rule equivp_reflp[OF fset_equivp]) |
|
117 |
apply (rule list_rel_refl) |
|
118 |
apply (metis equivp_def fset_equivp) |
|
119 |
apply rule |
|
120 |
apply rule |
|
1850 | 121 |
apply (rule quotient_compose_list_pre) |
824 | 122 |
done |
123 |
||
793
09dff5ef8f74
as expected problems occure when lifting concat lemmas
Christian Urban <urbanc@in.tum.de>
parents:
787
diff
changeset
|
124 |
lemma fconcat_empty: |
09dff5ef8f74
as expected problems occure when lifting concat lemmas
Christian Urban <urbanc@in.tum.de>
parents:
787
diff
changeset
|
125 |
shows "fconcat {||} = {||}" |
1850 | 126 |
apply(lifting concat1) |
127 |
apply(cleaning) |
|
1914
c50601bc617e
Remove the part already in FSet and leave the experiments
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1873
diff
changeset
|
128 |
apply(simp add: comp_def bot_fset_def) |
1850 | 129 |
done |
793
09dff5ef8f74
as expected problems occure when lifting concat lemmas
Christian Urban <urbanc@in.tum.de>
parents:
787
diff
changeset
|
130 |
|
830
89d772dae4d4
New_relations, all works again including concat examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
827
diff
changeset
|
131 |
lemma insert_rsp2[quot_respect]: |
851
e1473b4b2886
Change OO to OOO in FSet3.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
833
diff
changeset
|
132 |
"(op \<approx> ===> list_rel op \<approx> OOO op \<approx> ===> list_rel op \<approx> OOO op \<approx>) op # op #" |
1850 | 133 |
apply auto |
134 |
apply (simp add: set_in_eq) |
|
135 |
apply (rule_tac b="x # b" in pred_compI) |
|
136 |
apply auto |
|
137 |
apply (rule_tac b="x # ba" in pred_compI) |
|
1914
c50601bc617e
Remove the part already in FSet and leave the experiments
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1873
diff
changeset
|
138 |
apply auto |
1850 | 139 |
done |
830
89d772dae4d4
New_relations, all works again including concat examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
827
diff
changeset
|
140 |
|
89d772dae4d4
New_relations, all works again including concat examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
827
diff
changeset
|
141 |
lemma append_rsp[quot_respect]: |
89d772dae4d4
New_relations, all works again including concat examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
827
diff
changeset
|
142 |
"(op \<approx> ===> op \<approx> ===> op \<approx>) op @ op @" |
89d772dae4d4
New_relations, all works again including concat examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
827
diff
changeset
|
143 |
by (auto) |
89d772dae4d4
New_relations, all works again including concat examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
827
diff
changeset
|
144 |
|
793
09dff5ef8f74
as expected problems occure when lifting concat lemmas
Christian Urban <urbanc@in.tum.de>
parents:
787
diff
changeset
|
145 |
lemma fconcat_insert: |
09dff5ef8f74
as expected problems occure when lifting concat lemmas
Christian Urban <urbanc@in.tum.de>
parents:
787
diff
changeset
|
146 |
shows "fconcat (finsert x S) = x |\<union>| fconcat S" |
1850 | 147 |
apply(lifting concat2) |
148 |
apply(cleaning) |
|
149 |
apply (simp add: finsert_def fconcat_def comp_def) |
|
150 |
apply cleaning |
|
151 |
done |
|
768
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
152 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
153 |
text {* raw section *} |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
154 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
155 |
lemma map_rsp_aux: |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
156 |
assumes a: "a \<approx> b" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
157 |
shows "map f a \<approx> map f b" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
158 |
using a |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
159 |
apply(induct a arbitrary: b) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
160 |
apply(auto) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
161 |
apply(metis rev_image_eqI) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
162 |
done |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
163 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
164 |
lemma map_rsp[quot_respect]: |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
165 |
shows "(op = ===> op \<approx> ===> op \<approx>) map map" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
166 |
by (auto simp add: map_rsp_aux) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
167 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
168 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
169 |
text {* lifted section *} |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
170 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
171 |
(* TBD *) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
172 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
173 |
text {* syntax for fset comprehensions (adapted from lists) *} |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
174 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
175 |
nonterminals fsc_qual fsc_quals |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
176 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
177 |
syntax |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
178 |
"_fsetcompr" :: "'a \<Rightarrow> fsc_qual \<Rightarrow> fsc_quals \<Rightarrow> 'a fset" ("{|_ . __") |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
179 |
"_fsc_gen" :: "'a \<Rightarrow> 'a fset \<Rightarrow> fsc_qual" ("_ <- _") |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
180 |
"_fsc_test" :: "bool \<Rightarrow> fsc_qual" ("_") |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
181 |
"_fsc_end" :: "fsc_quals" ("|}") |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
182 |
"_fsc_quals" :: "fsc_qual \<Rightarrow> fsc_quals \<Rightarrow> fsc_quals" (", __") |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
183 |
"_fsc_abs" :: "'a => 'b fset => 'b fset" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
184 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
185 |
syntax (xsymbols) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
186 |
"_fsc_gen" :: "'a \<Rightarrow> 'a fset \<Rightarrow> fsc_qual" ("_ \<leftarrow> _") |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
187 |
syntax (HTML output) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
188 |
"_fsc_gen" :: "'a \<Rightarrow> 'a fset \<Rightarrow> fsc_qual" ("_ \<leftarrow> _") |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
189 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
190 |
parse_translation (advanced) {* |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
191 |
let |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
192 |
val femptyC = Syntax.const @{const_name fempty}; |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
193 |
val finsertC = Syntax.const @{const_name finsert}; |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
194 |
val fmapC = Syntax.const @{const_name fmap}; |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
195 |
val fconcatC = Syntax.const @{const_name fconcat}; |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
196 |
val IfC = Syntax.const @{const_name If}; |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
197 |
fun fsingl x = finsertC $ x $ femptyC; |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
198 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
199 |
fun pat_tr ctxt p e opti = (* %x. case x of p => e | _ => [] *) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
200 |
let |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
201 |
val x = Free (Name.variant (fold Term.add_free_names [p, e] []) "x", dummyT); |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
202 |
val e = if opti then fsingl e else e; |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
203 |
val case1 = Syntax.const "_case1" $ p $ e; |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
204 |
val case2 = Syntax.const "_case1" $ Syntax.const Term.dummy_patternN |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
205 |
$ femptyC; |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
206 |
val cs = Syntax.const "_case2" $ case1 $ case2 |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
207 |
val ft = Datatype_Case.case_tr false Datatype.info_of_constr |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
208 |
ctxt [x, cs] |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
209 |
in lambda x ft end; |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
210 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
211 |
fun abs_tr ctxt (p as Free(s,T)) e opti = |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
212 |
let val thy = ProofContext.theory_of ctxt; |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
213 |
val s' = Sign.intern_const thy s |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
214 |
in if Sign.declared_const thy s' |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
215 |
then (pat_tr ctxt p e opti, false) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
216 |
else (lambda p e, true) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
217 |
end |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
218 |
| abs_tr ctxt p e opti = (pat_tr ctxt p e opti, false); |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
219 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
220 |
fun fsc_tr ctxt [e, Const("_fsc_test",_) $ b, qs] = |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
221 |
let |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
222 |
val res = case qs of |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
223 |
Const("_fsc_end",_) => fsingl e |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
224 |
| Const("_fsc_quals",_)$ q $ qs => fsc_tr ctxt [e, q, qs]; |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
225 |
in |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
226 |
IfC $ b $ res $ femptyC |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
227 |
end |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
228 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
229 |
| fsc_tr ctxt [e, Const("_fsc_gen",_) $ p $ es, Const("_fsc_end",_)] = |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
230 |
(case abs_tr ctxt p e true of |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
231 |
(f,true) => fmapC $ f $ es |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
232 |
| (f, false) => fconcatC $ (fmapC $ f $ es)) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
233 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
234 |
| fsc_tr ctxt [e, Const("_fsc_gen",_) $ p $ es, Const("_fsc_quals",_) $ q $ qs] = |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
235 |
let |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
236 |
val e' = fsc_tr ctxt [e, q, qs]; |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
237 |
in |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
238 |
fconcatC $ (fmapC $ (fst (abs_tr ctxt p e' false)) $ es) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
239 |
end |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
240 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
241 |
in [("_fsetcompr", fsc_tr)] end |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
242 |
*} |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
243 |
|
1260
9df6144e281b
moved Quot package to Attic (still compiles there with "isabelle make")
Christian Urban <urbanc@in.tum.de>
parents:
1144
diff
changeset
|
244 |
|
9df6144e281b
moved Quot package to Attic (still compiles there with "isabelle make")
Christian Urban <urbanc@in.tum.de>
parents:
1144
diff
changeset
|
245 |
(* NEEDS FIXING *) |
768
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
246 |
(* examles *) |
1260
9df6144e281b
moved Quot package to Attic (still compiles there with "isabelle make")
Christian Urban <urbanc@in.tum.de>
parents:
1144
diff
changeset
|
247 |
(* |
768
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
248 |
term "{|(x,y,z). b|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
249 |
term "{|x. x \<leftarrow> xs|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
250 |
term "{|(x,y,z). x\<leftarrow>xs|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
251 |
term "{|e x y. x\<leftarrow>xs, y\<leftarrow>ys|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
252 |
term "{|(x,y,z). x<a, x>b|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
253 |
term "{|(x,y,z). x\<leftarrow>xs, x>b|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
254 |
term "{|(x,y,z). x<a, x\<leftarrow>xs|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
255 |
term "{|(x,y). Cons True x \<leftarrow> xs|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
256 |
term "{|(x,y,z). Cons x [] \<leftarrow> xs|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
257 |
term "{|(x,y,z). x<a, x>b, x=d|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
258 |
term "{|(x,y,z). x<a, x>b, y\<leftarrow>ys|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
259 |
term "{|(x,y,z). x<a, x\<leftarrow>xs,y>b|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
260 |
term "{|(x,y,z). x<a, x\<leftarrow>xs, y\<leftarrow>ys|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
261 |
term "{|(x,y,z). x\<leftarrow>xs, x>b, y<a|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
262 |
term "{|(x,y,z). x\<leftarrow>xs, x>b, y\<leftarrow>ys|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
263 |
term "{|(x,y,z). x\<leftarrow>xs, y\<leftarrow>ys,y>x|}" |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
264 |
term "{|(x,y,z). x\<leftarrow>xs, y\<leftarrow>ys,z\<leftarrow>zs|}" |
1260
9df6144e281b
moved Quot package to Attic (still compiles there with "isabelle make")
Christian Urban <urbanc@in.tum.de>
parents:
1144
diff
changeset
|
265 |
*) |
768
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
266 |
|
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
267 |
(* BELOW CONSTRUCTION SITE *) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
268 |
|
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
269 |
|
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
270 |
lemma no_mem_nil: |
729 | 271 |
"(\<forall>a. a \<notin> set A) = (A = [])" |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
272 |
by (induct A) (auto) |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
273 |
|
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
274 |
lemma none_mem_nil: |
729 | 275 |
"(\<forall>a. a \<notin> set A) = (A \<approx> [])" |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
276 |
by simp |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
277 |
|
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
278 |
lemma mem_cons: |
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
279 |
"a \<in> set A \<Longrightarrow> a # A \<approx> A" |
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
280 |
by auto |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
281 |
|
830
89d772dae4d4
New_relations, all works again including concat examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
827
diff
changeset
|
282 |
lemma cons_left_comm: |
89d772dae4d4
New_relations, all works again including concat examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
827
diff
changeset
|
283 |
"x # y # A \<approx> y # x # A" |
89d772dae4d4
New_relations, all works again including concat examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
827
diff
changeset
|
284 |
by (auto simp add: id_simps) |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
285 |
|
830
89d772dae4d4
New_relations, all works again including concat examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
827
diff
changeset
|
286 |
lemma cons_left_idem: |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
287 |
"x # x # A \<approx> x # A" |
830
89d772dae4d4
New_relations, all works again including concat examples.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
827
diff
changeset
|
288 |
by (auto simp add: id_simps) |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
289 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
290 |
lemma finite_set_raw_strong_cases: |
727
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
291 |
"(X = []) \<or> (\<exists>a Y. ((a \<notin> set Y) \<and> (X \<approx> a # Y)))" |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
292 |
apply (induct X) |
727
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
293 |
apply (simp) |
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
294 |
apply (rule disjI2) |
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
295 |
apply (erule disjE) |
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
296 |
apply (rule_tac x="a" in exI) |
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
297 |
apply (rule_tac x="[]" in exI) |
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
298 |
apply (simp) |
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
299 |
apply (erule exE)+ |
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
300 |
apply (case_tac "a = aa") |
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
301 |
apply (rule_tac x="a" in exI) |
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
302 |
apply (rule_tac x="Y" in exI) |
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
303 |
apply (simp) |
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
304 |
apply (rule_tac x="aa" in exI) |
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
305 |
apply (rule_tac x="a # Y" in exI) |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
306 |
apply (auto) |
727
2cfe6f3d6352
Proof of finite_set_storng_cases_raw.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
726
diff
changeset
|
307 |
done |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
308 |
|
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
309 |
fun |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
310 |
delete_raw :: "'a list \<Rightarrow> 'a \<Rightarrow> 'a list" |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
311 |
where |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
312 |
"delete_raw [] x = []" |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
313 |
| "delete_raw (a # A) x = (if (a = x) then delete_raw A x else a # (delete_raw A x))" |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
314 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
315 |
lemma mem_delete_raw: |
728 | 316 |
"x \<in> set (delete_raw A a) = (x \<in> set A \<and> \<not>(x = a))" |
726
1a777307f57f
A bracket was missing; with it proved the 'definitely false' lemma.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
724
diff
changeset
|
317 |
by (induct A arbitrary: x a) (auto) |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
318 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
319 |
lemma mem_delete_raw_ident: |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
320 |
"\<not>(a \<in> set (delete_raw A a))" |
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
321 |
by (induct A) (auto) |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
322 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
323 |
lemma not_mem_delete_raw_ident: |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
324 |
"b \<notin> set A \<Longrightarrow> (delete_raw A b = A)" |
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
325 |
by (induct A) (auto) |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
326 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
327 |
lemma delete_raw_RSP: |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
328 |
"A \<approx> B \<Longrightarrow> delete_raw A a \<approx> delete_raw B a" |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
329 |
apply(induct A arbitrary: B a) |
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
330 |
apply(auto) |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
331 |
sorry |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
332 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
333 |
lemma cons_delete_raw: |
728 | 334 |
"a # (delete_raw A a) \<approx> (if a \<in> set A then A else (a # A))" |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
335 |
sorry |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
336 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
337 |
lemma mem_cons_delete_raw: |
726
1a777307f57f
A bracket was missing; with it proved the 'definitely false' lemma.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
724
diff
changeset
|
338 |
"a \<in> set A \<Longrightarrow> a # (delete_raw A a) \<approx> A" |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
339 |
sorry |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
340 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
341 |
lemma finite_set_raw_delete_raw_cases: |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
342 |
"X = [] \<or> (\<exists>a. a mem X \<and> X \<approx> a # delete_raw X a)" |
726
1a777307f57f
A bracket was missing; with it proved the 'definitely false' lemma.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
724
diff
changeset
|
343 |
by (induct X) (auto) |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
344 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
345 |
|
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
346 |
|
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
347 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
348 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
349 |
lemma list2set_thm: |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
350 |
shows "set [] = {}" |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
351 |
and "set (h # t) = insert h (set t)" |
728 | 352 |
by (auto) |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
353 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
354 |
lemma list2set_RSP: |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
355 |
"A \<approx> B \<Longrightarrow> set A = set B" |
728 | 356 |
by auto |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
357 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
358 |
definition |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
359 |
rsp_fold |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
360 |
where |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
361 |
"rsp_fold f = (\<forall>u v w. (f u (f v w) = f v (f u w)))" |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
362 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
363 |
primrec |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
364 |
fold_raw :: "('a \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'b \<Rightarrow> 'a list \<Rightarrow> 'b" |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
365 |
where |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
366 |
"fold_raw f z [] = z" |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
367 |
| "fold_raw f z (a # A) = |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
368 |
(if (rsp_fold f) then |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
369 |
if a mem A then fold_raw f z A |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
370 |
else f a (fold_raw f z A) |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
371 |
else z)" |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
372 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
373 |
lemma mem_lcommuting_fold_raw: |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
374 |
"rsp_fold f \<Longrightarrow> h mem B \<Longrightarrow> fold_raw f z B = f h (fold_raw f z (delete_raw B h))" |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
375 |
sorry |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
376 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
377 |
lemma fold_rsp[quot_respect]: |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
378 |
"(op = ===> op = ===> op \<approx> ===> op =) fold_raw fold_raw" |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
379 |
apply(auto) |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
380 |
sorry |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
381 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
382 |
primrec |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
383 |
inter_raw |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
384 |
where |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
385 |
"inter_raw [] B = []" |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
386 |
| "inter_raw (a # A) B = (if a mem B then a # inter_raw A B else inter_raw A B)" |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
387 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
388 |
lemma mem_inter_raw: |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
389 |
"x mem (inter_raw A B) = x mem A \<and> x mem B" |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
390 |
sorry |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
391 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
392 |
lemma inter_raw_RSP: |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
393 |
"A1 \<approx> A2 \<and> B1 \<approx> B2 \<Longrightarrow> (inter_raw A1 B1) \<approx> (inter_raw A2 B2)" |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
394 |
sorry |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
395 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
396 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
397 |
(* LIFTING DEFS *) |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
398 |
|
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
399 |
|
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
400 |
section {* Constants on the Quotient Type *} |
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
401 |
|
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
402 |
|
767
37285ec4387d
on suggestion of Tobias renamed "quotient_def" to "quotient_definition"; needs new keyword file
Christian Urban <urbanc@in.tum.de>
parents:
766
diff
changeset
|
403 |
quotient_definition |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
404 |
"fdelete :: 'a fset \<Rightarrow> 'a \<Rightarrow> 'a fset" |
1139
c4001cda9da3
renamed 'as' to 'is' everywhere.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1128
diff
changeset
|
405 |
is "delete_raw" |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
406 |
|
767
37285ec4387d
on suggestion of Tobias renamed "quotient_def" to "quotient_definition"; needs new keyword file
Christian Urban <urbanc@in.tum.de>
parents:
766
diff
changeset
|
407 |
quotient_definition |
1144
538daee762e6
Added a binding to the parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1141
diff
changeset
|
408 |
finter ("_ \<inter>f _" [70, 71] 70) |
538daee762e6
Added a binding to the parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1141
diff
changeset
|
409 |
where |
538daee762e6
Added a binding to the parser.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1141
diff
changeset
|
410 |
"finter :: 'a fset \<Rightarrow> 'a fset \<Rightarrow> 'a fset" |
1139
c4001cda9da3
renamed 'as' to 'is' everywhere.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1128
diff
changeset
|
411 |
is "inter_raw" |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
412 |
|
767
37285ec4387d
on suggestion of Tobias renamed "quotient_def" to "quotient_definition"; needs new keyword file
Christian Urban <urbanc@in.tum.de>
parents:
766
diff
changeset
|
413 |
quotient_definition |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
414 |
"ffold :: ('a \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'b \<Rightarrow> 'a fset \<Rightarrow> 'b" |
1139
c4001cda9da3
renamed 'as' to 'is' everywhere.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1128
diff
changeset
|
415 |
is "fold_raw" |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
416 |
|
767
37285ec4387d
on suggestion of Tobias renamed "quotient_def" to "quotient_definition"; needs new keyword file
Christian Urban <urbanc@in.tum.de>
parents:
766
diff
changeset
|
417 |
quotient_definition |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
418 |
"fset_to_set :: 'a fset \<Rightarrow> 'a set" |
1139
c4001cda9da3
renamed 'as' to 'is' everywhere.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1128
diff
changeset
|
419 |
is "set" |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
420 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
421 |
|
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
422 |
section {* Lifted Theorems *} |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
423 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
424 |
thm list.cases (* ??? *) |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
425 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
426 |
thm cons_left_comm |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
427 |
lemma "finsert a (finsert b S) = finsert b (finsert a S)" |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
428 |
by (lifting cons_left_comm) |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
429 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
430 |
thm cons_left_idem |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
431 |
lemma "finsert a (finsert a S) = finsert a S" |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
432 |
by (lifting cons_left_idem) |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
433 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
434 |
(* thm MEM: |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
435 |
MEM x [] = F |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
436 |
MEM x (h::t) = (x=h) \/ MEM x t *) |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
437 |
thm none_mem_nil |
729 | 438 |
(*lemma "(\<forall>a. a \<notin>f A) = (A = fempty)"*) |
439 |
||
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
440 |
thm mem_cons |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
441 |
thm finite_set_raw_strong_cases |
768
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
442 |
(*thm card_raw.simps*) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
443 |
(*thm not_mem_card_raw*) |
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
444 |
(*thm card_raw_suc*) |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
445 |
|
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
446 |
lemma "fcard X = Suc n \<Longrightarrow> (\<exists>a S. a \<notin>f S & X = finsert a S)" |
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
447 |
(*by (lifting card_raw_suc)*) |
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
448 |
sorry |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
449 |
|
768
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
450 |
(*thm card_raw_cons_gt_0 |
743
4b3822d1ed24
Replies to questions from the weekend: Uncommenting the renamed theorem commented out in 734.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
734
diff
changeset
|
451 |
thm mem_card_raw_gt_0 |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
452 |
thm not_nil_equiv_cons |
768
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
453 |
*) |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
454 |
thm delete_raw.simps |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
455 |
(*thm mem_delete_raw*) |
768
e9e205b904e2
get_fun needed change to cope with "('a fset) fset" types...this needs composition (op o); now id_simps contains also id_o and o_id, and map_id is also added in QuotList.thy; regularize and cleaning needed to be hacked (indicated by "HACK")...THIS NEEDS ATTENTION!!!; except two lemmas in IntEx, all examples go through; added considerable material to FSet3; tuned FIXME-TODO
Christian Urban <urbanc@in.tum.de>
parents:
767
diff
changeset
|
456 |
(*thm card_raw_delete_raw*) |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
457 |
thm cons_delete_raw |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
458 |
thm mem_cons_delete_raw |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
459 |
thm finite_set_raw_delete_raw_cases |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
460 |
thm append.simps |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
461 |
(* MEM_APPEND: MEM e (APPEND l1 l2) = MEM e l1 \/ MEM e l2 *) |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
462 |
thm inter_raw.simps |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
463 |
thm mem_inter_raw |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
464 |
thm fold_raw.simps |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
465 |
thm list2set_thm |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
466 |
thm list_eq_def |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
467 |
thm list.induct |
722
d5fce1ead432
started to have a look at it; redefined the relation
Christian Urban <urbanc@in.tum.de>
parents:
716
diff
changeset
|
468 |
lemma "\<lbrakk>P fempty; \<And>a x. P x \<Longrightarrow> P (finsert a x)\<rbrakk> \<Longrightarrow> P l" |
714
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
469 |
by (lifting list.induct) |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
470 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
471 |
(* We also have map and some properties of it in FSet *) |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
472 |
(* and the following which still lifts ok *) |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
473 |
lemma "funion (funion x xa) xb = funion x (funion xa xb)" |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
474 |
by (lifting append_assoc) |
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
475 |
|
37f7dc85b61b
Added FSet3 with a formalisation of finite sets based on Michael's one.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
476 |
end |