38 #ifndef INSTANCE_INF_H 39 #define INSTANCE_INF_H 41 #include "bj_big_number.h" 43 #include "ch_string.h" 50 #define INSTANCE_CK(prm) DBG_CK(prm) 52 #define INVALID_PATH "invalid_path" 53 #define INVALID_RESULT_STR "invalid_result_str" 66 typedef bj_big_int_t consecutive_t;
68 #define INVALID_CONSECUTIVE -1 70 #define INVALID_QUANTON_ID 0 71 #define INVALID_POLARITY 0 72 #define INVALID_LAYER -1 83 class instance_exception :
public top_exception {
85 instance_exception(
long the_id = 0) : top_exception(the_id)
99 throw instance_exception(inx_bad_eq_op);
103 throw instance_exception(inx_bad_creat);
111 ch_string ist_file_path;
119 double ist_in_timeout;
120 double ist_in_memout;
124 avg_stat ist_num_variants_stat;
127 ch_string ist_last_proof_path;
129 ch_string ist_result_titles_str;
130 ch_string ist_result_str;
132 ch_string ist_err_assrt_str;
133 ch_string ist_err_stack_str;
136 init_instance_info(
true);
139 void init_instance_info(
bool reset_lims =
false,
bool free_mem =
true){
140 ist_with_assig =
false;
144 ist_file_path = INVALID_PATH;
146 ist_data.clear(free_mem, free_mem);
150 ist_ccls.clear(free_mem, free_mem);
157 init_output(ist_out);
159 ist_assig.clear(free_mem, free_mem);
161 ist_last_proof_path = INVALID_PATH;
163 ist_result_titles_str = INVALID_RESULT_STR;
164 ist_result_str = INVALID_RESULT_STR;
166 ist_err_assrt_str =
"no_assert_string_found";
167 ist_err_stack_str =
"no_stack_string_found";
175 out.bjo_solve_time = 0.0;
176 out.bjo_num_vars = 0;
177 out.bjo_num_ccls = 0;
178 out.bjo_num_lits = 0;
180 out.bjo_num_laps = 0.0;
181 out.bjo_num_recoils = 0.0;
183 out.bjo_load_time = 0.0;
184 out.bjo_num_cnf_saved = 0.0;
185 out.bjo_num_cnf_finds = 0.0;
186 out.bjo_quick_discards = 0.0;
189 out.bjo_err_char = 0;
190 out.bjo_err_line = -1;
191 out.bjo_err_pos = -1;
192 out.bjo_err_num_decl_cls = -1;
193 out.bjo_err_num_decl_vars = -1;
194 out.bjo_err_num_read_cls = -1;
195 out.bjo_err_bad_lit = -1;
197 out.bjo_dbg_enabled = 0;
198 out.bjo_dbg_never_write = 0;
199 out.bjo_dbg_never_find = 0;
200 out.bjo_dbg_min_trainable = 0;
201 out.bjo_dbg_as_release = 0;
204 ch_string& get_f_nam(){
205 return ist_file_path;
209 return (! ist_data.is_empty());
213 bool c1 = ! ist_ccls.is_empty();
214 bool c2 = (ist_num_vars >= 0);
215 bool c3 = (ist_num_ccls >= 0);
216 bool is_p = (c1 && c2 && c3);
220 bj_output_t& get_out_info(){
224 void set_result_titles_str();
225 void set_result_str();
226 void parse_result_str(ch_string& rslt_str);
229 bj_ostream& print_headers(bj_ostream& os);
231 bj_ostream& print_instance_info(bj_ostream& os,
bool from_pt =
false);
241 instance_info::print_headers(bj_ostream& os){
242 ch_string sep = RESULT_FIELD_SEP;
243 os <<
"file_path" << sep;
244 os <<
"solve_time" << sep;
245 os <<
"result" << sep;
246 os <<
"#vars" << sep;
247 os <<
"#ccls" << sep;
248 os <<
"#lits" << sep;
249 os <<
"#laps" << sep;
262 sf_str = RES_YES_SATISF_STR;
265 sf_str = RES_NO_SATISF_STR;
268 sf_str = RES_ERROR_STR;
276 as_satisf_val(ch_string str_ln){
280 }
else if(str_ln == RES_YES_SATISF_STR){
282 }
else if(str_ln == RES_NO_SATISF_STR){
284 }
else if(str_ln == RES_ERROR_STR){
292 instance_info::print_instance_info(bj_ostream& os,
bool from_pt){
294 os << ist_result_str;
301 #endif // INSTANCE_INF_H Error result.
Definition: ben_jose.h:81
Class that holds an instance data.
Definition: instance_info.h:96
ben_jose API declaration.
bj_satisf_val_t
Posible final results of the solving process.
Definition: ben_jose.h:77
static void init_output(bj_output_t &out)
init and output
Definition: instance_info.h:172
#define RES_UNKNOWN_STR
String to print a bjr_unknown_satisf result.
Definition: ben_jose.h:61
No error.
Definition: ben_jose.h:91
Unsatisfiable CNF.
Definition: ben_jose.h:80
Unknown result.
Definition: ben_jose.h:78
Satisfiable CNF.
Definition: ben_jose.h:79