00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00037 #ifndef __NUSMV_CORE_SAT_SOLVERS_SAT_ZCHAFF_PRIVATE_H__
00038 #define __NUSMV_CORE_SAT_SOLVERS_SAT_ZCHAFF_PRIVATE_H__
00039
00040 #include "nusmv/core/sat/solvers/SatZchaff.h"
00041 #include "nusmv/core/sat/solvers/satZChaffIfc.h"
00042
00043
00044 #include "nusmv/core/sat/SatIncSolver_private.h"
00045 #include "nusmv/core/utils/assoc.h"
00046
00047
00048
00049
00050
00051
00052
00053
00061 typedef struct SatZchaff_TAG
00062 {
00063 INHERITS_FROM(SatIncSolver);
00064
00065 SAT_Manager zchaffSolver;
00066
00067
00068 hash_ptr cnfVar2zchaffVar;
00069 hash_ptr zchaffVar2cnfVar;
00070
00071
00072
00073 Slist_ptr conflict;
00074 } SatZchaff;
00075
00078
00079
00080
00085 void sat_zchaff_init(SatZchaff_ptr self,
00086 const NuSMVEnv_ptr env,
00087 const char* name);
00088
00093 void sat_zchaff_deinit(SatZchaff_ptr self);
00094
00099 int sat_zchaff_cnfLiteral2zchaffLiteral(SatZchaff_ptr self,
00100 int cnfLitaral);
00105 int sat_zchaff_zchaffLiteral2cnfLiteral(SatZchaff_ptr self,
00106 int zchaffLiteral);
00107
00108
00109
00114 void sat_zchaff_add(const SatSolver_ptr self,
00115 const Be_Cnf_ptr cnfProb,
00116 SatSolverGroup group);
00117
00122 void sat_zchaff_set_polarity(const SatSolver_ptr self,
00123 const Be_Cnf_ptr cnfProb,
00124 int polarity,
00125 SatSolverGroup group);
00126
00131 void sat_zchaff_set_preferred_variables(const SatSolver_ptr self,
00132 const Slist_ptr cnfVars);
00133
00138 void sat_zchaff_clear_preferred_variables(const SatSolver_ptr self);
00139
00144 SatSolverResult sat_zchaff_solve_all_groups(const SatSolver_ptr self);
00145
00150 Slist_ptr sat_zchaff_make_model(const SatSolver_ptr self);
00151
00152
00157 SatSolverGroup
00158 sat_zchaff_create_group(const SatIncSolver_ptr self);
00159
00164 void
00165 sat_zchaff_destroy_group(const SatIncSolver_ptr self,
00166 SatSolverGroup group);
00167
00172 void
00173 sat_zchaff_move_to_permanent_and_destroy_group(const SatIncSolver_ptr self,
00174 SatSolverGroup group);
00179 SatSolverResult
00180 sat_zchaff_solve_groups(const SatIncSolver_ptr self,
00181 const Olist_ptr groups);
00182
00187 SatSolverResult
00188 sat_zchaff_solve_without_groups(const SatIncSolver_ptr self,
00189 const Olist_ptr groups);
00190
00195 SatSolverResult sat_zchaff_solve_permanent_group_assume(const SatSolver_ptr self, Slist_ptr assumption);
00196
00197 Slist_ptr sat_zchaff_get_conflicts(const SatSolver_ptr);
00198
00208 Slist_ptr sat_zchaff_make_conflicts(const SatZchaff_ptr self);
00209
00212 #endif