kodkod.engine.ucore
Class StrategyUtils

java.lang.Object
  extended by kodkod.engine.ucore.StrategyUtils

public final class StrategyUtils
extends java.lang.Object

A collection of utility methods for implementing logic-level reduction strategies.

Author:
Emina Torlak

Method Summary
static IntSet coreWithVar(ResolutionTrace trace, int maxVariable)
          Returns the indices of the clauses in the unsatifiable core of the given trace that have the specified maximum variable.
static IntSet maxCoreVars(ResolutionTrace trace)
          Returns the maximum variables of the clauses in the unsatisfiable core of the given trace.
static java.util.Set<Formula> topFormulas(Formula formula)
          Returns the top-level components of the given formula.
static IntSet topVars(TranslationLog log)
          Returns the variables that correspond to the top-level subformulas of log.formula
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

topFormulas

public static java.util.Set<Formula> topFormulas(Formula formula)
Returns the top-level components of the given formula. In other words, returns the subformulas, {f0, ..., fk}, of the given formula such that, for all 0<=i<=k, fi is not a conjuction and [[f0 && ... && fk]] <=> [[formula]].

Returns:
subformulas, {f0, ..., fk}, of the given formula such that, for all 0<=i<=k, fi is not a conjuction and [[f0 && ... && fk]] <=> [[formula]].

topVars

public static IntSet topVars(TranslationLog log)
Returns the variables that correspond to the top-level subformulas of log.formula

Returns:
 
 { v: int | some r: log.records | 
   r.node in topFormulas(log.formula) and 
   v = abs(r.literal) and
   no r': log.records | r'.node = r.node && abs(r'.literal) > v }
 

maxCoreVars

public static IntSet maxCoreVars(ResolutionTrace trace)
Returns the maximum variables of the clauses in the unsatisfiable core of the given trace.

Returns:
trace.elts[trace.core()].maxVariable()

coreWithVar

public static IntSet coreWithVar(ResolutionTrace trace,
                                 int maxVariable)
Returns the indices of the clauses in the unsatifiable core of the given trace that have the specified maximum variable.

Returns:
{ i: trace.core() | trace[i].maxVariable() = maxVariable }