From 7ed4a52341d8ce80db3cf1632591c6dc3b6adc07 Mon Sep 17 00:00:00 2001 From: Nuno Macedo Date: Mon, 15 Apr 2024 18:09:28 +0100 Subject: [PATCH] removed electrod int safeguards --- .../natv/electrod/ElectrodPrinter.java | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/org.alloytools.pardinus.native/src/main/java/org/alloytools/solvers/natv/electrod/ElectrodPrinter.java b/org.alloytools.pardinus.native/src/main/java/org/alloytools/solvers/natv/electrod/ElectrodPrinter.java index 638dab696..6169f6c12 100644 --- a/org.alloytools.pardinus.native/src/main/java/org/alloytools/solvers/natv/electrod/ElectrodPrinter.java +++ b/org.alloytools.pardinus.native/src/main/java/org/alloytools/solvers/natv/electrod/ElectrodPrinter.java @@ -818,11 +818,10 @@ public void visit(ProjectExpression node) { * tokenize[node.intExpr], "]" ] **/ // [HASLab] integer relations public void visit(IntToExprCast node) { - throw new InvalidUnboundedProblem(lastFormula); -// append("Int"); -// append("["); -// node.intExpr().accept(this); -// append("]"); + append("Int"); + append("["); + node.intExpr().accept(this); + append("]"); } /** @throws InvalidUnboundedProblem @@ -832,12 +831,11 @@ public void visit(IntToExprCast node) { public void visit(ExprToIntCast node) { switch(node.op()) { case SUM: - throw new InvalidUnboundedProblem(lastFormula); -// append("int"); -// append("["); -// node.expression().accept(this); -// append("]"); -// break; + append("int"); + append("["); + node.expression().accept(this); + append("]"); + break; case CARDINALITY : append("#"); append("("); @@ -883,9 +881,7 @@ public void visit(RelationPredicate node) { /** * Converts identifiers into a version that is compatible with Electrod by * removing '/', '.' and '$' symbols. - * - * TODO: what if id already has # symbols? - * + * * @param id the identifier. * @return the normalized identifier. */ @@ -900,9 +896,7 @@ else if (Arrays.asList(protected_keywords).contains(id)) /** * Converts identifiers that are compatible with Electrod back to their Kodkod * internal representation. - * - * * TODO: what if id already has # symbols? - * + * * @param id the identifier. * @return the denormalized identifier. */