abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SimpSolver.cpp File Reference
#include "Sort.h"
#include "SimpSolver.h"
#include "System.h"

Go to the source code of this file.

Functions

static void mkElimClause (vec< uint32_t > &elimclauses, Lit x)
 
static void mkElimClause (vec< uint32_t > &elimclauses, Var v, Clause &c)
 

Variables

static const char * _cat = "SIMP"
 
static BoolOption opt_use_asymm (_cat,"asymm","Shrink clauses by asymmetric branching.", false)
 
static BoolOption opt_use_rcheck (_cat,"rcheck","Check if a clause is already implied. (costly)", false)
 
static BoolOption opt_use_elim (_cat,"elim","Perform variable elimination.", true)
 
static IntOption opt_grow (_cat,"grow","Allow a variable elimination step to grow by a number of clauses.", 0)
 
static IntOption opt_clause_lim (_cat,"cl-lim","Variables are not eliminated if it produces a resolvent with a length above this limit. -1 means no limit", 20, IntRange(-1, INT32_MAX))
 
static IntOption opt_subsumption_lim (_cat,"sub-lim","Do not check if subsumption against a clause larger than this. -1 means no limit.", 1000, IntRange(-1, INT32_MAX))
 
static DoubleOption opt_simp_garbage_frac (_cat,"simp-gc-frac","The fraction of wasted memory allowed before a garbage collection is triggered during simplification.", 0.5, DoubleRange(0, false, HUGE_VAL, false))
 

Function Documentation

static void mkElimClause ( vec< uint32_t > &  elimclauses,
Lit  x 
)
static

Definition at line 438 of file SimpSolver.cpp.

439 {
440  elimclauses.push(toInt(x));
441  elimclauses.push(1);
442 }
void push(void)
Definition: Vec.h:73
int toInt(Var v)
Definition: SolverTypes.h:65
static void mkElimClause ( vec< uint32_t > &  elimclauses,
Var  v,
Clause c 
)
static

Definition at line 445 of file SimpSolver.cpp.

446 {
447  int first = elimclauses.size();
448  int v_pos = -1;
449 
450  // Copy clause to elimclauses-vector. Remember position where the
451  // variable 'v' occurs:
452  for (int i = 0; i < c.size(); i++){
453  elimclauses.push(toInt(c[i]));
454  if (var(c[i]) == v)
455  v_pos = i + first;
456  }
457  assert(v_pos != -1);
458 
459  // Swap the first literal with the 'v' literal, so that the literal
460  // containing 'v' will occur first in the clause:
461  uint32_t tmp = elimclauses[v_pos];
462  elimclauses[v_pos] = elimclauses[first];
463  elimclauses[first] = tmp;
464 
465  // Store the length of the clause last:
466  elimclauses.push(c.size());
467 }
int var(Lit p)
Definition: SolverTypes.h:62
void push(void)
Definition: Vec.h:73
int size(void) const
Definition: Vec.h:63
#define assert(ex)
Definition: util_old.h:213
int toInt(Var v)
Definition: SolverTypes.h:65

Variable Documentation

const char* _cat = "SIMP"
static

Definition at line 31 of file SimpSolver.cpp.

IntOption opt_clause_lim(_cat,"cl-lim","Variables are not eliminated if it produces a resolvent with a length above this limit. -1 means no limit", 20, IntRange(-1, INT32_MAX))
static
IntOption opt_grow(_cat,"grow","Allow a variable elimination step to grow by a number of clauses.", 0)
static
DoubleOption opt_simp_garbage_frac(_cat,"simp-gc-frac","The fraction of wasted memory allowed before a garbage collection is triggered during simplification.", 0.5, DoubleRange(0, false, HUGE_VAL, false))
static
IntOption opt_subsumption_lim(_cat,"sub-lim","Do not check if subsumption against a clause larger than this. -1 means no limit.", 1000, IntRange(-1, INT32_MAX))
static
BoolOption opt_use_asymm(_cat,"asymm","Shrink clauses by asymmetric branching.", false)
static
BoolOption opt_use_elim(_cat,"elim","Perform variable elimination.", true)
static
BoolOption opt_use_rcheck(_cat,"rcheck","Check if a clause is already implied. (costly)", false)
static