Skip to content

Commit ef3d3e2

Browse files
authored
improve on #126: workaround loss of qualification for type class assumption names (#127)
1 parent 5bdb4d0 commit ef3d3e2

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

ROOT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ session Tests in "tests" = Case_Studies +
4545
sessions
4646
System_Fsub
4747
Operations
48+
Infinitary_Lambda_Calculus
4849
directories
4950
"fixtures"
5051
theories

Tools/var_classes.ML

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ fun mk_class_for_bound b bound lthy =
8181
let
8282
val (class, lthy) = Local_Theory.background_theory_result (fn thy =>
8383
let
84+
(*Work around loss of qualification in "class" axioms by replicating it in the name*)
85+
val b' = fold_rev Binding.prefix_name
86+
(map (suffix "_" o fst) (filter snd (Binding.path_of b))) b;
87+
8488
fun mk_assumption name term = ((Binding.name name, []), single (term, []));
8589
val large = mk_assumption "large" (HOLogic.mk_Trueprop (mk_ordLeq
8690
(mk_card_of (mk_Field bound))
@@ -90,7 +94,7 @@ fun mk_class_for_bound b bound lthy =
9094
mk_regularCard (mk_card_of (HOLogic.mk_UNIV (Term.aT @{sort type})))
9195
))
9296

93-
val (class, lthy) = Class_Declaration.class b [] [] [
97+
val (class, lthy) = Class_Declaration.class b' [] [] [
9498
Element.Assumes [large, regular]
9599
] thy;
96100
in (class, Local_Theory.exit_global lthy) end
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
theory Case_Study_Regression_Tests
2-
imports "Binders.MRBNF_Recursor" "System_Fsub.Pattern"
2+
imports "Binders.MRBNF_Recursor" "System_Fsub.Pattern" "Infinitary_Lambda_Calculus.ILC"
33
begin
44

55
(* #72 *)
66
binder_datatype (FVars: 'v, FTVars: 'tv) trm2 =
77
Var 'v
88
| Let "('tv, p::'v) pat" "('v, 'tv) trm2" t::"('v, 'tv) trm2" binds p in t
99

10+
(* #126 *)
11+
binder_datatype (FFVars: 'a) iterm2
12+
= iVar 'a
13+
| iApp "'a iterm2" "'a iterm2 stream"
14+
| iLam "(xs::'a) stream" t::"'a iterm2" binds xs in t
15+
for
16+
map: ivvsubst
17+
subst: itvsubst
18+
1019
end

0 commit comments

Comments
 (0)