Browse Source

Bugfix: previous "improvement" to API wrt undefined constants broke some models, e.g. when trying to evaluate pow/floor etc. with wrong number of arguments.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@4249 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 14 years ago
parent
commit
95d7e89a57
  1. 16
      prism/src/parser/ast/ModulesFile.java

16
prism/src/parser/ast/ModulesFile.java

@ -490,14 +490,6 @@ public class ModulesFile extends ASTElement
// Check constants for cyclic dependencies // Check constants for cyclic dependencies
constantList.findCycles(); constantList.findCycles();
// If there are no undefined constants, set up values for constants
// (to avoid need for a later call to setUndefinedConstants).
// NB: Can't call setUndefinedConstants if there are undefined constants
// because semanticCheckAfterConstants may fail.
if (getUndefinedConstants().isEmpty()) {
setUndefinedConstants(null);
}
// Check variable names, etc. // Check variable names, etc.
checkVarNames(); checkVarNames();
// Find all instances of variables, replace identifiers with variables. // Find all instances of variables, replace identifiers with variables.
@ -512,8 +504,16 @@ public class ModulesFile extends ASTElement
// Various semantic checks // Various semantic checks
semanticCheck(this); semanticCheck(this);
// Type checking // Type checking
typeCheck(); typeCheck();
// If there are no undefined constants, set up values for constants
// (to avoid need for a later call to setUndefinedConstants).
// NB: Can't call setUndefinedConstants if there are undefined constants
// because semanticCheckAfterConstants may fail.
if (getUndefinedConstants().isEmpty()) {
setUndefinedConstants(null);
}
} }
// Check formula identifiers // Check formula identifiers

Loading…
Cancel
Save