private Predicate createPredicate(ISCContextRoot root, FormulaFactory ff) throws CoreException {
    ITypeEnvironmentBuilder te = ff.makeTypeEnvironment();

    List<Predicate> selected = new ArrayList<Predicate>();
    for (ISCAxiom iscAxiom : root.getSCAxioms()) {
      if (iscAxiom.hasAttribute(ContradictionAttribute.ATTRIBUTE)) {
        if (iscAxiom.getAttributeValue(ContradictionAttribute.ATTRIBUTE)) {
          selected.add(iscAxiom.getPredicate(te));
        }
      }
    }

    Predicate conjunctionOfAxioms;

    if (selected.size() == 1) {
      conjunctionOfAxioms = selected.get(0);
    } else {
      conjunctionOfAxioms = ff.makeAssociativePredicate(Predicate.LAND, selected, null);
    }

    List<BoundIdentDecl> theBoundOnes = new ArrayList<BoundIdentDecl>();

    conjunctionOfAxioms = conjunctionOfAxioms.bindAllFreeIdents(theBoundOnes);
    Predicate full =
        ff.makeQuantifiedPredicate(Predicate.EXISTS, theBoundOnes, conjunctionOfAxioms, null);
    return full;
  }
Ejemplo n.º 2
0
 @Override
 public Expression rewriteToEmptySet(SetExtension src) {
   final AtomicExpression expr = factory.makeEmptySet(src.getType(), src.getSourceLocation());
   return checkReplacement(src, rewriter.rewrite(expr));
 }