Package kodkod.engine.fol2sat

Examples of kodkod.engine.fol2sat.TranslationRecord


      final IntSet seenUnits = new IntTreeSet();
      for(Iterator<TranslationRecord> itr = log().replay(unitFilter); itr.hasNext(); ) {
        // it is possible that two top-level formulas have identical meaning,
        // and are represented with the same core unit; in that case, we want only
        // one of them in the core.
        final TranslationRecord rec = itr.next();
        if (seenUnits.add(rec.literal())) {
          coreRoots.put(rec.translated(), rec.node());
       
      }
      coreRoots = Collections.unmodifiableMap(coreRoots);
    }
    return coreRoots;
View Full Code Here


      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();) {
      TranslationRecord record = itr.next();
      int[] var = maxRootVar.get(record.translated());
      if (var==null) {
        var = new int[1];
        maxRootVar.put(record.translated(), var);
      }
      var[0] = StrictMath.abs(record.literal());
    }
   
    for(int[] var : maxRootVar.values()) {
      int topVar = var[0];
      if (topVar != Integer.MAX_VALUE) // formula simplified to TRUE
View Full Code Here

      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();) {
      TranslationRecord record = itr.next();
      int[] var = maxRootVar.get(record.translated());
      if (var==null) {
        var = new int[1];
        maxRootVar.put(record.translated(), var);
      }
      var[0] = StrictMath.abs(record.literal());
    }
   
    for(Map.Entry<Formula,int[]> entry : maxRootVar.entrySet()) {
      final int topVar = entry.getValue()[0];
      if (topVar != Integer.MAX_VALUE) // formula simplified to TRUE
View Full Code Here

    if (coreRoots==null) {
      final Iterator<TranslationRecord> itr = core();
      final Set<Formula> roots = log().roots();
      coreRoots = new LinkedHashMap<Formula,Node>();
      while( itr.hasNext() ) {
        TranslationRecord rec = itr.next();
        if (roots.contains(rec.translated()))
          coreRoots.put(rec.translated(), rec.node());
      }
      coreRoots = Collections.unmodifiableMap(coreRoots);
    }
    return coreRoots;
  }
View Full Code Here

    final Map<Formula, int[]> rootLits = new LinkedHashMap<Formula,int[]>();
    final Map<Formula, Node> rootNodes = new LinkedHashMap<Formula, Node>();
    final Set<Formula> roots = log().roots();
   
    for(Iterator<TranslationRecord> itr = core(); itr.hasNext();) {
      final TranslationRecord rec = itr.next();
      if (roots.contains(rec.translated())) {
        // simply record the most recent output value for each formula:
        // this is guaranteed to be the final output value for that
        // formula because of the translation log guarantee that the
        // log is replayed in the order of translation:  i.e. a child's
        // output value is always recorded before the parent's
        int[] val = rootLits.get(rec.translated());
        if (val==null) {
          val = new int[1];
          rootLits.put(rec.translated(), val);
        }
        val[0] = rec.literal();
        rootNodes.put(rec.translated(), rec.node());
      }
    }
   
    final SparseSequence<Formula> lits = new TreeSequence<Formula>();
    for(Map.Entry<Formula,int[]> entry : rootLits.entrySet()) {
View Full Code Here

       
      };
     
      constNodes = new LinkedHashMap<Formula,Boolean>();
      for(Iterator<TranslationRecord> itr = log.replay(filter); itr.hasNext(); ) {
        TranslationRecord rec = itr.next();
        int lit = rec.literal();
        if (Math.abs(lit) != Integer.MAX_VALUE) {
          constNodes.remove(rec.translated());
        } else if (lit==Integer.MAX_VALUE) {
          constNodes.put(rec.translated(), Boolean.TRUE);
        } else {
          constNodes.put(rec.translated(), Boolean.FALSE);
        }
      }
    }
View Full Code Here

TOP

Related Classes of kodkod.engine.fol2sat.TranslationRecord

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.