# revision

rev: 0000000015
author: adrpo
message:
  fixed compiler define checks for making real_string generate uniformly the string on every platforms.


rev: 0000000027
author: adrpo
message:
  Adrian Pop, 2006-03-17
  ---
  - small fix to debugging. 
  - added also new flags to the runtime: -debugall and -debugcalls
    + new functionality also


rev: 0000000029
author: adrpo
message:
  Added a little README.MLton.txt on how to compile the SML part of RML with MLton.
  Fixed debug messages to be RML/MMC dependent.
  Fixed generation of executables (no heap) for MLton. (RML.mlb)
  Fixed sources.mlb to include Util.sml as dependency to Control.sml
  Fixed compiler/Make.mk to re-compile the rml.$(HEAP_SUFFIX) if some of the *.sig and *.sml are changed.


rev: 0000000037
author: adrpo
message:
  Adrian Pop, adrpo@ida.liu.se, 2006-03-20
  - fixed debugging with sockets on MINGW32
  - fixed several a lot of other small stuff concerning debugging
  - added help for rml and for runtime
  - added more debugging commands


rev: 0000000040
author: adrpo
message:
  Fixed bug: 78
  http://bug.modelicacommunity.org/show_bug.cgi?id=78
  Implemented most of the things needed for bug 55
  http://bug.modelicacommunity.org/show_bug.cgi?id=55


rev: 0000000084
author: adrpo
message:
  - local variable declarations are now enforced.
  - come a little closer into fixing bug 76.
  - added input/output to local relbind declarations to be check later with relation type.
  - serialized match variables and return pattern to be checked later.


rev: 0000000097
author: adrpo
message:
  - fix for Visual C which doesn't know how to compile a c89 standard
    variables have to be declared at the start of a block


rev: 0000000100
author: adrpo
message:
  - fixes for arithmetic expressions and unary operators
  - fixes for function calls as arguments to binary/unary/lbinary/lunary operators
  - cleaning of the grammar


rev: 0000000103
author: adrpo
message:
  - fixed the grammar a bit
  - got rid of some debug info dumped to stdout from MOToRMLFn.sml 
  - fixed exit status from RML in case of an error.
  - fixed some of the MetaModelica examples


rev: 0000000104
author: adrpo
message:
  Fixed bug:
  http://bug.modelicacommunity.org/show_bug.cgi?id=93
  - fixed a bug where the debugger does not print the literals from the result expressions


rev: 0000000115
author: adrpo
message:
  - generate better label and success/failure continuation names
  - added a flag -fdfa-statistics to print the pattern-matching DFA


rev: 0000000116
author: adrpo
message:
  - better names for success and failure continuations
  - reverse mangling of names when called with -ftrace


rev: 0000000117
author: adrpo
message:
  - added -trace and -no-trace flag to the runtime
  - when a .rml and .mo file is compiled with -ftrace code is generated
    for printing relation/function names when the program is run.
    this is not enabled by default, use:
    exe -trace to enable printing.
  - moved the RMLruntime.sln and RMLruntime.vcproj to VS2005
   
    


rev: 0000000118
author: adrpo
message:
  - temporary fixes for compilation of debugging libraries
    + the result is quite intermediate, meaning that debugging in not working yet.


rev: 0000000125
author: adrpo
message:
  - got rid of RML_PUSHY and RML_WARPED runtime defines as they are not available anymore
  - increased the RML_YOUNG_SIZE for the plain runtime
  - added x86_64-darwin-gcc


rev: 0000000127
author: adrpo
message:
  Release 2.3.8 2007-07-16
  -----------------------------------------------------------------
  - rml+mmc handles both .rml files and .mo files
  - faster .mo or .rml compilation due to smaller 
    .srz files and less memory requirements
  - fixes of stringEqual (string_equal) function
  - rewriten the debugging part to work over sockets
  - debugging now works togheter with Modelica Development Tooling (MDT)
  - added set_debug_show_depth(int depth) to set the depth of variable showing
  - a lot of code refactoring and cleaning for faster compilation
  - dumped emacs-based debugging and readline library dependency
  - more platforms: 
    + x86_64-darwin-gcc
    + x86_64-linux-gcc
    + x86-darwin-gcc 
    + ppc-linux-gcc
  - a lot more i don't remember right now


rev: 0000000133
author: adrpo
message:
  - updated the mmc/rml runtime to the latest version
    + allocate the to-space (reserved) only when a major GC happen
    + trying a shrinking of the current heap on certain conditions
    + timers for GC (call with -log or -bench)
    + help text for the runtime when the executable is called with -help
    + fixed a typo in the -gcgag option


rev: 0000000134
author: adrpo
message:
  - changed the License in Copyright to Open Source Modelica Consortium (OSMC) Public License
  - played with the garbage collector strategy for heap shrinking


rev: 0000000137
author: adrpo
message:
  - sort of typo fix suggested by Dietmar Winkler
  - fixes to "configure" script to also consider 
    mllex and mlyacc instead of ml-lex and ml-yacc


rev: 0000000139
author: adrpo
message:
  - on some systems variable definition and 
    the export cannot be done in the same time
  - warn when SMLNJ_HOME is not defined


rev: 0000000140
author: adrpo
message:
  - some makes complain about:
    "Make.mk:4: *** commands commence before first target.  Stop."
  - fix for this problem.


rev: 0000000141
author: adrpo
message:
  - FINALLY fixed the memory leak due to mk_* functions.
    The mk_* functions now allocate memory in slots on demand
    and ONLY during a GC the slots are forwarded to current 
    region and the space is freed.
  - added string_append_list to the compiler/runtime system


rev: 0000000145
author: dietmarw
message:
  Update the installation instructions

   * INSTALL suggested installation of 'sml' but there is no such package in Ubuntu
   * marked all command line instructions with a bash sign '$'

  From: Dietmar Winkler <Dietmar.Winkler@TU-Berlin.de>


