equal
deleted
inserted
replaced
21 subsection \<open>Basic operations and type class instantiations\<close> |
21 subsection \<open>Basic operations and type class instantiations\<close> |
22 |
22 |
23 (* FIXME transfer and right_total vs. bi_total *) |
23 (* FIXME transfer and right_total vs. bi_total *) |
24 instantiation fset :: (finite) finite |
24 instantiation fset :: (finite) finite |
25 begin |
25 begin |
26 instance by default (transfer, simp) |
26 instance by (standard; transfer; simp) |
27 end |
27 end |
28 |
28 |
29 instantiation fset :: (type) "{bounded_lattice_bot, distrib_lattice, minus}" |
29 instantiation fset :: (type) "{bounded_lattice_bot, distrib_lattice, minus}" |
30 begin |
30 begin |
31 |
31 |
52 |
52 |
53 lift_definition minus_fset :: "'a fset \<Rightarrow> 'a fset \<Rightarrow> 'a fset" is minus parametric Diff_transfer |
53 lift_definition minus_fset :: "'a fset \<Rightarrow> 'a fset \<Rightarrow> 'a fset" is minus parametric Diff_transfer |
54 by simp |
54 by simp |
55 |
55 |
56 instance |
56 instance |
57 by default (transfer, auto)+ |
57 by (standard; transfer; auto)+ |
58 |
58 |
59 end |
59 end |
60 |
60 |
61 abbreviation fempty :: "'a fset" ("{||}") where "{||} \<equiv> bot" |
61 abbreviation fempty :: "'a fset" ("{||}") where "{||} \<equiv> bot" |
62 abbreviation fsubset_eq :: "'a fset \<Rightarrow> 'a fset \<Rightarrow> bool" (infix "|\<subseteq>|" 50) where "xs |\<subseteq>| ys \<equiv> xs \<le> ys" |
62 abbreviation fsubset_eq :: "'a fset \<Rightarrow> 'a fset \<Rightarrow> bool" (infix "|\<subseteq>|" 50) where "xs |\<subseteq>| ys \<equiv> xs \<le> ys" |
130 end |
130 end |
131 |
131 |
132 instantiation fset :: (finite) complete_lattice |
132 instantiation fset :: (finite) complete_lattice |
133 begin |
133 begin |
134 |
134 |
135 lift_definition top_fset :: "'a fset" is UNIV parametric right_total_UNIV_transfer UNIV_transfer by simp |
135 lift_definition top_fset :: "'a fset" is UNIV parametric right_total_UNIV_transfer UNIV_transfer |
136 |
136 by simp |
137 instance by default (transfer, auto)+ |
137 |
|
138 instance |
|
139 by (standard; transfer; auto) |
|
140 |
138 end |
141 end |
139 |
142 |
140 instantiation fset :: (finite) complete_boolean_algebra |
143 instantiation fset :: (finite) complete_boolean_algebra |
141 begin |
144 begin |
142 |
145 |
143 lift_definition uminus_fset :: "'a fset \<Rightarrow> 'a fset" is uminus |
146 lift_definition uminus_fset :: "'a fset \<Rightarrow> 'a fset" is uminus |
144 parametric right_total_Compl_transfer Compl_transfer by simp |
147 parametric right_total_Compl_transfer Compl_transfer by simp |
145 |
148 |
146 instance by (default, simp_all only: INF_def SUP_def) (transfer, simp add: Compl_partition Diff_eq)+ |
149 instance |
|
150 by (standard, simp_all only: INF_def SUP_def) (transfer, simp add: Compl_partition Diff_eq)+ |
147 |
151 |
148 end |
152 end |
149 |
153 |
150 abbreviation fUNIV :: "'a::finite fset" where "fUNIV \<equiv> top" |
154 abbreviation fUNIV :: "'a::finite fset" where "fUNIV \<equiv> top" |
151 abbreviation fuminus :: "'a::finite fset \<Rightarrow> 'a fset" ("|-| _" [81] 80) where "|-| x \<equiv> uminus x" |
155 abbreviation fuminus :: "'a::finite fset \<Rightarrow> 'a fset" ("|-| _" [81] 80) where "|-| x \<equiv> uminus x" |