Package kodkod.engine.fol2sat

Examples of kodkod.engine.fol2sat.RecordFilter


   * @return let formulas = (this.log.records[int] & literal.{i: int | abs(i) in coreVars}).formula |
   *       connected = {f: formulas  | some s: set coreNodes | f + this.log.formula in s and (s - this.log.formula).~components in s }
   */
  private Set<Formula>  connectedCore(final IntSet coreVars) {
    final Set<Formula> coreNodes = new IdentityHashSet<Formula>();
    final RecordFilter filter = new RecordFilter() {
      public boolean accept(Node node, Formula translated, int literal, Map<Variable,TupleSet> env) {
        return coreVars.contains(StrictMath.abs(literal));
      }
    };
    for(Iterator<TranslationRecord> itr = log().replay(filter); itr.hasNext(); ) {
View Full Code Here


   * {@inheritDoc}
   * @see kodkod.engine.Proof#core()
   */
  public final Iterator<TranslationRecord> core() {
    if (coreFilter == null) {
      coreFilter = new RecordFilter() {
        final IntSet coreVariables = StrategyUtils.coreVars(solver.proof());
        final Set<Formula> coreNodes = connectedCore(coreVariables);
        public boolean accept(Node node, Formula translated, int literal, Map<Variable,TupleSet> env) {
          return coreNodes.contains(translated) && coreVariables.contains(StrictMath.abs(literal));
        }
View Full Code Here

   * {@inheritDoc}
   * @see kodkod.engine.Proof#highLevelCore()
   */
  public final Map<Formula, Node> highLevelCore() {
    if (coreRoots == null) {
      final RecordFilter unitFilter = new RecordFilter() {
        final IntSet coreUnits = StrategyUtils.coreUnits(solver.proof());
        final Set<Formula> roots = log().roots();
        public boolean accept(Node node, Formula translated, int literal, Map<Variable, TupleSet> env) {
          return roots.contains(translated) && coreUnits.contains(Math.abs(literal));
        }
View Full Code Here

   */
  public static IntSet rootVars(TranslationLog log) {
    final IntSet rootVars = new IntTreeSet();
    final Set<Formula> roots = log.roots();
    final Map<Formula,int[]> maxRootVar = new LinkedHashMap<Formula,int[]>(roots.size());
    final RecordFilter filter = new RecordFilter() {
      public boolean accept(Node node, Formula translated, int literal, Map<Variable, TupleSet> env) {
        return roots.contains(translated) && env.isEmpty();
      }
    };
    for(Iterator<TranslationRecord> itr = log.replay(filter); itr.hasNext();) {
View Full Code Here

   */
  static SparseSequence<Formula> roots(TranslationLog log) {
    final SparseSequence<Formula> rootVars = new TreeSequence<Formula>();
    final Set<Formula> roots = log.roots();
    final Map<Formula,int[]> maxRootVar = new IdentityHashMap<Formula,int[]>(roots.size());
    final RecordFilter filter = new RecordFilter() {
      public boolean accept(Node node, Formula translated, int literal, Map<Variable, TupleSet> env) {
        return roots.contains(translated) && env.isEmpty();
      }
    };
    for(Iterator<TranslationRecord> itr = log.replay(filter); itr.hasNext();) {
View Full Code Here

   * {@inheritDoc}
   * @see kodkod.engine.Proof#core()
   */
  public final Iterator<TranslationRecord> core() {
    if (coreFilter==null) {
      coreFilter = new RecordFilter() {
        final Set<Node> coreNodes = NodePruner.relevantNodes(log(),  coreRoots==null ? log().roots() : coreRoots.keySet());
        public boolean accept(Node node, Formula translated, int literal, Map<Variable, TupleSet> env) {
          return coreNodes.contains(translated) ;
        }
      };
View Full Code Here

    @SuppressWarnings("unchecked")
    NodePruner(TranslationLog log) {
      visited = new IdentityHashSet<Node>();
      relevant = new IdentityHashSet<Node>();
           
      final RecordFilter filter = new RecordFilter() {
        public boolean accept(Node node, Formula translated, int literal, Map<Variable, TupleSet> env) {
          return env.isEmpty();
       
      };
     
View Full Code Here

TOP

Related Classes of kodkod.engine.fol2sat.RecordFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.