-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCombination-XOR.sml
62 lines (48 loc) · 1.89 KB
/
Combination-XOR.sml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
open HolKernel Parse
open binariesLib;
open binariesTheory;
open binariesCfgLib;
open binariesMemLib;
open bir_symbexec_stateLib;
open bir_symbexec_coreLib;
open bir_symbexec_stepLib;
open bir_symbexec_sumLib;
open bir_countw_simplificationLib;
open bir_block_collectionLib;
open bir_programSyntax;
open bir_valuesSyntax;
open bir_immSyntax;
open bir_exec_typingLib;
open commonBalrobScriptLib;
open binariesDefsLib;
open bir_cfgLib;
open bir_cfg_m0Lib;
open bir_symbexec_driverLib;
open Redblackmap;
open bir_symbexec_oracleLib;
open bir_symbexec_oracleLib;
(*Server*) (*
val lbl_tm = ``BL_Address (Imm64 4203632w)``;
val stop_lbl_tms = [``BL_Address (Imm64 4203760w)``];
(*Client*) *)
val lbl_tm = ``BL_Address (Imm64 4203632w)``;
val stop_lbl_tms = [``BL_Address (Imm64 4203756w)``];
val n_dict = bir_cfgLib.cfg_build_node_dict bl_dict_ prog_lbl_tms_;
val adr_dict = bir_symbexec_PreprocessLib.fun_addresses_dict bl_dict_ prog_lbl_tms_;
val syst = init_state lbl_tm prog_vars;
val pred_conjs = [``bir_exp_true``];
val syst = state_add_preds "init_pred" pred_conjs syst;
val _ = print "initial state created.\n\n";
val cfb = false;
val systs = symb_exec_to_stop (abpfun cfb) n_dict bl_dict_ [syst] stop_lbl_tms adr_dict [];
val _ = print "\n\n";
val _ = print "finished exploration of all paths.\n\n";
val _ = print ("number of stopped symbolic execution states: " ^ (Int.toString (length systs)));
val _ = print "\n\n";
val (systs_noassertfailed, systs_assertfailed) =
List.partition (fn syst => not (identical (SYST_get_status syst) BST_AssertionViolated_tm)) systs;
val _ = print ("number of \"assert failed\" paths found: " ^ (Int.toString (length systs_assertfailed)));
val _ = print "\n";
val _ = print ("number of \"no assert failed\" paths found: " ^ (Int.toString (length systs_noassertfailed)));
val _ = print "\n";
val Acts = bir_symbexec_treeLib.sym_exe_to_IML systs_noassertfailed;