Package kodkod.engine.bool

Examples of kodkod.engine.bool.BooleanFactory


   * @param declConstraints the constraints implied by the declarations; should be Boolean.TRUE intially
   * @param values integer values computed so far
   */
  private final void sum(Decls decls, IntExpression expr, int currentDecl, BooleanValue declConstraints,
      List<Int> values) {
    final BooleanFactory factory = interpreter.factory();
    if (decls.size()==currentDecl) {
      values.add( expr.accept(this).choice(declConstraints, factory.integer(0)) );
      return;
    }

    final Decl decl = decls.get(currentDecl);
    final BooleanMatrix declTransl = visit(decl);
    final BooleanMatrix groundValue = factory.matrix(declTransl.dimensions());
    env = env.extend(decl.variable(), groundValue);
    for(IndexedEntry<BooleanValue> entry : declTransl) {
      groundValue.set(entry.index(), BooleanConstant.TRUE);
      sum(decls, expr, currentDecl+1, factory.and(entry.value(), declConstraints), values);
      groundValue.set(entry.index(), BooleanConstant.FALSE)
    }
    env = env.parent();
  }
View Full Code Here

TOP

Related Classes of kodkod.engine.bool.BooleanFactory

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.