Doxygen Generated Documentation of Ben-Jose Trainable SAT Solver Library
shuffler.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 shuffler.h
33 
34 Declaration of functions to shuffler dimacs representations.
35 
36 --------------------------------------------------------------*/
37 
38 #ifndef SHUFFLER_H
39 #define SHUFFLER_H
40 
41 #include "tools.h"
42 #include "tak_mak.h"
43 
44 #define SHUFFLER_DBG(prm) DBG(prm)
45 #define SHUFFLER_CK(prm) DBG_CK(prm)
46 #define SHUFFLER_H_CK(prm) DBG_CK(prm)
47 
48 #define FIRST_LIT_IDX 1
49 
50 //=================================================================
51 // map funcs
52 
53 void shuffle_lit_mapping(tak_mak& rnd_gen, row<integer>& to_shuff);
54 void init_lit_mapping(tak_mak& rnd_gen, row<integer>& the_map, long num_var);
55 integer map_literal(row<integer>& the_map, integer lit);
56 integer shift_literal(long in_lit, long the_shift);
57 void map_cnf_lits(row<integer>& the_map, row<long>& in_ccls, row<long>& out_ccls);
58 void shuffle_cnf_lits(tak_mak& rnd_gen, long num_var, row<integer>& the_map,
59  row<long>& in_ccls, row<long>& out_ccls);
60 
61 void shuffle_ccl_mapping(tak_mak& rnd_gen, row<integer>& to_shuff);
62 void init_ccl_mapping(tak_mak& rnd_gen, row<integer>& the_map, long num_neu);
63 void rl_to_rrl(row<long>& in_lits, row_row_long_t& out_ccls);
64 void rrl_to_rl(row_row_long_t& in_ccls, row<long>& out_lits);
65 void shuffle_cnf_ccls(tak_mak& rnd_gen, row<integer>& the_map,
66  row<long>& in_lits, row<long>& out_lits);
67 
68 void shuffle_full_cnf(tak_mak& rnd_gen, long num_var, row<integer>& the_map,
69  row<long>& in_ccls, row<long>& out_ccls);
70 
71 void shift_cnf_lits(long the_shift, row<long>& in_out_lits);
72 void join_cnf_lits(row<long>& in_out_lits1, long num_var1, row<long>& in_out_lits2);
73 
74 
75 #endif // SHUFFLER_H
76 
77