@@ -39,7 +39,7 @@ let satisfyTrans ?(config = Config.default) ~(sygus : SyGuS.t) ~(z3 : ZProc.t)
3939 let invf'_call =
4040 " (invf " ^ (List. to_string_map sygus.inv_func.args ~sep: " "
4141 ~f: (fun (s , _ ) -> s ^ " !" )) ^ " )" in
42- let eval_term = (if not (config.model_completion_mode = `UsingZ3 ) then " true"
42+ let eval_term = (if not (Poly. equal config.model_completion_mode `UsingZ3 ) then " true"
4343 else " (and " ^ invf_call ^ " " ^ sygus.trans_func.body ^ " )" ) in
4444 let rec helper inv =
4545 Log. info (lazy (" IND >> Strengthening for inductiveness:"
@@ -64,7 +64,7 @@ let satisfyTrans ?(config = Config.default) ~(sygus : SyGuS.t) ~(z3 : ZProc.t)
6464 ~features: (List. map ~f: (fun (_ , name ) -> ( (ZProc. build_feature name z3)
6565 , (" (" ^ name ^ " " ^ all_state_vars ^ " )" )))
6666 config.user_features)
67- ~post: (fun _ res -> res = Ok (Value. Bool false )))
67+ ~post: (fun _ -> function Ok (Value. Bool false ) -> true | _ -> false ))
6868 in ZProc. close_scope z3
6969 ; Log. debug (lazy (" IND Delta: " ^ pre_inv))
7070 ; if String. equal pre_inv " true"
@@ -76,7 +76,7 @@ let satisfyTrans ?(config = Config.default) ~(sygus : SyGuS.t) ~(z3 : ZProc.t)
7676 in Log. info (lazy (" PRE >> Checking if the following candidate is weaker than precond:"
7777 ^ (Log. indented_sep 4 ) ^ new_inv))
7878 ; let ce = ZProc. implication_counter_example z3 sygus.pre_func.body new_inv
79- in if ce = None then helper new_inv else (new_inv, ce))
79+ in if Option. is_none ce then helper new_inv else (new_inv, ce))
8080 in helper inv
8181
8282let rec learnInvariant_internal ?(config = Config. default) ~(states : Value.t list list )
@@ -111,7 +111,7 @@ let rec learnInvariant_internal ?(config = Config.default) ~(states : Value.t li
111111 VPIE. learnVPreCond
112112 ~z3 ~config: config._VPIE ~consts: sygus.constants
113113 ~post_desc: sygus.post_func.body
114- ~eval_term: (if not (config.model_completion_mode = `UsingZ3 )
114+ ~eval_term: (if not (Poly. equal config.model_completion_mode `UsingZ3 )
115115 then " true" else sygus.post_func.body)
116116 (Job. create ()
117117 ~pos_tests: states
@@ -121,7 +121,7 @@ let rec learnInvariant_internal ?(config = Config.default) ~(states : Value.t li
121121 else (" (not (" ^ sygus.post_func.body ^ " ))" ))
122122 ~z3 ~arg_names: (List. map sygus.synth_variables ~f: fst))
123123 ~args: sygus.synth_variables
124- ~post: (fun _ res -> res = Ok (Value. Bool false )))
124+ ~post: (fun _ -> function Ok (Value. Bool false ) -> true | _ -> false ))
125125 in stats.lig_time_ms < - stats.lig_time_ms +. vpie_stats.vpi_time_ms
126126 ; stats.lig_ce < - stats.lig_ce + vpie_stats.vpi_ce
127127 ; stats._VPIE < - vpie_stats :: stats._VPIE
@@ -137,7 +137,7 @@ let rec learnInvariant_internal ?(config = Config.default) ~(states : Value.t li
137137 ^ (Log. indented_sep 4 ) ^ inv))
138138 ; match satisfyTrans ~config ~sygus ~states ~z3 inv stats with
139139 | inv, None
140- -> if inv <> " false" then ((ZProc. simplify z3 inv), stats)
140+ -> if not ( String. equal inv " false" ) then ((ZProc. simplify z3 inv), stats)
141141 else restart_with_new_states (random_value ~seed: (`Deterministic seed_string)
142142 (gen_pre_state ~use_trans: true sygus z3))
143143 | _, (Some ce_model)
@@ -152,6 +152,6 @@ let learnInvariant ?(config = Config.default) ~(states : Value.t list list)
152152 ~random_seed: (Some (Int. to_string (Quickcheck. (random_value ~seed: (`Deterministic config.base_random_seed)
153153 (Generator. small_non_negative_int)))))
154154 (fun z3 -> Simulator. setup sygus z3 ~user_features: (List. map ~f: fst config.user_features)
155- ; if (implication_counter_example z3 sygus.pre_func.body sygus.post_func.body) <> None
155+ ; if Option. is_none (implication_counter_example z3 sygus.pre_func.body sygus.post_func.body)
156156 then (" false" , stats)
157157 else learnInvariant_internal ~config ~states sygus config.base_random_seed z3 stats)
0 commit comments