Theory Lift_BNF
section ‹Demonstration of the \textbf{lift_bnf} Command›
theory Lift_BNF
imports Main
begin
subsection ‹Lifting \textbf{typedef}s›
typedef 'a nonempty_list = "{xs :: 'a list. xs ≠ []}"
by blast
setup_lifting type_definition_nonempty_list
lift_bnf (no_warn_wits) (neset: 'a) nonempty_list
for map: nemap rel: nerel
by auto
typedef ('a :: finite, 'b) fin_nonempty_list = "{(xs :: 'a set, ys :: 'b list). ys ≠ []}"
by blast
setup_lifting type_definition_fin_nonempty_list
lift_bnf (no_warn_wits) (dead 'a :: finite, 'b) fin_nonempty_list
[wits: "λb. ({} :: 'a :: finite set, [b :: 'b])"]
by auto