Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #457 #462

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ private List<CrySLPredicate> retrieveReqPredFromAltPreds(ReqPred left) {
}

private CrySLPredicate extractReqPred(final ReqPred pred) {
final List<ICrySLPredicateParameter> variables = new ArrayList<>();
PredLit innerPred = (PredLit) pred;
EObject cons = innerPred.getCons();
ISLConstraint conditional = null;
Expand All @@ -348,27 +347,8 @@ private CrySLPredicate extractReqPred(final ReqPred pred) {
} else if (cons instanceof Pred) {
conditional = getPredicate((Pred) cons);
}
if (innerPred.getPred().getParList() != null) {
for (final SuPar var : innerPred.getPred().getParList().getParameters()) {
if (var.getVal() != null) {
final LiteralExpression lit = var.getVal();

final ObjectImpl object = (ObjectImpl) ((LiteralExpression) lit.getLit().getName()).getValue();
final String type = ((ObjectDecl) object.eContainer()).getObjectType().getQualifiedName();
final String variable = object.getName();

final String part = var.getVal().getPart();
if (part != null) {
variables.add(new CrySLObject(variable, type, new CrySLSplitter(Integer.parseInt(lit.getInd()), Utils.filterQuotes(lit.getSplit()))));
} else {
variables.add(new CrySLObject(variable, type));
}
} else {
variables.add(new CrySLObject(UNDERSCORE, NULL));
}
}
}
return new CrySLPredicate(null, innerPred.getPred().getPredName(), variables, (innerPred.getNot() != null ? true : false), conditional);
CrySLPredicate islc = (CrySLPredicate) getPredicate(innerPred.getPred());
return new CrySLPredicate(islc.getBaseObject(), islc.getPredName(), islc.getParameters(), islc.isNegated(), conditional);
}

private ISLConstraint getPredicate(Pred pred) {
Expand Down