rev: 0000000146
author: dietmarw
message:
  Fix compilation on Linux with gnumake. Fixes Bug #1017.

   * the bug was a classic case of RTFM (from http://www.gnu.org/software/make/manual/html_node/Error-Messages.html#Error-Messages):
     `commands commence before first target. Stop.'
      This means the first thing in the makefile seems to be part of a command script: it begins with a TAB character and doesn't appear to be a legal make command (such as a variable assignment). Command scripts must always be associated with a target.

  From: Dietmar Winkler <Dietmar.Winkler@TU-Berlin.de>


rev: 0000000148
author: adrpo
message:
  - pushed in the include feature: -Idir flag by Andrzej Bednarski [andrzej.bednarski at math core]
  - the fist implementation of string sharing (only used for mk_scon for now)


rev: 0000000150
author: adrpo
message:
  Display the error messages a bit better to be 
  easier to differentiate between wrong types.

  Example:
  Ceval.mo:1003.5-1007.26 Error: while processing this clause:  cevalCallFunction
  type (Env.Cache,Env.Frame list...) => (Env.Cache,Values.Value) differs from:
  type (Env.Cache,Env.Frame list...) => (Env.Cache,Values.Value,Interactive.InteractiveSymbolTable option)
  reason: different number of relation arguments

  Before it was all displayed in one line which made it 
  very hard to follow the differences between long types.


rev: 0000000152
author: adrpo
message:
  - fixes for not discovering the type error in this code type:
    String s; case (C(named=SOME(s))
    where C.named is defined as String, not Option<String>.


rev: 0000000154
author: sjoelund.se
message:
  - Updated compiler/Make.mk with mlton targets.
  - Removed automatically generated lexer/parser files from svn so UNIX/Windows differences don't "change" the files.


rev: 0000000159
author: sjoelund.se
message:
  - Makes the configure script a little bit more sane, so that it does not depend on the sml version included in Debian 2004


rev: 0000000161
author: sjoelund.se
message:
  - Same as OpenModelica r5917: "+.", etc operators need an extra whitespace after them so the language is not ambiguous when parsing full Modelica code
  - There is even an extra token created so that the error message that is generated is good


rev: 0000000162
author: adrpo
message:
  Fixes for bugs: #1320 #1309
  - changed license
  - replaced tab with 2 spaces
  - support partial and encapsulated prefixes
  - support FQ names, i.e. type Env = .Env.Env
  - support full external definition: external "C" [external_function_call] [annotation] ";"


rev: 0000000164
author: adrpo
message:
  - added Absyn.CLAUSE3 for MATCH
  - added Absyn.IFgoal for if-equations
  - handle the new constructs in the .srz dump/parse.


rev: 0000000165
author: adrpo
message:
  - added more inlined equality operators for bool, real, string.
  - more names added for variables in the generated code.
  - FOL.IF now takes a variable for the condition instead of a goal.
  - fixes for else for match expressions with more than 1 input variables.
  - proper translation of if-expressions and match to new RML constructs.
  - more information on type errors.
  - tons of other small changes.
  - replaced tab with 2 spaces


rev: 0000000166
author: adrpo
message:
  - use RML_DBL_STRICT in windows MINGW GCC
  - this might fix the crashes with dynamic loading if omc is 
    compiled with visual studio and the loaded .dll with gcc.
    we should check this.


rev: 0000000172
author: adrpo
message:
  - fixes for heap shrinking (the previous strategy lead to crashes)
  - count the number of heap shrinking via rml_heap_shrinkings_count
  - if we don't have enough memory for a heap expansion do an alloc with the current size
  - do a heap expansion only if 90% of the heap is in use (before was 75%)
  - mk_bool, mk_none, mk_cons are now #defines
  - export both mk_scon_no_string_sharing and mk_scon_no_string_sharing.
    this can be used in the parser to share identifiers only, not other strings.


rev: 0000000173
author: adrpo
message:
  - more inline operators for basic types equality. boolEq, realEq, stringEq, etc.
  - some of mk_* functions are now defines.
  - export specific mk_scon_* functions
    void *mk_scon_no_string_sharing(const char *s);
    void *mk_scon_string_sharing(const char *s);
    to be used directly in the parser to create shared 
    strings only for ID's.


rev: 0000000178
author: adrpo
message:
  - added low level reference functions referenceInteger, referenceUpdate, referenceSetNth, referenceShare, referenceEq
  - added low level setGlobalRoot/getGlobalRoot for global data.
  - added unique(index) that is the same as tick()
  - added valueConstructor, valueSlots, valueEq, valueMatch
  - added low level integer bit operations and integer shift operations: intBitNot, intBitAnd, intBitOr, itBitXor, intBitLShift, intBitRShift
  - added listGet


rev: 0000000183
author: adrpo
message:
  - check that match(continue) / end match(continue) is the same.
  - moved more functions from System (acos, atan2, realCeil, etc) into MetaModelica/RML
  - added all the functions to rml-predef.h
  - moved System.enableTrace/disableTrace into MetaModelica/RML


rev: 0000000185
author: adrpo
message:
  - optimization of constant records (records without components) 
    to not consume memory when they are instantiated.
  - fixes for import warning position.


rev: 0000000186
author: adrpo
message:
  - warnings about local declarations in case
  - warnings about duplicate declarations in match, cases and else
  - disable warnings by default, enable them with -Wshow-warnings


rev: 0000000189
author: adrpo
message:
  - fixed version (manual date)
  - updated version to 2.4
  - made rml-core.h more VS friendly (inline in VS is weird)
  - fixed the missing definition of RML.enableTrace RML.disableTrace


rev: 0000000190
author: adrpo
message:
  compiler:
  - fixes for -Idir (to generate the .srz/.h/.c file in the current directory or the one specified by flags below)
  - added -oHdir (output directory for .h files)
  - added -oCdir (output directory for .c files)
  - added -oTdir (output directory for temporary .srz, .rdb, etc. files)
  - for all generated files write to a temporary file first, then rename it to the specific file
  - updated VersionFn.sml to 2.4.1

  runtime and config:
  - added librml_t.a, a library for tracing that will:
    + not exit when it cannot malloc (rather will fail the current function and activate the trace)
    + generate better names for Success/Failure continuations
  - added valueHash and valueHashMod to the runtime and compiler 


rev: 0000000192
author: adrpo
message:
  - fixing error of renaming files that does not work across partitions:
    Internal error: Control.renameFile Error: Invalid cross-device link!  
                    Could not rename file: /tmp/filei5FQ9T to: Absyn.srz
  - error is fixed by generating the temporary in the same directory so 
    that rename works fine.
  - updated version and build time.


rev: 0000000193
author: adrpo
message:
  - delete the generated temp file from which we take only the name.
  - updated version and build time.


rev: 0000000197
author: adrpo
message:
  - fixes to predefined relations (some typos)
  - hopefully finally fixed File Not Found Error
  - bumped the version info.


rev: 0000000198
author: adrpo
message:
  - try to fix the parallel make by not deleting the temp file until is used.
  - updated version and build time.


rev: 0000000199
author: adrpo
message:
  - fixes for debugging (use the filename only instead of prefix + filename).
  - updated version and build time.


rev: 0000000204
author: adrpo
message:
  - allow (and ignore) annotations in elements, equations and algorithms.
  - increased version number and updated the build date


rev: 0000000209
author: adrpo
message:
  - more fixes to RML
    + some fixes to generic uniontypes 
      (constant records did not get the correct type, 
       when having 2 type variables they were treated as a tuple, etc).
    + no more needed to define in each union the type variables, can be defined per package
    + added new flag -f{no-}relaxed-typecheck to allow for binding of 'a to STRUCTURE('b), not on by default.
    + better error messages for function type number of arguments
    + bumped version number to 2.5.0
    + some more things i don't remember now.
  - check the next commit in OpenModelica for a generic AvlTree implementation.


rev: 0000000242
author: adrpo
message:
  - add more mk_boxXX until 16.
  - small changes to way arrays are GCed.
  - use the old realString for MinGW and MSVC.


rev: 0000000257
author: adrpo
message:
  - get rid of all unnecessary scopes and move all variable declarations at the beginning of the function.
  - this can be improved even further by having an array of variables but is good enough for now.


rev: 0000000259
author: adrpo
message:
  - add config/x86_64-mingw32-gcc target and fix the configure to find it.
  - make config/tools/repchk.c compile with MinGW without changes.


rev: 0000000260
author: adrpo
message:
  - larger strings on 32 and 64 bit
    (now we consider the slots [*only for strings*] to be 
     32-5 bits on 32bit [3 is 101 the string tag + 2 to translate from words to bytes]
     and
     64-6 bits on 64bit [3 is 101 the string tag + 3 to translate from words to bytes])
    on 32 bit: 536870907 bytes maximum (~511 Mbytes strings)
    on 64 bit: who cares?
  - ansi C in list.c
  - more space in p-gccore.c


rev: 0000000261
author: adrpo
message:
  - better support x86_64-mingw32-gcc (mingw64)
  - configure using: CC=x86_64-w64-mingw32-gcc ./configure


rev: 0000000272
author: adrpo
message:
  - allow use of int (Integer) where instead of char (Char) and vice versa.
  - use stringAppendList for the stringCharListString implementation.


rev: 0000000274
author: adrpo
message:
  - make SML/NJ feel good about itself by forcing the exact type (thanks to Ivan Mendoza for reporting this error):
    FOLOptimFn.sml:14.9-14.27 Warning: type vars not generalized because of value restriction are instantiated to dummy types (X1,X2,...)
    FOLOptimFn.sml:23.7-23.52 Error: operator and operand don't agree [tycon mismatch]
      operator domain: TextIO.outstream * FOL.module * FOL.conj
      operand:         TextIO.outstream * ?.X1 * 'Z


rev: 0000000280
author: adrpo
message:
  - way less memory consumption by RML for packages (modules) with a lot of (transitive closure) imports
  - cache interfaces in compiler/AbsynToFOLFn.sml


# ticket

type: defect
priority: trivial
owner: petar
reporter: petar
cc: petar, adrpo
version: unspecified
status: closed
resolution: fixed
summary: Strange error message
description:
  {{{
  I got this strange error message
  Internal error: FOLToCPS.lookupVar: id
  Error: Bug

  for this code: (DAE.mo:3479)
   case ((COMP(ident = id,dAElist = DAE(elementLst = lst)) :: xs))
        equation 
          res1 = getFlowVariables(lst);
          res1_1 = getFlowVariables2(res1, id);
          res2 = getFlowVariables(xs);
          res = listAppend(res1_1, res2);
        then
        res;

  The problem is that no line number is given, so it was really hard to find where
  the problem was.
  }}}


type: defect
priority: major
owner: dietmarw
reporter: dietmarw
cc: dietmarw, adrpo
status: closed
resolution: fixed
summary: configure on Debian based system fails because 'ml-lex' is actually called 'mllex' there
description:
  Here is what I get on a Ubuntu 7.10 system:

  {{{
  ...OM1RML_trunk$ ./configure 
  ./configure: TARGET is x86-linux-gcc
  ./configure: unable to locate ml-lex in $PATH.
  .../OM1RML_trunk$ locate mllex
  /usr/bin/mllex
  /usr/share/doc-base/mllex
  /usr/share/doc/mlton/mllex.pdf
  /usr/share/man/man1/mllex.1.gz
  /var/lib/doc-base/info/mllex.status
  /var/lib/doc-base/omf/mllex
  /var/lib/doc-base/omf/mllex/mllex-C.omf
  }}}

  Maybe ./configure can take both versions into account?


type: defect
priority: major
owner: dietmarw
reporter: dietmarw
cc: dietmarw,
status: closed
resolution: fixed
summary: Building of mlton fails
description:
  After a long time I tried to build mlton again (this has always worked so far). I followed the instructions of  {{INSTALL.MLton.txt}}
  but 

  {{compiler> mlton -verbose 3 -target self rml.mlb}}

  fails. I attached the output in {{compile-mlton.log}}

  Has any thing mlton related changed towards r144?


type: defect
component: Code Generator
priority: major
owner: barnet
reporter: barnet
cc: barnet, adrpo
status: assigned
summary: Function returning multiple results does not simulate (MultiRes.onb)
description:
  {{Dear Developers, \\


  Simulating a model containing a function returning multiple results
  seems to be broken. \\


  Regards, \\


  Beat Arnet \\


  1) MultiRes.onb fails when executing "}}{{simulate(fCall)" \\


  2) Executing the example in a script also fails: \\
  }} \\
  function f \\
  Â  input Real x; \\
  Â  input Real y; \\
  Â  output Real r1; \\
  Â  output Real r2; \\
  Â  output Real r3; \\
  algorithm \\
  Â  r1 := x; \\
  Â  r2 := y; \\
  Â  r3 := x*y; \\
  end f;Â Â   \\


  model fCall \\
  Â  Real x[3]; \\
  Â  Real a, b, c; \\
  equation \\
  Â  (a, b, c) = f(1.0, 2.0); \\
  Â  (x[1], x[2], x[3]) = f(3.0, 4.0); \\
  end fCall; \\


  getVersion(); \\
  loadFile("functions.mo"); \\
  instantiateModel(fCall); \\
  f(2.5, 3); \\
  simulate(fCall); \\


  incidence_row_exp TUPLE not impl. yet.incidence_row_exp TUPLE not impl.
  yet.incidence_row_exp TUPLE not impl. yet.incidence_row_exp TUPLE not
  impl. yet."1.4.4"0 \\
  true \\
  "fclass fCall \\
  Real x[1]; \\
  Real x[2]; \\
  Real x[3]; \\
  Real a; \\
  Real b; \\
  Real c; \\
  equation \\
  Â  (a,b,c) = (1.0,2.0,2.0); \\
  Â  (x[1],x[2],x[3]) = (3.0,4.0,12.0); \\
  end fCall; \\
  " \\
  (2.5,3.0,7.5) \\
  record \\
  Â Â Â  resultFile = "Simulation failed. \\
  Too few equations, underdetermined system. The model has 6 variables
  and 2 equations \\
  " \\
  end record


type: defect
priority: major
owner: barnet
reporter: barnet
cc: barnet,
status: closed
resolution: fixed
summary: Problem with record constructor functions
description:
  Dear Developers, 

  For some reason, the code below does not simulate.

  Regards,

  Bear Arnet 

   

  record Person \\  String name; \\  Integer age; \\end Person; \\

  model CreatePerson \\  Integer hisage; \\  Person john = Person("John", 35); \\  equation \\    hisage = john.age; \\end CreatePerson; \\ \\

  getVersion(); \\system("if not exist bin mkdir bin"); \\loadFile("RecordConstructor.mo"); \\cd("bin"); \\instantiateModel(CreatePerson); \\simulate(CreatePerson); \\

  -lower2 failed \\-lower2 failed \\-lower2 failed \\-lower2 failed \\-lower2 failed \\-lower2 failed \\"1.4.4"0 \\true \\"D:/eclipsews/Java_32/ModelicaTesting/bin" \\"fclass CreatePerson \\Integer hisage; \\String john.name; \\Integer john.age; \\equation \\  __TMP__0 = Person("John",35); \\  john.name = __TMP__0.name; \\  john.age = __TMP__0.age; \\  hisage = john.age; \\end CreatePerson; \\" \\record \\    resultFile = "Simulation failed. \\" \\end record \\


type: defect
priority: major
owner: adrpo
reporter: adrpo
cc: adrpo, adrpo
status: assigned
summary: Named patterns in tuples should return error
description:
  {{{
  tuple<String, Real> x;
  matchcontinue(x)
  local 
    String s, ss, Real r;
  case (ss as s, NAME=r) <-- should fail!
  }}}


type: defect
priority: critical
owner: sjoelund.se
reporter: sjoelund.se
cc: sjoelund.se, adrpo
status: new
summary: Parallel make using rml sometimes fail
description:
  The issue is that one process starts writing to Filename.srz, another finds it and thinks it is safe to start reading it.
  The easy way to solve this would be to create Filename.srz.$$.tmp ($$ = the ID of the process). When it is finished, rename the file.


type: defect
priority: major
owner: sjoelund.se
reporter: sjoelund.se
cc: sjoelund.se, adrpo
status: closed
resolution: fixed
summary: RML Parser cannot handle external function annotations
description:
  For example, the following would be nice to have:

  {{{public function printBuf
    input String inString;

    external "C" annotation(Library = "omcruntime");
  end printBuf;}}}

  Also, the following does not work (only ident = call)
  {{{public function printBuf
    input String inString;

    external "C" Print__printBuf(inString);
  end printBuf;}}}


type: defect
priority: major
owner: sjoelund.se
reporter: sjoelund.se
cc: sjoelund.se, adrpo
status: closed
resolution: fixed
summary: Add support for Modelica FQ path notation
description:
  The following is valid Modelica (3.2):
  {{{type Env = .Env.Env}}}

  The following is used in RML (but is not valid Modelica):
  {{{type Env = Env.Env}}}


type: defect
priority: major
owner: perost
reporter: perost
cc: perost, adrpo
status: closed
resolution: invalid
summary: Package types fails if protected imports are used before
description:
  A package type will cause an "unbound type constructor" error if it is declared after a protected import. If the import is public or is placed after the type it works. For example:
  {{{
  package Test
    protected import SomePackage; // The content of SomePackage is not important, it can be empty and still cause the error.

    replaceable type T subtypeof Any;
    
    public function F
      input T t;  // This line will produce a "unbound type constructor T" error.
      output list<T> l;
    algorithm
      l := {t};
    end F;
  end Test;
  }}}


type: defect
component: Code Generator
priority: major
owner: somebody
reporter: lochel
cc: adrpo
status: closed
resolution: fixed
summary: listDelete: index should starts from 1
description:
  listDelete returns a new list without the element at the given index, but the index starts from 0 instead of 1. This is very confusing and not correct due to OpenModelicaMetaProgramming.pdf, section 5.13.5.1 Lists:

  {{{
  listDelete({2,3,4,5},2) => {2,4,5} 

  […]

  function listDelete "Return a new list without the element at the given index. The index starts from 1."
    replaceable type TypeVar subtypeof Any;
    input list<TypeVar> lst;
    input Integer index;
    output list<TypeVar> result;
  algorithm
    /* Return a new list without the element at the given index.
       The index starts from 1. */
  end listDelete;
  }}}


type: defect
component: Code Generator
priority: major
owner: somebody
reporter: lochel
cc: adrpo, sjoelund.se
status: new
summary: Why is 'array' not a keyword?
description:
  Why is {{{array}}} not a keyword due to OpenModelicaMetaProgramming.pdf, whereas {{{list}}} and {{{tuple}}} are?


# ticket_change

author: petar
field: comment
oldvalue: 1
newvalue:
  The lexer sometimes outputs too many lines (skipping tokens, etc.). This is not
  useful. It should instead only output the first skipped token for each time the
  parser finds a new token to retry on.


author: adrpo
field: comment
oldvalue: 2
newvalue:
  Fixed in rml-mmc-2.3.4 (to be released)
  Now the lexer actually throws a ParseError, it does 
  not just collect all the errors and delays the output 
  until parsing is done.


author: petar
field: comment
oldvalue: 1
newvalue:
  Local variables in match expressions are not used at all. They can be commented
  out, or replaced by other (errorenous) types. The code still compiles.

  I belive this is a major bug since people will write declarations that are wrong
  and when the compiler starts checking these declarations a lot of errors will occur!


author: petar
field: comment
oldvalue: 1
newvalue:
  a function with both a match expression in a statement followed by other
  algorithm statements, e.g. a print will not give a warning. The preceding
  statements are simpli ignored!


author: adrpo
field: comment
oldvalue: 2
newvalue:
  Not that easy as it requires analysis of all the modules and all the external
  c files. But possible.


author: adrpo
field: comment
oldvalue: 2
newvalue:
  The problem list is for the bugs that comes from omc.exe when parsing modelica.
  I wonder if the bugs that are due to the OMDev-builder can be put there... 


author: petar
field: comment
oldvalue: 3
newvalue:
  After using the environent for a while I would like to increase the severity of
  this bug/enhancement. It happens quite often that the error messages are
  overlooked since the last commands of the makefile always succeeds. Thus, it
  uses an old version of the omc.exe since the last compile had errors. This is
  hopefully solved when the problem list is updated.


author: adrpo
field: comment
oldvalue: 4
newvalue:
  The problem with continuing make was due to a bug that made MetaModelica 
  exiting with success even if it was an error. This is fixed in the latest 
  rml-mmc:
  http://www.ida.liu.se/~adrpo/omc/omdev/mingw/_hot_fixes/
  So make should actually fail, when rml-mmc fails.

  However, I will implement functionality to add the 
  problems found to the problem list.


author: petar
field: comment
oldvalue: 1
newvalue:
  Today, different arithmetic operators are used depending on type.
  For instance 1 + 1 but 1.0 +. 1.0

  These should be the same.
  Also, operator for string concatenation should be legal. E.g. "foo"+"bar" = "foobar"


author: petar
field: comment
oldvalue: 1
newvalue:
  consider the following RML code( I assume similar problems exist in MetaModelica)

  	generate_equation_order(blocks) => res 
  	-------------------------------------
  	generate_equation_order(DAELow.COND_EQN_BLOCK(_)::blocks) => res

  The error in this code is that the pattern should read
  DAELow.COND_EQN_BLOCK(_,_) . The error message produced by this is:
  type (int list,Exp.Exp) => DAELow.Block differs from type int list => 'a
  reason: different number of relation arguments

  It is a bit confusing that it says that relation arguments are different, since
  there is no relation at that line, only a pattern. It should therefore say that
  the type of the pattern is wrong, or similar.


author: petar
field: comment
oldvalue: 1
newvalue:
  The following code:

  Util.string_append_list(["a",1.0,"b"]) => str

  gives error messages like:
  BlaBla.rml:1.~1-1.~1 Error: while processing while elaborating expression 
  type real differs from type string
  reason: different type names
  Error: StaticElaborationError

  This makes it very hard to find the error if many changes are made between
  compilations. I gave it major in severity since you can spend -a lot- of time
  trying to find these types of errors. Especially if you do not know what to look
  for.


author: adrpo
field: comment
oldvalue: 2
newvalue:
  Fixed in release rml-mmc-2.3.4.

  Util.string_append_list(["x","y",1.0]) => x
  Error reported now:
  -------------------
  rmltomod.rml:90.27-90.39 Error: while processing while elaborating expression 

  Error reported before:
  ----------------------
  rmltomod.rml:1.1-1.1 Error: while processing while elaborating expression


author: mtiller
field: comment
oldvalue: 1
newvalue:
  I installed OpenModelica 1.3.1 and the MDT plug-in.  The editor works if I open
  a file (does the syntax highlighting) but if I type I get a message saying that
  I have not set my "OPENMODELICAPATH".  But I have set it (and restarted Eclipse)
  and I confirmed it was set with a command window.


author: x05andre
field: comment
oldvalue: 3
newvalue:
  (In reply to comment #0)
  > I installed OpenModelica 1.3.1 and the MDT plug-in.  The editor works if I open
  > a file (does the syntax highlighting) but if I type I get a message saying that
  > I have not set my "OPENMODELICAPATH".  But I have set it (and restarted Eclipse)
  > and I confirmed it was set with a command window.

  The problem was with the error message. It's actually OPENMODELICAHOME that
  should be set, not OPENMODELICAPATH.

  -Remar


author: adrpo
field: comment
oldvalue: 1
newvalue:
  From Interactive.mo
      case (ISTMTS(interactiveStmtLst = {IEXP(exp = Absyn.CALL(function_ = 
  Absyn.CREF_IDENT(name = "getComponentModifierValue"),functionArgs = 
  Absyn.FUNCTIONARGS(args = {Absyn.CREF(componentReg = class_),Absyn.CREF
  (componentReg = Absyn.CREF_IDENT(name = ident))},argNames = {})))}),(st as 
  SYMBOLTABLE(ast = p,explodedAst = s,instClsLst = ic,lstVarVal = 
  iv,compiledFunctions = cf)))
        equation 
          resstr = getParameterValue(class_, Absyn.CREF_IDENT(ident,{}), p);
        then ...

  If I edit to be case (ISTMTS(interactiveStmtMISTAKE = {...})
  i get an error that class_ is not bound:
  Interactive.mo:1018.36-1018.41 Error: unbound variable class_
  Error: StaticElaborationError
  The error should say that there is no component called
  interactiveStmtMISTAKE in ISTMTS


author: petar
field: comment
oldvalue: 1
newvalue:
  It would be nice with balancing of parentheses in the Modelica Editor, i.e. when
  a ')' is typed the corresponding '(' blinks once or twice..


author: petar
field: comment
oldvalue: 1
newvalue:
  It would be nice to have "find in files" in MetaModelica Editor. It is available
  in CDT C/C++ editor so it should just be to copy the functionality.


author: petar
field: comment
oldvalue: 1
newvalue:
  It would be very nice to have "Goto Definition" as a right-click menu choice i
  the MetaModelica editor.


author: adrpo
field: comment
oldvalue: 2
newvalue:
  Fixed since MDT 0.6.8. Use Ctrl+Mouse click to activate.
  Quite slow right now. I'm working at making it faster.


author: petar
field: comment
oldvalue: 1
newvalue:
  It would be nice is the MetaModelica editor colorcoded the function calls with
  the functionname in some nice color. This because the equation parts of match
  expressions are sometimes large and the function calls are most important.


author: petar
field: comment
oldvalue: 1
newvalue:
  The following code does not work:
  case (env,els,true) 
      equation      
      then ({},env,ClassInf.EXTERNAL_OBJ(Env.getClassName(env)));

  This generates:
  Error: unbound variable temp_t_101
  Error: StaticElaborationError

  This can be worked around by introducing tempory variable and make the
  assignment before the then clause.


author: adrpo
field: comment
oldvalue: 2
newvalue:
  Can you give me the exact location and which file to cause this bug?
  For me is working, and I cannot debug properly.

  Have you used the latest rml.exe?
  http://www.ida.liu.se/~adrpo/omc/omdev/mingw/_hot_fixes/

  Adrian/


author: adrpo
field: comment
oldvalue: 4
newvalue:
  I think in some cases it doesn't work.
  I'll re-check the code again if this bug re-appears.

  Adrian/


author: petar
field: comment
oldvalue: 1
newvalue:
  C comments on the form:
  /* bla bla <newline>
   bla bla */
  is not highlighted correctly, because of the newline.

  This makes it quite hard to read the comments of case's in matchcontinue
  expressions.


author: adrpo
field: comment
oldvalue: 1
newvalue:
  Code like:
     case (DIV(type_ = _)) then 36; 
  is displayed like:
     [case:binopPriority(DIV(type_ = _)) then ()]
  in the debugger, which is WRONG!

  Adrian/


author: adrpo
field: comment
oldvalue: 1
newvalue:
  Legend:
  |  = cursor
  [] = matching

  Example of error:
   ( ( [)] )|
  Example of how it should be:
   [(] ( ) )|

  Adrian/


author: petar
field: comment
oldvalue: 1
newvalue:
  The following code give errror:

    s=Util.stringAppendList({"instClassIn ",n," ",realString(time)," s\n"});

  Workaround
  s = realString(time);
  s =  s=Util.stringAppendList({"instClassIn ",n," ",s," s\n"});


author: petar
field: comment
oldvalue: 1
newvalue:
  CacheTree envTree[:];  // Gives parse error

  CacheTree[:] envTree;  // is ok.

  Modelica has both and so should MetaModelica.

  Since an obvious workaround exist, this is a low priority bug.


author: dietmarw
field: comment
oldvalue: 1
newvalue:
  Hi Adrian,

  I thought I will add the "bug" here so you can keep better track of it :)

  ./configure should automatically insert the right libs for mico (retrieved by
  "mico-config --libs") in the appropriate  Makefiles. Thus sparing me of manually
  replacing the code after a new ./configure call.


author: adrpo
field: comment
oldvalue: 1
newvalue:
  The MetaModelica compiler doesn't check the varibles
  on the left hand side of matchcontinue!
  Example that works even if it shouldn't!
  function F
    input Real  x;
    output Real y;
  algorithm
    undeclared_variable := matchcontinue(x)
      local Real k;
      case (k) then k;
    end matchontinue;
  end F;


author: petar
field: comment
oldvalue: 1
newvalue:
  Goto last Edit location (Ctrl-Q with emacs bindings) does no longer work. It
  worked in earlier versions of MDT, but now (0.6.9) it jumps to the wrong location.


author: adrpo
field: comment
oldvalue: 2
newvalue:
  I belive this is because I disabled the class folding, but I will look
  into it and see what's the problem.


author: adrpo
field: comment
oldvalue: 3
newvalue:
  I cannot reproduce this bug. 
  For me it works. I edit something, 
  I go to the start of the file, I hit the
  "Go to last edit location" icon on the 
  toolbar and it goes where it should.

  Can you give me a more detailed description on this?
  Is it just the key combination for emacs mode that 
  doesn't work or also the toobar button?

  Thanks,
  Adrian/


author: petar
field: comment
oldvalue: 4
newvalue:
  Strangely engough I cannot reproduce the bug either. Perhaps my MDT was in some
  kind of inconsistent state? 


author: dietmarw
field: comment
oldvalue: 1
newvalue:
  I just stumbled across a missing feature of MDT which would be really
  nice to have. When creating a default project in eclipse the user can
  choose between a workspace location or a alternative location on the
  file system for this project. Unfortunately the latter alternative can
  not be chosen when a new Modelica project is created. I normally find
  this very useful.


author: elsheikh
field: comment
oldvalue: 1
newvalue:
  For OMShell, 
  The $OPENMODELICAHOME should be set to /path/to/open/modelica/build, otherwise I
  get such message:

  To get help on using Mosh and OpenModelica, type "help()" and press enter
  Started server using:/software/modelica/OPENMODELICA_1_4_2/build/bin//bin/omc
  +d=interactive > /tmp/error.log 2>&1 &
   res = 0
  Error connecting to omc server in interactive mode.
  : Connection refused

  I am trying to install MDT (version 0.6.7 for eclipse). The Manual suggests that
  I should set the path to the folder where excutables are, i.e. 
  /path/to/open/modelica/build/bin/
  which is different than the suggested path for OMShell. I think that this clash
  is due to the different file structure of openmodelica under linux, and under
  windows.


author: adrpo
field: comment
oldvalue: 2
newvalue:
  $OPENMODELICAHOME should always be set to the parent of the "bin" directory.
  If the manual say otherwise, then is wrong.

  Actually, MDT searches for the omc executable in several places:
  $OPENMODELICAHOME/
  $OPENMODELICAHOME/bin/
  In order to use MDT you need to have OMC compiled with Corba, not with
  the socket interface!

  I see you use OpenModelica 1.4.2 and MDT 0.6.7.

  I suggest you move for OpenModelica to the latest sources from 
  Subversion because is now much faster and a lot of bugs were
  fixed. Also, you can move to MDT 0.6.9 as it has new features.

  Also, check out our Linux packages here:
  http://www.ida.liu.se/labs/pelab/modelica/OpenModelica.html#Download

  Regards,
  Adrian Pop/


author: petar
field: comment
oldvalue: 1
newvalue:
  I got this strange error message
  Internal error: FOLToCPS.lookupVar: id
  Error: Bug

  for this code: (DAE.mo:3479)
   case ((COMP(ident = id,dAElist = DAE(elementLst = lst)) :: xs))
        equation 
          res1 = getFlowVariables(lst);
          res1_1 = getFlowVariables2(res1, id);
          res2 = getFlowVariables(xs);
          res = listAppend(res1_1, res2);
        then
        res;

  The problem is that no line number is given, so it was really hard to find where
  the problem was.


author: petar
field: comment
oldvalue: 3
newvalue:
  The error is that I copied the code from a similar case, but forgot to remove
  the line  res1_1 = getFlowVariables2(res1, id);
  id is not declared anywhere, so thats what the error message should say, and on
  which line the error occured. 

  I set the priority very low on this bug, so you do not need to fix it right away.

  /Peter


author: petar
field: comment
oldvalue: 1
newvalue:
  When I try to open the rotationalgears.mos file in eclipse (I use C++
  perspective) I get the following error:
  java.lang.ClassCastException: org.modelica.mdt.internal.core.ModelicaFile
  	at
  org.modelica.mdt.ui.text.ModelicaFoldingStructureProvider.computeFoldingStructure(ModelicaFoldingStructureProvider.java:805)
  	at
  org.modelica.mdt.ui.text.ModelicaFoldingStructureProvider.update(ModelicaFoldingStructureProvider.java:745)
  	at
  org.modelica.mdt.ui.text.ModelicaFoldingStructureProvider.initialize(ModelicaFoldingStructureProvider.java:697)
  	at
  org.modelica.mdt.ui.text.ModelicaFoldingStructureProvider.handleProjectionEnabled(ModelicaFoldingStructureProvider.java:668)
  	at
  org.modelica.mdt.ui.text.ModelicaFoldingStructureProvider$ProjectionListener.projectionEnabled(ModelicaFoldingStructureProvider.java:554)
  	at
  org.eclipse.jface.text.source.projection.ProjectionViewer.fireProjectionEnabled(ProjectionViewer.java:481)
  	at
  org.eclipse.jface.text.source.projection.ProjectionViewer.enableProjection(ProjectionViewer.java:529)
  	at
  org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1429)
  	at
  org.modelica.mdt.ui.editor.ModelicaSourceViewer.doOperation(ModelicaSourceViewer.java:143)
  	at
  org.modelica.mdt.ui.editor.ModelicaEditor.createPartControl(ModelicaEditor.java:306)
  	at
  org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:596)
  	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:372)
  	at
  org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
  	at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:214)
  	at
  org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2595)
  	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2528)
  	at org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2520)
  	at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2505)
  	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
  	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2500)
  	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2485)
  	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:388)
  	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:350)
  	at
  org.eclipse.ui.internal.ide.EditorAreaDropAdapter.openNonExternalEditor(EditorAreaDropAdapter.java:136)
  	at
  org.eclipse.ui.internal.ide.EditorAreaDropAdapter.asyncDrop(EditorAreaDropAdapter.java:109)
  	at
  org.eclipse.ui.internal.ide.EditorAreaDropAdapter.access$0(EditorAreaDropAdapter.java:75)
  	at
  org.eclipse.ui.internal.ide.EditorAreaDropAdapter$1.run(EditorAreaDropAdapter.java:69)
  	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
  	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
  	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
  	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
  	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
  	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
  	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
  	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
  	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
  	at
  org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
  	at
  org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
  	at
  org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
  	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
  	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  	at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  	at java.lang.reflect.Method.invoke(Method.java:585)
  	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
  	at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
  	at org.eclipse.core.launcher.Main.run(Main.java:977)
  	at org.eclipse.core.launcher.Main.main(Main.java:952)


author: adrpo
field: comment
oldvalue: 2
newvalue:
  Yep. I know.
  An easy fix is to do this in Eclipse:
  Window->Preferences->General->Editors->File Associations
  Locate *.mos and remove the Modelica Editor.
  You could also add the Text Editor to *.mos if you want.

  I fixed this in the code for the next plugin release.


author: dietmarw
field: comment
oldvalue: 1
newvalue:
  When working on a Modelica package using the MDT with the Modelica perspective I
  noticed that the "Outline view" will only work properly if the Modelica package
  is in the root folder of the Modelica project. 

  Example:
  It *won't* work with this stucture:
  ModelicaProject/
  |-- docs
  |   `-- ModelicaLicense.tex
  `-- ModelicaPackage
      |-- a.mo    
      |-- b.mo    
      |-- c.mo
      `-- package.mo

  But will work with this structure:

  ModelicaProject/
      |-- a.mo    
      |-- b.mo    
      |-- c.mo
      `-- package.mo


author: dietmarw
field: comment
oldvalue: 1
newvalue:
  Hi Adrian,

  having a look at your improvements in r135 (how on earth can you do revision and source code links in codebeamer? ). 

  I did change the following:

  * use 'aptitude' instead of 'apt-get', as aptitude has an improved algorithm for tracking dependencies
  * converted tabs to spaces

  See attached INSTALL.patch


author: adrpo
field: comment
oldvalue: 2
newvalue:
  I tested on my Ubuntu 7.10 and installed:
  sml, ml-lex, ml-yacc with
  apt-get install

  Then I changed the "configure" script to fix it
  and everything went fine.

  On my system ml-lex and ml-yacc have "-" in them.

  What version of sml have you installed??

  Cheers,
  Adrian Pop/


author: adrpo
field: comment
oldvalue: 4
newvalue:
  I will try to fix the configure script to also 
  try mllex and mlyacc instead of ml-lex and ml-yacc.
  \\
  I'll get back to you when I put it in the subversion
  so you can test, as on my system things are different.
  \\

  Cheers,\\
  Adrian Pop/


author: dietmarw
field: comment
oldvalue: 5
newvalue:
  Could you also change:
  {{{
  - run these commands to install SML & others:
  + run this command to install SML & others:
  }}}
  in `INSTALL`

  And now I will shut up :)


author: adrpo
field: comment
oldvalue: 1
newvalue:
  Hi,

  I think you haven't read the INSTALL.MLton.txt carefuly. \\
  It say: "Just follow all the steps in INSTALL and then".

  If you have done what it say, it would work. \\
  Your error is: "File mod.grm.sig does not exist." \\
  which means you haven't run ml-yacc on mod.grm. \\Which in turn means you haven't follow the steps in INSTALL.

  Cheers, \\
  Adrian Pop/


author: dietmarw
field: comment
oldvalue: 2
newvalue:
  Adrian,

  Negative, I did exactly as stated in INSTALL.mlton.txt. Metamodelica is compiled successfully and also runs fine. I did have another look at the INSTALL.mlton.txt and couldn't find any reference to running "ml-yacc on mod.grm". 

  What did I miss? I mean I did compile mlton lot's of times before and haven't done anything different ... :(


author: adrpo
field: comment
oldvalue: 3
newvalue:
  Hi,

  Strange. After you build rml you should have mod.grm.sig there \\as the Makefile inside the "compiler" directory is calling ml-yacc \\on mod.grm. Did you do make clean or make distclean before \\you tried building rml using mlton?

  Cheers, \\Adrian Pop/


author: dietmarw
field: comment
oldvalue: 5
newvalue:
  This is resolved with the fix in r146. The problem was not mlton but MetaModelica not being compiled correctly because of a erroneous Makefile.

  From the [documentation of GNU make|http://www.gnu.org/software/make/manual/html_node/Error-Messages.html#Error-Messages]: 

  `commands commence before first target. Stop.'
      

  This means the first thing in the makefile seems to be part of a command script: it begins with a TAB character and doesn't appear to be a legal make command (such as a variable assignment). Command scripts must always be associated with a target.


author: adrpo
field: comment
oldvalue: 6
newvalue:
  Hi Dietmar,

  I think you commited the wrong Makefile. \\
  I had a look at your changes an there aren't any :) \\
  You commited trunk/compiler/Make.mk with absolutely no changes. \\
  I think you wanted to commit trunk/Makefile maybe.

  Cheers, \\
  Adrian Pop


author: adrpo
field: comment
oldvalue: 1
newvalue:
  Hi, \\

  As far as I know (I'll need to check in the code) we haven't implemented yet \\functions returning multiple results:
  {{{(x, y, z) = functionCall(...);}}}

  However it should work with arrays:
  {{{{x, y, z} = functionCall(...);
  }}}

  You could try this code and see if it works:
  {{{function f
    input Real x, y;
    output Real r[3];
  algorithm
    r := {x, y, x*y};
  end f;

  model fCall
    Real x[3];
    Real a, b, c;
  equation
    {a, b, c} = f(1.0, 2.0);
    {x[1], x[2], x[3]} = f(3.0, 4.0);
  end fCall; }}}

  I actually tested the function+model above:
  {{{adrpo@KAFKA ~/dev/OpenModelica/build/bin/BeatArnet/Tuples
  $ cat test.mo
  /* functions returning arrays could be used */
  function f
    input Real x, y;
    output Real r[3];
  algorithm
    r := {x, y, x*y};
  end f;


  model fCall
    Real x[3];
    Real a, b, c;
  equation
    {a, b, c} = f(1.0, 2.0);
    {x[1], x[2], x[3]} = f(3.0, 4.0);
  end fCall;
  }}}

  {{{adrpo@KAFKA ~/dev/OpenModelica/build/bin/BeatArnet/Tuples
  $ cat test.mos
  loadFile("test.mo");
  simulate(fCall);
  val(x[1], 0);
  val(x[2], 0);
  val(x[3], 0);
  val(a, 0);
  val(b, 0);
  val(c, 0);}}}

  {{{adrpo@KAFKA ~/dev/OpenModelica/build/bin/BeatArnet/Tuples
  $ /c/OpenModelica1.4.4/bin/omc test.mos
  true
  record
    resultFile = "fCall_res.plt"
  end record
  3.0
  4.0
  12.0
  1.0
  2.0
  2.0
  }}}
  {{{
  // here you can see that during instantiation
  // OpenModelica makes a dll out of the function
  // and loads it into omc.exe and then calls it
  // if the input parameters are constant
  adrpo@KAFKA ~/dev/OpenModelica/build/bin/BeatArnet/Tuples
  $ /c/OpenModelica1.4.4/bin/omc test.mo
  fclass fCall
  Real x[1];
  Real x[2];
  Real x[3];
  Real a;
  Real b;
  Real c;
  equation
    a = 1.0;
    b = 2.0;
    c = 2.0;
    x[1] = 3.0;
    x[2] = 4.0;
    x[3] = 12.0;
  end fCall;}}}

  Cheers, \\Adrian Pop/


author: barnet
field: comment
oldvalue: 2
newvalue:
  Hello Adrian,

  I tried this code below with the latest nightly build (10/21), but I still get the same "fel i lowerWhenEqn-lower2 failed, -lower2 failed" errors.

  Note that when I comment out "{c,d} = f(a, b);" and uncomment the subsequent two lines, the code simulates.

  Regards,

  Beat

  {{{
   

  function f
    input Integer x;
    input Integer y;
    output Integer a[2];
  algorithm
    a[1] := x;
    a[2] := y;
  end f;  

  function fx
    input Integer x;
    input Integer y;
    output Integer a;
  algorithm
    a := x;
  end fx;

  function fy
    input Integer x;
    input Integer y;
    output Integer a;
  algorithm
    a := y;
  end fy;

  model fCall
    parameter Real Ts=0.1;
    Integer a,b,c,d;
  equation
    a = 1;
    b = 2;
    when sample(0,Ts) then
      {c,d} = f(a, b);
      //c = fx(a, b);
      //d = fy(a, b);
    end when;
  end fCall; 
  }}}


author: adrpo
field: comment
oldvalue: 1
newvalue:
  Hi,

  I know about this problem and I'm working on a fix. \\It will take a while to fix this as is a bit involved.

  Also, you posted the bugs in the MetaModelica project, which is wrong. \\Please post the bugs about OpenModelica in the OpenModelica project: \\[http://openmodelica.ida.liu.se:8080/cb/proj/tracker/browseTracker.do?tracker_id=1|browseTracker.do?tracker_id=1]

  Cheers, \\Adrian Pop/


author: adrpo
field: comment
oldvalue: 2
newvalue:
  This is fixed since a long time now:
  {{{
  adrpo@kafka ~/dev/OpenModelica/build/bin/BearArnet
  $ ../omc RecordConstructor.mos
  "1.5.0"0
  true
  "c:/bin/cygwin/home/adrpo/dev/OpenModelica/build/bin/BearArnet/bin"
  "function Person "Automatically generated record constructor for Person"
  input String name;
  input Integer age;
  output Person res;
  end Person;

  class CreatePerson
    Integer hisage;
    String john.name = "John";
    Integer john.age = 35;
  equation
    hisage = john.age;
  end CreatePerson;
  "
  record SimulationResult
      resultFile = "CreatePerson_res.plt",
      messages = "",
      timeFrontend = 0.00185778726988421,
      timeBackend = 0.000828035726796714,
      timeSimCode = 0.000679058587665925,
      timeTemplates = 0.00815794194434029,
      timeCompile = 2.38211827783967,
      timeSimulation = 0.0716784064758476,
      timeTotal = 2.46547849378338
  end SimulationResult;
  }}}


author: lochel
field: description
oldvalue:
  listDelete returns a new list without the element at the given index, but the index starts from 0 instead if 1. This is very confusing and not correct due to OpenModelicaMetaProgramming.pdf, section 5.13.5.1 Lists:

  {{{
  listDelete({2,3,4,5},2) => {2,4,5} 

  […]

  function listDelete "Return a new list without the element at the given index. The index starts from 1."
    replaceable type TypeVar subtypeof Any;
    input list<TypeVar> lst;
    input Integer index;
    output list<TypeVar> result;
  algorithm
    /* Return a new list without the element at the given index.
       The index starts from 1. */
  end listDelete;
  }}}

newvalue:
  listDelete returns a new list without the element at the given index, but the index starts from 0 instead of 1. This is very confusing and not correct due to OpenModelicaMetaProgramming.pdf, section 5.13.5.1 Lists:

  {{{
  listDelete({2,3,4,5},2) => {2,4,5} 

  […]

  function listDelete "Return a new list without the element at the given index. The index starts from 1."
    replaceable type TypeVar subtypeof Any;
    input list<TypeVar> lst;
    input Integer index;
    output list<TypeVar> result;
  algorithm
    /* Return a new list without the element at the given index.
       The index starts from 1. */
  end listDelete;
  }}}


author: lochel
field: comment
oldvalue: 2
newvalue:
  The following patch should work for the bootstrapped compiler. I will check it in as soon as we do not support the rml stuff anymore.

  {{{#!diff
  Index: SimulationRuntime/c/meta/meta_modelica_builtin.c
  ===================================================================
  --- SimulationRuntime/c/meta/meta_modelica_builtin.c	(revision 21784)
  +++ SimulationRuntime/c/meta/meta_modelica_builtin.c	(working copy)
  @@ -515,29 +515,25 @@
     return boxptr_listGet(threadData,lst,mmc_mk_icon(mmc_unbox_integer(i)+1));
   }
   
  -modelica_metatype boxptr_listDelete(threadData_t *threadData,modelica_metatype lst, modelica_metatype iix)
  +modelica_metatype boxptr_listDelete(threadData_t *threadData, modelica_metatype lst, modelica_metatype iix)
   {
     /* TODO: If we assume the index exists we can do this in a much better way */
     int ix = mmc_unbox_integer(iix);
     modelica_metatype *tmpArr = NULL;
     int i = 0;
   
  -  if (ix < 0) {
  +  if (ix <= 0) {
       MMC_THROW_INTERNAL();
     }
  -  if (ix == 0) {
  -    if (listEmpty(lst)) {
  -      MMC_THROW_INTERNAL();
  -    }
  -    return MMC_CDR(lst);
  -  }
  -  tmpArr = (modelica_metatype *) GC_malloc(sizeof(modelica_metatype)*(ix)); /* We know the size of the first part of the list (+1 for the element to delete) */
  +
  +  tmpArr = (modelica_metatype *) GC_malloc(sizeof(modelica_metatype)*(ix-1)); /* We know the size of the first part of the list */
     if (tmpArr == NULL) {
       fprintf(stderr, "%s:%d: malloc failed", __FILE__, __LINE__);
       EXIT(1);
     }
  -  for (i=0; i<ix; i++) {
  -    if (MMC_NILTEST(lst)) {
  +
  +  for (i=0; i<ix-1; i++) {
  +    if (listEmpty(lst)) {
         if (tmpArr) {
           GC_free(tmpArr);
         }
  @@ -546,13 +542,14 @@
       tmpArr[i] = MMC_CAR(lst);
       lst = MMC_CDR(lst);
     }
  +
     if (listEmpty(lst)) {
       GC_free(tmpArr);
       MMC_THROW_INTERNAL();
     }
  -
     lst = MMC_CDR(lst);
  -  for (i=ix-1; i>=0; i--) {
  +
  +  for (i=ix-2; i>=0; i--) {
       lst = mmc_mk_cons(tmpArr[i], lst);
     }
     GC_free(tmpArr);
  }}}

  Until then {{{List.delete}}} could be used as a workaround.


author: lochel
field: comment
oldvalue: 2
newvalue:
  Well, but they are listed as keywords in the section 'MetaModelica Keywords'. Probably that document should get updated/fixed more regularly.


author: Christoph <buchner@fotec.at>
field: comment
oldvalue: 2
newvalue:
  Is this tracker still used for the MDT plugin?

  I just found this bug via Google, and I have the exact same feature request.


# report

title: Active Tickets
description:
  * List all active tickets by priority.
  * Color each row based on priority.

query:
  SELECT p.value AS __color__,
     id AS ticket, summary, component, version, milestone, t.type AS type, 
     owner, status,
     time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status <> 'closed'
    ORDER BY CAST(p.value AS integer), milestone, t.type, time


title: Active Tickets by Version
query:
  SELECT p.value AS __color__,
     version AS __group__,
     id AS ticket, summary, component, version, t.type AS type, 
     owner, status,
     time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status <> 'closed'
    ORDER BY (version IS NULL),version, CAST(p.value AS integer), t.type, time

description:
  This report shows how to color results by priority,
  while grouping results by version.

  Last modification time, description and reporter are included as hidden fields
  for useful RSS export.


title: Active Tickets by Milestone
query:
  SELECT p.value AS __color__,
     'Milestone '||milestone AS __group__,
     id AS ticket, summary, component, version, t.type AS type, 
     owner, status,
     time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status <> 'closed' 
    ORDER BY (milestone IS NULL),milestone, CAST(p.value AS integer), t.type, time

description:
  This report shows how to color results by priority,
  while grouping results by milestone.

  Last modification time, description and reporter are included as hidden fields
  for useful RSS export.


title: Accepted, Active Tickets by Owner
description: List accepted tickets, group by ticket owner, sorted by priority.
query:
  SELECT p.value AS __color__,
     owner AS __group__,
     id AS ticket, summary, component, milestone, t.type AS type, time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status = 'accepted'
    ORDER BY owner, CAST(p.value AS integer), t.type, time


title: Accepted, Active Tickets by Owner (Full Description)
query:
  SELECT p.value AS __color__,
     owner AS __group__,
     id AS ticket, summary, component, milestone, t.type AS type, time AS created,
     description AS _description_,
     changetime AS _changetime, reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status = 'accepted'
    ORDER BY owner, CAST(p.value AS integer), t.type, time

description:
  List tickets accepted, group by ticket owner.
  This report demonstrates the use of full-row display.


title: All Tickets By Milestone (Including closed)
description: A more complex example to show how to make advanced reports.
query:
  SELECT p.value AS __color__,
     t.milestone AS __group__,
     (CASE status 
        WHEN 'closed' THEN 'color: #777; background: #ddd; border-color: #ccc;'
        ELSE 
          (CASE owner WHEN $USER THEN 'font-weight: bold' END)
      END) AS __style__,
     id AS ticket, summary, component, status, 
     resolution,version, t.type AS type, priority, owner,
     changetime AS modified,
     time AS _time,reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    ORDER BY (milestone IS NULL), milestone DESC, (status = 'closed'), 
          (CASE status WHEN 'closed' THEN changetime ELSE (-1) * CAST(p.value AS integer) END) DESC


title: My Tickets
query:
  SELECT p.value AS __color__,
     (CASE status WHEN 'accepted' THEN 'Accepted' ELSE 'Owned' END) AS __group__,
     id AS ticket, summary, component, version, milestone,
     t.type AS type, priority, time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE t.status <> 'closed' AND owner = $USER
    ORDER BY (status = 'accepted') DESC, CAST(p.value AS integer), milestone, t.type, time

description:
  This report demonstrates the use of the automatically set 
  USER dynamic variable, replaced with the username of the
  logged in user when executed.


title: Active Tickets, Mine first
query:
  SELECT p.value AS __color__,
     (CASE owner 
       WHEN $USER THEN 'My Tickets' 
       ELSE 'Active Tickets' 
      END) AS __group__,
     id AS ticket, summary, component, version, milestone, t.type AS type, 
     owner, status,
     time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status <> 'closed' 
    ORDER BY (COALESCE(owner, '') = $USER) DESC, CAST(p.value AS integer), milestone, t.type, time

description:
   * List all active tickets by priority.
   * Show all tickets owned by the logged in user in a group first.


# mathcaptcha_history

ip: 198.211.100.174
operator: add
incorrect_solution: maisie_maum@peacemail.com
author: Maisie
href: /newticket
text:
  I like it when individuals get together and share views.
  Great blog, stick with it!
  Here is my blog


ip: 76.20.135.146
operator: add
incorrect_solution: bernieholden@gawab.com
author: Bernie
href: /newticket
text:
  This is the right website for anyone who hopes to understand this topic.
  You understand a whole lot its almost tough to argue with you (not that I really would want 
  to…HaHa). You certainly put a brand new spin on a topic which has been written about for years.
  Excellent stuff, just great!
  Visit my site: 우리카지노계열


ip: 76.20.135.146
operator: add
incorrect_solution: bernieholden@gawab.com
author: 우리카지노계열
href: /newticket
text:
  This is the right website for anyone who hopes to understand this topic.
  You understand a whole lot its almost tough to argue with you (not that 
  I really would want to…HaHa). You certainly put a brand new spin on a topic which has 
  been written about for years. Excellent stuff, just great!


  Visit my site: 우리카지노계열


ip: 49.207.201.54
operator: add
author: jimmy.colleen@gmail.com
summary: Error messages for Modelia projects
href: /newticket
text:
  [https://www.wordplaycontent.com/content-writing-services Content writing services] are the first go-to when it comes to digital marketing for any website out there. Content helps attract new potential customers and users, and if your website content is persuasive enough, it will convert users to paying customers. Content is the substance of the internet, it's what users consume when they browse the web in the first place. When brands start creating content of their own, they can help sell more of their products or services.


# spamfilter_log

path: /newticket
author: jimmy.colleen@gmail.com
ipnr: 49.207.201.54
headers:
  Referer: https://trac.openmodelica.org/MetaModelica/newticket
  Sec-Gpc: 1
  Origin: https://trac.openmodelica.org
  User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:78.0) Gecko/20100101 Firefox/78.0
  Connection: keep-alive
  Cookie: trac_form_token=323dff6efe55254eca0d3adc; trac_session=faf4b903dd7872550d2f8cdb
  Dnt: 1
  Host: trac.openmodelica.org
  Upgrade-Insecure-Requests: 1
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
  Accept-Language: en-US,en;q=0.5
  Accept-Encoding: gzip, deflate, br

content:
  RXJyb3IgbWVzc2FnZXMgZm9yIE1vZGVsaWEgcHJvamVjdHMKCltodHRwczovL3d3dy53b3JkcGxh
  eWNvbnRlbnQuY29tL2NvbnRlbnQtd3JpdGluZy1zZXJ2aWNlcyBDb250ZW50IHdyaXRpbmcgc2Vy
  dmljZXNdIGFyZSB0aGUgZmlyc3QgZ28tdG8gd2hlbiBpdCBjb21lcyB0byBkaWdpdGFsIG1hcmtl
  dGluZyBmb3IgYW55IHdlYnNpdGUgb3V0IHRoZXJlLiBDb250ZW50IGhlbHBzIGF0dHJhY3QgbmV3
  IHBvdGVudGlhbCBjdXN0b21lcnMgYW5kIHVzZXJzLCBhbmQgaWYgeW91ciB3ZWJzaXRlIGNvbnRl
  bnQgaXMgcGVyc3Vhc2l2ZSBlbm91Z2gsIGl0IHdpbGwgY29udmVydCB1c2VycyB0byBwYXlpbmcg
  Y3VzdG9tZXJzLiBDb250ZW50IGlzIHRoZSBzdWJzdGFuY2Ugb2YgdGhlIGludGVybmV0LCBpdCdz
  IHdoYXQgdXNlcnMgY29uc3VtZSB3aGVuIHRoZXkgYnJvd3NlIHRoZSB3ZWIgaW4gdGhlIGZpcnN0
  IHBsYWNlLiBXaGVuIGJyYW5kcyBzdGFydCBjcmVhdGluZyBjb250ZW50IG9mIHRoZWlyIG93biwg
  dGhleSBjYW4gaGVscCBzZWxsIG1vcmUgb2YgdGhlaXIgcHJvZHVjdHMgb3Igc2VydmljZXMuCgoK
  Cg==

reasons:
  <entries><e name="Bayesian" points="-15" text="SpamBayes determined spam probability of %s%%"><v value="100.00" /></e><e name="Session" points="3" text="Existing session found" /></entries>

request:
  <request target="/newticket"><arg key="field_type">defect</arg><arg key="submit">Create ticket</arg><arg key="author">jimmy.colleen@gmail.com</arg><arg key="url">5932555</arg><arg key="field_owner">&lt; default &gt;</arg><arg key="field_keywords" /><arg key="sfph_mail" /><arg key="field_summary">Error messages for Modelia projects</arg><arg key="field_priority">major</arg><arg key="__FORM_TOKEN">323dff6efe55254eca0d3adc</arg><arg key="field_component">Code Generator</arg><arg key="field_cc" /><arg key="sfp_email" /><arg key="field_version" /><arg key="email" /><arg key="field_description">[https://www.wordplaycontent.com/content-writing-services Content writing services] are the first go-to when it comes to digital marketing for any website out there. Content helps attract new potential customers and users, and if your website content is persuasive enough, it will convert users to paying customers. Content is the substance of the internet, it's what users consume when they browse the web in the first place. When brands start creating content of their own, they can help sell more of their products or services.</arg></request>


