Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
sav08:advanced_sat_solving_techniques [2008/03/12 21:22] vkuncak |
sav08:advanced_sat_solving_techniques [2008/03/13 10:43] vkuncak |
||
---|---|---|---|
Line 22: | Line 22: | ||
} | } | ||
</code> | </code> | ||
+ | |||
+ | ===== Branching Heuristics - decide_next_branch() ===== | ||
+ | |||
+ | Decision level: each variable whose value is chosed increase decision level. | ||
+ | |||
+ | Score variables: if a variable participates in deriving lemmas triggered by a conflict, increase its score. | ||
+ | * decrease existing scores gradually over time | ||
===== Deduction Algorithm - deduce() ===== | ===== Deduction Algorithm - deduce() ===== | ||
Main: Boolean Constraint Propagation (BCP), also called unit propagation. | Main: Boolean Constraint Propagation (BCP), also called unit propagation. | ||
+ | |||
+ | Deduced variables have same decision level as the last decision variable. | ||
+ | |||
+ | === Data Structures === | ||
++Problem with deleting clauses and literals:|backtracking is expensive.++ | ++Problem with deleting clauses and literals:|backtracking is expensive.++ | ||
+ | |||
+ | Instead: maintain truth value of literals in current assignment. | ||
+ | |||
+ | We always work with original clauses (we just record how many literals are false) | ||
Need efficient data structures: | Need efficient data structures: | ||
+ | * counters: simple, need many updates | ||
* head/tail list | * head/tail list | ||
- | * two-literal watching | + | * two-literal watching: each var has list of unassigned literals, do search to see if there are other literals to watch in clause |
- | + | * invariant: each clause has at least one watched literal, but not all literals need to be watched | |
- | Other mechanisms less important: e.g. propagating equivalences. | + | |
- | Note: as a result of these data structures, we always work with original clauses (we just record how many literals are false) | + | Mechanisms other than unit propagation are less important: e.g. propagating equivalences. |
===== Conflict Analysis and Lemma Learning - analyze_conflict() ===== | ===== Conflict Analysis and Lemma Learning - analyze_conflict() ===== | ||
Line 53: | Line 68: | ||
analyze_conflict() { | analyze_conflict() { | ||
cl = find_conflicting_clause(); | cl = find_conflicting_clause(); | ||
- | while (!stop_criterion_met(c1)) { | + | while (!is_asserting_clause(c1)) { |
var = var_of_lit(choose_literal(c1)); | var = var_of_lit(choose_literal(c1)); | ||
c1 = resolve(c1, antecedant(var), var); | c1 = resolve(c1, antecedant(var), var); | ||
Line 67: | Line 82: | ||
* then antecedant(var) is C | * then antecedant(var) is C | ||
- | ===== Branching Heuristics - decide_next_branch() ===== | + | asserting clause: |
+ | * false at current decision level | ||
+ | * only one literal has current decision level (others were assigned before) | ||
- | Score variables: if a variable caused a conflict, increase its score. | + | If c1 is not asserting clause yet, we resolve it with antecedants of variables, following backwards deduction steps. |
- | * decrease existing scores gradually over time | + | |
+ | The clause forces a different value of a decision variable at a previous level. | ||
===== Storing Clauses ===== | ===== Storing Clauses ===== |