Skip to content

Commit 63efb45

Browse files
further improvments to the opt of BDD
1 parent 475f090 commit 63efb45

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

hol/policy_to_table/bdd_end_to_endScript.sml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,8 +773,8 @@ End
773773

774774
Definition correct_var_policy_var_tables_exec2_def:
775775
correct_var_policy_var_tables_exec2 var_policy var_table vars I =
776-
let BDD1_opt = mk_BDDPred_opt policy_structure (0,[],[(0, non_termn (NONE, var_policy))]) [] vars 1 in
777-
let BDD2_opt = mk_BDDPred_opt table_structure_new (0,[],[(0, non_termn (NONE, var_table ))]) [] vars 1 in
776+
let BDD1_opt = mk_BDDPred_opt_new policy_structure (0,[],[(0, non_termn (NONE, var_policy))]) [] vars 1 in
777+
let BDD2_opt = mk_BDDPred_opt_new table_structure_new (0,[],[(0, non_termn (NONE, var_table ))]) [] vars 1 in
778778
if ~ IS_SOME(BDD1_opt) \/ ~ IS_SOME (BDD2_opt) then
779779
T
780780
else let BDD1 = THE BDD1_opt in let BDD2 = THE BDD2_opt in

hol/policy_to_table/bdd_genScript.sml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ Definition has_parent_def:
602602
End
603603

604604

605+
(* TODO: remove lookup *)
605606
Definition eliminable_def:
606607
eliminable ((r,edges,labels):('a,'b)BDD) n =
607608
case ALOOKUP edges n of
@@ -658,7 +659,15 @@ End
658659

659660

660661

662+
(*
663+
Definition edges_project_def:
664+
edges_project ((r,edges,labels):('a,'b)BDD) nl =
665+
everything in nl is in the domain od edges'
666+
End
667+
*)
661668

669+
670+
(* here we use the projection *)
662671

663672
(* eliminate part *)
664673
Definition eliminate_BDD_def:
@@ -1099,6 +1108,7 @@ End
10991108

11001109
(******************* new better optimized definitions ***************************)
11011110

1111+
val _ = type_abbrev("distrub_st", ``:( (string, (num list) option) alist # num list # num list)``);
11021112

11031113

11041114
Definition update_internals_def:
@@ -1160,7 +1170,6 @@ End
11601170

11611171

11621172

1163-
(* can be improved more *)
11641173

11651174
(* can be improved more *)
11661175
Definition optimize_node_def:

hol/policy_to_table/fwd_proofLib.sml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ open bdd_utilsLib;
103103

104104

105105
(* create BDD of var policy *)
106-
val eval_policy_full_opt = EVAL “mk_BDDPred_opt policy_structure (0,[],[(0, non_termn (NONE, ^var_policy))]) [] ^policy_order 1”;
106+
val eval_policy_full_opt = EVAL “mk_BDDPred_opt_new policy_structure (0,[],[(0, non_termn (NONE, ^var_policy))]) [] ^policy_order 1”;
107107
val eval_policy_full_opt_rhs = optionSyntax.dest_some (rhs (concl eval_policy_full_opt));
108108

109109
val _ = time_stage ("Stage 2 from var policy to BDD", start_cpu_stage2, start_real_stage2);
@@ -124,7 +124,7 @@ open bdd_utilsLib;
124124
val eval_table_full_opt_auto_rhs = optionSyntax.dest_some (rhs (concl eval_table_full_opt_auto));
125125
*)
126126

127-
val eval_table_full_opt_auto = EVAL “mk_BDDPred_opt table_structure_new (0,[],[(0, non_termn (NONE, ^gen_var_table_auto))]) [] ^policy_order 1”;
127+
val eval_table_full_opt_auto = EVAL “mk_BDDPred_opt_new table_structure_new (0,[],[(0, non_termn (NONE, ^gen_var_table_auto))]) [] ^policy_order 1”;
128128
val eval_table_full_opt_auto_rhs = optionSyntax.dest_some (rhs (concl eval_table_full_opt_auto));
129129

130130
val _ = time_stage ("Stage 2 from table to table BDD", start_cpu_stage2_tbl, start_real_stage2_tbl);

0 commit comments

Comments
 (0)