Skip to content

Commit 140971d

Browse files
committed
Updates for Isabelle2025
1 parent 7e846bd commit 140971d

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

Z_Machine.ML

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ fun chantype_name n = n ^ "_chan"
253253
fun zmachine_sem (ZMachine {name = n, state = s, init = i, inv = inv, operations = ops, ends = e}) thy =
254254
let open Syntax; open HOLogic; open Lift_Expr
255255
val ctx = Named_Target.theory_init thy
256-
val cs = map (fn n => (firstLower n, YXML.content_of (string_of_typ ctx (get_zop_ptype n ctx)))) ops @
257-
map (fn n => (firstLower n ^ "_Out", YXML.content_of (string_of_typ ctx (get_zop_outtype n ctx)))) ops
256+
val cs = map (fn n => (firstLower n, XML.content_of (YXML.parse_body (string_of_typ ctx (get_zop_ptype n ctx))))) ops @
257+
map (fn n => (firstLower n ^ "_Out", XML.content_of (YXML.parse_body (string_of_typ ctx (get_zop_outtype n ctx))))) ops
258258
val st = read_typ ctx s
259259
val inve = mk_lift_expr ctx (parse_term ctx inv)
260260
val init = parse_term ctx i

Z_Machine.thy

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ theory Z_Machine
66
and "over" "init" "invariant" "operations" "until" "params" "output" "pre" "update" "\<in>" "promote" "emit" "extends"
77
begin
88

9-
expr_vars
9+
declare [[literal_variables=false]]
1010

1111
named_theorems z_machine_defs
1212

@@ -120,7 +120,9 @@ text \<open> Function to show the channel of an operation \<close>
120120

121121
definition show_op_channel :: "String.literal \<Rightarrow> 'a::show \<Rightarrow> String.literal" where
122122
"show_op_channel c p = c + STR '' '' + show p"
123-
123+
124+
ML \<open>open YXML\<close>
125+
124126
ML_file \<open>Z_Machine.ML\<close>
125127

126128
ML \<open>
@@ -139,7 +141,7 @@ code_datatype pfun_of_alist pfun_of_map pfun_entries
139141

140142
setup \<open> Explorer_Lib.switch_to_quotes \<close>
141143

142-
lit_vars
144+
declare [[literal_variables]]
143145

144146
text \<open> Change the default target of string syntax to be literals. Literals are much better for
145147
code generation, and also provide more control since they are a distinct type to lists.
@@ -150,10 +152,10 @@ bundle literal_syntax
150152
begin
151153

152154
no_syntax
153-
"_String" :: "str_position \<Rightarrow> string" ("_")
155+
"_String" :: "str_position \<Rightarrow> string" (\<open>(\<open>open_block notation=\<open>literal string\<close>\<close>_)\<close>)
154156

155157
syntax
156-
"_Literal" :: "str_position \<Rightarrow> String.literal" ("_")
158+
"_Literal" :: "str_position \<Rightarrow> String.literal" (\<open>(\<open>open_block notation=\<open>literal string\<close>\<close>_)\<close>)
157159

158160
end
159161

@@ -226,6 +228,6 @@ code_printing
226228
| constant "show_set_inst.show_set" \<rightharpoonup> (Haskell) "Prelude.show"
227229
| class_instance "set" :: "show" \<rightharpoonup> (Haskell) -
228230

229-
code_reserved Haskell List_Set
231+
code_reserved (Haskell) List_Set
230232

231233
end

0 commit comments

Comments
 (0)