use of com.rockwellcollins.atc.agree.agree.PatternStatement in project AGREE by loonwerks.
the class AgreeASTBuilder method getGuaranteeStatements.
private List<AgreeStatement> getGuaranteeStatements(EList<SpecStatement> specs, Map<String, jkind.lustre.Expr> rewriteMap) {
List<AgreeStatement> guarantees = new ArrayList<>();
for (SpecStatement spec : specs) {
if (spec instanceof GuaranteeStatement) {
GuaranteeStatement guarantee = (GuaranteeStatement) spec;
String str = guarantee.getStr();
if (guarantee.getExpr() != null) {
guarantees.add(new AgreeStatement(str, doSwitch(guarantee.getExpr()).accept(new SubstitutionVisitor(rewriteMap)), guarantee));
} else {
PatternStatement pattern = guarantee.getPattern();
AgreeStatement patStatement = new AgreePatternBuilder(str, guarantee, this).doSwitch(pattern);
patStatement.expr = patStatement.expr.accept(new SubstitutionVisitor(rewriteMap));
guarantees.add(patStatement);
}
}
}
return guarantees;
}
use of com.rockwellcollins.atc.agree.agree.PatternStatement in project AGREE by loonwerks.
the class AgreeASTBuilder method getAssertionStatements.
private List<AgreeStatement> getAssertionStatements(EList<SpecStatement> specs) {
List<AgreeStatement> asserts = new ArrayList<>();
for (SpecStatement spec : specs) {
if (spec instanceof AssertStatement) {
AssertStatement assertState = (AssertStatement) spec;
String str = assertState.getStr();
if (assertState.getExpr() != null) {
asserts.add(new AgreeStatement(str, doSwitch(assertState.getExpr()), assertState));
} else {
PatternStatement pattern = assertState.getPattern();
asserts.add(new AgreePatternBuilder(str, assertState, this).doSwitch(pattern));
}
}
}
return asserts;
}
use of com.rockwellcollins.atc.agree.agree.PatternStatement in project AGREE by loonwerks.
the class NamedSpecStatementImpl method basicSetPattern.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPattern(PatternStatement newPattern, NotificationChain msgs) {
PatternStatement oldPattern = pattern;
pattern = newPattern;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AgreePackage.NAMED_SPEC_STATEMENT__PATTERN, oldPattern, newPattern);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of com.rockwellcollins.atc.agree.agree.PatternStatement in project AGREE by loonwerks.
the class AgreeASTBuilder method getReachableStatements.
private List<AgreeStatement> getReachableStatements(EList<SpecStatement> specs, Map<String, jkind.lustre.Expr> rewriteMap) {
List<AgreeStatement> reachables = new ArrayList<>();
for (SpecStatement spec : specs) {
if (spec instanceof ReachableStatement) {
ReachableStatement reachable = (ReachableStatement) spec;
if (reachable.getExpr() != null) {
reachables.add(new AgreeStatement(reachable.getStr(), new jkind.lustre.UnaryExpr(jkind.lustre.UnaryOp.NOT, doSwitch(reachable.getExpr()).accept(new SubstitutionVisitor(rewriteMap))), spec));
} else {
PatternStatement pattern = reachable.getPattern();
AgreeStatement patStatement = new AgreePatternBuilder(reachable.getStr(), reachable, this).doSwitch(pattern);
patStatement.expr = new jkind.lustre.UnaryExpr(jkind.lustre.UnaryOp.NOT, patStatement.expr.accept(new SubstitutionVisitor(rewriteMap)));
reachables.add(patStatement);
}
}
}
return reachables;
}
use of com.rockwellcollins.atc.agree.agree.PatternStatement in project AGREE by loonwerks.
the class AgreeASTBuilder method getAssumptionStatements.
private List<AgreeStatement> getAssumptionStatements(EList<SpecStatement> specs, Map<String, jkind.lustre.Expr> rewriteMap) {
List<AgreeStatement> assumptions = new ArrayList<>();
for (SpecStatement spec : specs) {
if (spec instanceof AssumeStatement) {
AssumeStatement assumption = (AssumeStatement) spec;
String str = assumption.getStr();
if (assumption.getExpr() != null) {
assumptions.add(new AgreeStatement(str, doSwitch(assumption.getExpr()).accept(new SubstitutionVisitor(rewriteMap)), assumption));
} else {
PatternStatement pattern = assumption.getPattern();
AgreeStatement patAssumption = new AgreePatternBuilder(str, assumption, this).doSwitch(pattern);
patAssumption.expr = patAssumption.expr.accept(new SubstitutionVisitor(rewriteMap));
assumptions.add(patAssumption);
}
}
}
return assumptions;
}
Aggregations