Skip to content

Commit c230a46

Browse files
edited a bit the sml function to adapt to the new data types
1 parent 155a86f commit c230a46

File tree

2 files changed

+31
-10
lines changed

2 files changed

+31
-10
lines changed

hol/bdd_test_casesScript.sml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ open pred_specTheory;
2020
open policy_specTheory;
2121
open tables_specTheory;
2222
open bdd_isomorphTheory;
23-
open bdd_end_to_endTheory;
24-
25-
23+
open bdd_end_to_endTheory;
2624

2725
open policy_arith_to_varTheory;
2826

27+
open table_arith_to_intervalTheory;
28+
29+
30+
2931

3032

3133
val _ = load "bdd_utils";
3234

3335
val _ = new_theory "bdd_test_cases";
3436

35-
(* TODO: update the sml definition that takes a var bdd and generates var table, now the var_table has new syntax. Var x | True | False | Not atom -->
36-
Var x | Not x | Not True | Not False | True | False
37-
3837

38+
3939
(* a few types abbreviations *)
4040
val _ = type_abbrev("BDD_tbl_type", “:(( (string# num list) var_table_list, (string# num list) action_expr) BDD)”);
4141

@@ -79,7 +79,7 @@ val eval_policy1_full_opt_rhs = optionSyntax.dest_some (rhs (concl eval_policy1_
7979

8080
(* automatically generate a table*)
8181
val test_groupings1 = rhs(concl(EVAL “[("a",["x";"y"]);("b",["z"])]”));
82-
val test_action_table1_auto =BDDUtils.bdd_to_tables_iterative eval_policy1_full_opt_rhs test_groupings1;
82+
val test_action_table1_auto = BDDUtils.bdd_to_tables_iterative eval_policy1_full_opt_rhs test_groupings1;
8383

8484
(* now create a BDD for the table*)
8585
val eval_table1_full_opt_auto = EVAL “mk_BDDPred_opt table_structure (0,[],[(0, non_termn (NONE, ^test_action_table1_auto))]) [] ["x";"y";"z"] 1”;
@@ -94,6 +94,19 @@ val policy1_thm_init = computeLib.RESTR_EVAL_CONV [“sem_tables”,“sem_polic
9494
val policy1_thm = SIMP_RULE bool_ss [correct_var_policy_var_tables_exec_thm1] policy1_thm_init;
9595

9696

97+
(* from var tables to final single interval table*)
98+
99+
100+
101+
102+
103+
104+
105+
106+
107+
108+
109+
97110
(*
98111
(* policy 1: var TABLE representation *)
99112
@@ -301,6 +314,12 @@ val arith_policy3_var_policy3_thm = REWRITE_RULE[all_distinct_conj, arith_policy
301314
302315
*)
303316

304-
*)
317+
305318
val _ = export_theory ();
306319

320+
321+
322+
323+
324+
325+

hol/bdd_utils.sml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ fun get_all_vars_in_group groupings group_name =
141141
| NONE => [];
142142

143143
(* Generate action table for terminal nodes *)
144-
fun generate_action_table bdd_term =
144+
(*fun generate_action_table bdd_term =
145145
let
146146
val (start_state_term, rest) = dest_pair bdd_term
147147
val (edges_term, labelings_term) = dest_pair rest
@@ -172,6 +172,8 @@ fun generate_action_table bdd_term =
172172
in
173173
terminal_entries
174174
end;
175+
*)
176+
175177

176178
(* Enhanced find_paths_for_group that handles input states *)
177179
fun find_paths_for_group_with_inputs bdd_term groupings_term group_name input_states =
@@ -270,7 +272,7 @@ fun find_paths_for_group_with_inputs bdd_term groupings_term group_name input_st
270272
let
271273
val atom_vars = map (fn (var, value) =>
272274
if value then ``Var ^(fromMLstring var)``
273-
else ``Not (Var ^(fromMLstring var))``
275+
else ``Not (^(fromMLstring var))``
274276
) path
275277

276278
val simplified_atoms =

0 commit comments

Comments
 (0)