Skip to content

Commit d723e47

Browse files
changed location and changed a few things in sptrees
1 parent ba0e77b commit d723e47

File tree

1 file changed

+1
-124
lines changed

1 file changed

+1
-124
lines changed

hol/policy_to_table/bdd_cake_trans/test_sptrees_ProgScript.sml renamed to hol/policy_to_table/bdd_sptrees_genScript.sml

Lines changed: 1 addition & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ open HolKernel Parse boolLib bossLib;
22
open optionTheory pairTheory bdd_genTheory policy_specTheory pred_specTheory;
33
open sptreeTheory;
44

5+
val _ = new_theory "bdd_sptrees_gen";
56

67
val _ = type_abbrev("sp_edges", ``:(num#num) spt``);
78

@@ -316,129 +317,5 @@ Definition policy_structure2_def:
316317
End
317318

318319

319-
320-
val arith_policy_eval = EVAL “convert_arith_to_var_policy ^arith_policy ^policy_me”;
321-
val var_policy = optionSyntax.dest_some (rhs (concl arith_policy_eval));
322-
323-
324-
val eval_policy_full_opt = EVAL “sp_mk_BDDPred_opt policy_structure (0n,LN,insert 0 (non_termn (NONE, ^var_policy)) LN) [] ^policy_order 1”;
325-
326-
327-
328-
(*
329-
val pred = “Or (And (Var "x1") (Var "x2")) (And (Var "x3") (Var "x4"))”;
330-
EVAL “sp_mk_BDDPred_opt pred_structure (0n,LN,insert 0 (non_termn (NONE, ^pred)) LN) [] ["x1";"x3";"x2";"x4"] 1”;
331-
*)
332-
333-
334-
val policy_order = “[
335-
("is_srcPort_le_57222");
336-
("is_srcPort_ge_57222");
337-
("is_dstPort_le_53");
338-
("is_dstPort_ge_53");
339-
("is_srcNAT_le_54587");
340-
("is_srcNAT_ge_54587");
341-
("is_dstNAT_le_53");
342-
("is_dstNAT_ge_53");
343-
("is_srcPort_le_56258");
344-
("is_srcPort_ge_56258");
345-
("is_dstPort_le_3389");
346-
("is_dstPort_ge_3389");
347-
("is_srcNAT_le_56258");
348-
("is_srcNAT_ge_56258");
349-
("is_dstNAT_le_3389");
350-
("is_dstNAT_ge_3389");
351-
("is_srcPort_le_6881");
352-
("is_srcPort_ge_6881");
353-
("is_dstPort_le_50321");
354-
("is_dstPort_ge_50321");
355-
("is_srcNAT_le_43265");
356-
("is_srcNAT_ge_43265");
357-
("is_dstNAT_le_50321");
358-
("is_dstNAT_ge_50321");
359-
("is_srcPort_le_50553");
360-
("is_srcPort_ge_50553");
361-
("is_srcNAT_le_50553");
362-
("is_srcNAT_ge_50553");
363-
("is_srcPort_le_50002");
364-
("is_srcPort_ge_50002");
365-
("is_dstPort_le_443");
366-
("is_dstPort_ge_443");
367-
("is_srcNAT_le_45848");
368-
("is_srcNAT_ge_45848");
369-
("is_dstNAT_le_443");
370-
("is_dstNAT_ge_443");
371-
("is_srcPort_le_51465");
372-
("is_srcPort_ge_51465");
373-
("is_srcNAT_le_39975");
374-
("is_srcNAT_ge_39975");
375-
]”;
376-
377-
378-
379-
380-
381-
382-
383-
384-
385-
386-
387-
388-
389-
(*
390-
391-
val var_pred = “ Or (And (Var "x") (Not (Var "y"))) (And (Not (Var "b")) (Var "e")) ”
392-
EVAL “sp_mk_BDDPred_opt pred_structure (0n,LN,insert 0 (non_termn (NONE, ^var_pred)) LN) [] ["b";"e";"x"; "y"] 1”;
393-
EVAL “sp_mk_BDDPred_opt pred_structure (0n,LN,insert 0 (non_termn (NONE, ^var_pred)) LN) [] ["x";"y";"b"; "e"] 1”;
394-
395-
396-
397-
val var_pred = “ Or (And (Var "x") (Not (Var "y"))) (And (Not (Var "a")) (Var "b")) ”
398-
val var_pred2 = “ Or (And (Var "c") (Not (Var "d"))) (And (Not (Var "e")) (Var "f")) ”
399-
val var_pred3 = “ Or ^var_pred ^var_pred2 ”
400-
401-
402-
403-
EVAL “sp_mk_BDDPred_opt pred_structure (0n,LN,insert 0 (non_termn (NONE, ^var_pred)) LN) [] ["a";"b";"c"; "d"; "f"; "g"; "x"; "y"] 1”;
404-
405-
EVAL “sp_mk_BDDPred_opt pred_structure (0n,LN,insert 0 (non_termn (NONE, ^var_pred)) LN) [] ["a";"b";"c"; "d"; "x"; "y"; "f"; "e"] 1”;
406-
407-
val _ = type_abbrev("action_rule_type", “:((string# num list) action_expr) rule”);
408-
val _ = type_abbrev("action_policy_type", “:((string# num list) action_expr) policy”);
409-
410-
val rule1 = “(^var_pred3 , action ("allow",[1]: num list)):action_rule_type”;
411-
val rule2 = “((Var "k") , action ("allow",[2]: num list)):action_rule_type”;
412-
val rule3 = “((Var "o") , action ("allow",[3]: num list)):action_rule_type”;
413-
414-
val arith_policy_rule_default = “(True, action ("drop", []: num list)):action_rule_type”;
415-
416-
417-
val arith_policy = “[
418-
^rule1;
419-
^rule2;
420-
^arith_policy_rule_default
421-
]: action_policy_type”;
422-
423-
424-
o -> k -> a -> b -> c -> d -> x -> y -> f -> e
425-
426-
427-
EVAL “sp_mk_BDDPred_opt policy_structure (0n,LN,insert 0 (non_termn (NONE, ^arith_policy)) LN) []
428-
["o"; "k";"a";"b";"c"; "d"; "x"; "y"; "f"; "e"]
429-
1”;
430-
431-
432-
433-
EVAL “sp_mk_BDDPred_opt policy_structure (0n,LN,insert 0 (non_termn (NONE, ^arith_policy)) LN) []
434-
["x"; "y";"a";"b";"c"; "d"; "e"; "f"; "k"; "o"]
435-
1”;
436-
437-
438-
439-
440-
*)
441-
442-
443320

444321
val _ = export_theory ();

0 commit comments

Comments
 (0)