@Test public void testMultiary() { final Valuation val = ImmutableValuation.builder().put(ca, Int(5)).put(cb, Int(9)).build(); Assert.assertEquals(val.toExpr(), And(Eq(ca.getRef(), Int(5)), Eq(cb.getRef(), Int(9)))); }
public Expr<BoolType> toExpr() { final List<Expr<BoolType>> exprs = new ArrayList<>(); for (final Decl<?> decl : getDecls()) { final Expr<BoolType> expr = Eq(decl.getRef(), eval(decl).get()); exprs.add(expr); } return SmartBoolExprs.And(exprs); }
Valuation implements Substitution { public Expr<BoolType> toExpr() { final List<Expr<BoolType>> exprs = new ArrayList<>(); for (final Decl<?> decl : getDecls()) { final Expr<BoolType> expr = Eq(decl.getRef(), eval(decl).get()); exprs.add(expr); } return SmartBoolExprs.And(exprs); } }
Valuation implements Substitution { public Expr<BoolType> toExpr() { final List<Expr<BoolType>> exprs = new ArrayList<>(); for (final Decl<?> decl : getDecls()) { final Expr<BoolType> expr = Eq(decl.getRef(), eval(decl).get()); exprs.add(expr); } return SmartBoolExprs.And(exprs); }  }
Valuation implements Substitution { public Expr<BoolType> toExpr() { final List<Expr<BoolType>> exprs = new ArrayList<>(); for (final Decl<?> decl : getDecls()) { final Expr<BoolType> expr = Eq(decl.getRef(), eval(decl).get()); exprs.add(expr); } return SmartBoolExprs.And(exprs); }  @Override abstract Optional<LitExpr<DeclType>> eval(final Decl<DeclType> decl); abstract Map<Decl<?>, LitExpr<?>> toMap(); Expr<BoolType> toExpr(); boolean isLeq(final Valuation that); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); }
Valuation implements Substitution { public Expr<BoolType> toExpr() { final List<Expr<BoolType>> exprs = new ArrayList<>(); for (final Decl<?> decl : getDecls()) { final Expr<BoolType> expr = Eq(decl.getRef(), eval(decl).get()); exprs.add(expr); } return SmartBoolExprs.And(exprs); }  @Override abstract Optional<LitExpr<DeclType>> eval(final Decl<DeclType> decl); abstract Map<Decl<?>, LitExpr<?>> toMap(); Expr<BoolType> toExpr(); boolean isLeq(final Valuation that); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString();  }