Doxygen Generated Documentation of Ben-Jose Trainable SAT Solver Library
proof.h
1 
2 
3 /*************************************************************
4 
5 This file is part of ben-jose.
6 
7 ben-jose is free software: you can redistribute it and/or modify
8 it under the terms of the version 3 of the GNU General Public
9 License as published by the Free Software Foundation.
10 
11 ben-jose is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with ben-jose. If not, see <http://www.gnu.org/licenses/>.
18 
19 ------------------------------------------------------------
20 
21 Copyright (C) 2007-2012, 2014-2016. QUIROGA BELTRAN, Jose Luis.
22 Id (cedula): 79523732 de Bogota - Colombia.
23 See https://github.com/joseluisquiroga/ben-jose
24 
25 ben-jose is free software thanks to The Glory of Our Lord
26  Yashua Melej Hamashiaj.
27 Our Resurrected and Living, both in Body and Spirit,
28  Prince of Peace.
29 
30 ------------------------------------------------------------
31 
32 proof.h
33 
34 proof writing function declarations.
35 
36 --------------------------------------------------------------*/
37 
38 #ifndef PROOF_FUNCS_H
39 #define PROOF_FUNCS_H
40 
41 #include "brain.h"
42 
43 class proof_tk;
44 
45 ch_string proof_get_unirons_path(skeleton_glb& skg);
46 void proof_create_final_unirons_path(skeleton_glb& skg, ch_string end_dir_pth);
47 
48 long proof_max_end_idx(deduction& dct);
49 
50 ch_string proof_add_paths(ch_string pth1, ch_string pth2);
51 ch_string proof_get_nmp_proof_path(neuromap& the_nmp);
52 ch_string proof_get_tk_dir_path(ch_string pth_pref, proof_tk& pf_tk);
53 ch_string proof_get_tk_file_name(proof_tk& pf_tk);
54 ch_string proof_get_tk_html_file_name(proof_tk& pf_tk);
55 
56 void proof_do_res_step(brain& brn, row_quanton_t& curr_res, prop_signal& curr_ps);
57 
58 long proof_get_trace_idx_of(deduction& dct, long to_wrt_idx);
59 void proof_write_all_json_files_for(deduction& dct);
60 void proof_write_json_file_for(deduction& dct, long to_wrt_idx, long prv_wrt_idx);
61 void proof_append_ps(brain& brn, row<char>& json_str, prop_signal& the_sig, bool& is_fst_ps,
62  ch_string& pth_pref, proof_tk& pf_tk, row<ch_string>& all_to_move);
63 void proof_append_uniron(row<char>& json_str, prop_signal& the_sig, bool& is_fst_ps,
64  row<ch_string>& all_to_move);
65 void proof_append_neu_lits(brain& brn, row<char>& json_str, row_quanton_t& all_quas);
66 void proof_append_lits(brain& brn, row<char>& json_str, row_quanton_t& all_quas);
67 void proof_append_neu(brain& brn, row<char>& json_str, neuron* neu,
68  ch_string& pth_pref, proof_tk& pf_tk, row<ch_string>& all_to_move);
69 void proof_append_qua(row<char>& json_str, quanton* qua);
70 
71 //void proof_write_html_file_for(ch_string end_dir_pth, deduction& dct, proof_tk& pf_tk);
72 
73 void proof_write_permutation(row<char>& json_str, neuromap& nmp);
74 void proof_write_ref_bj_proof_for(row<char>& json_str, deduction& dct);
75 void proof_write_bj_proof_for(neuromap& nmp, proof_tk& pf_tk);
76 
77 void proof_move_all_to_mv(deduction& dct, ch_string& pf_dir_pth,
78  row<ch_string>& all_to_move, proof_tk& pf_tk);
79 
80 void proof_write_top_html_file(ch_string the_pth);
81 
82 bool is_ptk_equal(proof_tk& tk1, proof_tk& tk2);
83 
84 //=============================================================================
85 // proof_tk
86 
87 class proof_tk {
88  public:
89  ticket pt_brn_tk;
90  long pt_wrt_idx;
91 
92  // methods
93 
94  proof_tk(){
95  init_proof_tk();
96  }
97 
98  proof_tk(ticket& tk, long w_idx = INVALID_IDX){
99  init_with(tk, w_idx);
100  }
101 
102  void init_with(ticket& tk, long w_idx = INVALID_IDX){
103  pt_brn_tk = tk;
104  pt_wrt_idx = w_idx;
105  }
106 
107  void init_proof_tk(){
108  pt_brn_tk.init_ticket();
109  pt_wrt_idx = INVALID_IDX;
110  }
111 
112  brain* get_dbg_brn(){
113  return NULL;
114  }
115 
116  solver* get_dbg_slv(){
117  return NULL;
118  }
119 
120  bool is_ptk_virgin(){
121  bool c1 = pt_brn_tk.is_tk_virgin();
122  bool c2 = (pt_wrt_idx == INVALID_IDX);
123 
124  return (c1 && c2);
125  }
126 
127  ch_string get_str();
128 
129 };
130 
131 
132 #endif // PROOF_FUNCS_H
133 
134 
Class that holds all data used to solve a particular CNF instance.
Definition: brain.h:3085
Class for CNF variables (each variable has a positon and a negaton).
Definition: brain.h:600
Class that holds the result of analyzing (doing resolution) of a conflict.
Definition: brain.h:1715
Declarations of classes and that implement the solver&#39;s core functionality.
A neuromap is a CNF sub-formula.
Definition: brain.h:2191
Class for representing BCP propagation data.
Definition: brain.h:1525
A skeleton_glb is a directory holding a database.
Definition: skeleton.h:761
Class for CNF clause behavior. So there is one neuron per clause.
Definition: brain.h:1211