Skip to content

Commit a84edcc

Browse files
committed
- Removed strict RML checks.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22944 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 7268e5c commit a84edcc

File tree

6 files changed

+17
-123
lines changed

6 files changed

+17
-123
lines changed

Compiler/FrontEnd/InstFunction.mo

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ algorithm
278278
case (cache,env,ih,mod,pre,(c as SCode.CLASS(restriction = r,partialPrefix = pPrefix)),inst_dims)
279279
equation
280280
failure(SCode.R_RECORD(_) = r);
281-
true = MetaUtil.strictRMLCheck(Flags.isSet(Flags.STRICT_RML),c);
282281
(cache,env,ih,funs) = implicitFunctionInstantiation2(cache,env,ih,mod,pre,c,inst_dims,false);
283282
cache = InstUtil.addFunctionsToDAE(cache, funs, pPrefix);
284283
then (cache,env,ih);

Compiler/FrontEnd/MetaUtil.mo

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -639,92 +639,5 @@ algorithm
639639
end match;
640640
end tryToConvertArrayToList;
641641

642-
public function strictRMLCheck
643-
"If we are checking for strict RML, and function containing a single statement
644-
that is a match expression must be on the form (outputs) := matchcontinue (inputs).
645-
RML does not check this even though it's translated to this internally, so we
646-
must check for it to warn the user."
647-
input Boolean b;
648-
input SCode.Element c;
649-
output Boolean isOK;
650-
algorithm
651-
isOK := matchcontinue (b,c)
652-
local
653-
list<SCode.Element> elts,inelts,outelts;
654-
list<String> innames,outnames;
655-
list<Absyn.Exp> outcrefs,increfs;
656-
Absyn.Exp comp,inputs;
657-
Absyn.Info info;
658-
case (false,_) then true;
659-
case (_,SCode.CLASS(info = info, restriction = SCode.R_FUNCTION(SCode.FR_NORMAL_FUNCTION(_)), classDef = SCode.PARTS(elementLst = elts, normalAlgorithmLst = {SCode.ALGORITHM({SCode.ALG_ASSIGN(assignComponent = comp, value = Absyn.MATCHEXP(inputExp = inputs))})})))
660-
equation
661-
outcrefs = extractListFromTuple(comp,0);
662-
increfs = extractListFromTuple(inputs,0);
663-
inelts = List.select1(elts, SCode.isComponentWithDirection, Absyn.INPUT());
664-
outelts = List.select1(elts, SCode.isComponentWithDirection, Absyn.OUTPUT());
665-
innames = List.map(inelts, SCode.elementName);
666-
outnames = List.map(outelts, SCode.elementName);
667-
then strictRMLCheck2(increfs,outcrefs,innames,outnames,info);
668-
else true;
669-
end matchcontinue;
670-
end strictRMLCheck;
671-
672-
protected function strictRMLCheck2
673-
"If we are checking for strict RML, and function containing a single statement
674-
that is a match expression must be on the form (outputs) := matchcontinue (inputs).
675-
RML does not check this even though it's translated to this internally, so we
676-
must check for it to warn the user."
677-
input list<Absyn.Exp> increfs;
678-
input list<Absyn.Exp> outcrefs;
679-
input list<String> innames;
680-
input list<String> outnames;
681-
input Absyn.Info info;
682-
output Boolean b;
683-
algorithm
684-
b := matchcontinue (increfs,outcrefs,innames,outnames,info)
685-
local
686-
list<String> names;
687-
case (_,_,_,_,_)
688-
equation
689-
true = (listLength(increfs) <> listLength(innames));
690-
Error.addSourceMessage(Error.META_STRICT_RML_MATCH_IN_OUT, {"Number of input arguments don't match"}, info);
691-
then false;
692-
case (_,_,_,_::_,_)
693-
equation
694-
true = (listLength(outcrefs) <> listLength(outnames));
695-
Error.addSourceMessage(Error.META_STRICT_RML_MATCH_IN_OUT, {"Number of output arguments don't match"}, info);
696-
then false;
697-
case (_,_,_,_,_)
698-
equation
699-
false = (listLength(outnames)+listLength(innames)) == listLength(List.union(innames,outnames));
700-
Error.addSourceMessage(Error.META_STRICT_RML_MATCH_IN_OUT, {"An argument in the output has the same name as one in the input"}, info);
701-
then false;
702-
case (_,_,_,_,_)
703-
equation
704-
failure(_ = List.map(increfs, Absyn.expCref));
705-
Error.addSourceMessage(Error.META_STRICT_RML_MATCH_IN_OUT, {"Input expression was not a tuple of component references"}, info);
706-
then false;
707-
case (_,_,_,_,_)
708-
equation
709-
failure(_ = List.map(outcrefs, Absyn.expCref));
710-
Error.addSourceMessage(Error.META_STRICT_RML_MATCH_IN_OUT, {"Output expression was not a tuple of component references"}, info);
711-
then false;
712-
case (_,_,_,_,_)
713-
equation
714-
names = List.map(increfs, Absyn.expComponentRefStr);
715-
failure(equality(names = innames));
716-
Error.addSourceMessage(Error.META_STRICT_RML_MATCH_IN_OUT, {"The input does not match"}, info);
717-
then false;
718-
case (_,{Absyn.CREF(Absyn.WILD())},_,{},_) then true;
719-
case (_,_,_,_,_)
720-
equation
721-
names = List.map(outcrefs, Absyn.expComponentRefStr);
722-
failure(equality(names = outnames));
723-
Error.addSourceMessage(Error.META_STRICT_RML_MATCH_IN_OUT, {"The output does not match"}, info);
724-
then false;
725-
else true;
726-
end matchcontinue;
727-
end strictRMLCheck2;
728-
729642
annotation(__OpenModelica_Interface="frontend");
730643
end MetaUtil;

