From 0a0445c72e005c328b4764f5fb0f8f38e7a55d60 Mon Sep 17 00:00:00 2001 From: Son Ho Date: Wed, 5 Jul 2023 14:52:23 +0200 Subject: Start using namespaces in the Lean backend --- tests/hol4/betree/betreeMain_OpaqueScript.sml | 2 +- tests/hol4/hashmap_on_disk/hashmapMain_OpaqueScript.sml | 2 +- tests/hol4/misc-external/external_OpaqueScript.sml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/hol4') diff --git a/tests/hol4/betree/betreeMain_OpaqueScript.sml b/tests/hol4/betree/betreeMain_OpaqueScript.sml index a6f0cf15..10d67cca 100644 --- a/tests/hol4/betree/betreeMain_OpaqueScript.sml +++ b/tests/hol4/betree/betreeMain_OpaqueScript.sml @@ -1,5 +1,5 @@ (** THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS *) -(** [betree_main]: opaque function definitions *) +(** [betree_main]: external function declarations *) open primitivesLib divDefLib open betreeMain_TypesTheory diff --git a/tests/hol4/hashmap_on_disk/hashmapMain_OpaqueScript.sml b/tests/hol4/hashmap_on_disk/hashmapMain_OpaqueScript.sml index 5f6bcbb4..c38eca01 100644 --- a/tests/hol4/hashmap_on_disk/hashmapMain_OpaqueScript.sml +++ b/tests/hol4/hashmap_on_disk/hashmapMain_OpaqueScript.sml @@ -1,5 +1,5 @@ (** THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS *) -(** [hashmap_main]: opaque function definitions *) +(** [hashmap_main]: external function declarations *) open primitivesLib divDefLib open hashmapMain_TypesTheory diff --git a/tests/hol4/misc-external/external_OpaqueScript.sml b/tests/hol4/misc-external/external_OpaqueScript.sml index e2fd281d..02efc2be 100644 --- a/tests/hol4/misc-external/external_OpaqueScript.sml +++ b/tests/hol4/misc-external/external_OpaqueScript.sml @@ -1,5 +1,5 @@ (** THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS *) -(** [external]: opaque function definitions *) +(** [external]: external function declarations *) open primitivesLib divDefLib open external_TypesTheory -- cgit v1.2.3 From 7c95800cefc87fad894f8bf855cfc047e713b3a7 Mon Sep 17 00:00:00 2001 From: Son Ho Date: Thu, 6 Jul 2023 12:20:28 +0200 Subject: Improve the generated comments --- tests/hol4/betree/betreeMain_FunsScript.sml | 118 ++++++++++---------- tests/hol4/betree/betreeMain_OpaqueScript.sml | 10 +- tests/hol4/hashmap/hashmap_FunsScript.sml | 85 +++++++------- .../hashmap_on_disk/hashmapMain_FunsScript.sml | 89 ++++++++------- .../hashmap_on_disk/hashmapMain_OpaqueScript.sml | 4 +- tests/hol4/misc-constants/constantsScript.sml | 16 +-- tests/hol4/misc-external/external_FunsScript.sml | 18 +-- tests/hol4/misc-external/external_OpaqueScript.sml | 10 +- tests/hol4/misc-loops/loops_FunsScript.sml | 124 +++++++++++---------- .../noNestedBorrowsScript.sml | 112 ++++++++++--------- tests/hol4/misc-paper/paperScript.sml | 21 ++-- .../hol4/misc-polonius_list/poloniusListScript.sml | 4 +- 12 files changed, 320 insertions(+), 291 deletions(-) (limited to 'tests/hol4') diff --git a/tests/hol4/betree/betreeMain_FunsScript.sml b/tests/hol4/betree/betreeMain_FunsScript.sml index df0c6a24..03ff2671 100644 --- a/tests/hol4/betree/betreeMain_FunsScript.sml +++ b/tests/hol4/betree/betreeMain_FunsScript.sml @@ -7,7 +7,7 @@ val _ = new_theory "betreeMain_Funs" val betree_load_internal_node_fwd_def = Define ‘ - (** [betree_main::betree::load_internal_node] *) + (** [betree_main::betree::load_internal_node]: forward function *) betree_load_internal_node_fwd (id : u64) (st : state) : (state # (u64 # betree_message_t) betree_list_t) result @@ -16,7 +16,7 @@ val betree_load_internal_node_fwd_def = Define ‘ ’ val betree_store_internal_node_fwd_def = Define ‘ - (** [betree_main::betree::store_internal_node] *) + (** [betree_main::betree::store_internal_node]: forward function *) betree_store_internal_node_fwd (id : u64) (content : (u64 # betree_message_t) betree_list_t) (st : state) : @@ -29,14 +29,14 @@ val betree_store_internal_node_fwd_def = Define ‘ ’ val betree_load_leaf_node_fwd_def = Define ‘ - (** [betree_main::betree::load_leaf_node] *) + (** [betree_main::betree::load_leaf_node]: forward function *) betree_load_leaf_node_fwd (id : u64) (st : state) : (state # (u64 # u64) betree_list_t) result = betree_utils_load_leaf_node_fwd id st ’ val betree_store_leaf_node_fwd_def = Define ‘ - (** [betree_main::betree::store_leaf_node] *) + (** [betree_main::betree::store_leaf_node]: forward function *) betree_store_leaf_node_fwd (id : u64) (content : (u64 # u64) betree_list_t) (st : state) : (state # unit) result @@ -48,7 +48,7 @@ val betree_store_leaf_node_fwd_def = Define ‘ ’ val betree_fresh_node_id_fwd_def = Define ‘ - (** [betree_main::betree::fresh_node_id] *) + (** [betree_main::betree::fresh_node_id]: forward function *) betree_fresh_node_id_fwd (counter : u64) : u64 result = do _ <- u64_add counter (int_to_u64 1); @@ -57,19 +57,19 @@ val betree_fresh_node_id_fwd_def = Define ‘ ’ val betree_fresh_node_id_back_def = Define ‘ - (** [betree_main::betree::fresh_node_id] *) + (** [betree_main::betree::fresh_node_id]: backward function 0 *) betree_fresh_node_id_back (counter : u64) : u64 result = u64_add counter (int_to_u64 1) ’ val betree_node_id_counter_new_fwd_def = Define ‘ - (** [betree_main::betree::NodeIdCounter::{0}::new] *) + (** [betree_main::betree::NodeIdCounter::{0}::new]: forward function *) betree_node_id_counter_new_fwd : betree_node_id_counter_t result = Return (<| betree_node_id_counter_next_node_id := (int_to_u64 0) |>) ’ val betree_node_id_counter_fresh_id_fwd_def = Define ‘ - (** [betree_main::betree::NodeIdCounter::{0}::fresh_id] *) + (** [betree_main::betree::NodeIdCounter::{0}::fresh_id]: forward function *) betree_node_id_counter_fresh_id_fwd (self : betree_node_id_counter_t) : u64 result = do @@ -79,7 +79,7 @@ val betree_node_id_counter_fresh_id_fwd_def = Define ‘ ’ val betree_node_id_counter_fresh_id_back_def = Define ‘ - (** [betree_main::betree::NodeIdCounter::{0}::fresh_id] *) + (** [betree_main::betree::NodeIdCounter::{0}::fresh_id]: backward function 0 *) betree_node_id_counter_fresh_id_back (self : betree_node_id_counter_t) : betree_node_id_counter_t result = do @@ -97,7 +97,7 @@ Definition core_num_u64_max_c_def: End val betree_upsert_update_fwd_def = Define ‘ - (** [betree_main::betree::upsert_update] *) + (** [betree_main::betree::upsert_update]: forward function *) betree_upsert_update_fwd (prev : u64 option) (st : betree_upsert_fun_state_t) : u64 result = (case prev of @@ -117,7 +117,7 @@ val betree_upsert_update_fwd_def = Define ‘ ’ val [betree_list_len_fwd_def] = DefineDiv ‘ - (** [betree_main::betree::List::{1}::len] *) + (** [betree_main::betree::List::{1}::len]: forward function *) betree_list_len_fwd (self : 't betree_list_t) : u64 result = (case self of | BetreeListCons t tl => @@ -129,7 +129,7 @@ val [betree_list_len_fwd_def] = DefineDiv ‘ ’ val [betree_list_split_at_fwd_def] = DefineDiv ‘ - (** [betree_main::betree::List::{1}::split_at] *) + (** [betree_main::betree::List::{1}::split_at]: forward function *) betree_list_split_at_fwd (self : 't betree_list_t) (n : u64) : ('t betree_list_t # 't betree_list_t) result @@ -148,7 +148,8 @@ val [betree_list_split_at_fwd_def] = DefineDiv ‘ ’ val betree_list_push_front_fwd_back_def = Define ‘ - (** [betree_main::betree::List::{1}::push_front] *) + (** [betree_main::betree::List::{1}::push_front]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) betree_list_push_front_fwd_back (self : 't betree_list_t) (x : 't) : 't betree_list_t result = let tl = mem_replace_fwd self BetreeListNil in @@ -157,7 +158,7 @@ val betree_list_push_front_fwd_back_def = Define ‘ ’ val betree_list_pop_front_fwd_def = Define ‘ - (** [betree_main::betree::List::{1}::pop_front] *) + (** [betree_main::betree::List::{1}::pop_front]: forward function *) betree_list_pop_front_fwd (self : 't betree_list_t) : 't result = let ls = mem_replace_fwd self BetreeListNil in (case ls of @@ -166,7 +167,7 @@ val betree_list_pop_front_fwd_def = Define ‘ ’ val betree_list_pop_front_back_def = Define ‘ - (** [betree_main::betree::List::{1}::pop_front] *) + (** [betree_main::betree::List::{1}::pop_front]: backward function 0 *) betree_list_pop_front_back (self : 't betree_list_t) : 't betree_list_t result = let ls = mem_replace_fwd self BetreeListNil in @@ -176,7 +177,7 @@ val betree_list_pop_front_back_def = Define ‘ ’ val betree_list_hd_fwd_def = Define ‘ - (** [betree_main::betree::List::{1}::hd] *) + (** [betree_main::betree::List::{1}::hd]: forward function *) betree_list_hd_fwd (self : 't betree_list_t) : 't result = (case self of | BetreeListCons hd l => Return hd @@ -184,7 +185,7 @@ val betree_list_hd_fwd_def = Define ‘ ’ val betree_list_head_has_key_fwd_def = Define ‘ - (** [betree_main::betree::List::{2}::head_has_key] *) + (** [betree_main::betree::List::{2}::head_has_key]: forward function *) betree_list_head_has_key_fwd (self : (u64 # 't) betree_list_t) (key : u64) : bool result = (case self of @@ -193,7 +194,7 @@ val betree_list_head_has_key_fwd_def = Define ‘ ’ val [betree_list_partition_at_pivot_fwd_def] = DefineDiv ‘ - (** [betree_main::betree::List::{2}::partition_at_pivot] *) + (** [betree_main::betree::List::{2}::partition_at_pivot]: forward function *) betree_list_partition_at_pivot_fwd (self : (u64 # 't) betree_list_t) (pivot : u64) : ((u64 # 't) betree_list_t # (u64 # 't) betree_list_t) result @@ -214,7 +215,7 @@ val [betree_list_partition_at_pivot_fwd_def] = DefineDiv ‘ ’ val betree_leaf_split_fwd_def = Define ‘ - (** [betree_main::betree::Leaf::{3}::split] *) + (** [betree_main::betree::Leaf::{3}::split]: forward function *) betree_leaf_split_fwd (self : betree_leaf_t) (content : (u64 # u64) betree_list_t) (params : betree_params_t) (node_id_cnt : betree_node_id_counter_t) @@ -256,7 +257,7 @@ val betree_leaf_split_fwd_def = Define ‘ ’ val betree_leaf_split_back_def = Define ‘ - (** [betree_main::betree::Leaf::{3}::split] *) + (** [betree_main::betree::Leaf::{3}::split]: backward function 2 *) betree_leaf_split_back (self : betree_leaf_t) (content : (u64 # u64) betree_list_t) (params : betree_params_t) (node_id_cnt : betree_node_id_counter_t) @@ -279,7 +280,7 @@ val betree_leaf_split_back_def = Define ‘ ’ val [betree_node_lookup_in_bindings_fwd_def] = DefineDiv ‘ - (** [betree_main::betree::Node::{5}::lookup_in_bindings] *) + (** [betree_main::betree::Node::{5}::lookup_in_bindings]: forward function *) betree_node_lookup_in_bindings_fwd (key : u64) (bindings : (u64 # u64) betree_list_t) : u64 option result = (case bindings of @@ -295,7 +296,7 @@ val [betree_node_lookup_in_bindings_fwd_def] = DefineDiv ‘ ’ val [betree_node_lookup_first_message_for_key_fwd_def] = DefineDiv ‘ - (** [betree_main::betree::Node::{5}::lookup_first_message_for_key] *) + (** [betree_main::betree::Node::{5}::lookup_first_message_for_key]: forward function *) betree_node_lookup_first_message_for_key_fwd (key : u64) (msgs : (u64 # betree_message_t) betree_list_t) : (u64 # betree_message_t) betree_list_t result @@ -310,7 +311,7 @@ val [betree_node_lookup_first_message_for_key_fwd_def] = DefineDiv ‘ ’ val [betree_node_lookup_first_message_for_key_back_def] = DefineDiv ‘ - (** [betree_main::betree::Node::{5}::lookup_first_message_for_key] *) + (** [betree_main::betree::Node::{5}::lookup_first_message_for_key]: backward function 0 *) betree_node_lookup_first_message_for_key_back (key : u64) (msgs : (u64 # betree_message_t) betree_list_t) (ret : (u64 # betree_message_t) betree_list_t) : @@ -331,7 +332,7 @@ val [betree_node_lookup_first_message_for_key_back_def] = DefineDiv ‘ ’ val [betree_node_apply_upserts_fwd_def] = DefineDiv ‘ - (** [betree_main::betree::Node::{5}::apply_upserts] *) + (** [betree_main::betree::Node::{5}::apply_upserts]: forward function *) betree_node_apply_upserts_fwd (msgs : (u64 # betree_message_t) betree_list_t) (prev : u64 option) (key : u64) (st : state) : @@ -364,7 +365,7 @@ val [betree_node_apply_upserts_fwd_def] = DefineDiv ‘ ’ val [betree_node_apply_upserts_back_def] = DefineDiv ‘ - (** [betree_main::betree::Node::{5}::apply_upserts] *) + (** [betree_main::betree::Node::{5}::apply_upserts]: backward function 0 *) betree_node_apply_upserts_back (msgs : (u64 # betree_message_t) betree_list_t) (prev : u64 option) (key : u64) (st : state) : @@ -396,7 +397,7 @@ val [betree_node_apply_upserts_back_def] = DefineDiv ‘ ’ val [betree_node_lookup_fwd_def, betree_node_lookup_back_def, betree_internal_lookup_in_children_fwd_def, betree_internal_lookup_in_children_back_def] = DefineDiv ‘ - (** [betree_main::betree::Node::{5}::lookup] *) + (** [betree_main::betree::Node::{5}::lookup]: forward function *) (betree_node_lookup_fwd (self : betree_node_t) (key : u64) (st : state) : (state # u64 option) result @@ -466,7 +467,7 @@ val [betree_node_lookup_fwd_def, betree_node_lookup_back_def, betree_internal_lo od)) /\ - (** [betree_main::betree::Node::{5}::lookup] *) + (** [betree_main::betree::Node::{5}::lookup]: backward function 0 *) (betree_node_lookup_back (self : betree_node_t) (key : u64) (st : state) : betree_node_t result = (case self of @@ -534,7 +535,7 @@ val [betree_node_lookup_fwd_def, betree_node_lookup_back_def, betree_internal_lo od)) /\ - (** [betree_main::betree::Internal::{4}::lookup_in_children] *) + (** [betree_main::betree::Internal::{4}::lookup_in_children]: forward function *) (betree_internal_lookup_in_children_fwd (self : betree_internal_t) (key : u64) (st : state) : (state # u64 option) result @@ -544,7 +545,7 @@ val [betree_node_lookup_fwd_def, betree_node_lookup_back_def, betree_internal_lo else betree_node_lookup_fwd self.betree_internal_right key st) /\ - (** [betree_main::betree::Internal::{4}::lookup_in_children] *) + (** [betree_main::betree::Internal::{4}::lookup_in_children]: backward function 0 *) betree_internal_lookup_in_children_back (self : betree_internal_t) (key : u64) (st : state) : betree_internal_t result @@ -563,7 +564,7 @@ val [betree_node_lookup_fwd_def, betree_node_lookup_back_def, betree_internal_lo ’ val [betree_node_lookup_mut_in_bindings_fwd_def] = DefineDiv ‘ - (** [betree_main::betree::Node::{5}::lookup_mut_in_bindings] *) + (** [betree_main::betree::Node::{5}::lookup_mut_in_bindings]: forward function *) betree_node_lookup_mut_in_bindings_fwd (key : u64) (bindings : (u64 # u64) betree_list_t) : (u64 # u64) betree_list_t result @@ -578,7 +579,7 @@ val [betree_node_lookup_mut_in_bindings_fwd_def] = DefineDiv ‘ ’ val [betree_node_lookup_mut_in_bindings_back_def] = DefineDiv ‘ - (** [betree_main::betree::Node::{5}::lookup_mut_in_bindings] *) + (** [betree_main::betree::Node::{5}::lookup_mut_in_bindings]: backward function 0 *) betree_node_lookup_mut_in_bindings_back (key : u64) (bindings : (u64 # u64) betree_list_t) (ret : (u64 # u64) betree_list_t) : @@ -598,7 +599,8 @@ val [betree_node_lookup_mut_in_bindings_back_def] = DefineDiv ‘ ’ val betree_node_apply_to_leaf_fwd_back_def = Define ‘ - (** [betree_main::betree::Node::{5}::apply_to_leaf] *) + (** [betree_main::betree::Node::{5}::apply_to_leaf]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) betree_node_apply_to_leaf_fwd_back (bindings : (u64 # u64) betree_list_t) (key : u64) (new_msg : betree_message_t) : @@ -651,7 +653,8 @@ val betree_node_apply_to_leaf_fwd_back_def = Define ‘ ’ val [betree_node_apply_messages_to_leaf_fwd_back_def] = DefineDiv ‘ - (** [betree_main::betree::Node::{5}::apply_messages_to_leaf] *) + (** [betree_main::betree::Node::{5}::apply_messages_to_leaf]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) betree_node_apply_messages_to_leaf_fwd_back (bindings : (u64 # u64) betree_list_t) (new_msgs : (u64 # betree_message_t) betree_list_t) : @@ -668,7 +671,8 @@ val [betree_node_apply_messages_to_leaf_fwd_back_def] = DefineDiv ‘ ’ val [betree_node_filter_messages_for_key_fwd_back_def] = DefineDiv ‘ - (** [betree_main::betree::Node::{5}::filter_messages_for_key] *) + (** [betree_main::betree::Node::{5}::filter_messages_for_key]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) betree_node_filter_messages_for_key_fwd_back (key : u64) (msgs : (u64 # betree_message_t) betree_list_t) : (u64 # betree_message_t) betree_list_t result @@ -687,7 +691,7 @@ val [betree_node_filter_messages_for_key_fwd_back_def] = DefineDiv ‘ ’ val [betree_node_lookup_first_message_after_key_fwd_def] = DefineDiv ‘ - (** [betree_main::betree::Node::{5}::lookup_first_message_after_key] *) + (** [betree_main::betree::Node::{5}::lookup_first_message_after_key]: forward function *) betree_node_lookup_first_message_after_key_fwd (key : u64) (msgs : (u64 # betree_message_t) betree_list_t) : (u64 # betree_message_t) betree_list_t result @@ -702,7 +706,7 @@ val [betree_node_lookup_first_message_after_key_fwd_def] = DefineDiv ‘ ’ val [betree_node_lookup_first_message_after_key_back_def] = DefineDiv ‘ - (** [betree_main::betree::Node::{5}::lookup_first_message_after_key] *) + (** [betree_main::betree::Node::{5}::lookup_first_message_after_key]: backward function 0 *) betree_node_lookup_first_message_after_key_back (key : u64) (msgs : (u64 # betree_message_t) betree_list_t) (ret : (u64 # betree_message_t) betree_list_t) : @@ -723,7 +727,8 @@ val [betree_node_lookup_first_message_after_key_back_def] = DefineDiv ‘ ’ val betree_node_apply_to_internal_fwd_back_def = Define ‘ - (** [betree_main::betree::Node::{5}::apply_to_internal] *) + (** [betree_main::betree::Node::{5}::apply_to_internal]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) betree_node_apply_to_internal_fwd_back (msgs : (u64 # betree_message_t) betree_list_t) (key : u64) (new_msg : betree_message_t) : @@ -789,7 +794,8 @@ val betree_node_apply_to_internal_fwd_back_def = Define ‘ ’ val [betree_node_apply_messages_to_internal_fwd_back_def] = DefineDiv ‘ - (** [betree_main::betree::Node::{5}::apply_messages_to_internal] *) + (** [betree_main::betree::Node::{5}::apply_messages_to_internal]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) betree_node_apply_messages_to_internal_fwd_back (msgs : (u64 # betree_message_t) betree_list_t) (new_msgs : (u64 # betree_message_t) betree_list_t) : @@ -806,7 +812,7 @@ val [betree_node_apply_messages_to_internal_fwd_back_def] = DefineDiv ‘ ’ val [betree_node_apply_messages_fwd_def, betree_node_apply_messages_back_def, betree_internal_flush_fwd_def, betree_internal_flush_back_def] = DefineDiv ‘ - (** [betree_main::betree::Node::{5}::apply_messages] *) + (** [betree_main::betree::Node::{5}::apply_messages]: forward function *) (betree_node_apply_messages_fwd (self : betree_node_t) (params : betree_params_t) (node_id_cnt : betree_node_id_counter_t) @@ -861,7 +867,7 @@ val [betree_node_apply_messages_fwd_def, betree_node_apply_messages_back_def, be od)) /\ - (** [betree_main::betree::Node::{5}::apply_messages] *) + (** [betree_main::betree::Node::{5}::apply_messages]: backward function 0 *) (betree_node_apply_messages_back (self : betree_node_t) (params : betree_params_t) (node_id_cnt : betree_node_id_counter_t) @@ -918,7 +924,7 @@ val [betree_node_apply_messages_fwd_def, betree_node_apply_messages_back_def, be od)) /\ - (** [betree_main::betree::Internal::{4}::flush] *) + (** [betree_main::betree::Internal::{4}::flush]: forward function *) (betree_internal_flush_fwd (self : betree_internal_t) (params : betree_params_t) (node_id_cnt : betree_node_id_counter_t) @@ -967,7 +973,7 @@ val [betree_node_apply_messages_fwd_def, betree_node_apply_messages_back_def, be od) /\ - (** [betree_main::betree::Internal::{4}::flush] *) + (** [betree_main::betree::Internal::{4}::flush]: backward function 0 *) betree_internal_flush_back (self : betree_internal_t) (params : betree_params_t) (node_id_cnt : betree_node_id_counter_t) @@ -1016,7 +1022,7 @@ val [betree_node_apply_messages_fwd_def, betree_node_apply_messages_back_def, be ’ val betree_node_apply_fwd_def = Define ‘ - (** [betree_main::betree::Node::{5}::apply] *) + (** [betree_main::betree::Node::{5}::apply]: forward function *) betree_node_apply_fwd (self : betree_node_t) (params : betree_params_t) (node_id_cnt : betree_node_id_counter_t) (key : u64) @@ -1036,7 +1042,7 @@ val betree_node_apply_fwd_def = Define ‘ ’ val betree_node_apply_back_def = Define ‘ - (** [betree_main::betree::Node::{5}::apply] *) + (** [betree_main::betree::Node::{5}::apply]: backward function 0 *) betree_node_apply_back (self : betree_node_t) (params : betree_params_t) (node_id_cnt : betree_node_id_counter_t) (key : u64) @@ -1049,7 +1055,7 @@ val betree_node_apply_back_def = Define ‘ ’ val betree_be_tree_new_fwd_def = Define ‘ - (** [betree_main::betree::BeTree::{6}::new] *) + (** [betree_main::betree::BeTree::{6}::new]: forward function *) betree_be_tree_new_fwd (min_flush_size : u64) (split_size : u64) (st : state) : (state # betree_be_tree_t) result @@ -1075,7 +1081,7 @@ val betree_be_tree_new_fwd_def = Define ‘ ’ val betree_be_tree_apply_fwd_def = Define ‘ - (** [betree_main::betree::BeTree::{6}::apply] *) + (** [betree_main::betree::BeTree::{6}::apply]: forward function *) betree_be_tree_apply_fwd (self : betree_be_tree_t) (key : u64) (msg : betree_message_t) (st : state) : @@ -1093,7 +1099,7 @@ val betree_be_tree_apply_fwd_def = Define ‘ ’ val betree_be_tree_apply_back_def = Define ‘ - (** [betree_main::betree::BeTree::{6}::apply] *) + (** [betree_main::betree::BeTree::{6}::apply]: backward function 0 *) betree_be_tree_apply_back (self : betree_be_tree_t) (key : u64) (msg : betree_message_t) (st : state) : @@ -1113,7 +1119,7 @@ val betree_be_tree_apply_back_def = Define ‘ ’ val betree_be_tree_insert_fwd_def = Define ‘ - (** [betree_main::betree::BeTree::{6}::insert] *) + (** [betree_main::betree::BeTree::{6}::insert]: forward function *) betree_be_tree_insert_fwd (self : betree_be_tree_t) (key : u64) (value : u64) (st : state) : (state # unit) result @@ -1127,7 +1133,7 @@ val betree_be_tree_insert_fwd_def = Define ‘ ’ val betree_be_tree_insert_back_def = Define ‘ - (** [betree_main::betree::BeTree::{6}::insert] *) + (** [betree_main::betree::BeTree::{6}::insert]: backward function 0 *) betree_be_tree_insert_back (self : betree_be_tree_t) (key : u64) (value : u64) (st : state) : betree_be_tree_t result @@ -1136,7 +1142,7 @@ val betree_be_tree_insert_back_def = Define ‘ ’ val betree_be_tree_delete_fwd_def = Define ‘ - (** [betree_main::betree::BeTree::{6}::delete] *) + (** [betree_main::betree::BeTree::{6}::delete]: forward function *) betree_be_tree_delete_fwd (self : betree_be_tree_t) (key : u64) (st : state) : (state # unit) result @@ -1149,7 +1155,7 @@ val betree_be_tree_delete_fwd_def = Define ‘ ’ val betree_be_tree_delete_back_def = Define ‘ - (** [betree_main::betree::BeTree::{6}::delete] *) + (** [betree_main::betree::BeTree::{6}::delete]: backward function 0 *) betree_be_tree_delete_back (self : betree_be_tree_t) (key : u64) (st : state) : betree_be_tree_t result @@ -1158,7 +1164,7 @@ val betree_be_tree_delete_back_def = Define ‘ ’ val betree_be_tree_upsert_fwd_def = Define ‘ - (** [betree_main::betree::BeTree::{6}::upsert] *) + (** [betree_main::betree::BeTree::{6}::upsert]: forward function *) betree_be_tree_upsert_fwd (self : betree_be_tree_t) (key : u64) (upd : betree_upsert_fun_state_t) (st : state) : @@ -1172,7 +1178,7 @@ val betree_be_tree_upsert_fwd_def = Define ‘ ’ val betree_be_tree_upsert_back_def = Define ‘ - (** [betree_main::betree::BeTree::{6}::upsert] *) + (** [betree_main::betree::BeTree::{6}::upsert]: backward function 0 *) betree_be_tree_upsert_back (self : betree_be_tree_t) (key : u64) (upd : betree_upsert_fun_state_t) (st : state) : @@ -1182,7 +1188,7 @@ val betree_be_tree_upsert_back_def = Define ‘ ’ val betree_be_tree_lookup_fwd_def = Define ‘ - (** [betree_main::betree::BeTree::{6}::lookup] *) + (** [betree_main::betree::BeTree::{6}::lookup]: forward function *) betree_be_tree_lookup_fwd (self : betree_be_tree_t) (key : u64) (st : state) : (state # u64 option) result @@ -1191,7 +1197,7 @@ val betree_be_tree_lookup_fwd_def = Define ‘ ’ val betree_be_tree_lookup_back_def = Define ‘ - (** [betree_main::betree::BeTree::{6}::lookup] *) + (** [betree_main::betree::BeTree::{6}::lookup]: backward function 0 *) betree_be_tree_lookup_back (self : betree_be_tree_t) (key : u64) (st : state) : betree_be_tree_t result @@ -1203,7 +1209,7 @@ val betree_be_tree_lookup_back_def = Define ‘ ’ val main_fwd_def = Define ‘ - (** [betree_main::main] *) + (** [betree_main::main]: forward function *) main_fwd : unit result = Return () ’ diff --git a/tests/hol4/betree/betreeMain_OpaqueScript.sml b/tests/hol4/betree/betreeMain_OpaqueScript.sml index 10d67cca..1d16db4c 100644 --- a/tests/hol4/betree/betreeMain_OpaqueScript.sml +++ b/tests/hol4/betree/betreeMain_OpaqueScript.sml @@ -6,21 +6,21 @@ open betreeMain_TypesTheory val _ = new_theory "betreeMain_Opaque" -val _ = new_constant ("betree_utils_load_internal_node_fwd", +(** [betree_main::betree_utils::load_internal_node]: forward function *)val _ = new_constant ("betree_utils_load_internal_node_fwd", “:u64 -> state -> (state # (u64 # betree_message_t) betree_list_t) result”) -val _ = new_constant ("betree_utils_store_internal_node_fwd", +(** [betree_main::betree_utils::store_internal_node]: forward function *)val _ = new_constant ("betree_utils_store_internal_node_fwd", “:u64 -> (u64 # betree_message_t) betree_list_t -> state -> (state # unit) result”) -val _ = new_constant ("betree_utils_load_leaf_node_fwd", +(** [betree_main::betree_utils::load_leaf_node]: forward function *)val _ = new_constant ("betree_utils_load_leaf_node_fwd", “:u64 -> state -> (state # (u64 # u64) betree_list_t) result”) -val _ = new_constant ("betree_utils_store_leaf_node_fwd", +(** [betree_main::betree_utils::store_leaf_node]: forward function *)val _ = new_constant ("betree_utils_store_leaf_node_fwd", “:u64 -> (u64 # u64) betree_list_t -> state -> (state # unit) result”) -val _ = new_constant ("core_option_option_unwrap_fwd", +(** [core::option::Option::{0}::unwrap]: forward function *)val _ = new_constant ("core_option_option_unwrap_fwd", “:'t option -> state -> (state # 't) result”) val _ = export_theory () diff --git a/tests/hol4/hashmap/hashmap_FunsScript.sml b/tests/hol4/hashmap/hashmap_FunsScript.sml index 9ad497f5..1ed57080 100644 --- a/tests/hol4/hashmap/hashmap_FunsScript.sml +++ b/tests/hol4/hashmap/hashmap_FunsScript.sml @@ -7,13 +7,13 @@ val _ = new_theory "hashmap_Funs" val hash_key_fwd_def = Define ‘ - (** [hashmap::hash_key] *) + (** [hashmap::hash_key]: forward function *) hash_key_fwd (k : usize) : usize result = Return k ’ val [hash_map_allocate_slots_loop_fwd_def] = DefineDiv ‘ - (** [hashmap::HashMap::{0}::allocate_slots] *) + (** [hashmap::HashMap::{0}::allocate_slots]: loop 0: forward function *) hash_map_allocate_slots_loop_fwd (slots : 't list_t vec) (n : usize) : 't list_t vec result = if usize_gt n (int_to_usize 0) @@ -27,14 +27,14 @@ val [hash_map_allocate_slots_loop_fwd_def] = DefineDiv ‘ ’ val hash_map_allocate_slots_fwd_def = Define ‘ - (** [hashmap::HashMap::{0}::allocate_slots] *) + (** [hashmap::HashMap::{0}::allocate_slots]: forward function *) hash_map_allocate_slots_fwd (slots : 't list_t vec) (n : usize) : 't list_t vec result = hash_map_allocate_slots_loop_fwd slots n ’ val hash_map_new_with_capacity_fwd_def = Define ‘ - (** [hashmap::HashMap::{0}::new_with_capacity] *) + (** [hashmap::HashMap::{0}::new_with_capacity]: forward function *) hash_map_new_with_capacity_fwd (capacity : usize) (max_load_dividend : usize) (max_load_divisor : usize) : 't hash_map_t result @@ -55,14 +55,15 @@ val hash_map_new_with_capacity_fwd_def = Define ‘ ’ val hash_map_new_fwd_def = Define ‘ - (** [hashmap::HashMap::{0}::new] *) + (** [hashmap::HashMap::{0}::new]: forward function *) hash_map_new_fwd : 't hash_map_t result = hash_map_new_with_capacity_fwd (int_to_usize 32) (int_to_usize 4) (int_to_usize 5) ’ val [hash_map_clear_loop_fwd_back_def] = DefineDiv ‘ - (** [hashmap::HashMap::{0}::clear] *) + (** [hashmap::HashMap::{0}::clear]: loop 0: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hash_map_clear_loop_fwd_back (slots : 't list_t vec) (i : usize) : 't list_t vec result = let i0 = vec_len slots in @@ -77,7 +78,8 @@ val [hash_map_clear_loop_fwd_back_def] = DefineDiv ‘ ’ val hash_map_clear_fwd_back_def = Define ‘ - (** [hashmap::HashMap::{0}::clear] *) + (** [hashmap::HashMap::{0}::clear]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hash_map_clear_fwd_back (self : 't hash_map_t) : 't hash_map_t result = do v <- hash_map_clear_loop_fwd_back self.hash_map_slots (int_to_usize 0); @@ -91,13 +93,13 @@ val hash_map_clear_fwd_back_def = Define ‘ ’ val hash_map_len_fwd_def = Define ‘ - (** [hashmap::HashMap::{0}::len] *) + (** [hashmap::HashMap::{0}::len]: forward function *) hash_map_len_fwd (self : 't hash_map_t) : usize result = Return self.hash_map_num_entries ’ val [hash_map_insert_in_list_loop_fwd_def] = DefineDiv ‘ - (** [hashmap::HashMap::{0}::insert_in_list] *) + (** [hashmap::HashMap::{0}::insert_in_list]: loop 0: forward function *) hash_map_insert_in_list_loop_fwd (key : usize) (value : 't) (ls : 't list_t) : bool result = (case ls of @@ -109,14 +111,14 @@ val [hash_map_insert_in_list_loop_fwd_def] = DefineDiv ‘ ’ val hash_map_insert_in_list_fwd_def = Define ‘ - (** [hashmap::HashMap::{0}::insert_in_list] *) + (** [hashmap::HashMap::{0}::insert_in_list]: forward function *) hash_map_insert_in_list_fwd (key : usize) (value : 't) (ls : 't list_t) : bool result = hash_map_insert_in_list_loop_fwd key value ls ’ val [hash_map_insert_in_list_loop_back_def] = DefineDiv ‘ - (** [hashmap::HashMap::{0}::insert_in_list] *) + (** [hashmap::HashMap::{0}::insert_in_list]: loop 0: backward function 0 *) hash_map_insert_in_list_loop_back (key : usize) (value : 't) (ls : 't list_t) : 't list_t result = (case ls of @@ -132,14 +134,15 @@ val [hash_map_insert_in_list_loop_back_def] = DefineDiv ‘ ’ val hash_map_insert_in_list_back_def = Define ‘ - (** [hashmap::HashMap::{0}::insert_in_list] *) + (** [hashmap::HashMap::{0}::insert_in_list]: backward function 0 *) hash_map_insert_in_list_back (key : usize) (value : 't) (ls : 't list_t) : 't list_t result = hash_map_insert_in_list_loop_back key value ls ’ val hash_map_insert_no_resize_fwd_back_def = Define ‘ - (** [hashmap::HashMap::{0}::insert_no_resize] *) + (** [hashmap::HashMap::{0}::insert_no_resize]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hash_map_insert_no_resize_fwd_back (self : 't hash_map_t) (key : usize) (value : 't) : 't hash_map_t result = do @@ -176,7 +179,8 @@ Definition core_num_u32_max_c_def: End val [hash_map_move_elements_from_list_loop_fwd_back_def] = DefineDiv ‘ - (** [hashmap::HashMap::{0}::move_elements_from_list] *) + (** [hashmap::HashMap::{0}::move_elements_from_list]: loop 0: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hash_map_move_elements_from_list_loop_fwd_back (ntable : 't hash_map_t) (ls : 't list_t) : 't hash_map_t result = (case ls of @@ -189,14 +193,16 @@ val [hash_map_move_elements_from_list_loop_fwd_back_def] = DefineDiv ‘ ’ val hash_map_move_elements_from_list_fwd_back_def = Define ‘ - (** [hashmap::HashMap::{0}::move_elements_from_list] *) + (** [hashmap::HashMap::{0}::move_elements_from_list]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hash_map_move_elements_from_list_fwd_back (ntable : 't hash_map_t) (ls : 't list_t) : 't hash_map_t result = hash_map_move_elements_from_list_loop_fwd_back ntable ls ’ val [hash_map_move_elements_loop_fwd_back_def] = DefineDiv ‘ - (** [hashmap::HashMap::{0}::move_elements] *) + (** [hashmap::HashMap::{0}::move_elements]: loop 0: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hash_map_move_elements_loop_fwd_back (ntable : 't hash_map_t) (slots : 't list_t vec) (i : usize) : ('t hash_map_t # 't list_t vec) result @@ -221,7 +227,8 @@ val [hash_map_move_elements_loop_fwd_back_def] = DefineDiv ‘ ’ val hash_map_move_elements_fwd_back_def = Define ‘ - (** [hashmap::HashMap::{0}::move_elements] *) + (** [hashmap::HashMap::{0}::move_elements]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hash_map_move_elements_fwd_back (ntable : 't hash_map_t) (slots : 't list_t vec) (i : usize) : ('t hash_map_t # 't list_t vec) result @@ -230,7 +237,8 @@ val hash_map_move_elements_fwd_back_def = Define ‘ ’ val hash_map_try_resize_fwd_back_def = Define ‘ - (** [hashmap::HashMap::{0}::try_resize] *) + (** [hashmap::HashMap::{0}::try_resize]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hash_map_try_resize_fwd_back (self : 't hash_map_t) : 't hash_map_t result = do max_usize <- mk_usize (u32_to_int core_num_u32_max_c); @@ -263,7 +271,8 @@ val hash_map_try_resize_fwd_back_def = Define ‘ ’ val hash_map_insert_fwd_back_def = Define ‘ - (** [hashmap::HashMap::{0}::insert] *) + (** [hashmap::HashMap::{0}::insert]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hash_map_insert_fwd_back (self : 't hash_map_t) (key : usize) (value : 't) : 't hash_map_t result = do @@ -276,7 +285,7 @@ val hash_map_insert_fwd_back_def = Define ‘ ’ val [hash_map_contains_key_in_list_loop_fwd_def] = DefineDiv ‘ - (** [hashmap::HashMap::{0}::contains_key_in_list] *) + (** [hashmap::HashMap::{0}::contains_key_in_list]: loop 0: forward function *) hash_map_contains_key_in_list_loop_fwd (key : usize) (ls : 't list_t) : bool result = (case ls of @@ -288,14 +297,14 @@ val [hash_map_contains_key_in_list_loop_fwd_def] = DefineDiv ‘ ’ val hash_map_contains_key_in_list_fwd_def = Define ‘ - (** [hashmap::HashMap::{0}::contains_key_in_list] *) + (** [hashmap::HashMap::{0}::contains_key_in_list]: forward function *) hash_map_contains_key_in_list_fwd (key : usize) (ls : 't list_t) : bool result = hash_map_contains_key_in_list_loop_fwd key ls ’ val hash_map_contains_key_fwd_def = Define ‘ - (** [hashmap::HashMap::{0}::contains_key] *) + (** [hashmap::HashMap::{0}::contains_key]: forward function *) hash_map_contains_key_fwd (self : 't hash_map_t) (key : usize) : bool result = do @@ -310,7 +319,7 @@ val hash_map_contains_key_fwd_def = Define ‘ ’ val [hash_map_get_in_list_loop_fwd_def] = DefineDiv ‘ - (** [hashmap::HashMap::{0}::get_in_list] *) + (** [hashmap::HashMap::{0}::get_in_list]: loop 0: forward function *) hash_map_get_in_list_loop_fwd (key : usize) (ls : 't list_t) : 't result = (case ls of | ListCons ckey cvalue tl => @@ -321,13 +330,13 @@ val [hash_map_get_in_list_loop_fwd_def] = DefineDiv ‘ ’ val hash_map_get_in_list_fwd_def = Define ‘ - (** [hashmap::HashMap::{0}::get_in_list] *) + (** [hashmap::HashMap::{0}::get_in_list]: forward function *) hash_map_get_in_list_fwd (key : usize) (ls : 't list_t) : 't result = hash_map_get_in_list_loop_fwd key ls ’ val hash_map_get_fwd_def = Define ‘ - (** [hashmap::HashMap::{0}::get] *) + (** [hashmap::HashMap::{0}::get]: forward function *) hash_map_get_fwd (self : 't hash_map_t) (key : usize) : 't result = do hash <- hash_key_fwd key; @@ -341,7 +350,7 @@ val hash_map_get_fwd_def = Define ‘ ’ val [hash_map_get_mut_in_list_loop_fwd_def] = DefineDiv ‘ - (** [hashmap::HashMap::{0}::get_mut_in_list] *) + (** [hashmap::HashMap::{0}::get_mut_in_list]: loop 0: forward function *) hash_map_get_mut_in_list_loop_fwd (ls : 't list_t) (key : usize) : 't result = (case ls of @@ -353,13 +362,13 @@ val [hash_map_get_mut_in_list_loop_fwd_def] = DefineDiv ‘ ’ val hash_map_get_mut_in_list_fwd_def = Define ‘ - (** [hashmap::HashMap::{0}::get_mut_in_list] *) + (** [hashmap::HashMap::{0}::get_mut_in_list]: forward function *) hash_map_get_mut_in_list_fwd (ls : 't list_t) (key : usize) : 't result = hash_map_get_mut_in_list_loop_fwd ls key ’ val [hash_map_get_mut_in_list_loop_back_def] = DefineDiv ‘ - (** [hashmap::HashMap::{0}::get_mut_in_list] *) + (** [hashmap::HashMap::{0}::get_mut_in_list]: loop 0: backward function 0 *) hash_map_get_mut_in_list_loop_back (ls : 't list_t) (key : usize) (ret : 't) : 't list_t result = (case ls of @@ -375,14 +384,14 @@ val [hash_map_get_mut_in_list_loop_back_def] = DefineDiv ‘ ’ val hash_map_get_mut_in_list_back_def = Define ‘ - (** [hashmap::HashMap::{0}::get_mut_in_list] *) + (** [hashmap::HashMap::{0}::get_mut_in_list]: backward function 0 *) hash_map_get_mut_in_list_back (ls : 't list_t) (key : usize) (ret : 't) : 't list_t result = hash_map_get_mut_in_list_loop_back ls key ret ’ val hash_map_get_mut_fwd_def = Define ‘ - (** [hashmap::HashMap::{0}::get_mut] *) + (** [hashmap::HashMap::{0}::get_mut]: forward function *) hash_map_get_mut_fwd (self : 't hash_map_t) (key : usize) : 't result = do hash <- hash_key_fwd key; @@ -396,7 +405,7 @@ val hash_map_get_mut_fwd_def = Define ‘ ’ val hash_map_get_mut_back_def = Define ‘ - (** [hashmap::HashMap::{0}::get_mut] *) + (** [hashmap::HashMap::{0}::get_mut]: backward function 0 *) hash_map_get_mut_back (self : 't hash_map_t) (key : usize) (ret : 't) : 't hash_map_t result = do @@ -413,7 +422,7 @@ val hash_map_get_mut_back_def = Define ‘ ’ val [hash_map_remove_from_list_loop_fwd_def] = DefineDiv ‘ - (** [hashmap::HashMap::{0}::remove_from_list] *) + (** [hashmap::HashMap::{0}::remove_from_list]: loop 0: forward function *) hash_map_remove_from_list_loop_fwd (key : usize) (ls : 't list_t) : 't option result = (case ls of @@ -429,14 +438,14 @@ val [hash_map_remove_from_list_loop_fwd_def] = DefineDiv ‘ ’ val hash_map_remove_from_list_fwd_def = Define ‘ - (** [hashmap::HashMap::{0}::remove_from_list] *) + (** [hashmap::HashMap::{0}::remove_from_list]: forward function *) hash_map_remove_from_list_fwd (key : usize) (ls : 't list_t) : 't option result = hash_map_remove_from_list_loop_fwd key ls ’ val [hash_map_remove_from_list_loop_back_def] = DefineDiv ‘ - (** [hashmap::HashMap::{0}::remove_from_list] *) + (** [hashmap::HashMap::{0}::remove_from_list]: loop 0: backward function 1 *) hash_map_remove_from_list_loop_back (key : usize) (ls : 't list_t) : 't list_t result = (case ls of @@ -456,14 +465,14 @@ val [hash_map_remove_from_list_loop_back_def] = DefineDiv ‘ ’ val hash_map_remove_from_list_back_def = Define ‘ - (** [hashmap::HashMap::{0}::remove_from_list] *) + (** [hashmap::HashMap::{0}::remove_from_list]: backward function 1 *) hash_map_remove_from_list_back (key : usize) (ls : 't list_t) : 't list_t result = hash_map_remove_from_list_loop_back key ls ’ val hash_map_remove_fwd_def = Define ‘ - (** [hashmap::HashMap::{0}::remove] *) + (** [hashmap::HashMap::{0}::remove]: forward function *) hash_map_remove_fwd (self : 't hash_map_t) (key : usize) : 't option result = do hash <- hash_key_fwd key; @@ -484,7 +493,7 @@ val hash_map_remove_fwd_def = Define ‘ ’ val hash_map_remove_back_def = Define ‘ - (** [hashmap::HashMap::{0}::remove] *) + (** [hashmap::HashMap::{0}::remove]: backward function 0 *) hash_map_remove_back (self : 't hash_map_t) (key : usize) : 't hash_map_t result = do @@ -513,7 +522,7 @@ val hash_map_remove_back_def = Define ‘ ’ val test1_fwd_def = Define ‘ - (** [hashmap::test1] *) + (** [hashmap::test1]: forward function *) test1_fwd : unit result = do hm <- hash_map_new_fwd; diff --git a/tests/hol4/hashmap_on_disk/hashmapMain_FunsScript.sml b/tests/hol4/hashmap_on_disk/hashmapMain_FunsScript.sml index 5a8f7ff8..6ec6223d 100644 --- a/tests/hol4/hashmap_on_disk/hashmapMain_FunsScript.sml +++ b/tests/hol4/hashmap_on_disk/hashmapMain_FunsScript.sml @@ -7,13 +7,13 @@ val _ = new_theory "hashmapMain_Funs" val hashmap_hash_key_fwd_def = Define ‘ - (** [hashmap_main::hashmap::hash_key] *) + (** [hashmap_main::hashmap::hash_key]: forward function *) hashmap_hash_key_fwd (k : usize) : usize result = Return k ’ val [hashmap_hash_map_allocate_slots_loop_fwd_def] = DefineDiv ‘ - (** [hashmap_main::hashmap::HashMap::{0}::allocate_slots] *) + (** [hashmap_main::hashmap::HashMap::{0}::allocate_slots]: loop 0: forward function *) hashmap_hash_map_allocate_slots_loop_fwd (slots : 't hashmap_list_t vec) (n : usize) : 't hashmap_list_t vec result @@ -29,7 +29,7 @@ val [hashmap_hash_map_allocate_slots_loop_fwd_def] = DefineDiv ‘ ’ val hashmap_hash_map_allocate_slots_fwd_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::allocate_slots] *) + (** [hashmap_main::hashmap::HashMap::{0}::allocate_slots]: forward function *) hashmap_hash_map_allocate_slots_fwd (slots : 't hashmap_list_t vec) (n : usize) : 't hashmap_list_t vec result @@ -38,7 +38,7 @@ val hashmap_hash_map_allocate_slots_fwd_def = Define ‘ ’ val hashmap_hash_map_new_with_capacity_fwd_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::new_with_capacity] *) + (** [hashmap_main::hashmap::HashMap::{0}::new_with_capacity]: forward function *) hashmap_hash_map_new_with_capacity_fwd (capacity : usize) (max_load_dividend : usize) (max_load_divisor : usize) : 't hashmap_hash_map_t result @@ -60,14 +60,15 @@ val hashmap_hash_map_new_with_capacity_fwd_def = Define ‘ ’ val hashmap_hash_map_new_fwd_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::new] *) + (** [hashmap_main::hashmap::HashMap::{0}::new]: forward function *) hashmap_hash_map_new_fwd : 't hashmap_hash_map_t result = hashmap_hash_map_new_with_capacity_fwd (int_to_usize 32) (int_to_usize 4) (int_to_usize 5) ’ val [hashmap_hash_map_clear_loop_fwd_back_def] = DefineDiv ‘ - (** [hashmap_main::hashmap::HashMap::{0}::clear] *) + (** [hashmap_main::hashmap::HashMap::{0}::clear]: loop 0: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hashmap_hash_map_clear_loop_fwd_back (slots : 't hashmap_list_t vec) (i : usize) : 't hashmap_list_t vec result @@ -84,7 +85,8 @@ val [hashmap_hash_map_clear_loop_fwd_back_def] = DefineDiv ‘ ’ val hashmap_hash_map_clear_fwd_back_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::clear] *) + (** [hashmap_main::hashmap::HashMap::{0}::clear]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hashmap_hash_map_clear_fwd_back (self : 't hashmap_hash_map_t) : 't hashmap_hash_map_t result = do @@ -102,13 +104,13 @@ val hashmap_hash_map_clear_fwd_back_def = Define ‘ ’ val hashmap_hash_map_len_fwd_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::len] *) + (** [hashmap_main::hashmap::HashMap::{0}::len]: forward function *) hashmap_hash_map_len_fwd (self : 't hashmap_hash_map_t) : usize result = Return self.hashmap_hash_map_num_entries ’ val [hashmap_hash_map_insert_in_list_loop_fwd_def] = DefineDiv ‘ - (** [hashmap_main::hashmap::HashMap::{0}::insert_in_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::insert_in_list]: loop 0: forward function *) hashmap_hash_map_insert_in_list_loop_fwd (key : usize) (value : 't) (ls : 't hashmap_list_t) : bool result = (case ls of @@ -120,14 +122,14 @@ val [hashmap_hash_map_insert_in_list_loop_fwd_def] = DefineDiv ‘ ’ val hashmap_hash_map_insert_in_list_fwd_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::insert_in_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::insert_in_list]: forward function *) hashmap_hash_map_insert_in_list_fwd (key : usize) (value : 't) (ls : 't hashmap_list_t) : bool result = hashmap_hash_map_insert_in_list_loop_fwd key value ls ’ val [hashmap_hash_map_insert_in_list_loop_back_def] = DefineDiv ‘ - (** [hashmap_main::hashmap::HashMap::{0}::insert_in_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::insert_in_list]: loop 0: backward function 0 *) hashmap_hash_map_insert_in_list_loop_back (key : usize) (value : 't) (ls : 't hashmap_list_t) : 't hashmap_list_t result @@ -146,7 +148,7 @@ val [hashmap_hash_map_insert_in_list_loop_back_def] = DefineDiv ‘ ’ val hashmap_hash_map_insert_in_list_back_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::insert_in_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::insert_in_list]: backward function 0 *) hashmap_hash_map_insert_in_list_back (key : usize) (value : 't) (ls : 't hashmap_list_t) : 't hashmap_list_t result @@ -155,7 +157,8 @@ val hashmap_hash_map_insert_in_list_back_def = Define ‘ ’ val hashmap_hash_map_insert_no_resize_fwd_back_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::insert_no_resize] *) + (** [hashmap_main::hashmap::HashMap::{0}::insert_no_resize]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hashmap_hash_map_insert_no_resize_fwd_back (self : 't hashmap_hash_map_t) (key : usize) (value : 't) : 't hashmap_hash_map_t result @@ -199,7 +202,8 @@ Definition core_num_u32_max_c_def: End val [hashmap_hash_map_move_elements_from_list_loop_fwd_back_def] = DefineDiv ‘ - (** [hashmap_main::hashmap::HashMap::{0}::move_elements_from_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::move_elements_from_list]: loop 0: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hashmap_hash_map_move_elements_from_list_loop_fwd_back (ntable : 't hashmap_hash_map_t) (ls : 't hashmap_list_t) : 't hashmap_hash_map_t result @@ -214,7 +218,8 @@ val [hashmap_hash_map_move_elements_from_list_loop_fwd_back_def] = DefineDiv ‘ ’ val hashmap_hash_map_move_elements_from_list_fwd_back_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::move_elements_from_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::move_elements_from_list]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hashmap_hash_map_move_elements_from_list_fwd_back (ntable : 't hashmap_hash_map_t) (ls : 't hashmap_list_t) : 't hashmap_hash_map_t result @@ -223,7 +228,8 @@ val hashmap_hash_map_move_elements_from_list_fwd_back_def = Define ‘ ’ val [hashmap_hash_map_move_elements_loop_fwd_back_def] = DefineDiv ‘ - (** [hashmap_main::hashmap::HashMap::{0}::move_elements] *) + (** [hashmap_main::hashmap::HashMap::{0}::move_elements]: loop 0: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hashmap_hash_map_move_elements_loop_fwd_back (ntable : 't hashmap_hash_map_t) (slots : 't hashmap_list_t vec) (i : usize) : @@ -249,7 +255,8 @@ val [hashmap_hash_map_move_elements_loop_fwd_back_def] = DefineDiv ‘ ’ val hashmap_hash_map_move_elements_fwd_back_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::move_elements] *) + (** [hashmap_main::hashmap::HashMap::{0}::move_elements]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hashmap_hash_map_move_elements_fwd_back (ntable : 't hashmap_hash_map_t) (slots : 't hashmap_list_t vec) (i : usize) : @@ -259,7 +266,8 @@ val hashmap_hash_map_move_elements_fwd_back_def = Define ‘ ’ val hashmap_hash_map_try_resize_fwd_back_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::try_resize] *) + (** [hashmap_main::hashmap::HashMap::{0}::try_resize]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hashmap_hash_map_try_resize_fwd_back (self : 't hashmap_hash_map_t) : 't hashmap_hash_map_t result = do @@ -293,7 +301,8 @@ val hashmap_hash_map_try_resize_fwd_back_def = Define ‘ ’ val hashmap_hash_map_insert_fwd_back_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::insert] *) + (** [hashmap_main::hashmap::HashMap::{0}::insert]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) hashmap_hash_map_insert_fwd_back (self : 't hashmap_hash_map_t) (key : usize) (value : 't) : 't hashmap_hash_map_t result @@ -308,7 +317,7 @@ val hashmap_hash_map_insert_fwd_back_def = Define ‘ ’ val [hashmap_hash_map_contains_key_in_list_loop_fwd_def] = DefineDiv ‘ - (** [hashmap_main::hashmap::HashMap::{0}::contains_key_in_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::contains_key_in_list]: loop 0: forward function *) hashmap_hash_map_contains_key_in_list_loop_fwd (key : usize) (ls : 't hashmap_list_t) : bool result = (case ls of @@ -320,14 +329,14 @@ val [hashmap_hash_map_contains_key_in_list_loop_fwd_def] = DefineDiv ‘ ’ val hashmap_hash_map_contains_key_in_list_fwd_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::contains_key_in_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::contains_key_in_list]: forward function *) hashmap_hash_map_contains_key_in_list_fwd (key : usize) (ls : 't hashmap_list_t) : bool result = hashmap_hash_map_contains_key_in_list_loop_fwd key ls ’ val hashmap_hash_map_contains_key_fwd_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::contains_key] *) + (** [hashmap_main::hashmap::HashMap::{0}::contains_key]: forward function *) hashmap_hash_map_contains_key_fwd (self : 't hashmap_hash_map_t) (key : usize) : bool result = do @@ -342,7 +351,7 @@ val hashmap_hash_map_contains_key_fwd_def = Define ‘ ’ val [hashmap_hash_map_get_in_list_loop_fwd_def] = DefineDiv ‘ - (** [hashmap_main::hashmap::HashMap::{0}::get_in_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::get_in_list]: loop 0: forward function *) hashmap_hash_map_get_in_list_loop_fwd (key : usize) (ls : 't hashmap_list_t) : 't result = (case ls of @@ -354,14 +363,14 @@ val [hashmap_hash_map_get_in_list_loop_fwd_def] = DefineDiv ‘ ’ val hashmap_hash_map_get_in_list_fwd_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::get_in_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::get_in_list]: forward function *) hashmap_hash_map_get_in_list_fwd (key : usize) (ls : 't hashmap_list_t) : 't result = hashmap_hash_map_get_in_list_loop_fwd key ls ’ val hashmap_hash_map_get_fwd_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::get] *) + (** [hashmap_main::hashmap::HashMap::{0}::get]: forward function *) hashmap_hash_map_get_fwd (self : 't hashmap_hash_map_t) (key : usize) : 't result = do @@ -376,7 +385,7 @@ val hashmap_hash_map_get_fwd_def = Define ‘ ’ val [hashmap_hash_map_get_mut_in_list_loop_fwd_def] = DefineDiv ‘ - (** [hashmap_main::hashmap::HashMap::{0}::get_mut_in_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::get_mut_in_list]: loop 0: forward function *) hashmap_hash_map_get_mut_in_list_loop_fwd (ls : 't hashmap_list_t) (key : usize) : 't result = (case ls of @@ -388,14 +397,14 @@ val [hashmap_hash_map_get_mut_in_list_loop_fwd_def] = DefineDiv ‘ ’ val hashmap_hash_map_get_mut_in_list_fwd_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::get_mut_in_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::get_mut_in_list]: forward function *) hashmap_hash_map_get_mut_in_list_fwd (ls : 't hashmap_list_t) (key : usize) : 't result = hashmap_hash_map_get_mut_in_list_loop_fwd ls key ’ val [hashmap_hash_map_get_mut_in_list_loop_back_def] = DefineDiv ‘ - (** [hashmap_main::hashmap::HashMap::{0}::get_mut_in_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::get_mut_in_list]: loop 0: backward function 0 *) hashmap_hash_map_get_mut_in_list_loop_back (ls : 't hashmap_list_t) (key : usize) (ret : 't) : 't hashmap_list_t result @@ -413,7 +422,7 @@ val [hashmap_hash_map_get_mut_in_list_loop_back_def] = DefineDiv ‘ ’ val hashmap_hash_map_get_mut_in_list_back_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::get_mut_in_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::get_mut_in_list]: backward function 0 *) hashmap_hash_map_get_mut_in_list_back (ls : 't hashmap_list_t) (key : usize) (ret : 't) : 't hashmap_list_t result @@ -422,7 +431,7 @@ val hashmap_hash_map_get_mut_in_list_back_def = Define ‘ ’ val hashmap_hash_map_get_mut_fwd_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::get_mut] *) + (** [hashmap_main::hashmap::HashMap::{0}::get_mut]: forward function *) hashmap_hash_map_get_mut_fwd (self : 't hashmap_hash_map_t) (key : usize) : 't result = do @@ -437,7 +446,7 @@ val hashmap_hash_map_get_mut_fwd_def = Define ‘ ’ val hashmap_hash_map_get_mut_back_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::get_mut] *) + (** [hashmap_main::hashmap::HashMap::{0}::get_mut]: backward function 0 *) hashmap_hash_map_get_mut_back (self : 't hashmap_hash_map_t) (key : usize) (ret : 't) : 't hashmap_hash_map_t result @@ -456,7 +465,7 @@ val hashmap_hash_map_get_mut_back_def = Define ‘ ’ val [hashmap_hash_map_remove_from_list_loop_fwd_def] = DefineDiv ‘ - (** [hashmap_main::hashmap::HashMap::{0}::remove_from_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::remove_from_list]: loop 0: forward function *) hashmap_hash_map_remove_from_list_loop_fwd (key : usize) (ls : 't hashmap_list_t) : 't option result = (case ls of @@ -473,14 +482,14 @@ val [hashmap_hash_map_remove_from_list_loop_fwd_def] = DefineDiv ‘ ’ val hashmap_hash_map_remove_from_list_fwd_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::remove_from_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::remove_from_list]: forward function *) hashmap_hash_map_remove_from_list_fwd (key : usize) (ls : 't hashmap_list_t) : 't option result = hashmap_hash_map_remove_from_list_loop_fwd key ls ’ val [hashmap_hash_map_remove_from_list_loop_back_def] = DefineDiv ‘ - (** [hashmap_main::hashmap::HashMap::{0}::remove_from_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::remove_from_list]: loop 0: backward function 1 *) hashmap_hash_map_remove_from_list_loop_back (key : usize) (ls : 't hashmap_list_t) : 't hashmap_list_t result = (case ls of @@ -501,14 +510,14 @@ val [hashmap_hash_map_remove_from_list_loop_back_def] = DefineDiv ‘ ’ val hashmap_hash_map_remove_from_list_back_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::remove_from_list] *) + (** [hashmap_main::hashmap::HashMap::{0}::remove_from_list]: backward function 1 *) hashmap_hash_map_remove_from_list_back (key : usize) (ls : 't hashmap_list_t) : 't hashmap_list_t result = hashmap_hash_map_remove_from_list_loop_back key ls ’ val hashmap_hash_map_remove_fwd_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::remove] *) + (** [hashmap_main::hashmap::HashMap::{0}::remove]: forward function *) hashmap_hash_map_remove_fwd (self : 't hashmap_hash_map_t) (key : usize) : 't option result = do @@ -530,7 +539,7 @@ val hashmap_hash_map_remove_fwd_def = Define ‘ ’ val hashmap_hash_map_remove_back_def = Define ‘ - (** [hashmap_main::hashmap::HashMap::{0}::remove] *) + (** [hashmap_main::hashmap::HashMap::{0}::remove]: backward function 0 *) hashmap_hash_map_remove_back (self : 't hashmap_hash_map_t) (key : usize) : 't hashmap_hash_map_t result @@ -566,7 +575,7 @@ val hashmap_hash_map_remove_back_def = Define ‘ ’ val hashmap_test1_fwd_def = Define ‘ - (** [hashmap_main::hashmap::test1] *) + (** [hashmap_main::hashmap::test1]: forward function *) hashmap_test1_fwd : unit result = do hm <- hashmap_hash_map_new_fwd; @@ -623,7 +632,7 @@ val hashmap_test1_fwd_def = Define ‘ val _ = assert_return (“hashmap_test1_fwd”) val insert_on_disk_fwd_def = Define ‘ - (** [hashmap_main::insert_on_disk] *) + (** [hashmap_main::insert_on_disk]: forward function *) insert_on_disk_fwd (key : usize) (value : u64) (st : state) : (state # unit) result = do @@ -635,7 +644,7 @@ val insert_on_disk_fwd_def = Define ‘ ’ val main_fwd_def = Define ‘ - (** [hashmap_main::main] *) + (** [hashmap_main::main]: forward function *) main_fwd : unit result = Return () ’ diff --git a/tests/hol4/hashmap_on_disk/hashmapMain_OpaqueScript.sml b/tests/hol4/hashmap_on_disk/hashmapMain_OpaqueScript.sml index c38eca01..f7221d92 100644 --- a/tests/hol4/hashmap_on_disk/hashmapMain_OpaqueScript.sml +++ b/tests/hol4/hashmap_on_disk/hashmapMain_OpaqueScript.sml @@ -6,10 +6,10 @@ open hashmapMain_TypesTheory val _ = new_theory "hashmapMain_Opaque" -val _ = new_constant ("hashmap_utils_deserialize_fwd", +(** [hashmap_main::hashmap_utils::deserialize]: forward function *)val _ = new_constant ("hashmap_utils_deserialize_fwd", “:state -> (state # u64 hashmap_hash_map_t) result”) -val _ = new_constant ("hashmap_utils_serialize_fwd", +(** [hashmap_main::hashmap_utils::serialize]: forward function *)val _ = new_constant ("hashmap_utils_serialize_fwd", “:u64 hashmap_hash_map_t -> state -> (state # unit) result”) val _ = export_theory () diff --git a/tests/hol4/misc-constants/constantsScript.sml b/tests/hol4/misc-constants/constantsScript.sml index 324d553d..145c3e0f 100644 --- a/tests/hol4/misc-constants/constantsScript.sml +++ b/tests/hol4/misc-constants/constantsScript.sml @@ -38,7 +38,7 @@ Definition x2_c_def: End val incr_fwd_def = Define ‘ - (** [constants::incr] *) + (** [constants::incr]: forward function *) incr_fwd (n : u32) : u32 result = u32_add n (int_to_u32 1) ’ @@ -52,7 +52,7 @@ Definition x3_c_def: End val mk_pair0_fwd_def = Define ‘ - (** [constants::mk_pair0] *) + (** [constants::mk_pair0]: forward function *) mk_pair0_fwd (x : u32) (y : u32) : (u32 # u32) result = Return (x, y) ’ @@ -63,7 +63,7 @@ Datatype: End val mk_pair1_fwd_def = Define ‘ - (** [constants::mk_pair1] *) + (** [constants::mk_pair1]: forward function *) mk_pair1_fwd (x : u32) (y : u32) : (u32, u32) pair_t result = Return (<| pair_x := x; pair_y := y |>) ’ @@ -108,7 +108,7 @@ Datatype: End val wrap_new_fwd_def = Define ‘ - (** [constants::Wrap::{0}::new] *) + (** [constants::Wrap::{0}::new]: forward function *) wrap_new_fwd (val : 't) : 't wrap_t result = Return (<| wrap_val := val |>) ’ @@ -122,7 +122,7 @@ Definition y_c_def: End val unwrap_y_fwd_def = Define ‘ - (** [constants::unwrap_y] *) + (** [constants::unwrap_y]: forward function *) unwrap_y_fwd : i32 result = Return y_c.wrap_val ’ @@ -144,13 +144,13 @@ Definition get_z1_z1_c_def: End val get_z1_fwd_def = Define ‘ - (** [constants::get_z1] *) + (** [constants::get_z1]: forward function *) get_z1_fwd : i32 result = Return get_z1_z1_c ’ val add_fwd_def = Define ‘ - (** [constants::add] *) + (** [constants::add]: forward function *) add_fwd (a : i32) (b : i32) : i32 result = i32_add a b ’ @@ -180,7 +180,7 @@ Definition q3_c_def: End val get_z2_fwd_def = Define ‘ - (** [constants::get_z2] *) + (** [constants::get_z2]: forward function *) get_z2_fwd : i32 result = do i <- get_z1_fwd; diff --git a/tests/hol4/misc-external/external_FunsScript.sml b/tests/hol4/misc-external/external_FunsScript.sml index 8172bc1c..f3692ee2 100644 --- a/tests/hol4/misc-external/external_FunsScript.sml +++ b/tests/hol4/misc-external/external_FunsScript.sml @@ -7,7 +7,7 @@ val _ = new_theory "external_Funs" val swap_fwd_def = Define ‘ - (** [external::swap] *) + (** [external::swap]: forward function *) swap_fwd (x : 't) (y : 't) (st : state) : (state # unit) result = do (st0, _) <- core_mem_swap_fwd x y st; @@ -18,7 +18,7 @@ val swap_fwd_def = Define ‘ ’ val swap_back_def = Define ‘ - (** [external::swap] *) + (** [external::swap]: backward function 0 *) swap_back (x : 't) (y : 't) (st : state) (st0 : state) : (state # ('t # 't)) result = do @@ -30,7 +30,7 @@ val swap_back_def = Define ‘ ’ val test_new_non_zero_u32_fwd_def = Define ‘ - (** [external::test_new_non_zero_u32] *) + (** [external::test_new_non_zero_u32]: forward function *) test_new_non_zero_u32_fwd (x : u32) (st : state) : (state # core_num_nonzero_non_zero_u32_t) result = do @@ -40,7 +40,7 @@ val test_new_non_zero_u32_fwd_def = Define ‘ ’ val test_vec_fwd_def = Define ‘ - (** [external::test_vec] *) + (** [external::test_vec]: forward function *) test_vec_fwd : unit result = let v = vec_new in do _ <- vec_push_back v (int_to_u32 0); @@ -52,7 +52,7 @@ val test_vec_fwd_def = Define ‘ val _ = assert_return (“test_vec_fwd”) val custom_swap_fwd_def = Define ‘ - (** [external::custom_swap] *) + (** [external::custom_swap]: forward function *) custom_swap_fwd (x : 't) (y : 't) (st : state) : (state # 't) result = do (st0, _) <- core_mem_swap_fwd x y st; @@ -63,7 +63,7 @@ val custom_swap_fwd_def = Define ‘ ’ val custom_swap_back_def = Define ‘ - (** [external::custom_swap] *) + (** [external::custom_swap]: backward function 0 *) custom_swap_back (x : 't) (y : 't) (st : state) (ret : 't) (st0 : state) : (state # ('t # 't)) result @@ -77,7 +77,7 @@ val custom_swap_back_def = Define ‘ ’ val test_custom_swap_fwd_def = Define ‘ - (** [external::test_custom_swap] *) + (** [external::test_custom_swap]: forward function *) test_custom_swap_fwd (x : u32) (y : u32) (st : state) : (state # unit) result = do @@ -87,7 +87,7 @@ val test_custom_swap_fwd_def = Define ‘ ’ val test_custom_swap_back_def = Define ‘ - (** [external::test_custom_swap] *) + (** [external::test_custom_swap]: backward function 0 *) test_custom_swap_back (x : u32) (y : u32) (st : state) (st0 : state) : (state # (u32 # u32)) result @@ -96,7 +96,7 @@ val test_custom_swap_back_def = Define ‘ ’ val test_swap_non_zero_fwd_def = Define ‘ - (** [external::test_swap_non_zero] *) + (** [external::test_swap_non_zero]: forward function *) test_swap_non_zero_fwd (x : u32) (st : state) : (state # u32) result = do (st0, _) <- swap_fwd x (int_to_u32 0) st; diff --git a/tests/hol4/misc-external/external_OpaqueScript.sml b/tests/hol4/misc-external/external_OpaqueScript.sml index 02efc2be..b5a6d91d 100644 --- a/tests/hol4/misc-external/external_OpaqueScript.sml +++ b/tests/hol4/misc-external/external_OpaqueScript.sml @@ -6,20 +6,20 @@ open external_TypesTheory val _ = new_theory "external_Opaque" -val _ = new_constant ("core_mem_swap_fwd", +(** [core::mem::swap]: forward function *)val _ = new_constant ("core_mem_swap_fwd", “:'t -> 't -> state -> (state # unit) result”) -val _ = new_constant ("core_mem_swap_back0", +(** [core::mem::swap]: backward function 0 *)val _ = new_constant ("core_mem_swap_back0", “:'t -> 't -> state -> state -> (state # 't) result”) -val _ = new_constant ("core_mem_swap_back1", +(** [core::mem::swap]: backward function 1 *)val _ = new_constant ("core_mem_swap_back1", “:'t -> 't -> state -> state -> (state # 't) result”) -val _ = new_constant ("core_num_nonzero_non_zero_u32_new_fwd", +(** [core::num::nonzero::NonZeroU32::{14}::new]: forward function *)val _ = new_constant ("core_num_nonzero_non_zero_u32_new_fwd", “:u32 -> state -> (state # core_num_nonzero_non_zero_u32_t option) result”) -val _ = new_constant ("core_option_option_unwrap_fwd", +(** [core::option::Option::{0}::unwrap]: forward function *)val _ = new_constant ("core_option_option_unwrap_fwd", “:'t option -> state -> (state # 't) result”) val _ = export_theory () diff --git a/tests/hol4/misc-loops/loops_FunsScript.sml b/tests/hol4/misc-loops/loops_FunsScript.sml index f0ef036b..65cf77d4 100644 --- a/tests/hol4/misc-loops/loops_FunsScript.sml +++ b/tests/hol4/misc-loops/loops_FunsScript.sml @@ -7,7 +7,7 @@ val _ = new_theory "loops_Funs" val [sum_loop_fwd_def] = DefineDiv ‘ - (** [loops::sum] *) + (** [loops::sum]: loop 0: forward function *) sum_loop_fwd (max : u32) (i : u32) (s : u32) : u32 result = if u32_lt i max then ( @@ -20,13 +20,13 @@ val [sum_loop_fwd_def] = DefineDiv ‘ ’ val sum_fwd_def = Define ‘ - (** [loops::sum] *) + (** [loops::sum]: forward function *) sum_fwd (max : u32) : u32 result = sum_loop_fwd max (int_to_u32 0) (int_to_u32 0) ’ val [sum_with_mut_borrows_loop_fwd_def] = DefineDiv ‘ - (** [loops::sum_with_mut_borrows] *) + (** [loops::sum_with_mut_borrows]: loop 0: forward function *) sum_with_mut_borrows_loop_fwd (max : u32) (mi : u32) (ms : u32) : u32 result = if u32_lt mi max @@ -40,13 +40,13 @@ val [sum_with_mut_borrows_loop_fwd_def] = DefineDiv ‘ ’ val sum_with_mut_borrows_fwd_def = Define ‘ - (** [loops::sum_with_mut_borrows] *) + (** [loops::sum_with_mut_borrows]: forward function *) sum_with_mut_borrows_fwd (max : u32) : u32 result = sum_with_mut_borrows_loop_fwd max (int_to_u32 0) (int_to_u32 0) ’ val [sum_with_shared_borrows_loop_fwd_def] = DefineDiv ‘ - (** [loops::sum_with_shared_borrows] *) + (** [loops::sum_with_shared_borrows]: loop 0: forward function *) sum_with_shared_borrows_loop_fwd (max : u32) (i : u32) (s : u32) : u32 result = if u32_lt i max @@ -60,13 +60,14 @@ val [sum_with_shared_borrows_loop_fwd_def] = DefineDiv ‘ ’ val sum_with_shared_borrows_fwd_def = Define ‘ - (** [loops::sum_with_shared_borrows] *) + (** [loops::sum_with_shared_borrows]: forward function *) sum_with_shared_borrows_fwd (max : u32) : u32 result = sum_with_shared_borrows_loop_fwd max (int_to_u32 0) (int_to_u32 0) ’ val [clear_loop_fwd_back_def] = DefineDiv ‘ - (** [loops::clear] *) + (** [loops::clear]: loop 0: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) clear_loop_fwd_back (v : u32 vec) (i : usize) : u32 vec result = let i0 = vec_len v in if usize_lt i i0 @@ -80,13 +81,14 @@ val [clear_loop_fwd_back_def] = DefineDiv ‘ ’ val clear_fwd_back_def = Define ‘ - (** [loops::clear] *) + (** [loops::clear]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) clear_fwd_back (v : u32 vec) : u32 vec result = clear_loop_fwd_back v (int_to_usize 0) ’ val [list_mem_loop_fwd_def] = DefineDiv ‘ - (** [loops::list_mem] *) + (** [loops::list_mem]: loop 0: forward function *) list_mem_loop_fwd (x : u32) (ls : u32 list_t) : bool result = (case ls of | ListCons y tl => if y = x then Return T else list_mem_loop_fwd x tl @@ -94,13 +96,13 @@ val [list_mem_loop_fwd_def] = DefineDiv ‘ ’ val list_mem_fwd_def = Define ‘ - (** [loops::list_mem] *) + (** [loops::list_mem]: forward function *) list_mem_fwd (x : u32) (ls : u32 list_t) : bool result = list_mem_loop_fwd x ls ’ val [list_nth_mut_loop_loop_fwd_def] = DefineDiv ‘ - (** [loops::list_nth_mut_loop] *) + (** [loops::list_nth_mut_loop]: loop 0: forward function *) list_nth_mut_loop_loop_fwd (ls : 't list_t) (i : u32) : 't result = (case ls of | ListCons x tl => @@ -115,13 +117,13 @@ val [list_nth_mut_loop_loop_fwd_def] = DefineDiv ‘ ’ val list_nth_mut_loop_fwd_def = Define ‘ - (** [loops::list_nth_mut_loop] *) + (** [loops::list_nth_mut_loop]: forward function *) list_nth_mut_loop_fwd (ls : 't list_t) (i : u32) : 't result = list_nth_mut_loop_loop_fwd ls i ’ val [list_nth_mut_loop_loop_back_def] = DefineDiv ‘ - (** [loops::list_nth_mut_loop] *) + (** [loops::list_nth_mut_loop]: loop 0: backward function 0 *) list_nth_mut_loop_loop_back (ls : 't list_t) (i : u32) (ret : 't) : 't list_t result = (case ls of @@ -138,14 +140,14 @@ val [list_nth_mut_loop_loop_back_def] = DefineDiv ‘ ’ val list_nth_mut_loop_back_def = Define ‘ - (** [loops::list_nth_mut_loop] *) + (** [loops::list_nth_mut_loop]: backward function 0 *) list_nth_mut_loop_back (ls : 't list_t) (i : u32) (ret : 't) : 't list_t result = list_nth_mut_loop_loop_back ls i ret ’ val [list_nth_shared_loop_loop_fwd_def] = DefineDiv ‘ - (** [loops::list_nth_shared_loop] *) + (** [loops::list_nth_shared_loop]: loop 0: forward function *) list_nth_shared_loop_loop_fwd (ls : 't list_t) (i : u32) : 't result = (case ls of | ListCons x tl => @@ -160,13 +162,13 @@ val [list_nth_shared_loop_loop_fwd_def] = DefineDiv ‘ ’ val list_nth_shared_loop_fwd_def = Define ‘ - (** [loops::list_nth_shared_loop] *) + (** [loops::list_nth_shared_loop]: forward function *) list_nth_shared_loop_fwd (ls : 't list_t) (i : u32) : 't result = list_nth_shared_loop_loop_fwd ls i ’ val [get_elem_mut_loop_fwd_def] = DefineDiv ‘ - (** [loops::get_elem_mut] *) + (** [loops::get_elem_mut]: loop 0: forward function *) get_elem_mut_loop_fwd (x : usize) (ls : usize list_t) : usize result = (case ls of | ListCons y tl => if y = x then Return y else get_elem_mut_loop_fwd x tl @@ -174,7 +176,7 @@ val [get_elem_mut_loop_fwd_def] = DefineDiv ‘ ’ val get_elem_mut_fwd_def = Define ‘ - (** [loops::get_elem_mut] *) + (** [loops::get_elem_mut]: forward function *) get_elem_mut_fwd (slots : usize list_t vec) (x : usize) : usize result = do l <- vec_index_mut_fwd slots (int_to_usize 0); @@ -183,7 +185,7 @@ val get_elem_mut_fwd_def = Define ‘ ’ val [get_elem_mut_loop_back_def] = DefineDiv ‘ - (** [loops::get_elem_mut] *) + (** [loops::get_elem_mut]: loop 0: backward function 0 *) get_elem_mut_loop_back (x : usize) (ls : usize list_t) (ret : usize) : usize list_t result = (case ls of @@ -199,7 +201,7 @@ val [get_elem_mut_loop_back_def] = DefineDiv ‘ ’ val get_elem_mut_back_def = Define ‘ - (** [loops::get_elem_mut] *) + (** [loops::get_elem_mut]: backward function 0 *) get_elem_mut_back (slots : usize list_t vec) (x : usize) (ret : usize) : usize list_t vec result @@ -212,7 +214,7 @@ val get_elem_mut_back_def = Define ‘ ’ val [get_elem_shared_loop_fwd_def] = DefineDiv ‘ - (** [loops::get_elem_shared] *) + (** [loops::get_elem_shared]: loop 0: forward function *) get_elem_shared_loop_fwd (x : usize) (ls : usize list_t) : usize result = (case ls of | ListCons y tl => @@ -221,7 +223,7 @@ val [get_elem_shared_loop_fwd_def] = DefineDiv ‘ ’ val get_elem_shared_fwd_def = Define ‘ - (** [loops::get_elem_shared] *) + (** [loops::get_elem_shared]: forward function *) get_elem_shared_fwd (slots : usize list_t vec) (x : usize) : usize result = do l <- vec_index_fwd slots (int_to_usize 0); @@ -230,25 +232,25 @@ val get_elem_shared_fwd_def = Define ‘ ’ val id_mut_fwd_def = Define ‘ - (** [loops::id_mut] *) + (** [loops::id_mut]: forward function *) id_mut_fwd (ls : 't list_t) : 't list_t result = Return ls ’ val id_mut_back_def = Define ‘ - (** [loops::id_mut] *) + (** [loops::id_mut]: backward function 0 *) id_mut_back (ls : 't list_t) (ret : 't list_t) : 't list_t result = Return ret ’ val id_shared_fwd_def = Define ‘ - (** [loops::id_shared] *) + (** [loops::id_shared]: forward function *) id_shared_fwd (ls : 't list_t) : 't list_t result = Return ls ’ val [list_nth_mut_loop_with_id_loop_fwd_def] = DefineDiv ‘ - (** [loops::list_nth_mut_loop_with_id] *) + (** [loops::list_nth_mut_loop_with_id]: loop 0: forward function *) list_nth_mut_loop_with_id_loop_fwd (i : u32) (ls : 't list_t) : 't result = (case ls of | ListCons x tl => @@ -263,7 +265,7 @@ val [list_nth_mut_loop_with_id_loop_fwd_def] = DefineDiv ‘ ’ val list_nth_mut_loop_with_id_fwd_def = Define ‘ - (** [loops::list_nth_mut_loop_with_id] *) + (** [loops::list_nth_mut_loop_with_id]: forward function *) list_nth_mut_loop_with_id_fwd (ls : 't list_t) (i : u32) : 't result = do ls0 <- id_mut_fwd ls; @@ -272,7 +274,7 @@ val list_nth_mut_loop_with_id_fwd_def = Define ‘ ’ val [list_nth_mut_loop_with_id_loop_back_def] = DefineDiv ‘ - (** [loops::list_nth_mut_loop_with_id] *) + (** [loops::list_nth_mut_loop_with_id]: loop 0: backward function 0 *) list_nth_mut_loop_with_id_loop_back (i : u32) (ls : 't list_t) (ret : 't) : 't list_t result = (case ls of @@ -289,7 +291,7 @@ val [list_nth_mut_loop_with_id_loop_back_def] = DefineDiv ‘ ’ val list_nth_mut_loop_with_id_back_def = Define ‘ - (** [loops::list_nth_mut_loop_with_id] *) + (** [loops::list_nth_mut_loop_with_id]: backward function 0 *) list_nth_mut_loop_with_id_back (ls : 't list_t) (i : u32) (ret : 't) : 't list_t result = do @@ -300,7 +302,7 @@ val list_nth_mut_loop_with_id_back_def = Define ‘ ’ val [list_nth_shared_loop_with_id_loop_fwd_def] = DefineDiv ‘ - (** [loops::list_nth_shared_loop_with_id] *) + (** [loops::list_nth_shared_loop_with_id]: loop 0: forward function *) list_nth_shared_loop_with_id_loop_fwd (i : u32) (ls : 't list_t) : 't result = (case ls of @@ -316,7 +318,7 @@ val [list_nth_shared_loop_with_id_loop_fwd_def] = DefineDiv ‘ ’ val list_nth_shared_loop_with_id_fwd_def = Define ‘ - (** [loops::list_nth_shared_loop_with_id] *) + (** [loops::list_nth_shared_loop_with_id]: forward function *) list_nth_shared_loop_with_id_fwd (ls : 't list_t) (i : u32) : 't result = do ls0 <- id_shared_fwd ls; @@ -325,7 +327,7 @@ val list_nth_shared_loop_with_id_fwd_def = Define ‘ ’ val [list_nth_mut_loop_pair_loop_fwd_def] = DefineDiv ‘ - (** [loops::list_nth_mut_loop_pair] *) + (** [loops::list_nth_mut_loop_pair]: loop 0: forward function *) list_nth_mut_loop_pair_loop_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = (case ls0 of @@ -344,14 +346,14 @@ val [list_nth_mut_loop_pair_loop_fwd_def] = DefineDiv ‘ ’ val list_nth_mut_loop_pair_fwd_def = Define ‘ - (** [loops::list_nth_mut_loop_pair] *) + (** [loops::list_nth_mut_loop_pair]: forward function *) list_nth_mut_loop_pair_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = list_nth_mut_loop_pair_loop_fwd ls0 ls1 i ’ val [list_nth_mut_loop_pair_loop_back'a_def] = DefineDiv ‘ - (** [loops::list_nth_mut_loop_pair] *) + (** [loops::list_nth_mut_loop_pair]: loop 0: backward function 0 *) list_nth_mut_loop_pair_loop_back'a (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) (ret : 't) : 't list_t result @@ -373,7 +375,7 @@ val [list_nth_mut_loop_pair_loop_back'a_def] = DefineDiv ‘ ’ val list_nth_mut_loop_pair_back'a_def = Define ‘ - (** [loops::list_nth_mut_loop_pair] *) + (** [loops::list_nth_mut_loop_pair]: backward function 0 *) list_nth_mut_loop_pair_back'a (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) (ret : 't) : 't list_t result @@ -382,7 +384,7 @@ val list_nth_mut_loop_pair_back'a_def = Define ‘ ’ val [list_nth_mut_loop_pair_loop_back'b_def] = DefineDiv ‘ - (** [loops::list_nth_mut_loop_pair] *) + (** [loops::list_nth_mut_loop_pair]: loop 0: backward function 1 *) list_nth_mut_loop_pair_loop_back'b (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) (ret : 't) : 't list_t result @@ -404,7 +406,7 @@ val [list_nth_mut_loop_pair_loop_back'b_def] = DefineDiv ‘ ’ val list_nth_mut_loop_pair_back'b_def = Define ‘ - (** [loops::list_nth_mut_loop_pair] *) + (** [loops::list_nth_mut_loop_pair]: backward function 1 *) list_nth_mut_loop_pair_back'b (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) (ret : 't) : 't list_t result @@ -413,7 +415,7 @@ val list_nth_mut_loop_pair_back'b_def = Define ‘ ’ val [list_nth_shared_loop_pair_loop_fwd_def] = DefineDiv ‘ - (** [loops::list_nth_shared_loop_pair] *) + (** [loops::list_nth_shared_loop_pair]: loop 0: forward function *) list_nth_shared_loop_pair_loop_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = (case ls0 of @@ -432,14 +434,14 @@ val [list_nth_shared_loop_pair_loop_fwd_def] = DefineDiv ‘ ’ val list_nth_shared_loop_pair_fwd_def = Define ‘ - (** [loops::list_nth_shared_loop_pair] *) + (** [loops::list_nth_shared_loop_pair]: forward function *) list_nth_shared_loop_pair_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = list_nth_shared_loop_pair_loop_fwd ls0 ls1 i ’ val [list_nth_mut_loop_pair_merge_loop_fwd_def] = DefineDiv ‘ - (** [loops::list_nth_mut_loop_pair_merge] *) + (** [loops::list_nth_mut_loop_pair_merge]: loop 0: forward function *) list_nth_mut_loop_pair_merge_loop_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = (case ls0 of @@ -458,14 +460,14 @@ val [list_nth_mut_loop_pair_merge_loop_fwd_def] = DefineDiv ‘ ’ val list_nth_mut_loop_pair_merge_fwd_def = Define ‘ - (** [loops::list_nth_mut_loop_pair_merge] *) + (** [loops::list_nth_mut_loop_pair_merge]: forward function *) list_nth_mut_loop_pair_merge_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = list_nth_mut_loop_pair_merge_loop_fwd ls0 ls1 i ’ val [list_nth_mut_loop_pair_merge_loop_back_def] = DefineDiv ‘ - (** [loops::list_nth_mut_loop_pair_merge] *) + (** [loops::list_nth_mut_loop_pair_merge]: loop 0: backward function 0 *) list_nth_mut_loop_pair_merge_loop_back (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) (ret : ('t # 't)) : ('t list_t # 't list_t) result @@ -488,7 +490,7 @@ val [list_nth_mut_loop_pair_merge_loop_back_def] = DefineDiv ‘ ’ val list_nth_mut_loop_pair_merge_back_def = Define ‘ - (** [loops::list_nth_mut_loop_pair_merge] *) + (** [loops::list_nth_mut_loop_pair_merge]: backward function 0 *) list_nth_mut_loop_pair_merge_back (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) (ret : ('t # 't)) : ('t list_t # 't list_t) result @@ -497,7 +499,7 @@ val list_nth_mut_loop_pair_merge_back_def = Define ‘ ’ val [list_nth_shared_loop_pair_merge_loop_fwd_def] = DefineDiv ‘ - (** [loops::list_nth_shared_loop_pair_merge] *) + (** [loops::list_nth_shared_loop_pair_merge]: loop 0: forward function *) list_nth_shared_loop_pair_merge_loop_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = (case ls0 of @@ -516,14 +518,14 @@ val [list_nth_shared_loop_pair_merge_loop_fwd_def] = DefineDiv ‘ ’ val list_nth_shared_loop_pair_merge_fwd_def = Define ‘ - (** [loops::list_nth_shared_loop_pair_merge] *) + (** [loops::list_nth_shared_loop_pair_merge]: forward function *) list_nth_shared_loop_pair_merge_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = list_nth_shared_loop_pair_merge_loop_fwd ls0 ls1 i ’ val [list_nth_mut_shared_loop_pair_loop_fwd_def] = DefineDiv ‘ - (** [loops::list_nth_mut_shared_loop_pair] *) + (** [loops::list_nth_mut_shared_loop_pair]: loop 0: forward function *) list_nth_mut_shared_loop_pair_loop_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = (case ls0 of @@ -542,14 +544,14 @@ val [list_nth_mut_shared_loop_pair_loop_fwd_def] = DefineDiv ‘ ’ val list_nth_mut_shared_loop_pair_fwd_def = Define ‘ - (** [loops::list_nth_mut_shared_loop_pair] *) + (** [loops::list_nth_mut_shared_loop_pair]: forward function *) list_nth_mut_shared_loop_pair_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = list_nth_mut_shared_loop_pair_loop_fwd ls0 ls1 i ’ val [list_nth_mut_shared_loop_pair_loop_back_def] = DefineDiv ‘ - (** [loops::list_nth_mut_shared_loop_pair] *) + (** [loops::list_nth_mut_shared_loop_pair]: loop 0: backward function 0 *) list_nth_mut_shared_loop_pair_loop_back (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) (ret : 't) : 't list_t result @@ -571,7 +573,7 @@ val [list_nth_mut_shared_loop_pair_loop_back_def] = DefineDiv ‘ ’ val list_nth_mut_shared_loop_pair_back_def = Define ‘ - (** [loops::list_nth_mut_shared_loop_pair] *) + (** [loops::list_nth_mut_shared_loop_pair]: backward function 0 *) list_nth_mut_shared_loop_pair_back (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) (ret : 't) : 't list_t result @@ -580,7 +582,7 @@ val list_nth_mut_shared_loop_pair_back_def = Define ‘ ’ val [list_nth_mut_shared_loop_pair_merge_loop_fwd_def] = DefineDiv ‘ - (** [loops::list_nth_mut_shared_loop_pair_merge] *) + (** [loops::list_nth_mut_shared_loop_pair_merge]: loop 0: forward function *) list_nth_mut_shared_loop_pair_merge_loop_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = (case ls0 of @@ -599,14 +601,14 @@ val [list_nth_mut_shared_loop_pair_merge_loop_fwd_def] = DefineDiv ‘ ’ val list_nth_mut_shared_loop_pair_merge_fwd_def = Define ‘ - (** [loops::list_nth_mut_shared_loop_pair_merge] *) + (** [loops::list_nth_mut_shared_loop_pair_merge]: forward function *) list_nth_mut_shared_loop_pair_merge_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = list_nth_mut_shared_loop_pair_merge_loop_fwd ls0 ls1 i ’ val [list_nth_mut_shared_loop_pair_merge_loop_back_def] = DefineDiv ‘ - (** [loops::list_nth_mut_shared_loop_pair_merge] *) + (** [loops::list_nth_mut_shared_loop_pair_merge]: loop 0: backward function 0 *) list_nth_mut_shared_loop_pair_merge_loop_back (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) (ret : 't) : 't list_t result @@ -628,7 +630,7 @@ val [list_nth_mut_shared_loop_pair_merge_loop_back_def] = DefineDiv ‘ ’ val list_nth_mut_shared_loop_pair_merge_back_def = Define ‘ - (** [loops::list_nth_mut_shared_loop_pair_merge] *) + (** [loops::list_nth_mut_shared_loop_pair_merge]: backward function 0 *) list_nth_mut_shared_loop_pair_merge_back (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) (ret : 't) : 't list_t result @@ -637,7 +639,7 @@ val list_nth_mut_shared_loop_pair_merge_back_def = Define ‘ ’ val [list_nth_shared_mut_loop_pair_loop_fwd_def] = DefineDiv ‘ - (** [loops::list_nth_shared_mut_loop_pair] *) + (** [loops::list_nth_shared_mut_loop_pair]: loop 0: forward function *) list_nth_shared_mut_loop_pair_loop_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = (case ls0 of @@ -656,14 +658,14 @@ val [list_nth_shared_mut_loop_pair_loop_fwd_def] = DefineDiv ‘ ’ val list_nth_shared_mut_loop_pair_fwd_def = Define ‘ - (** [loops::list_nth_shared_mut_loop_pair] *) + (** [loops::list_nth_shared_mut_loop_pair]: forward function *) list_nth_shared_mut_loop_pair_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = list_nth_shared_mut_loop_pair_loop_fwd ls0 ls1 i ’ val [list_nth_shared_mut_loop_pair_loop_back_def] = DefineDiv ‘ - (** [loops::list_nth_shared_mut_loop_pair] *) + (** [loops::list_nth_shared_mut_loop_pair]: loop 0: backward function 1 *) list_nth_shared_mut_loop_pair_loop_back (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) (ret : 't) : 't list_t result @@ -685,7 +687,7 @@ val [list_nth_shared_mut_loop_pair_loop_back_def] = DefineDiv ‘ ’ val list_nth_shared_mut_loop_pair_back_def = Define ‘ - (** [loops::list_nth_shared_mut_loop_pair] *) + (** [loops::list_nth_shared_mut_loop_pair]: backward function 1 *) list_nth_shared_mut_loop_pair_back (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) (ret : 't) : 't list_t result @@ -694,7 +696,7 @@ val list_nth_shared_mut_loop_pair_back_def = Define ‘ ’ val [list_nth_shared_mut_loop_pair_merge_loop_fwd_def] = DefineDiv ‘ - (** [loops::list_nth_shared_mut_loop_pair_merge] *) + (** [loops::list_nth_shared_mut_loop_pair_merge]: loop 0: forward function *) list_nth_shared_mut_loop_pair_merge_loop_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = (case ls0 of @@ -713,14 +715,14 @@ val [list_nth_shared_mut_loop_pair_merge_loop_fwd_def] = DefineDiv ‘ ’ val list_nth_shared_mut_loop_pair_merge_fwd_def = Define ‘ - (** [loops::list_nth_shared_mut_loop_pair_merge] *) + (** [loops::list_nth_shared_mut_loop_pair_merge]: forward function *) list_nth_shared_mut_loop_pair_merge_fwd (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) : ('t # 't) result = list_nth_shared_mut_loop_pair_merge_loop_fwd ls0 ls1 i ’ val [list_nth_shared_mut_loop_pair_merge_loop_back_def] = DefineDiv ‘ - (** [loops::list_nth_shared_mut_loop_pair_merge] *) + (** [loops::list_nth_shared_mut_loop_pair_merge]: loop 0: backward function 0 *) list_nth_shared_mut_loop_pair_merge_loop_back (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) (ret : 't) : 't list_t result @@ -742,7 +744,7 @@ val [list_nth_shared_mut_loop_pair_merge_loop_back_def] = DefineDiv ‘ ’ val list_nth_shared_mut_loop_pair_merge_back_def = Define ‘ - (** [loops::list_nth_shared_mut_loop_pair_merge] *) + (** [loops::list_nth_shared_mut_loop_pair_merge]: backward function 0 *) list_nth_shared_mut_loop_pair_merge_back (ls0 : 't list_t) (ls1 : 't list_t) (i : u32) (ret : 't) : 't list_t result diff --git a/tests/hol4/misc-no_nested_borrows/noNestedBorrowsScript.sml b/tests/hol4/misc-no_nested_borrows/noNestedBorrowsScript.sml index c8b106cd..66614c3f 100644 --- a/tests/hol4/misc-no_nested_borrows/noNestedBorrowsScript.sml +++ b/tests/hol4/misc-no_nested_borrows/noNestedBorrowsScript.sml @@ -38,49 +38,49 @@ Datatype: End val neg_test_fwd_def = Define ‘ - (** [no_nested_borrows::neg_test] *) + (** [no_nested_borrows::neg_test]: forward function *) neg_test_fwd (x : i32) : i32 result = i32_neg x ’ val add_test_fwd_def = Define ‘ - (** [no_nested_borrows::add_test] *) + (** [no_nested_borrows::add_test]: forward function *) add_test_fwd (x : u32) (y : u32) : u32 result = u32_add x y ’ val subs_test_fwd_def = Define ‘ - (** [no_nested_borrows::subs_test] *) + (** [no_nested_borrows::subs_test]: forward function *) subs_test_fwd (x : u32) (y : u32) : u32 result = u32_sub x y ’ val div_test_fwd_def = Define ‘ - (** [no_nested_borrows::div_test] *) + (** [no_nested_borrows::div_test]: forward function *) div_test_fwd (x : u32) (y : u32) : u32 result = u32_div x y ’ val div_test1_fwd_def = Define ‘ - (** [no_nested_borrows::div_test1] *) + (** [no_nested_borrows::div_test1]: forward function *) div_test1_fwd (x : u32) : u32 result = u32_div x (int_to_u32 2) ’ val rem_test_fwd_def = Define ‘ - (** [no_nested_borrows::rem_test] *) + (** [no_nested_borrows::rem_test]: forward function *) rem_test_fwd (x : u32) (y : u32) : u32 result = u32_rem x y ’ val cast_test_fwd_def = Define ‘ - (** [no_nested_borrows::cast_test] *) + (** [no_nested_borrows::cast_test]: forward function *) cast_test_fwd (x : u32) : i32 result = mk_i32 (u32_to_int x) ’ val test2_fwd_def = Define ‘ - (** [no_nested_borrows::test2] *) + (** [no_nested_borrows::test2]: forward function *) test2_fwd : unit result = do _ <- u32_add (int_to_u32 23) (int_to_u32 44); @@ -92,13 +92,13 @@ val test2_fwd_def = Define ‘ val _ = assert_return (“test2_fwd”) val get_max_fwd_def = Define ‘ - (** [no_nested_borrows::get_max] *) + (** [no_nested_borrows::get_max]: forward function *) get_max_fwd (x : u32) (y : u32) : u32 result = if u32_ge x y then Return x else Return y ’ val test3_fwd_def = Define ‘ - (** [no_nested_borrows::test3] *) + (** [no_nested_borrows::test3]: forward function *) test3_fwd : unit result = do x <- get_max_fwd (int_to_u32 4) (int_to_u32 3); @@ -112,7 +112,7 @@ val test3_fwd_def = Define ‘ val _ = assert_return (“test3_fwd”) val test_neg1_fwd_def = Define ‘ - (** [no_nested_borrows::test_neg1] *) + (** [no_nested_borrows::test_neg1]: forward function *) test_neg1_fwd : unit result = do y <- i32_neg (int_to_i32 3); @@ -124,7 +124,7 @@ val test_neg1_fwd_def = Define ‘ val _ = assert_return (“test_neg1_fwd”) val refs_test1_fwd_def = Define ‘ - (** [no_nested_borrows::refs_test1] *) + (** [no_nested_borrows::refs_test1]: forward function *) refs_test1_fwd : unit result = if ~ (int_to_i32 1 = int_to_i32 1) then Fail Failure else Return () ’ @@ -133,7 +133,7 @@ val refs_test1_fwd_def = Define ‘ val _ = assert_return (“refs_test1_fwd”) val refs_test2_fwd_def = Define ‘ - (** [no_nested_borrows::refs_test2] *) + (** [no_nested_borrows::refs_test2]: forward function *) refs_test2_fwd : unit result = if ~ (int_to_i32 2 = int_to_i32 2) then Fail Failure @@ -151,7 +151,7 @@ val refs_test2_fwd_def = Define ‘ val _ = assert_return (“refs_test2_fwd”) val test_list1_fwd_def = Define ‘ - (** [no_nested_borrows::test_list1] *) + (** [no_nested_borrows::test_list1]: forward function *) test_list1_fwd : unit result = Return () ’ @@ -160,7 +160,7 @@ val test_list1_fwd_def = Define ‘ val _ = assert_return (“test_list1_fwd”) val test_box1_fwd_def = Define ‘ - (** [no_nested_borrows::test_box1] *) + (** [no_nested_borrows::test_box1]: forward function *) test_box1_fwd : unit result = let b = int_to_i32 1 in let x = b in @@ -171,25 +171,25 @@ val test_box1_fwd_def = Define ‘ val _ = assert_return (“test_box1_fwd”) val copy_int_fwd_def = Define ‘ - (** [no_nested_borrows::copy_int] *) + (** [no_nested_borrows::copy_int]: forward function *) copy_int_fwd (x : i32) : i32 result = Return x ’ val test_unreachable_fwd_def = Define ‘ - (** [no_nested_borrows::test_unreachable] *) + (** [no_nested_borrows::test_unreachable]: forward function *) test_unreachable_fwd (b : bool) : unit result = if b then Fail Failure else Return () ’ val test_panic_fwd_def = Define ‘ - (** [no_nested_borrows::test_panic] *) + (** [no_nested_borrows::test_panic]: forward function *) test_panic_fwd (b : bool) : unit result = if b then Fail Failure else Return () ’ val test_copy_int_fwd_def = Define ‘ - (** [no_nested_borrows::test_copy_int] *) + (** [no_nested_borrows::test_copy_int]: forward function *) test_copy_int_fwd : unit result = do y <- copy_int_fwd (int_to_i32 0); @@ -201,13 +201,13 @@ val test_copy_int_fwd_def = Define ‘ val _ = assert_return (“test_copy_int_fwd”) val is_cons_fwd_def = Define ‘ - (** [no_nested_borrows::is_cons] *) + (** [no_nested_borrows::is_cons]: forward function *) is_cons_fwd (l : 't list_t) : bool result = (case l of | ListCons t l0 => Return T | ListNil => Return F) ’ val test_is_cons_fwd_def = Define ‘ - (** [no_nested_borrows::test_is_cons] *) + (** [no_nested_borrows::test_is_cons]: forward function *) test_is_cons_fwd : unit result = let l = ListNil in do @@ -220,13 +220,13 @@ val test_is_cons_fwd_def = Define ‘ val _ = assert_return (“test_is_cons_fwd”) val split_list_fwd_def = Define ‘ - (** [no_nested_borrows::split_list] *) + (** [no_nested_borrows::split_list]: forward function *) split_list_fwd (l : 't list_t) : ('t # 't list_t) result = (case l of | ListCons hd tl => Return (hd, tl) | ListNil => Fail Failure) ’ val test_split_list_fwd_def = Define ‘ - (** [no_nested_borrows::test_split_list] *) + (** [no_nested_borrows::test_split_list]: forward function *) test_split_list_fwd : unit result = let l = ListNil in do @@ -240,19 +240,19 @@ val test_split_list_fwd_def = Define ‘ val _ = assert_return (“test_split_list_fwd”) val choose_fwd_def = Define ‘ - (** [no_nested_borrows::choose] *) + (** [no_nested_borrows::choose]: forward function *) choose_fwd (b : bool) (x : 't) (y : 't) : 't result = if b then Return x else Return y ’ val choose_back_def = Define ‘ - (** [no_nested_borrows::choose] *) + (** [no_nested_borrows::choose]: backward function 0 *) choose_back (b : bool) (x : 't) (y : 't) (ret : 't) : ('t # 't) result = if b then Return (ret, y) else Return (x, ret) ’ val choose_test_fwd_def = Define ‘ - (** [no_nested_borrows::choose_test] *) + (** [no_nested_borrows::choose_test]: forward function *) choose_test_fwd : unit result = do z <- choose_fwd T (int_to_i32 0) (int_to_i32 0); @@ -273,7 +273,7 @@ val choose_test_fwd_def = Define ‘ val _ = assert_return (“choose_test_fwd”) val test_char_fwd_def = Define ‘ - (** [no_nested_borrows::test_char] *) + (** [no_nested_borrows::test_char]: forward function *) test_char_fwd : char result = Return #"a" ’ @@ -287,7 +287,7 @@ Datatype: End val [list_length_fwd_def] = DefineDiv ‘ - (** [no_nested_borrows::list_length] *) + (** [no_nested_borrows::list_length]: forward function *) list_length_fwd (l : 't list_t) : u32 result = (case l of | ListCons t l1 => do @@ -298,7 +298,7 @@ val [list_length_fwd_def] = DefineDiv ‘ ’ val [list_nth_shared_fwd_def] = DefineDiv ‘ - (** [no_nested_borrows::list_nth_shared] *) + (** [no_nested_borrows::list_nth_shared]: forward function *) list_nth_shared_fwd (l : 't list_t) (i : u32) : 't result = (case l of | ListCons x tl => @@ -312,7 +312,7 @@ val [list_nth_shared_fwd_def] = DefineDiv ‘ ’ val [list_nth_mut_fwd_def] = DefineDiv ‘ - (** [no_nested_borrows::list_nth_mut] *) + (** [no_nested_borrows::list_nth_mut]: forward function *) list_nth_mut_fwd (l : 't list_t) (i : u32) : 't result = (case l of | ListCons x tl => @@ -326,7 +326,7 @@ val [list_nth_mut_fwd_def] = DefineDiv ‘ ’ val [list_nth_mut_back_def] = DefineDiv ‘ - (** [no_nested_borrows::list_nth_mut] *) + (** [no_nested_borrows::list_nth_mut]: backward function 0 *) list_nth_mut_back (l : 't list_t) (i : u32) (ret : 't) : 't list_t result = (case l of | ListCons x tl => @@ -342,7 +342,7 @@ val [list_nth_mut_back_def] = DefineDiv ‘ ’ val [list_rev_aux_fwd_def] = DefineDiv ‘ - (** [no_nested_borrows::list_rev_aux] *) + (** [no_nested_borrows::list_rev_aux]: forward function *) list_rev_aux_fwd (li : 't list_t) (lo : 't list_t) : 't list_t result = (case li of | ListCons hd tl => list_rev_aux_fwd tl (ListCons hd lo) @@ -350,13 +350,14 @@ val [list_rev_aux_fwd_def] = DefineDiv ‘ ’ val list_rev_fwd_back_def = Define ‘ - (** [no_nested_borrows::list_rev] *) + (** [no_nested_borrows::list_rev]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) list_rev_fwd_back (l : 't list_t) : 't list_t result = let li = mem_replace_fwd l ListNil in list_rev_aux_fwd li ListNil ’ val test_list_functions_fwd_def = Define ‘ - (** [no_nested_borrows::test_list_functions] *) + (** [no_nested_borrows::test_list_functions]: forward function *) test_list_functions_fwd : unit result = let l = ListNil in let l0 = ListCons (int_to_i32 2) l in @@ -411,63 +412,63 @@ val test_list_functions_fwd_def = Define ‘ val _ = assert_return (“test_list_functions_fwd”) val id_mut_pair1_fwd_def = Define ‘ - (** [no_nested_borrows::id_mut_pair1] *) + (** [no_nested_borrows::id_mut_pair1]: forward function *) id_mut_pair1_fwd (x : 't1) (y : 't2) : ('t1 # 't2) result = Return (x, y) ’ val id_mut_pair1_back_def = Define ‘ - (** [no_nested_borrows::id_mut_pair1] *) + (** [no_nested_borrows::id_mut_pair1]: backward function 0 *) id_mut_pair1_back (x : 't1) (y : 't2) (ret : ('t1 # 't2)) : ('t1 # 't2) result = let (t, t0) = ret in Return (t, t0) ’ val id_mut_pair2_fwd_def = Define ‘ - (** [no_nested_borrows::id_mut_pair2] *) + (** [no_nested_borrows::id_mut_pair2]: forward function *) id_mut_pair2_fwd (p : ('t1 # 't2)) : ('t1 # 't2) result = let (t, t0) = p in Return (t, t0) ’ val id_mut_pair2_back_def = Define ‘ - (** [no_nested_borrows::id_mut_pair2] *) + (** [no_nested_borrows::id_mut_pair2]: backward function 0 *) id_mut_pair2_back (p : ('t1 # 't2)) (ret : ('t1 # 't2)) : ('t1 # 't2) result = let (t, t0) = ret in Return (t, t0) ’ val id_mut_pair3_fwd_def = Define ‘ - (** [no_nested_borrows::id_mut_pair3] *) + (** [no_nested_borrows::id_mut_pair3]: forward function *) id_mut_pair3_fwd (x : 't1) (y : 't2) : ('t1 # 't2) result = Return (x, y) ’ val id_mut_pair3_back'a_def = Define ‘ - (** [no_nested_borrows::id_mut_pair3] *) + (** [no_nested_borrows::id_mut_pair3]: backward function 0 *) id_mut_pair3_back'a (x : 't1) (y : 't2) (ret : 't1) : 't1 result = Return ret ’ val id_mut_pair3_back'b_def = Define ‘ - (** [no_nested_borrows::id_mut_pair3] *) + (** [no_nested_borrows::id_mut_pair3]: backward function 1 *) id_mut_pair3_back'b (x : 't1) (y : 't2) (ret : 't2) : 't2 result = Return ret ’ val id_mut_pair4_fwd_def = Define ‘ - (** [no_nested_borrows::id_mut_pair4] *) + (** [no_nested_borrows::id_mut_pair4]: forward function *) id_mut_pair4_fwd (p : ('t1 # 't2)) : ('t1 # 't2) result = let (t, t0) = p in Return (t, t0) ’ val id_mut_pair4_back'a_def = Define ‘ - (** [no_nested_borrows::id_mut_pair4] *) + (** [no_nested_borrows::id_mut_pair4]: backward function 0 *) id_mut_pair4_back'a (p : ('t1 # 't2)) (ret : 't1) : 't1 result = Return ret ’ val id_mut_pair4_back'b_def = Define ‘ - (** [no_nested_borrows::id_mut_pair4] *) + (** [no_nested_borrows::id_mut_pair4]: backward function 1 *) id_mut_pair4_back'b (p : ('t1 # 't2)) (ret : 't2) : 't2 result = Return ret ’ @@ -478,19 +479,19 @@ Datatype: End val new_tuple1_fwd_def = Define ‘ - (** [no_nested_borrows::new_tuple1] *) + (** [no_nested_borrows::new_tuple1]: forward function *) new_tuple1_fwd : (u32, u32) struct_with_tuple_t result = Return (<| struct_with_tuple_p := (int_to_u32 1, int_to_u32 2) |>) ’ val new_tuple2_fwd_def = Define ‘ - (** [no_nested_borrows::new_tuple2] *) + (** [no_nested_borrows::new_tuple2]: forward function *) new_tuple2_fwd : (i16, i16) struct_with_tuple_t result = Return (<| struct_with_tuple_p := (int_to_i16 1, int_to_i16 2) |>) ’ val new_tuple3_fwd_def = Define ‘ - (** [no_nested_borrows::new_tuple3] *) + (** [no_nested_borrows::new_tuple3]: forward function *) new_tuple3_fwd : (u64, i64) struct_with_tuple_t result = Return (<| struct_with_tuple_p := (int_to_u64 1, int_to_i64 2) |>) ’ @@ -501,7 +502,7 @@ Datatype: End val new_pair1_fwd_def = Define ‘ - (** [no_nested_borrows::new_pair1] *) + (** [no_nested_borrows::new_pair1]: forward function *) new_pair1_fwd : (u32, u32) struct_with_pair_t result = Return (<| @@ -511,7 +512,7 @@ val new_pair1_fwd_def = Define ‘ ’ val test_constants_fwd_def = Define ‘ - (** [no_nested_borrows::test_constants] *) + (** [no_nested_borrows::test_constants]: forward function *) test_constants_fwd : unit result = do swt <- new_tuple1_fwd; @@ -546,7 +547,7 @@ val test_constants_fwd_def = Define ‘ val _ = assert_return (“test_constants_fwd”) val test_weird_borrows1_fwd_def = Define ‘ - (** [no_nested_borrows::test_weird_borrows1] *) + (** [no_nested_borrows::test_weird_borrows1]: forward function *) test_weird_borrows1_fwd : unit result = Return () ’ @@ -555,26 +556,27 @@ val test_weird_borrows1_fwd_def = Define ‘ val _ = assert_return (“test_weird_borrows1_fwd”) val test_mem_replace_fwd_back_def = Define ‘ - (** [no_nested_borrows::test_mem_replace] *) + (** [no_nested_borrows::test_mem_replace]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) test_mem_replace_fwd_back (px : u32) : u32 result = let y = mem_replace_fwd px (int_to_u32 1) in if ~ (y = int_to_u32 0) then Fail Failure else Return (int_to_u32 2) ’ val test_shared_borrow_bool1_fwd_def = Define ‘ - (** [no_nested_borrows::test_shared_borrow_bool1] *) + (** [no_nested_borrows::test_shared_borrow_bool1]: forward function *) test_shared_borrow_bool1_fwd (b : bool) : u32 result = if b then Return (int_to_u32 0) else Return (int_to_u32 1) ’ val test_shared_borrow_bool2_fwd_def = Define ‘ - (** [no_nested_borrows::test_shared_borrow_bool2] *) + (** [no_nested_borrows::test_shared_borrow_bool2]: forward function *) test_shared_borrow_bool2_fwd : u32 result = Return (int_to_u32 0) ’ val test_shared_borrow_enum1_fwd_def = Define ‘ - (** [no_nested_borrows::test_shared_borrow_enum1] *) + (** [no_nested_borrows::test_shared_borrow_enum1]: forward function *) test_shared_borrow_enum1_fwd (l : u32 list_t) : u32 result = (case l of | ListCons i l0 => Return (int_to_u32 1) @@ -582,7 +584,7 @@ val test_shared_borrow_enum1_fwd_def = Define ‘ ’ val test_shared_borrow_enum2_fwd_def = Define ‘ - (** [no_nested_borrows::test_shared_borrow_enum2] *) + (** [no_nested_borrows::test_shared_borrow_enum2]: forward function *) test_shared_borrow_enum2_fwd : u32 result = Return (int_to_u32 0) ’ diff --git a/tests/hol4/misc-paper/paperScript.sml b/tests/hol4/misc-paper/paperScript.sml index 4d6e99ba..3ac5b6ca 100644 --- a/tests/hol4/misc-paper/paperScript.sml +++ b/tests/hol4/misc-paper/paperScript.sml @@ -6,13 +6,14 @@ val _ = new_theory "paper" val ref_incr_fwd_back_def = Define ‘ - (** [paper::ref_incr] *) + (** [paper::ref_incr]: merged forward/backward function + (there is a single backward function, and the forward function returns ()) *) ref_incr_fwd_back (x : i32) : i32 result = i32_add x (int_to_i32 1) ’ val test_incr_fwd_def = Define ‘ - (** [paper::test_incr] *) + (** [paper::test_incr]: forward function *) test_incr_fwd : unit result = do x <- ref_incr_fwd_back (int_to_i32 0); @@ -24,19 +25,19 @@ val test_incr_fwd_def = Define ‘ val _ = assert_return (“test_incr_fwd”) val choose_fwd_def = Define ‘ - (** [paper::choose] *) + (** [paper::choose]: forward function *) choose_fwd (b : bool) (x : 't) (y : 't) : 't result = if b then Return x else Return y ’ val choose_back_def = Define ‘ - (** [paper::choose] *) + (** [paper::choose]: backward function 0 *) choose_back (b : bool) (x : 't) (y : 't) (ret : 't) : ('t # 't) result = if b then Return (ret, y) else Return (x, ret) ’ val test_choose_fwd_def = Define ‘ - (** [paper::test_choose] *) + (** [paper::test_choose]: forward function *) test_choose_fwd : unit result = do z <- choose_fwd T (int_to_i32 0) (int_to_i32 0); @@ -62,7 +63,7 @@ Datatype: End val [list_nth_mut_fwd_def] = DefineDiv ‘ - (** [paper::list_nth_mut] *) + (** [paper::list_nth_mut]: forward function *) list_nth_mut_fwd (l : 't list_t) (i : u32) : 't result = (case l of | ListCons x tl => @@ -76,7 +77,7 @@ val [list_nth_mut_fwd_def] = DefineDiv ‘ ’ val [list_nth_mut_back_def] = DefineDiv ‘ - (** [paper::list_nth_mut] *) + (** [paper::list_nth_mut]: backward function 0 *) list_nth_mut_back (l : 't list_t) (i : u32) (ret : 't) : 't list_t result = (case l of | ListCons x tl => @@ -92,7 +93,7 @@ val [list_nth_mut_back_def] = DefineDiv ‘ ’ val [sum_fwd_def] = DefineDiv ‘ - (** [paper::sum] *) + (** [paper::sum]: forward function *) sum_fwd (l : i32 list_t) : i32 result = (case l of | ListCons x tl => do @@ -103,7 +104,7 @@ val [sum_fwd_def] = DefineDiv ‘ ’ val test_nth_fwd_def = Define ‘ - (** [paper::test_nth] *) + (** [paper::test_nth]: forward function *) test_nth_fwd : unit result = let l = ListNil in let l0 = ListCons (int_to_i32 3) l in @@ -121,7 +122,7 @@ val test_nth_fwd_def = Define ‘ val _ = assert_return (“test_nth_fwd”) val call_choose_fwd_def = Define ‘ - (** [paper::call_choose] *) + (** [paper::call_choose]: forward function *) call_choose_fwd (p : (u32 # u32)) : u32 result = let (px, py) = p in do diff --git a/tests/hol4/misc-polonius_list/poloniusListScript.sml b/tests/hol4/misc-polonius_list/poloniusListScript.sml index dd631169..06876ed4 100644 --- a/tests/hol4/misc-polonius_list/poloniusListScript.sml +++ b/tests/hol4/misc-polonius_list/poloniusListScript.sml @@ -11,7 +11,7 @@ Datatype: End val [get_list_at_x_fwd_def] = DefineDiv ‘ - (** [polonius_list::get_list_at_x] *) + (** [polonius_list::get_list_at_x]: forward function *) get_list_at_x_fwd (ls : u32 list_t) (x : u32) : u32 list_t result = (case ls of | ListCons hd tl => @@ -20,7 +20,7 @@ val [get_list_at_x_fwd_def] = DefineDiv ‘ ’ val [get_list_at_x_back_def] = DefineDiv ‘ - (** [polonius_list::get_list_at_x] *) + (** [polonius_list::get_list_at_x]: backward function 0 *) get_list_at_x_back (ls : u32 list_t) (x : u32) (ret : u32 list_t) : u32 list_t result = (case ls of -- cgit v1.2.3