# HG changeset patch # User wenzelm # Date 1728473119 -7200 # Node ID 52ed95fa465665929d0aefbd51dc5ca9f589a890 # Parent 2b949a3bfaac124243524bd9af58273e89098da0 more syntax bundles, less clones; diff -r 2b949a3bfaac -r 52ed95fa4656 src/HOL/Library/Datatype_Records.thy --- a/src/HOL/Library/Datatype_Records.thy Wed Oct 09 13:06:55 2024 +0200 +++ b/src/HOL/Library/Datatype_Records.thy Wed Oct 09 13:25:19 2024 +0200 @@ -26,41 +26,10 @@ \<^item> extensible records are not supported \ -no_syntax - "_constify" :: "id => ident" (\_\) - "_constify" :: "longid => ident" (\_\) - - "_field_type" :: "ident => type => field_type" (\(\indent=2 notation=\infix field type\\_ ::/ _)\) - "" :: "field_type => field_types" (\_\) - "_field_types" :: "field_type => field_types => field_types" (\_,/ _\) - "_record_type" :: "field_types => type" (\(\indent=3 notation=\mixfix record type\\\_\)\) - "_record_type_scheme" :: "field_types => type => type" (\(\indent=3 notation=\mixfix record type\\\_,/ (\indent=2 notation=\infix more type\\\ ::/ _)\)\) - - "_field" :: "ident => 'a => field" (\(\indent=2 notation=\infix field value\\_ =/ _)\) - "" :: "field => fields" (\_\) - "_fields" :: "field => fields => fields" (\_,/ _\) - "_record" :: "fields => 'a" (\(\indent=3 notation=\mixfix record value\\\_\)\) - "_record_scheme" :: "fields => 'a => 'a" (\(\indent=3 notation=\mixfix record value\\\_,/ (\indent=2 notation=\infix more value\\\ =/ _)\)\) +open_bundle datatype_record_syntax +begin - "_field_update" :: "ident => 'a => field_update" (\(\indent=2 notation=\infix field update\\_ :=/ _)\) - "" :: "field_update => field_updates" (\_\) - "_field_updates" :: "field_update => field_updates => field_updates" (\_,/ _\) - "_record_update" :: "'a => field_updates => 'b" (\_/(\indent=3 notation=\mixfix record update\\\_\)\ [900, 0] 900) - -no_syntax (ASCII) - "_record_type" :: "field_types => type" (\(\indent=3 notation=\mixfix record type\\'(| _ |'))\) - "_record_type_scheme" :: "field_types => type => type" (\(\indent=3 notation=\mixfix record type\\'(| _,/ (\indent=2 notation=\infix more type\\... ::/ _) |'))\) - "_record" :: "fields => 'a" (\(\indent=3 notation=\mixfix record value\\'(| _ |'))\) - "_record_scheme" :: "fields => 'a => 'a" (\(\indent=3 notation=\mixfix record value\\'(| _,/ (\indent=2 notation=\infix more value\\... =/ _) |'))\) - "_record_update" :: "'a => field_updates => 'b" (\_/(\indent=3 notation=\mixfix record update\\'(| _ |'))\ [900, 0] 900) - -(* copied and adapted from Record.thy *) - -nonterminal - field and - fields and - field_update and - field_updates +unbundle no record_syntax syntax "_constify" :: "id => ident" (\_\) @@ -80,6 +49,8 @@ "_datatype_record_scheme" :: "fields => 'a => 'a" (\(3'(| _,/ (2... =/ _) |'))\) "_datatype_record_update" :: "'a => field_updates => 'b" (\_/(3'(| _ |'))\ [900, 0] 900) +end + named_theorems datatype_record_update ML_file \datatype_records.ML\ diff -r 2b949a3bfaac -r 52ed95fa4656 src/HOL/Record.thy --- a/src/HOL/Record.thy Wed Oct 09 13:06:55 2024 +0200 +++ b/src/HOL/Record.thy Wed Oct 09 13:25:19 2024 +0200 @@ -422,6 +422,9 @@ field_update and field_updates +open_bundle record_syntax +begin + syntax "_constify" :: "id => ident" (\_\) "_constify" :: "longid => ident" (\_\) @@ -450,6 +453,8 @@ "_record_scheme" :: "fields => 'a => 'a" (\(\indent=3 notation=\mixfix record value\\'(| _,/ (\indent=2 notation=\infix more value\\... =/ _) |'))\) "_record_update" :: "'a => field_updates => 'b" (\(\open_block notation=\mixfix record update\\_/(3'(| _ |')))\ [900, 0] 900) +end + subsection \Record package\