Compiler/FrontEnd/ModelicaBuiltin.mo

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,12 +1702,6 @@ external "builtin";
17021702
annotation(preferredView="text");
17031703
end getClassesInModelicaPath;
17041704

1705-
function strictRMLCheck "Checks if any loaded function."
1706-
output String message "empty if there was no problem";
1707-
external "builtin";
1708-
annotation(preferredView="text");
1709-
end strictRMLCheck;
1710-
17111705
/* These don't influence anything...
17121706
function getClassNamesForSimulation
17131707
output String classNamesForSimulation;

Compiler/Script/CevalScript.mo

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3332,13 +3332,6 @@ algorithm
33323332
setEcho(bval);
33333333
then (cache,v,st);
33343334

3335-
case (cache,_,"strictRMLCheck",_,st as GlobalScript.SYMBOLTABLE(ast = p),_)
3336-
equation
3337-
_ = List.map1r(List.map(Interactive.getFunctionsInProgram(p), SCodeUtil.translateClass), MetaUtil.strictRMLCheck, true);
3338-
str = Error.printMessagesStr(false);
3339-
v = Values.STRING(str);
3340-
then (cache,v,st);
3341-
33423335
case (cache,env,"dumpXMLDAE",vals,st,_)
33433336
equation
33443337
(cache,st,xml_filename) = dumpXMLDAE(cache,env,vals,st, msg);

Compiler/Util/Error.mo

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,8 +801,6 @@ public constant Message META_MATCH_GENERAL_FAILURE = MESSAGE(5014, TRANSLATION()
801801
Util.gettext("Failed to elaborate match expression %s"));
802802
public constant Message META_CONS_TYPE_MATCH = MESSAGE(5015, TRANSLATION(), ERROR(),
803803
Util.gettext("Failed to match types of cons expression %s. The head has type %s and the tail %s."));
804-
public constant Message META_STRICT_RML_MATCH_IN_OUT = MESSAGE(5016, TRANSLATION(), ERROR(),
805-
Util.gettext("%s. Strict RML enforces match expression input and output to be the same as the function's."));
806804
public constant Message META_NONE_CREF = MESSAGE(5017, TRANSLATION(), ERROR(),
807805
Util.gettext("NONE is not acceptable syntax. Use NONE() instead."));
808806
public constant Message META_INVALID_PATTERN_NAMED_FIELD = MESSAGE(5018, TRANSLATION(), ERROR(),

Compiler/Util/Flags.mo

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -376,41 +376,39 @@ constant DebugFlag EVALUATE_CONST_FUNCTIONS = DEBUG_FLAG(105, "evalConstFuncs",
376376
Util.gettext("Evaluates functions complete and partially and checks for constant output."));
377377
constant DebugFlag HPCOM_ANALYZATION_MODE = DEBUG_FLAG(106, "hpcomAnalyzationMode", false,
378378
Util.gettext("Creates statically linked c++ - code for analyzation (requires statically build cpp-runtime)"));
379-
constant DebugFlag STRICT_RML = DEBUG_FLAG(107, "strictRml", false,
380-
Util.gettext("Turns on extra RML checks."));
381-
constant DebugFlag IMPL_ODE = DEBUG_FLAG(108, "implOde", false,
379+
constant DebugFlag IMPL_ODE = DEBUG_FLAG(107, "implOde", false,
382380
Util.gettext("activates implicit codegen"));
383-
constant DebugFlag EVAL_FUNC_DUMP = DEBUG_FLAG(109, "evalFuncDump", false,
381+
constant DebugFlag EVAL_FUNC_DUMP = DEBUG_FLAG(108, "evalFuncDump", false,
384382
Util.gettext("dumps debug information about the function evaluation"));
385-
constant DebugFlag PRINT_STRUCTURAL = DEBUG_FLAG(110, "printStructuralParameters", false,
383+
constant DebugFlag PRINT_STRUCTURAL = DEBUG_FLAG(109, "printStructuralParameters", false,
386384
Util.gettext("Prints the structural parameters identified by the front-end"));
387-
constant DebugFlag ITERATION_VARS = DEBUG_FLAG(111, "iterationVars", false,
385+
constant DebugFlag ITERATION_VARS = DEBUG_FLAG(110, "iterationVars", false,
388386
Util.gettext("Shows a list of all iteration variables."));
389-
constant DebugFlag ALLOW_RECORD_TOO_MANY_FIELDS = DEBUG_FLAG(112, "acceptTooManyFields", false,
387+
constant DebugFlag ALLOW_RECORD_TOO_MANY_FIELDS = DEBUG_FLAG(111, "acceptTooManyFields", false,
390388
Util.gettext("Accepts passing records with more fields than expected to a function. This is not allowed, but is used in Fluid.Dissipation. See https://trac.modelica.org/Modelica/ticket/1245 for details."));
391-
constant DebugFlag HPCOM_MEMORY_OPT = DEBUG_FLAG(113, "hpcomMemoryOpt", false,
389+
constant DebugFlag HPCOM_MEMORY_OPT = DEBUG_FLAG(112, "hpcomMemoryOpt", false,
392390
Util.gettext("Optimize the memory structure regarding the selected scheduler"));
393-
constant DebugFlag DUMP_SYNCHRONOUS = DEBUG_FLAG(114, "dumpSynchronous", false,
391+
constant DebugFlag DUMP_SYNCHRONOUS = DEBUG_FLAG(113, "dumpSynchronous", false,
394392
Util.gettext("Dumps information of the clock partitioning."));
395-
constant DebugFlag STRIP_PREFIX = DEBUG_FLAG(115, "stripPrefix", true,
393+
constant DebugFlag STRIP_PREFIX = DEBUG_FLAG(114, "stripPrefix", true,
396394
Util.gettext("Strips the environment prefix from path/crefs. Defaults to true."));
397-
constant DebugFlag DO_SCODE_DEP = DEBUG_FLAG(116, "doSCodeDep", true,
395+
constant DebugFlag DO_SCODE_DEP = DEBUG_FLAG(115, "doSCodeDep", true,
398396
Util.gettext("Does scode dependency analysis prior to instantiation. Defaults to true."));
399-
constant DebugFlag SHOW_INST_CACHE_INFO = DEBUG_FLAG(117, "showInstCacheInfo", false,
397+
constant DebugFlag SHOW_INST_CACHE_INFO = DEBUG_FLAG(116, "showInstCacheInfo", false,
400398
Util.gettext("Prints information about instantiation cache hits and additions. Defaults to false."));
401-
constant DebugFlag DUMP_UNIT = DEBUG_FLAG(118, "dumpUnits", false,
399+
constant DebugFlag DUMP_UNIT = DEBUG_FLAG(117, "dumpUnits", false,
402400
Util.gettext("Dumps all the calculated units."));
403-
constant DebugFlag DUMP_EQ_UNIT = DEBUG_FLAG(119, "dumpEqInUC", false,
401+
constant DebugFlag DUMP_EQ_UNIT = DEBUG_FLAG(118, "dumpEqInUC", false,
404402
Util.gettext("Dumps all equations handled by the unit checker."));
405-
constant DebugFlag DUMP_EQ_UNIT_STRUCT = DEBUG_FLAG(120, "dumpEqUCStruct", false,
403+
constant DebugFlag DUMP_EQ_UNIT_STRUCT = DEBUG_FLAG(119, "dumpEqUCStruct", false,
406404
Util.gettext("Dumps all the equations handled by the unit checker as tree-structure."));
407-
constant DebugFlag SHOW_DAE_GENERATION = DEBUG_FLAG(121, "showDaeGeneration", false,
405+
constant DebugFlag SHOW_DAE_GENERATION = DEBUG_FLAG(120, "showDaeGeneration", false,
408406
Util.gettext("Show the dae variable declarations as they happen."));
409-
constant DebugFlag RESHUFFLE_POST = DEBUG_FLAG(122, "reshufflePost", false,
407+
constant DebugFlag RESHUFFLE_POST = DEBUG_FLAG(121, "reshufflePost", false,
410408
Util.gettext("Reshuffles the systems of equations."));
411-
constant DebugFlag SHOW_EXPANDABLE_INFO = DEBUG_FLAG(123, "showExpandableInfo", false,
409+
constant DebugFlag SHOW_EXPANDABLE_INFO = DEBUG_FLAG(122, "showExpandableInfo", false,
412410
Util.gettext("Show information about expandable connector handling."));
413-
constant DebugFlag DUMP_HOMOTOPY = DEBUG_FLAG(124, "dumpHomotopy", false,
411+
constant DebugFlag DUMP_HOMOTOPY = DEBUG_FLAG(123, "dumpHomotopy", false,
414412
Util.gettext("Dumps the results of the postOptModule optimizeHomotopyCalls."));
415413

416414
// This is a list of all debug flags, to keep track of which flags are used. A
@@ -524,7 +522,6 @@ constant list<DebugFlag> allDebugFlags = {
524522
DUMP_TRANSFORMED_MODELICA_MODEL,
525523
EVALUATE_CONST_FUNCTIONS,
526524
HPCOM_ANALYZATION_MODE,
527-
STRICT_RML,
528525
IMPL_ODE,
529526
EVAL_FUNC_DUMP,
530527
PRINT_STRUCTURAL,

0 commit comments

Comments
 (0)