Index: tags/v1_0_dk2/modeq/testsuite/.cvsignore
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/.cvsignore	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/.cvsignore	(revision 344)
@@ -0,0 +1,15 @@
+VERSION.texi
+cases.texi
+modtest.aux
+modtest.cp
+modtest.dvi
+modtest.fn
+modtest.info*
+modtest.ky
+modtest.log
+modtest.pg
+modtest.ps
+modtest.toc
+modtest.tp
+modtest.vr
+modtest_*.html
Index: tags/v1_0_dk2/modeq/testsuite/Algorithm1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Algorithm1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Algorithm1.mo	(revision 344)
@@ -0,0 +1,70 @@
+// name:     Algorithm1
+// keywords: algorithm
+// status:   correct
+// 
+// Simple algorithms
+
+model Algorithm1
+  Real x, y;
+equation
+  y = sin(time);
+protected
+  Integer i;
+algorithm
+  i := 0;
+  x := y-1.0;
+  while ((i/10) < y) loop
+    x := x + 0.5;
+  end while;
+algorithm
+  for i in 1:3 loop
+    if i > 2 then
+      x := x - i;
+    end if;
+    if i < 1 then
+      x := 1.0;
+    elseif i < 2 then
+      x := 2.0;
+    else
+      x := 3.0;
+    end if;
+  end for;
+algorithm
+  when y>0.9 do
+    x := 0.0;
+  end when;
+end Algorithm1;
+
+// fclass Algorithm1
+// 	       String  i.unit;
+// 	       Integer i;
+// 	       String  x.unit;
+// 	       Real    x;
+// 	       String  y.unit;
+// 	       Real    y;
+// equation
+//   y = sin(time);
+// algorithm
+//   i := 0;
+//   x := y - 1.0;
+//   while Real(i)/Real(10) < y loop
+//     x := x + 0.5;
+//   end while;
+// algorithm
+//   for i in 1:3 loop
+//     if i > 2 then
+// 	 x := x - Real(i);
+//     end if;
+//     if i < 1 then
+// 	 x := 1.0;
+//     elseif i < 2 then
+// 	 x := 2.0;
+//     else
+// 	 x := 3.0;
+//     end if;
+//   end for;
+// algorithm
+//   when y > 0.9 do
+//     x := 0.0;
+//   end when;
+// end Algorithm1;
Index: tags/v1_0_dk2/modeq/testsuite/Algorithm2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Algorithm2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Algorithm2.mo	(revision 344)
@@ -0,0 +1,13 @@
+// name:     Algorithm2
+// keywords: algorithm
+// status:   incorrect
+// 
+// Type checks in algorithms.
+// 
+
+class Algorithm2
+  Integer i;
+  Real x;
+algorithm
+  i := x;
+end Algorithm2;
Index: tags/v1_0_dk2/modeq/testsuite/Algorithm3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Algorithm3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Algorithm3.mo	(revision 344)
@@ -0,0 +1,23 @@
+// name:     Algorithm3
+// keywords: algorithm
+// status:   correct
+// 
+// Type checks in algorithms.
+// 
+
+class Algorithm3
+  Integer i;
+  Real x;
+algorithm
+  x := i;
+end Algorithm3;
+
+// fclass Algorithm3
+// 	       String  i.unit;
+// 	       Integer i;
+// 	       String  x.unit;
+// 	       Real    x;
+// equation
+// algorithm
+//   x := Real(i);
+// end Algorithm3;
Index: tags/v1_0_dk2/modeq/testsuite/Array1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Array1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Array1.mo	(revision 344)
@@ -0,0 +1,31 @@
+// name:     Array1
+// keywords: array
+// status:   correct
+// 
+// This is a simple test of basic array handling.
+// 
+
+model Array1
+  Integer x[5] = [1,2,3,4,5];
+  Integer y[3] = 1:3;
+end Array1;
+
+// fclass Array1
+//   Integer x[1];
+//   Integer x[2];
+//   Integer x[3];
+//   Integer x[4];
+//   Integer x[5];
+//   Integer y[1];
+//   Integer y[2];
+//   Integer y[3];
+// equation
+//   x[1] = 1;
+//   x[2] = 2;
+//   x[3] = 3;
+//   x[4] = 4;
+//   x[5] = 5;
+//   y[1] = (1:3)[1];
+//   y[2] = (1:3)[2];
+//   y[3] = (1:3)[3];
+// end Array1;
Index: tags/v1_0_dk2/modeq/testsuite/Array2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Array2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Array2.mo	(revision 344)
@@ -0,0 +1,20 @@
+// name:     Array2
+// keywords: array
+// status:   correct
+// 
+// Multidimensional arrays
+// 
+
+model Array1
+  Integer x[2,3];
+end Array1;
+
+// fclass Array1
+//   Integer x[1,1];
+//   Integer x[1,2];
+//   Integer x[1,3];
+//   Integer x[2,1];
+//   Integer x[2,2];
+//   Integer x[2,3];
+// equation
+// end Array1;
Index: tags/v1_0_dk2/modeq/testsuite/Array3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Array3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Array3.mo	(revision 344)
@@ -0,0 +1,26 @@
+// name:     Array3
+// keywords: array
+// status:   correct
+// 
+// This is a simple test of basic matrix handling.
+// 
+
+model Array3
+  Integer x[2,3] = [ 1,2,3 ; 4,5,6 ] ;
+end Array3;
+
+// fclass Array3
+//   Integer x[1,1];
+//   Integer x[1,2];
+//   Integer x[1,3];
+//   Integer x[2,1];
+//   Integer x[2,2];
+//   Integer x[2,3];
+// equation
+//   x[1,1] = [1,2,3;4,5,6][1][1];
+//   x[1,2] = [1,2,3;4,5,6][1][2];
+//   x[1,3] = [1,2,3;4,5,6][1][3];
+//   x[2,1] = [1,2,3;4,5,6][2][1];
+//   x[2,2] = [1,2,3;4,5,6][2][2];
+//   x[2,3] = [1,2,3;4,5,6][2][3];
+// end Array3;
Index: tags/v1_0_dk2/modeq/testsuite/Array4.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Array4.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Array4.mo	(revision 344)
@@ -0,0 +1,23 @@
+// name:     Array4
+// keywords: array,unknown
+// status:   correct
+// 
+// This is a test of arrays of arrays.  The type T2 is equivalent or
+// similar to Real[2,3].
+// 
+
+model Array4
+  type T1 = Real[3];
+  type T2 = T1[2];
+  T2 x;
+end Array4;
+
+// fclass Array4
+//   Integer x[1,1];
+//   Integer x[1,2];
+//   Integer x[1,3];
+//   Integer x[2,1];
+//   Integer x[2,2];
+//   Integer x[2,3];
+// equation
+// end Array4;
Index: tags/v1_0_dk2/modeq/testsuite/ArrayModification1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ArrayModification1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ArrayModification1.mo	(revision 344)
@@ -0,0 +1,21 @@
+// name:     ArrayModification1
+// keywords: array,modification
+// status:   correct
+// 
+// Simple equation modification of array elements.
+// 
+
+class ArrayModification1
+  class A
+    Real x[3];
+  end A;
+  A a(x[2] = 1.0);
+end ArrayModification1;
+
+// fclass ArrayModification1
+//   Real a.x[1];
+//   Real a.x[2];
+//   Real a.x[3];
+// equation
+//   a.x[2] = 1.0;
+// end ArrayModification1;
Index: tags/v1_0_dk2/modeq/testsuite/ArrayModification10.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ArrayModification10.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ArrayModification10.mo	(revision 344)
@@ -0,0 +1,23 @@
+// name:     ArrayModification10
+// keywords: array,modification
+// status:   correct
+// 
+// Double multi-dimensional modifications.
+// 
+
+class ArrayModification1
+  class A
+    Real x[2,2];
+  end A;
+  A a(x[2,1] = 1.0, x[2,2] = 2.0);
+end ArrayModification1;
+
+// fclass ArrayModification1
+//   Real a.x[1,1];
+//   Real a.x[1,2];
+//   Real a.x[2,1];
+//   Real a.x[2,2];
+// equation
+//   a.x[2,1] = 1.0;
+//   a.x[2,2] = 2.0;
+// end ArrayModification1;
Index: tags/v1_0_dk2/modeq/testsuite/ArrayModification2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ArrayModification2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ArrayModification2.mo	(revision 344)
@@ -0,0 +1,22 @@
+// name:     ArrayModification2
+// keywords: array,modification
+// status:   correct
+// 
+// Simple equation modification of array elements.
+// 
+
+class ArrayModification2
+  class A
+    Real x[3];
+  end A;
+  A a(x[2] = 1.0, x[3] = 2.0);
+end ArrayModification2;
+
+// fclass ArrayModification2
+//   Real a.x[1];
+//   Real a.x[2];
+//   Real a.x[3];
+// equation
+//   a.x[2] = 1.0;
+//   a.x[3] = 2.0;
+// end ArrayModification2;
Index: tags/v1_0_dk2/modeq/testsuite/ArrayModification3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ArrayModification3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ArrayModification3.mo	(revision 344)
@@ -0,0 +1,27 @@
+// name:     ArrayModification3
+// keywords: array,modification
+// status:   correct
+// 
+
+record R
+  Real a,b;
+end R;
+
+class ArrayModification3
+  class A
+    R x[3];
+  end A;
+  A a(x[2].a = 1.0, x[2].b = 1.0);
+end ArrayModification3;
+
+// fclass ArrayModification3
+//   Real a.x[1].a;
+//   Real a.x[1].b;
+//   Real a.x[2].a;
+//   Real a.x[2].b;
+//   Real a.x[3].a;
+//   Real a.x[3].b;
+// equation
+//   a.x[2].a = 1.0;
+//   a.x[2].b = 1.0;
+// end ArrayModification3;
Index: tags/v1_0_dk2/modeq/testsuite/ArrayModification4.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ArrayModification4.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ArrayModification4.mo	(revision 344)
@@ -0,0 +1,22 @@
+// name:     ArrayModification4
+// keywords: array,modification
+// status:   correct
+// 
+
+class ArrayModification4
+  class A
+    Real x[3];
+  end A;
+  A a(x[1] = 1.0, x.unit = "V");
+end ArrayModification4;
+
+// fclass ArrayModification4
+//   Real a.x[1];
+//   Real a.x[2];
+//   Real a.x[3];
+// equation
+//   a.x[1] = 1.0;
+//   a.x[1].unit = "V";
+//   a.x[2].unit = "V";
+//   a.x[3].unit = "V";
+// end ArrayModification4;
Index: tags/v1_0_dk2/modeq/testsuite/ArrayModification5.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ArrayModification5.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ArrayModification5.mo	(revision 344)
@@ -0,0 +1,23 @@
+// name:     ArrayModification5
+// keywords: array,modification,unknown
+// status:   incorrect
+// 
+// Partial indexing
+// 
+
+class ArrayModification5
+  class A
+    Real x[2,2];
+  end A;
+  A a(x[2] = [1.0,2.0]);
+end ArrayModification5;
+
+// fclass ArrayModification5
+//   Real    a.x[1,1];
+//   Real    a.x[1,2];
+//   Real    a.x[2,1];
+//   Real    a.x[2,2];
+// equation
+//   a.x[2,1] = 1.0;
+//   a.x[2,2] = 2.0;
+// end ArrayModification5;
Index: tags/v1_0_dk2/modeq/testsuite/ArrayModification6.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ArrayModification6.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ArrayModification6.mo	(revision 344)
@@ -0,0 +1,24 @@
+// name:     ArrayModification6
+// keywords: array,modification,unknown
+// status:   incorrect
+// 
+// Partial indexing mixed with full indexing.
+// 
+
+class ArrayModification6
+  class A
+    Real x[2,2];
+  end A;
+  A a(x[2] = 1.0, x[2,1] = 2.0);
+end ArrayModification6;
+
+// fclass ArrayModification6
+//   Real a.x[1,1];
+//   Real a.x[1,2];
+//   Real a.x[2,1];
+//   Real a.x[2,2];
+// equation
+//   a.x[2,1] = 1.0;
+//   a.x[2,2] = 1.0;
+//   a.x[2,1] = 2.0;
+// end ArrayModification6;
Index: tags/v1_0_dk2/modeq/testsuite/ArrayModification7.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ArrayModification7.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ArrayModification7.mo	(revision 344)
@@ -0,0 +1,26 @@
+// name:     ArrayModification7
+// keywords: array,modification,unknown
+// status:   incorrect
+// 
+// This tests array modifications where the index is an array, which
+// means that the modification modifies a whole slice.
+// 
+
+class ArrayModification7
+  class A
+    Real x[5];
+  end A;
+  A a(x[2:4] = 1.0);
+end ArrayModification7;
+
+// fclass ArrayModification7
+//   Real    a.x[1];
+//   Real    a.x[2];
+//   Real    a.x[3];
+//   Real    a.x[4];
+//   Real    a.x[5];
+// equation
+//   a.x[2] = 1.0;
+//   a.x[3] = 1.0;
+//   a.x[4] = 1.0;
+// end ArrayModification7;
Index: tags/v1_0_dk2/modeq/testsuite/ArrayModification8.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ArrayModification8.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ArrayModification8.mo	(revision 344)
@@ -0,0 +1,24 @@
+// name:     ArrayModification8
+// keywords: array,modification,unknown
+// status:   correct
+// 
+// This tests array modifications where the whole array is equated to
+// an array expression.
+// 
+
+class ArrayModification8
+  class A
+    Real x[3];
+  end A;
+  A a(x = [1.0,2.0,3.0]);
+end ArrayModification8;
+
+// fclass ArrayModification8
+//   Real    a.x[1];
+//   Real    a.x[2];
+//   Real    a.x[3];
+// equation
+//   a.x[1] = 1.0;
+//   a.x[2] = 2.0;
+//   a.x[3] = 3.0;
+// end ArrayModification8;
Index: tags/v1_0_dk2/modeq/testsuite/ArrayModification9.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ArrayModification9.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ArrayModification9.mo	(revision 344)
@@ -0,0 +1,22 @@
+// name:     ArrayModification9
+// keywords: array,modification
+// status:   correct
+// 
+// Full indexing of a multidimensional array.
+// 
+
+class ArrayModification6
+  class A
+    Real x[2,2];
+  end A;
+  A a(x[1,2] = 2.0);
+end ArrayModification6;
+
+// fclass ArrayModification6
+//   Real a.x[1,1];
+//   Real a.x[1,2];
+//   Real a.x[2,1];
+//   Real a.x[2,2];
+// equation
+//   a.x[1,2] = 2.0;
+// end ArrayModification6;
Index: tags/v1_0_dk2/modeq/testsuite/ArraySlice1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ArraySlice1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ArraySlice1.mo	(revision 344)
@@ -0,0 +1,22 @@
+// name:     ArraySlice1
+// keywords: array
+// status:   correct
+// 
+// Simple array slicing.
+// 
+
+class ArraySlice1
+  Real a[4];
+equation
+  a[[1,3]] = a[[2,4]];
+end ArraySlice1;
+
+// fclass ArraySlice1
+//   Real    a[1];
+//   Real    a[2];
+//   Real    a[3];
+//   Real    a[4];
+// equation
+//   a[1] = a[2];
+//   a[3] = a[4];
+// end ArraySlice1;
Index: tags/v1_0_dk2/modeq/testsuite/Circuit1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Circuit1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Circuit1.mo	(revision 344)
@@ -0,0 +1,200 @@
+// name:     Circuit1
+// keywords: 
+// status:   correct
+// 
+// This is the example from the report.  It is here to have a somewhat
+// larger test.
+//
+
+type Voltage = Real(unit="V");
+type Current = Real(unit="A");
+
+
+connector Pin 
+  Voltage      v;
+  flow Current i;
+end Pin;
+
+partial model TwoPin "Superclass of elements with two electrical pins" 
+  Pin p, n;
+  Voltage v;
+  Current i;
+equation
+  v = p.v - n.v;
+  0 = p.i + n.i; 
+  i = p.i;
+end TwoPin;
+
+model Resistor "Ideal electrical resistor" 
+  extends TwoPin;
+  parameter Real R(unit="Ohm") "Resistance";
+equation 
+  R*i = v;
+end Resistor;
+
+model Capacitor "Ideal electrical capacitor" 
+  extends TwoPin;
+  parameter Real C(unit="F") "Capacitance";
+equation 
+  C*der(v) = i;
+end Capacitor;
+
+model Inductor "Ideal electrical inductor" 
+  extends TwoPin;
+  parameter Real L(unit="H") "Inductance";
+equation 
+  L*der(i) = v;
+end Inductor;
+
+model VsourceAC "Sin-wave voltage source" 
+  extends TwoPin;
+  parameter Voltage VA = 220 "Amplitude";
+  parameter Real f(unit="Hz") = 50  "Frequency";
+  constant  Real PI=3.141592653589793;  
+equation 
+  v = VA*sin(2*PI*f*time);
+end VsourceAC;
+
+model Ground "Ground" 
+  Pin p;
+equation 
+  p.v = 0;
+end Ground;
+
+model Circuit1
+  Resistor  R1(R=10);
+  Capacitor C(C=0.01);
+  Resistor  R2(R=100);
+  Inductor  L(L=0.1);
+  VsourceAC AC;
+  Ground    G;
+  
+equation
+  connect (AC.p, R1.p);		// Capacitor circuit
+  connect (R1.n, C.p);
+  connect (C.n, AC.n);
+  connect (R1.p, R2.p);		// Inductor circuit
+  connect (R2.n, L.p);
+  connect (L.n,  C.n);
+  connect (AC.n, G.p);		// Ground
+end Circuit1;
+
+// fclass Circuit1
+//             Real    R1.p.v;
+//	       Real    R1.p.i;
+//	       Real    R1.n.v;
+//	       Real    R1.n.i;
+//	       Real    R1.v;
+//	       Real    R1.i;
+//   parameter Real    R1.R;
+//	       Real    C.p.v;
+//	       Real    C.p.i;
+//	       Real    C.n.v;
+//	       Real    C.n.i;
+//	       Real    C.v;
+//	       Real    C.i;
+//   parameter Real    C.C;
+//	       Real    R2.p.v;
+//	       Real    R2.p.i;
+//	       Real    R2.n.v;
+//	       Real    R2.n.i;
+//	       Real    R2.v;
+//	       Real    R2.i;
+//   parameter Real    R2.R;
+//	       Real    L.p.v;
+//	       Real    L.p.i;
+//	       Real    L.n.v;
+//	       Real    L.n.i;
+//	       Real    L.v;
+//	       Real    L.i;
+//   parameter Real    L.L;
+//	       Real    AC.p.v;
+//	       Real    AC.p.i;
+//	       Real    AC.n.v;
+//	       Real    AC.n.i;
+//	       Real    AC.v;
+//	       Real    AC.i;
+//   parameter Real    AC.VA;
+//   parameter Real    AC.f;
+//   constant  Real    AC.PI;
+//	       Real    G.p.v;
+//	       Real    G.p.i;
+// equation
+//   Real(0) = AC.p.i + AC.n.i;
+//   Real(0) = C.p.i  + C.n.i;
+//   Real(0) = L.p.i  + L.n.i;
+//   Real(0) = R1.p.i + R1.n.i;
+//   Real(0) = R2.p.i + R2.n.i;
+//   AC.PI = 3.14159265358979;
+//   AC.VA = Real(220);
+//   AC.VA.unit = "V";
+//   AC.f = Real(50);
+//   AC.f.unit = "Hz";
+//   AC.i = AC.p.i;
+//   AC.i.unit = "A";
+//   AC.n.i.unit = "A";
+//   AC.n.v = G.p.v;
+//   AC.n.v.unit = "V";
+//   AC.p.i + R1.p.i + R2.p.i = 0.0;
+//   AC.p.i.unit = "A";
+//   AC.p.v = R1.p.v;
+//   AC.p.v.unit = "V";
+//   AC.v = AC.VA*sin(Real(2)*AC.PI*AC.f*time);
+//   AC.v = AC.p.v - AC.n.v;
+//   AC.v.unit = "V";
+//   C.C = 0.01;
+//   C.C * der(C.v) = C.i;
+//   C.C.unit = "F";
+//   C.i = C.p.i;
+//   C.i.unit = "A";
+//   C.n.i.unit = "A";
+//   C.n.v = AC.n.v;
+//   C.n.v.unit = "V";
+//   C.p.i.unit = "A";
+//   C.p.v.unit = "V";
+//   C.v = C.p.v - C.n.v;
+//   C.v.unit = "V";
+//   G.p.i.unit = "A";
+//   G.p.v = Real(0);
+//   G.p.v.unit = "V";
+//   L.L = 0.1;
+//   L.L * der(L.i) = L.v;
+//   L.L.unit = "H";
+//   L.i = L.p.i;
+//   L.i.unit = "A";
+//   L.n.i + C.n.i + AC.n.i + G.p.i = 0.0;
+//   L.n.i.unit = "A";
+//   L.n.v = C.n.v;
+//   L.n.v.unit = "V";
+//   L.p.i.unit = "A";
+//   L.p.v.unit = "V";
+//   L.v = L.p.v - L.n.v;
+//   L.v.unit = "V";
+//   R1.R = Real(10);
+//   R1.R * R1.i = R1.v;
+//   R1.R.unit = "Ohm";
+//   R1.i = R1.p.i;
+//   R1.i.unit = "A";
+//   R1.n.i + C.p.i = 0.0;
+//   R1.n.i.unit = "A";
+//   R1.n.v = C.p.v;
+//   R1.n.v.unit = "V";
+//   R1.p.i.unit = "A";
+//   R1.p.v = R2.p.v;
+//   R1.p.v.unit = "V";
+//   R1.v = R1.p.v - R1.n.v;
+//   R1.v.unit = "V";
+//   R2.R = Real(100);
+//   R2.R * R2.i = R2.v;
+//   R2.R.unit = "Ohm";
+//   R2.i = R2.p.i;
+//   R2.i.unit = "A";
+//   R2.n.i + L.p.i = 0.0;
+//   R2.n.i.unit = "A";
+//   R2.n.v = L.p.v;
+//   R2.n.v.unit = "V";
+//   R2.p.i.unit = "A";
+//   R2.p.v.unit = "V";
+//   R2.v = R2.p.v - R2.n.v;
+//   R2.v.unit = "V";
+// end Circuit1;
Index: tags/v1_0_dk2/modeq/testsuite/Class1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Class1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Class1.mo	(revision 344)
@@ -0,0 +1,14 @@
+// name:     Class1
+// keywords: 
+// status:   correct
+// 
+// An empty class should be allowed.
+// 
+
+class Class1
+  
+end Class1;
+
+// fclass Class1
+// equation
+// end Class1;
Index: tags/v1_0_dk2/modeq/testsuite/Class2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Class2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Class2.mo	(revision 344)
@@ -0,0 +1,17 @@
+// name:     Class2
+// keywords: 
+// status:   correct
+// 
+// This is a really simple tests.
+// 
+
+class Class2
+  Real x = 17.0;
+end Class2;
+
+// fclass Class2
+//   Real    x;
+//   String  x.unit;
+// equation
+//   x = 17.0;
+// end Class2;
Index: tags/v1_0_dk2/modeq/testsuite/Class3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Class3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Class3.mo	(revision 344)
@@ -0,0 +1,10 @@
+// name:     Class3
+// keywords: 
+// status:   incorrect
+// 
+// The end must have the same identifier as the head.
+// 
+
+class Class3
+  Real x = 17.0;
+end WrongEnd;
Index: tags/v1_0_dk2/modeq/testsuite/Class4.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Class4.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Class4.mo	(revision 344)
@@ -0,0 +1,14 @@
+// name:     Class4
+// keywords: 
+// status:   correct
+// 
+// A minimal source file
+// 
+
+class Class4
+  
+end;
+
+// fclass Class4
+// equation
+// end Class4;
Index: tags/v1_0_dk2/modeq/testsuite/ConditionalArrayExpression1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ConditionalArrayExpression1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ConditionalArrayExpression1.mo	(revision 344)
@@ -0,0 +1,12 @@
+// name:     ConditionalArrayExpression1
+// keywords: equation, array
+// status:   incorrect
+// 
+// The sizes must fit in array expressions and equations.
+// 
+
+model ConditionalArrayExpression1
+  Real a=1, b=2, c[2], d, e;
+equation
+  0 = if a > b then c else [d; e];
+end ConditionalArrayExpression1;
Index: tags/v1_0_dk2/modeq/testsuite/ConditionalArrayExpression2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ConditionalArrayExpression2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ConditionalArrayExpression2.mo	(revision 344)
@@ -0,0 +1,25 @@
+// name:     ConditionalArrayExpression2
+// keywords: equation,array
+// status:   correct
+// 
+// The sizes must fit in array expressions and equations.
+//
+
+model ConditionalArrayExpression2
+  Real a=1.0, b=2.0, c[2], d, e;
+equation
+  [0.0; 0.0] = if a > b then c else [d; e];
+end ConditionalArrayExpression2;
+
+// fclass ConditionalArrayExpression2
+//   Real a;
+//   Real b;
+//   Real c[2];
+//   Real d;
+//   Real e;
+// equation
+//   a = Real(1);
+//   b = Real(2);
+//   0 = if a > b then c[1] else d;
+//   0 = if a > b then c[2] else e;
+// end ConditionalArrayExpression2;
Index: tags/v1_0_dk2/modeq/testsuite/Connect1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Connect1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Connect1.mo	(revision 344)
@@ -0,0 +1,27 @@
+// name:     Connect1
+// keywords: connect
+// status:   correct
+// 
+// Basic connections
+// 
+
+connector C
+  flow Real f;
+  Real e;
+end C;
+
+model Connect1
+  C c1,c2;
+equation
+  connect(c1,c2);
+end Connect1;
+
+// fclass Connect1
+//   Real c1.f;
+//   Real c2.f;
+//   Real c1.e;
+//   Real c2.e;
+// equation
+//   c1.e = c2.e;
+//   (-c1.f) + (-c2.f) = 0.0;
+// end Connect1;
Index: tags/v1_0_dk2/modeq/testsuite/Connect2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Connect2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Connect2.mo	(revision 344)
@@ -0,0 +1,31 @@
+// name:     Connect2
+// keywords: connect
+// status:   correct
+// 
+// Basic connections between three connectors.
+// 
+
+connector C
+  flow Real f;
+  Real e;
+end C;
+
+model Connect2
+  C c1,c2,c3;
+equation
+  connect(c1,c2);
+  connect(c2,c3);
+end Connect2;
+
+// fclass Connect2
+//   Real c1.f;
+//   Real c2.f;
+//   Real c3.f;
+//   Real c1.e;
+//   Real c2.e;
+//   Real c3.e;
+// equation
+//   c1.e = c2.e;
+//   c2.e = c3.e;
+//   (-c1.f) + (-c2.f) + (-c3.f) = 0.0;
+// end Connect2;
Index: tags/v1_0_dk2/modeq/testsuite/Connect3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Connect3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Connect3.mo	(revision 344)
@@ -0,0 +1,26 @@
+// name:     Connect3
+// keywords: connect,unknown
+// status:   correct
+// 
+// Connection of two reals is not specifically allowed in the report,
+// but it seems that at least some people thought that it should be
+// possible.
+// 
+
+model Connect3
+  Real e1,e2;
+  flow Real f1,f2;
+equation
+  connect(e1,e2);
+  connect(f1,f2);
+end Connect3;
+
+// fclass Connect3
+//   Real e1;
+//   Real e2;
+//   Real f1;
+//   Real f2;
+// equation
+//   e1 = e2;
+//   (-f1) + (-f2) = 0.0;
+// end Connect3;
Index: tags/v1_0_dk2/modeq/testsuite/Connect4.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Connect4.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Connect4.mo	(revision 344)
@@ -0,0 +1,16 @@
+// name:     Connect4
+// keywords: connect,type,unknown
+// status:   incorrect
+// 
+// Are integers allowed in connectors?
+// 
+
+connector C
+  Integer i;
+end C;
+
+model Connect4
+  C c1,c2;
+equation
+  connect(c1,c2);
+end Connect4;
Index: tags/v1_0_dk2/modeq/testsuite/Connect5.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Connect5.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Connect5.mo	(revision 344)
@@ -0,0 +1,16 @@
+// name:     Connect5
+// keywords: connect,type,unknown
+// status:   incorrect
+// 
+// Are booleans allowed in connectors?
+// 
+
+connector C
+  Boolean b;
+end C;
+
+model Connect5
+  C c1,c2;
+equation
+  connect(c1,c2);
+end Connect5;
Index: tags/v1_0_dk2/modeq/testsuite/Connect6.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Connect6.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Connect6.mo	(revision 344)
@@ -0,0 +1,16 @@
+// name:     Connect6
+// keywords: connect,type,unknown
+// status:   incorrect
+// 
+// Strings are not allowed in connectors.  Or are they?
+// 
+
+connector C
+  String s;
+end C;
+
+model Connect6
+  C c1,c2;
+equation
+  connect(c1,c2);
+end Connect6;
Index: tags/v1_0_dk2/modeq/testsuite/Connect7.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Connect7.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Connect7.mo	(revision 344)
@@ -0,0 +1,32 @@
+// name:     Connect7
+// keywords: connect
+// status:   correct
+// 
+// If parameters are involved in connections, the parameters have to
+// be known to generate the equations.  If the parameter N would have
+// been set to 3 instead, only one big connection set would have been
+// generated.
+// 
+
+connector C
+  flow Real x;
+end C;
+
+class Connect7
+  parameter Integer N = 2;
+  C c[3], cx, cy;
+equation
+  connect(c[N],cx);
+  connect(c[3],cy);
+end Connect7;
+
+// fclass Connect7
+//   Real c[1].x;
+//   Real c[2].x;
+//   Real c[3].x;
+//   Real cx.x;
+//   Real cy.x;
+// equation
+//   (-c[2].x) + (-cx.x) = 0.0;
+//   (-c[2].x) + (-cx.x) = 0.0;
+// end Connect7;
Index: tags/v1_0_dk2/modeq/testsuite/Connect8.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Connect8.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Connect8.mo	(revision 344)
@@ -0,0 +1,29 @@
+// name:     Connect8
+// keywords: connect
+// status:   correct
+// 
+// If parameters are involved in connections, the parameters have to
+// be known to generate the equations.
+// 
+
+connector C
+  flow Real x;
+end C;
+
+class Connect8
+  parameter Integer N = 3;
+  C c[3], cx, cy;
+equation
+  connect(c[N],cx);
+  connect(c[3],cy);
+end Connect8;
+
+// fclass Connect8
+//   Real c[1].x;
+//   Real c[2].x;
+//   Real c[3].x;
+//   Real cx.x;
+//   Real cy.x;
+// equation
+//   (-c[2].x) + (-cx.x) + (-cy.x) = 0.0;
+// end Connect8;
Index: tags/v1_0_dk2/modeq/testsuite/ConnectConst1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ConnectConst1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ConnectConst1.mo	(revision 344)
@@ -0,0 +1,18 @@
+// name:     ConnectConst1
+// keywords: connect,constant,unknown
+// status:   incorrect
+// 
+// You should not be able to declare connectors as constant, or should you?
+// 
+
+class C
+  flow Real f;
+  Real e;
+end A;
+
+model World
+  C c1;
+  constant C c2;
+equation
+  connect(c1,c2);
+end World;
Index: tags/v1_0_dk2/modeq/testsuite/ConnectFlowEffort.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ConnectFlowEffort.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ConnectFlowEffort.mo	(revision 344)
@@ -0,0 +1,21 @@
+// name:     ConnectFlowEffort
+// keywords: connect,modification
+// status:   incorrect
+// 
+// Flow and effort variables may not be connected.
+//
+
+connector Connector1
+  Real e;
+end Connector1;
+
+connector Connector2
+  flow Real e;
+end Connector2;
+
+class ConnectFlowEffort
+  Connector1 c1;
+  Connector2 c2;
+equation
+  connect(c1, c2);
+end ConnectFlowEffort;
Index: tags/v1_0_dk2/modeq/testsuite/ConnectHierarchical1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ConnectHierarchical1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ConnectHierarchical1.mo	(revision 344)
@@ -0,0 +1,51 @@
+// name:     ConnectHierarchical1
+// keywords: connect
+// status:   correct
+// 
+// All effort variables are equal to 1. The unknown flow 'a.b.c.f'
+// evaluates to -1.
+//
+
+connector Connector
+  flow Real f;
+  Real e;
+end Connector;
+
+class B
+  Connector c;
+end B;
+
+class A
+  B b;
+  Connector c1, c2(f = 2.0);
+equation
+  connect(c1, b.c);
+end A;
+
+class ConnectHierarchical1
+  A a;
+  Connector c(e = 1.0, f = 1.0);
+equation
+  connect(a.c1, a.c2);
+  connect(c, a.c1);
+end ConnectHierarchical1;
+
+// fclass ConnectHierarchical1
+//   Real a.b.c.f;
+//   Real a.b.c.e;
+//   Real a.c1.f;
+//   Real a.c1.e;
+//   Real a.c2.f;
+//   Real a.c2.e;
+//   Real c.f;
+//   Real c.e;
+// equation
+//   a.c2.f = 2.0;
+//   a.c1.e = a.b.c.e;
+//   (-a.c1.f) + a.b.c.f = 0.0;
+//   c.f = 1.0;
+//   c.e = 1.0;
+//   c.e = a.c1.e;
+//   a.c1.e = a.c2.e;
+//   (-c.f) + a.c1.f + a.c2.f = 0.0;
+// end ConnectHierarchical1;
Index: tags/v1_0_dk2/modeq/testsuite/ConnectHierarchical2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ConnectHierarchical2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ConnectHierarchical2.mo	(revision 344)
@@ -0,0 +1,56 @@
+// name:     ConnectHierarchical2
+// keywords: connect
+// status:   correct
+// 
+// All effort variables are equal to 1. The unknown flow 'a.b.c.f'
+// evaluates to 3, even though the same connections as in 
+// ConnectHierarchical1 are established ('a.b.c.f' evaluates to -1 
+// there)! 
+//
+
+connector Connector
+  flow Real f;
+  Real e;
+end Connector;
+
+class B
+  Connector c;
+end B;
+
+class A
+  B b;
+  Connector c1, c2(f = 2.0);
+equation
+  connect(c1, b.c);
+  connect(c1, c2);
+end A;
+
+class ConnectHierarchical2
+  A a;
+  Connector c(e = 1.0, f = 1.0);
+equation
+  connect(c, a.c1);
+end ConnectHierarchical2;
+
+// fclass ConnectHierarchical2
+//   Real a.b.c.f;
+//   Real a.b.c.e;
+//   Real a.c1.f;
+//   Real a.c1.e;
+//   Real a.c2.f;
+//   Real a.c2.e;
+//   Real c.f;
+//   Real c.e;
+// equation
+//   a.c2.f = 2.0;
+//   a.c1.e = a.b.c.e;
+//   a.b.c.e = a.c2.e;
+//   (-a.c1.f) + a.b.c.f + (-a.c2.f) = 0.0;
+//   c.f = 1.0;
+//   c.e = 1.0;
+//   c.e = a.c1.e;
+//   (-c.f) + a.c1.f = 0.0;
+// end ConnectHierarchical2;
+
+
+
Index: tags/v1_0_dk2/modeq/testsuite/ConnectTypes.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ConnectTypes.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ConnectTypes.mo	(revision 344)
@@ -0,0 +1,41 @@
+// name:     ConnectTypes
+// keywords: connect,type,unknown
+// status:   correct
+// 
+// Check generation of connection equations. No equations should be 
+// generated for parameters and constants. <Ruediger: not sure>
+//
+
+connector Connector
+  Real e;
+  parameter Real p;
+  discrete Real d;
+  constant Real c;
+end Connector;
+
+class A
+  Connector c;
+end A;
+
+class ConnectTypes
+  A a;
+  Connector c;
+equation
+  connect(c, a.c);
+end ConnectTypes;
+
+// fclass ConnectTypes
+//   Real a.c.e;
+//   parameter Real a.c.p;
+//   discrete Real a.c.d;
+//   constant Real a.c.c;
+//   Real c.e;
+//   parameter Real c.p;
+//   discrete Real c.d;
+//   constant Real c.c;
+// equation
+//   c.e = a.c.e;
+//   c.p = a.c.p;
+//   c.d = a.c.d;
+//   c.c = a.c.c;
+// end ConnectTypes;
Index: tags/v1_0_dk2/modeq/testsuite/Constant1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Constant1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Constant1.mo	(revision 344)
@@ -0,0 +1,24 @@
+// name:     Constant1
+// keywords: declaration
+// status:   correct
+// 
+// Basic constant definitions.
+// 
+
+class Constant1
+  constant Real PI = 3.14159265358979;
+  constant Integer N = 17;
+  Real x;
+equation
+  x = 2.0 * PI;
+end Constant1;
+
+// fclass Constant1
+//   constant Real PI;
+//   constant Integer N;
+//   Real x;
+// equation
+//   PI = 3.14159265358979;
+//   N = 17;
+//   x = 2.0 * PI;
+// end Constant1;
Index: tags/v1_0_dk2/modeq/testsuite/Constant2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Constant2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Constant2.mo	(revision 344)
@@ -0,0 +1,32 @@
+// name:     Constant2
+// keywords: declaration,type
+// status:   correct
+// 
+// Constants and their use in expressions. This tests that the
+// translator checks that the equation modifications are constant.
+// 
+
+model Constant2
+  constant Real A = 5.0;
+  constant Real B = A;
+  constant Real C = B + 1.0;
+  constant Real D = C - A;
+  constant Integer E = 3;
+  constant Integer F = E + 4;
+end Constant2;
+
+// fclass Constant2
+//   constant Real A;
+//   constant Real B;
+//   constant Real C;
+//   constant Real D;
+//   constant Integer E;
+//   constant Integer F;
+// equation
+//   A = 5.0;
+//   B = A;
+//   C = B + 1.0;
+//   D = C - A;
+//   E = 3;
+//   F = E + 4;
+// end Constant2;
Index: tags/v1_0_dk2/modeq/testsuite/Constant3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Constant3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Constant3.mo	(revision 344)
@@ -0,0 +1,23 @@
+// name:     Constant3
+// keywords: declaration,array
+// status:   correct
+// 
+// Basic constant definitions.
+// 
+
+class Constant3
+  constant Integer N = 3;
+  Real x[N];
+equation
+  x[N-1] = 2.0;
+end Constant3;
+
+// fclass Constant3
+//   constant Integer N;
+//   Real x[1];
+//   Real x[2];
+//   Real x[3];
+// equation
+//   N = 3;
+//   x[N-1] = 2.0;
+// end Constant3;
Index: tags/v1_0_dk2/modeq/testsuite/ConstructParameters.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ConstructParameters.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ConstructParameters.mo	(revision 344)
@@ -0,0 +1,45 @@
+// name:     ConstructParameters
+// keywords: declaration,algorithm,unknown
+// status:   incorrect
+// 
+// A set of parameters can be computed from a set of other parameters 
+// by using a function call.
+//
+// david: whereever did you come up with this syntax? It is wrong
+//
+
+function fc
+  output Real p3, p4;
+  input  Real p1, p2;
+algorithm
+  p3 := p1*p2;
+  p4 := p3*p1 + p2;
+end fc; 
+
+model ConstructParameters
+  parameter Real p1=2.0, p2=3.0;
+protected
+  parameter Real (p3,p4) = fc(p1,p2);
+end ConstructParameters;
+
+// fclass ConstructParameters
+//   parameter Real p1;
+//   parameter Real p2;
+// protected
+//   parameter Real p3;
+//   parameter Real p4;
+//   Real fc~1.p3;
+//   Real fc~1.p4;
+//   Real fc~1.p1;
+//   Real fc~1.p2;
+// equation
+//   p1 = Real(2);
+//   p2 = Real(3);
+//   fc~1.p1 = p1;
+//   fc~1.p2 = p2;
+//   p3 = fc~1.p3;
+//   p4 = fc~1.p4;
+// algorithm
+//   fc~1.p3 := fc~1.p1*fc~1.p2;
+//   fc~1.p4 := fc~1.p3*fc~1.p1 + fc~1.p2;
+// end ConstructParameters;
Index: tags/v1_0_dk2/modeq/testsuite/Declaration1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Declaration1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Declaration1.mo	(revision 344)
@@ -0,0 +1,10 @@
+// name:     Declaration1
+// keywords: declaration
+// status:   incorrect
+// 
+// Misuse of component attributes.
+//
+
+class Declaration1
+  discrete constant Real x;
+end Declaration1;
Index: tags/v1_0_dk2/modeq/testsuite/Declaration2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Declaration2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Declaration2.mo	(revision 344)
@@ -0,0 +1,10 @@
+// name:     Declaration2
+// keywords: declaration
+// status:   incorrect
+// 
+// Misuse of component attributes.
+//
+
+class Declaration2
+  constant discrete Real x;
+end Declaration2;
Index: tags/v1_0_dk2/modeq/testsuite/Declaration3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Declaration3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Declaration3.mo	(revision 344)
@@ -0,0 +1,10 @@
+// name:     Declaration3
+// keywords: declaration
+// status:   incorrect
+// 
+// Misuse of component attributes.
+//
+
+class Declaration3
+  constant parameter Real x;
+end Declaration3;
Index: tags/v1_0_dk2/modeq/testsuite/DeclareConstant1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/DeclareConstant1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/DeclareConstant1.mo	(revision 344)
@@ -0,0 +1,13 @@
+// name:     DeclareConstant1
+// keywords: declaration,equation
+// status:   incorrect
+// 
+// A constant requires a declaration equation with constant 
+// expression on the right hand side.
+// 
+
+class DeclareConstant1
+  constant String s;
+equation
+  s = "value";
+end DeclareConstant1;
Index: tags/v1_0_dk2/modeq/testsuite/DeclareConstant2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/DeclareConstant2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/DeclareConstant2.mo	(revision 344)
@@ -0,0 +1,10 @@
+// name:     DeclareConstant2
+// keywords: declaration
+// status:   incorrect
+// 
+// The attribute 'value' shall not be accessed.
+// 
+
+class DeclareConstant2
+  constant String s(value = "value");
+end DeclareConstant2;
Index: tags/v1_0_dk2/modeq/testsuite/DeclareConstant3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/DeclareConstant3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/DeclareConstant3.mo	(revision 344)
@@ -0,0 +1,14 @@
+// name:     DeclareConstant3
+// keywords: declaration
+// status:   incorrect
+// 
+// A constant requires a declaration equation with constant 
+// expression on the right hand side.
+// 
+
+class DeclareConstant3
+  Real x, y;
+  constant Real c = x + y;
+equation
+  c = 5.0;
+end DeclareConstant3;
Index: tags/v1_0_dk2/modeq/testsuite/DependsMutual.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/DependsMutual.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/DependsMutual.mo	(revision 344)
@@ -0,0 +1,17 @@
+// name:     DependsMutual
+// keywords: scoping
+// status:   incorrect
+// 
+// Mutual dependence is not supported as only previously declared models 
+// are known and no forward declaration exists in Modelica.
+//
+
+class A
+ Real x;
+ DependsMutual b;
+end A;
+
+class DependsMutual
+  Real x;
+  A a;
+end DependsMutual;
Index: tags/v1_0_dk2/modeq/testsuite/DependsRecursive.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/DependsRecursive.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/DependsRecursive.mo	(revision 344)
@@ -0,0 +1,11 @@
+// name:     DependsRecursive
+// keywords: scoping
+// status:   incorrect
+// 
+// A recursive model can not be instantiated.
+//
+
+model DependsRecursive
+  Real head;
+  DependsRecursive tail;
+end DependsRecursive;
Index: tags/v1_0_dk2/modeq/testsuite/Discrete1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Discrete1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Discrete1.mo	(revision 344)
@@ -0,0 +1,14 @@
+// name:     Discrete1
+// keywords: declaration
+// status:   correct
+// 
+// Test the `discrete' keyword
+
+class Discrete1
+  discrete Real x;
+end Discrete1;
+
+// fclass Discrete1
+//   discrete Real    x;
+// equation
+// end Discrete1;
Index: tags/v1_0_dk2/modeq/testsuite/Discrete2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Discrete2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Discrete2.mo	(revision 344)
@@ -0,0 +1,18 @@
+// name:     Discrete2
+// keywords: declaration,unknown
+// status:   erroneous
+// 
+// This is not valid, but should it complain now or later?
+
+class Discrete2
+  discrete Real x;
+equation
+  x = sin(time);
+end Discrete2;
+
+// fclass Discrete2
+//   discrete Real    x;
+//            String  x.unit;
+// equation
+//   x = sin(time);
+// end Discrete2;
Index: tags/v1_0_dk2/modeq/testsuite/DisturbedResistance1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/DisturbedResistance1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/DisturbedResistance1.mo	(revision 344)
@@ -0,0 +1,17 @@
+// name:     DisturbedResistance1
+// keywords: modification
+// status:   incorrect
+// 
+// A parameter must not be time-varying.
+//
+
+model Resistor
+  Real u, i;
+  parameter Real R = 1.0;
+equation
+  u = R*i;
+end Resistor;
+
+model DisturbedResistance1
+  extends Resistor(R = 1.0 + 0.1*sin(time));
+end DisturbedResistance1;
Index: tags/v1_0_dk2/modeq/testsuite/DisturbedResistance2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/DisturbedResistance2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/DisturbedResistance2.mo	(revision 344)
@@ -0,0 +1,17 @@
+// name:     DisturbedResistance2
+// keywords: modification
+// status:   incorrect
+// 
+// A parameter may not be redeclared as variable.
+//
+
+model Resistor
+  Real u, i;
+  parameter Real R = 1.0;
+equation
+  u = R*i;
+end Resistor;
+
+model DisturbedResistance2
+  extends Resistor(redeclare Real R = 1.0 + 0.1*sin(time));
+end DisturbedResistance2;
Index: tags/v1_0_dk2/modeq/testsuite/DisturbedResistance3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/DisturbedResistance3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/DisturbedResistance3.mo	(revision 344)
@@ -0,0 +1,29 @@
+// name:     DisturbedResistance3
+// keywords: modification
+// status:   correct
+// 
+// This is an example of replacing a variable without using 
+// redeclaration syntax. In this way a parameter can be replaced 
+// by a variable.
+//
+
+model Resistor
+  Real u, i;
+  parameter Real R = 1.0;
+equation
+  u = R*i;
+end Resistor;
+
+model DisturbedResistance3
+  Real R = 1.0 + 0.1*sin(time);
+  extends Resistor;
+end DisturbedResistance3;
+
+// fclass DisturbedResistance3
+//   Real u;
+//   Real i;
+//   Real R;
+// equation
+//   R = 1.0 + 0.1*sin(time);
+//   u = R*i;
+// end DisturbedResistance3;
Index: tags/v1_0_dk2/modeq/testsuite/DisturbedResistance4.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/DisturbedResistance4.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/DisturbedResistance4.mo	(revision 344)
@@ -0,0 +1,27 @@
+// name:     DisturbedResistance4
+// keywords: modification
+// status:   erroneous
+// 
+// Finalized objects shall not be overwritten.
+//
+
+model Resistor
+  Real u, i;
+  final parameter Real R = 1.0;
+equation
+  u = R*i;
+end Resistor;
+
+model DisturbedResistance4
+  Real R = 1.0 + 0.1*sin(time);
+  extends Resistor;
+end DisturbedResistance4;
+
+// fclass DisturbedResistance4
+//   Real u;
+//   Real i;
+//   Real R;
+// equation
+//   R = 1.0 + 0.1*sin(time);
+//   u = R*i;
+// end DisturbedResistance4;
Index: tags/v1_0_dk2/modeq/testsuite/EquationFor1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/EquationFor1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/EquationFor1.mo	(revision 344)
@@ -0,0 +1,29 @@
+// name:     EquationFor1
+// keywords: equation,array
+// status:   correct
+// 
+// Test for loops in equations.
+// 
+
+class EquationFor1
+  Real a[5];
+equation
+  a[1] = 1.0;
+  for i in [2,3,4,5] loop
+    a[i] = a[i-1] + 1.0;
+  end for;
+end EquationFor1;
+
+// fclass EquationFor1
+//   Real a[1];
+//   Real a[2];
+//   Real a[3];
+//   Real a[4];
+//   Real a[5];
+// equation
+//   a[1] = 1.0;
+//   a[2] = a[2-1] + 1.0;
+//   a[3] = a[3-1] + 1.0;
+//   a[4] = a[4-1] + 1.0;
+//   a[5] = a[5-1] + 1.0;
+// end EquationFor1;
Index: tags/v1_0_dk2/modeq/testsuite/EquationFor2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/EquationFor2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/EquationFor2.mo	(revision 344)
@@ -0,0 +1,30 @@
+// name:     EquationFor2
+// keywords: equation,array
+// status:   correct
+// 
+// Test for loops in equations.
+// 
+
+class EquationFor2
+  constant Integer N = 4;
+  Real a[N];
+equation
+  a[1] = 1.0;
+  for i in 1:N-1 loop
+    a[i+1] = a[i] + 1.0;
+  end for;
+end EquationFor2;
+
+// fclass EquationFor2
+//   constant Integer N;
+//   Real a[1];
+//   Real a[2];
+//   Real a[3];
+//   Real a[4];
+// equation
+//   N = 4;
+//   a[1] = 1.0;
+//   a[1 + 1] = a[1] + 1.0;
+//   a[2 + 1] = a[2] + 1.0;
+//   a[3 + 1] = a[3] + 1.0;
+// end EquationFor2;
Index: tags/v1_0_dk2/modeq/testsuite/EquationFor3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/EquationFor3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/EquationFor3.mo	(revision 344)
@@ -0,0 +1,30 @@
+// name:     EquationFor3
+// keywords: equation,array
+// status:   correct
+// 
+// Test for loops in equations.  The size is a parameter.
+// 
+
+class EquationFor3
+  parameter Integer N = 4;
+  Real a[N];
+equation
+  a[1] = 1.0;
+  for i in 1:N-1 loop
+    a[i+1] = a[i] + 1.0;
+  end for;
+end EquationFor3;
+
+// fclass EquationFor3
+//   constant Integer N;
+//   Real a[1];
+//   Real a[2];
+//   Real a[3];
+//   Real a[4];
+// equation
+//   N = 4;
+//   a[1] = 1.0;
+//   a[1 + 1] = a[1] + 1.0;
+//   a[2 + 1] = a[2] + 1.0;
+//   a[3 + 1] = a[3] + 1.0;
+// end EquationFor3;
Index: tags/v1_0_dk2/modeq/testsuite/EquationIf1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/EquationIf1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/EquationIf1.mo	(revision 344)
@@ -0,0 +1,25 @@
+// name:     EquationIf1
+// keywords: equation
+// status:   correct
+// 
+// Testing `if' clauses in equations.
+// 
+
+class EquationIf1
+  parameter Boolean b = true;
+  Real x;
+equation
+  if b then
+    x = 1.0;
+  else
+    x = 2.0;
+  end if;
+end EquationIf1;
+
+// fclass EquationIf1
+//   parameter Boolean b;
+//   Real x;
+// equation
+//   b = true;
+//   x = 1.0;
+// end EquationIf1;
Index: tags/v1_0_dk2/modeq/testsuite/EquationIf2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/EquationIf2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/EquationIf2.mo	(revision 344)
@@ -0,0 +1,25 @@
+// name:     EquationIf2
+// keywords: equation
+// status:   correct
+// 
+// Testing `if' clauses in equations.
+// 
+
+class EquationIf2
+  parameter Boolean b = false;
+  Real x;
+equation
+  if b then
+    x = 1.0;
+  else
+    x = 2.0;
+  end if;
+end EquationIf2;
+
+// fclass EquationIf2
+//   parameter Boolean b;
+//   Real x;
+// equation
+//   b = false;
+//   x = 2.0;
+// end EquationIf2;
Index: tags/v1_0_dk2/modeq/testsuite/EquationIf3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/EquationIf3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/EquationIf3.mo	(revision 344)
@@ -0,0 +1,27 @@
+// name:     EquationIf3
+// keywords: equation
+// status:   correct
+// 
+// Testing `if' clauses in equations.
+// 
+
+class EquationIf3
+  parameter Boolean b = false;
+  Real x;
+equation
+  if b then
+    x = 1.0;
+  elseif not b then
+    x = 2.0;
+  else
+    x = 3.0;
+  end if;
+end EquationIf3;
+
+// fclass EquationIf3
+//   parameter Boolean b;
+//   Real x;
+// equation
+//   b = false;
+//   x = 2.0;
+// end EquationIf3;
Index: tags/v1_0_dk2/modeq/testsuite/EquationIf4.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/EquationIf4.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/EquationIf4.mo	(revision 344)
@@ -0,0 +1,29 @@
+// name:     EquationIf4
+// keywords: equation
+// status:   correct
+// 
+// Testing `if' clauses in equations.
+// 
+
+class EquationIf4
+  parameter Real p = 10.0;
+  Real x;
+equation
+  if p<0.0 then
+    x = 1.0;
+  elseif p<10.0 then
+    x = 2.0;
+  elseif p > 10.0 then
+    x = 3.0
+  else
+    x = 4.0;
+  end if;
+end EquationIf4;
+
+// fclass EquationIf4
+//   parameter Real p;
+//   Real x;
+// equation
+//   p = 10.0;
+//   x = 4.0;
+// end EquationIf4;
Index: tags/v1_0_dk2/modeq/testsuite/Extends1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Extends1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Extends1.mo	(revision 344)
@@ -0,0 +1,26 @@
+// name:     Extends1
+// keywords: extends
+// status:   correct
+// 
+// Testing extends clauses
+
+class A
+  Real a = 1.0;
+end A;
+
+class B
+  extends A(a = 2.0);
+  Real b = 2.0;
+end B;
+
+model Extends1
+  B x;
+end Extends1;
+
+// fclass Extends1
+//   Real x.a;
+//   Real x.b;
+// equation
+//   x.a = 2.0;
+//   x.b = 2.0;
+// end Extends1;
Index: tags/v1_0_dk2/modeq/testsuite/Faculty1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Faculty1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Faculty1.mo	(revision 344)
@@ -0,0 +1,17 @@
+// name:     Faculty1
+// keywords: algorithm,scoping
+// status:   incorrect
+// 
+// Example for a recursive function. The function 'Faculty' must be 
+// known during its definition in order to be called from itself.
+//
+// Only fully instantiated classes are known. Consequently recursive 
+// function are not supported inside Modelica.
+//
+
+function Faculty1
+  input Integer x;
+  output Integer y;
+algorithm
+  y := if x > 0 then Faculty1(x-1) else 1;
+end Faculty1;
Index: tags/v1_0_dk2/modeq/testsuite/Faculty2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Faculty2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Faculty2.mo	(revision 344)
@@ -0,0 +1,31 @@
+// name:     Faculty2
+// keywords: algorithm
+// status:   correct
+// 
+// Definition of faculty using a for loop. The for loop can not be
+// unrolled.
+//
+
+function Faculty2
+  input Integer x;
+  output Integer y;
+  Integer i;
+algorithm
+  y := 1;
+  for i in 2:x loop
+    y := i * y;
+  end for;
+end Faculty2;
+
+// fclass Faculty2
+//   Integer x;
+//   Integer y;
+//   Integer i;
+// equation
+// algorithm
+//   y := 1;
+//   for i in 2:x loop
+//     y := i * y;
+//   end for;
+// end Faculty2;
+
Index: tags/v1_0_dk2/modeq/testsuite/Faculty3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Faculty3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Faculty3.mo	(revision 344)
@@ -0,0 +1,35 @@
+// name:     Faculty3
+// keywords: algorithm
+// status:   correct
+// 
+// Definition of faculty using a while loop. The while loop can not be
+// unrolled.
+//
+
+function Faculty3
+  input Integer x;
+  output Integer y;
+  Integer i;
+algorithm
+  y := 1;
+  i := 2;
+  while (i <= x) loop
+    y := i * y;
+    i := i + 1;
+  end while;
+end Faculty3;
+
+// fclass Faculty3
+//   Integer x;
+//   Integer y;
+//   Integer i;
+// equation
+// algorithm
+//   y := 1;
+//   i := 2;
+//   while i <= x loop
+//     y := i * y;
+//     i := i + 1;
+//   end while;
+// end Faculty3;
+
Index: tags/v1_0_dk2/modeq/testsuite/Faculty4.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Faculty4.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Faculty4.mo	(revision 344)
@@ -0,0 +1,43 @@
+// name:     Faculty4
+// keywords: equation,array
+// status:   correct
+// 
+// Definition of faculty using equations. It is a matter of 
+// quality of implementation if the model can be treated with 
+// 'x' being a parameter. In the expected result given here 'x' 
+// is treated constant.
+//
+
+block Faculty4
+  parameter Integer x(min = 0) = 4;
+  Integer work[x];
+  output Integer y;
+equation
+  if x < 2 then
+    y = 1;
+  else
+    y = work[x];
+    work[x:-1:2] = work[x-1:-1:1] * (ones(x-1) + work[x-1:-1:1]);
+    work[1] = 1;
+  end if;
+end Faculty4;
+
+// fclass Faculty4
+//   parameter Integer x;
+//   parameter Integer x.min;
+//   Integer work[x];
+//   output Integer y;
+// equation
+//   x = 4;
+//   x.min = 0;
+//   if x < 2 then
+//     y = 1;
+//   else
+//     y = work[4];
+//     work[4] = work[3] * (1 + work[3]);
+//     work[3] = work[2] * (1 + work[2]);
+//     work[2] = work[1] * (1 + work[1]);
+//     work[1] = 1;
+//   end if;
+//   assert(x >= x.min);
+// end Faculty4;
Index: tags/v1_0_dk2/modeq/testsuite/Function1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Function1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Function1.mo	(revision 344)
@@ -0,0 +1,43 @@
+// name:     Function1
+// keywords: function
+// status:   correct
+// 
+// This tests basic function functionality
+
+function f
+  input Real x;
+  output Real r;
+algorithm
+  r := 2.0 * x;
+end f;
+
+model M
+  Real x, y, z;
+equation
+  x = f(z);
+  y = f(z);
+end M;
+
+// Variables:
+//
+//   variable real f#1.x
+//   variable real f#1.r
+//   variable real f#2.x
+//   variable real f#2.r
+//   variable real x
+//   variable real y
+//   variable real z
+//
+// Equations:
+//
+//   f#1.x = z
+//   f#1.r = x
+//   f#2.x = z
+//   f#2.r = y
+//
+// Algorithms:
+//
+//   f#1.r := 2.0 *(Real) f#1.x
+//
+//   f#2.r := 2.0 *(Real) f#2.x
+//
Index: tags/v1_0_dk2/modeq/testsuite/Integer2Real.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Integer2Real.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Integer2Real.mo	(revision 344)
@@ -0,0 +1,22 @@
+// name:     Integer2Real
+// keywords: type
+// status:   correct
+// 
+// Automatic conversion from Integer to Real.
+//
+
+class Integer2Real
+  Integer n;
+  Real a;
+equation
+  n = 5;
+  a = n / 2;
+end Integer2Real;
+
+// fclass Integer2Real
+//   Integer n;
+//   Real a;
+// equation
+//   n = 5;
+//   a = Real(n) / Real(2);
+// end Integer2Real;
Index: tags/v1_0_dk2/modeq/testsuite/Lookup1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Lookup1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Lookup1.mo	(revision 344)
@@ -0,0 +1,23 @@
+// name:     Lookup1
+// keywords: scoping
+// status:   correct
+// 
+// Names are looked up in a partially defined class.
+// 
+
+class Lookup1
+  constant Real a = 3.0;
+  class B
+    Real c = a;
+  end B;
+  B b;
+end Lookup1;
+
+// fclass Lookup1
+//   constant Real a;
+//   Real b.c;
+// equation
+//   a = 3.0;
+//   b.c = a;
+// end Lookup1;
+
Index: tags/v1_0_dk2/modeq/testsuite/Lookup2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Lookup2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Lookup2.mo	(revision 344)
@@ -0,0 +1,23 @@
+// name:     Lookup2
+// keywords: scoping
+// status:   incorrect
+// 
+// Lookup2 does not exists until it is completely defined.
+//
+
+class Lookup2
+  constant Real a = 3.0;
+  class B
+    Real c = Lookup2.a;
+  end B;
+  B b;
+end Lookup2;
+
+// fclass Lookup2
+//   Real a;
+//   Real c.b
+// equation
+//   a = 3.0;
+//   b.c = a;
+// end Lookup2;
+
Index: tags/v1_0_dk2/modeq/testsuite/Lookup3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Lookup3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Lookup3.mo	(revision 344)
@@ -0,0 +1,14 @@
+// name:     Lookup3
+// keywords: scoping
+// status:   incorrect
+// 
+// Non-constants in an outer scope can not be referred to.
+//
+
+class Lookup3
+  Real a = 3.0;
+  class B
+    Real c = a;
+  end B;
+  B b;
+end Lookup3;
Index: tags/v1_0_dk2/modeq/testsuite/Lookup4.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Lookup4.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Lookup4.mo	(revision 344)
@@ -0,0 +1,24 @@
+// name:     Lookup4
+// keywords: scoping
+// status:   correct
+// 
+// Constants can be referred to using names of previously defined
+// classes.
+//
+
+class Container
+  constant Real a = 3.0;
+end Container;
+
+class Lookup4
+  Real b = Container.a;
+end Lookup4;
+
+// fclass Lookup4
+//   constant Real Container.a;
+//   Real b
+// equation
+//   Container.a = 3.0;
+//   b = Container.a;
+// end Lookup4;
+
Index: tags/v1_0_dk2/modeq/testsuite/Lookup5.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Lookup5.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Lookup5.mo	(revision 344)
@@ -0,0 +1,24 @@
+// name:     Lookup5
+// keywords: scoping
+// status:   correct
+// 
+// Only fully declared elements (declaration ended by semicolon)
+// are known.
+//
+
+class Lookup5
+  constant Real a = 3.0;
+  class B
+    Real a = a;
+  end B;
+  B b;
+end Lookup5;
+
+// fclass Lookup5
+//   constant Real a;
+//   Real b.a;
+// equation
+//   a = 3.0;
+//   b.a = a;
+// end Lookup5;
+
Index: tags/v1_0_dk2/modeq/testsuite/Lookup6.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Lookup6.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Lookup6.mo	(revision 344)
@@ -0,0 +1,26 @@
+// name:     Lookup6
+// keywords: scoping
+// status:   correct
+// 
+// The constant 'a' is hidden in class 'B' after the declaration 
+// of 'B.a'.
+//
+
+class Lookup6
+  constant Real a = 3.0;
+  class B
+    Real a;
+  equation
+    a = a;
+  end B;
+  B b;
+end Lookup6;
+
+// fclass Lookup6
+//   constant Real a;
+//   Real b.a;
+// equation
+//   a = 3.0;
+//   b.a = b.a;
+// end Lookup6;
+
Index: tags/v1_0_dk2/modeq/testsuite/Makefile
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Makefile	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Makefile	(revision 344)
@@ -0,0 +1,67 @@
+TEST=./rtest
+
+TESTFILES=*.mo
+DOCFILES=modtest.texi cases.texi VERSION.texi
+DISTFILES=$(TESTFILES) VERSION modtest.texi \
+	Makefile rtest cases.texi index.html
+HTMLFILE=modtest_toc.html
+
+TEXI2DVI=texi2dvi
+TEXI2HTML=texi2html -split_chapter
+MAKEINFO=makeinfo
+
+VERSION = $(shell cat VERSION)
+
+.PHONY : default
+default : modtest.ps modtest.info $(HTMLFILE)
+
+.PHONY : test
+test :
+	@echo
+	@echo Running tests...
+	@echo
+	@$(TEST) $(TESTFILES)
+
+keywords :
+	$(TEST) -l $(TESTFILES)
+
+modtest.dvi : $(DOCFILES)
+	$(TEXI2DVI) $<
+
+modtest.ps : modtest.dvi
+	dvips -o $@ $<
+
+modtest.info : $(DOCFILES)
+	$(MAKEINFO) $<
+
+$(HTMLFILE) : $(DOCFILES)
+	$(TEXI2HTML) $<
+
+cases.texi : $(TESTFILES)
+	$(RM) $@
+	cases=`$(TEST) -L $(TESTFILES) | sort`; \
+	echo "@menu" >> $@; \
+	for c in $$cases; do echo "* $$c::" >> $@; done; \
+	echo "@end menu" >> $@; \
+	set "Test Cases" $$cases ""; \
+	while [ "$$2" != "" ] ; do \
+		echo ""                 	    >> $@; \
+		echo "@page"                        >> $@; \
+		echo "@node $$2,$$3,$$1,Test Cases" >> $@; \
+		echo "@appendixsec $$2" 	    >> $@; \
+		echo "@example"         	    >> $@; \
+		echo "@include $$2.mo"  	    >> $@; \
+		echo "@end example"     	    >> $@; \
+		shift ; \
+	done
+
+VERSION.texi : VERSION
+	sed -e 's/^\(.*\)$$/@set VERSION \1/' < $< > $@
+
+.PHONY : dist
+dist : $(DISTFILES)
+	mkdir modtest-$(VERSION)
+	cp $(DISTFILES) modtest-$(VERSION)
+	tar cvf modtest-$(VERSION).tar modtest-$(VERSION)
+	gzip -9 modtest-$(VERSION).tar
+	$(RM) -r modtest-$(VERSION)
Index: tags/v1_0_dk2/modeq/testsuite/Modelica.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Modelica.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Modelica.mo	(revision 344)
@@ -0,0 +1,653 @@
+/*
+   Modelica Standard Library
+   (Modelica Language Definition, Version 1, September 97)
+*/
+
+package Modelica
+/* The Modelica package is a standardized, pre-defined package,
+   that is shipped together with a Modelica translator. The package
+   provides constants, types, connectors, partial models and some
+   often used model components in various disciplines. Especially,
+   the following sub-packages are available:
+
+   SIunit   : Types defining SIunits of ISO 1000.
+   Constant : Mathematical and physical constants.
+   Interface: Basic interfaces in various disciplines
+   Signal   : Real and Boolean signal generators.
+
+
+   The following conventions are used in the whole package:
+
+   - Class and instance names are written in upper and lower case
+   letters, e.g., "ElectricCurrent". An underscore is only used 
+   at the end of a name to characterize a lower or upper index,
+   e.g., body_low_up.
+
+   - Type names start always with an upper case letter. Instance names start
+   always with a lower case letter with only a few exceptions according to
+   common engineering practice, such as "T" for a temperature instance.
+
+   - Usually, SIunits are used via pre-defined SIunit types.
+
+   - Preferred instance names for connectors:
+   p,n: positive and negative side of a partial model.
+   a,b: side "a" and side "b" of partial model,
+   if the two connectors are completely equivalent.
+*/
+
+
+package SIunit
+
+/* This package provides predefined types based on the international standard
+   on units (ISO 31-1992 "General principles concerning quantities, units and
+   symbols" and ISO 1000-1992 "SI units and recommendations for the use of
+   their multiples and of certain other units"). The ordering of the type
+   declarations follows ISO 31. The naming of  the types follows the following 
+   convention:
+
+   - Modelica quantity names are defined according to the recommendations of
+   ISO 31. Some of these name are rather long, such as 
+   "ThermodynamicTemperature". Shorter alias names are defined in
+   appropriate subpackages, e.g., "type Temp_K = ThermodynamicTemperature;".   
+
+   - Modelica units are defined according to the SI base units without
+   multiples (only exception "kg").
+
+   - For some quantities, more convenient units for an engineer are defined as 
+   "displayUnit", i.e., the default unit for display purposes
+   (e.g., displayUnit="deg" for quantity="Angle"). 
+
+   - The type name is identical to the quantity name, following
+   the convention of type names.
+   
+   - All quantity and unit attributes are defined as final in order
+   that they cannot be redefined to another value.
+
+   - Some quantities, which are obviously also important but are not
+   explicitly mentioned in the ISO 1000 standard, such as 
+   "AngularAcceleration", are also included.
+*/
+
+// Part 1: Space and time
+type Angle               = Real(final quantity="Angle",
+				final unit    ="rad", 
+				Displayunit   ="deg");
+type SolidAngle          = Real(final quantity="SolidAngle",
+				final unit    ="sr"); 
+type Length              = Real(final quantity="Length",
+				final unit    ="m");
+type Area                = Real(final quantity="Area",
+				final unit    ="m2");
+type Volume              = Real(final quantity="Volume",
+				final unit    ="m3");
+type Time                = Real(final quantity="Time", 
+				final unit    ="s");
+type AngularVelocity     = Real(final quantity="AngularVelocity",
+				final unit    ="rad/s");
+type Velocity            = Real(final quantity="Velocity",
+				final unit    ="m/s");
+type AngularAcceleration = Real(final quantity="AngularAcceleration",
+				final unit    ="rad/s2");
+type Acceleration        = Real(final quantity="Acceleration",
+				final unit    ="m/s2");
+
+// Part 2: Periodic and related phenomens
+//...
+
+// Part 3: Mechanics
+type Mass               = Real(final quantity="Mass",
+			       final unit    ="kg", min=0);
+type Density            = Real(final quantity="Density",
+			       final unit    ="kg/m3", min=0);
+type LinearDensity      = Real(final quantity="LinearDensity",
+			       final unit    ="kg/m", min=0);
+type MomentOfInertia    = Real(final quantity="MomentOfInertia",
+			       final unit    ="kg*m^2");
+type Momentum           = Real(final quantity="Mass",
+			       final unit    ="kg.m/s");
+type Force              = Real(final quantity="Force",
+			       final unit    ="N");
+type AngularMomentum    = Real(final quantity="Mass",
+			       final unit    ="kg.m2/s");
+type MomentOfForce      = Real(final quantity="MomentOfForce",
+			       final unit    ="N.m");
+type Pressure           = Real(final quantity="Pressure",
+			       final unit    ="Pa", min=0);
+type NormalStress       = Real(final quantity="NormalStress",
+			       final unit    ="Pa");
+type DynamicViscosity   = Real(final quantity="DynamicViscosity",
+			       final unit    ="Pa.s", min=0);
+type KinematicViscosity = Real(final quantity="KinematicViscosity",
+			       final unit    ="m2/s", min=0);
+type SurfaceTension     = Real(final quantity="SurfaceTension",
+			       final unit    ="N/m");
+type Energy             = Real(final quantity="Energy",
+			       final unit    ="J");
+type Power              = Real(final quantity="Power",
+			       final unit    ="W");
+
+// Part 4: Heat
+type ThermodynamicTemperature = Real(final quantity="ThermodynamicTemperature",
+				     final unit    ="K", min=0,
+				     Displayunit   ="degC");
+type CelsiusTemperature       = Real(final quantity="CelsiusTemperature",
+				     final unit    ="degC", min = -273.15);
+
+type LinearExpansionCoefficient       = Real(final quantity=" LinearExpansionCoefficient",
+					     final unit ="1/K");
+type CubicExpansionCoefficient        = Real(final quantity="CubicExpansionCoefficient",
+					     final unit ="1/K");
+type RelativePressureCoefficient      = Real(final quantity="RelativePressureCoefficient",
+					     final unit ="1/K");
+type PressureCoefficient              = Real(final quantity="PressureCoefficient",
+					     final unit ="Pa/K");
+type IsothermalCompressibility        = Real(final quantity="IsothermalCompressibility",
+					     final unit ="1/Pa");
+type IsentropicCompressibility        = Real(final quantity="IsentropicCompressibility",
+					     final unit ="1/Pa");
+type Heat                             = Energy;
+type HeatFlowRate                     = Real(final quantity="HeatFlowRate",
+					     final unit ="W");
+type DensityOfHeatFlowRate            = Real(final quantity="DensityOfHeatFlowRate",
+					     final unit ="W/m^2");
+type ThermalConductivity              = Real(final quantity="ThermalConductivity",
+					     final unit ="W/(m.K)");
+type CoefficientOfHeatTransfer        = Real(final quantity="CoefficientOfHeatTransfer",
+					     final unit ="W/(m^2.K)");
+type SurfaceCoefficientOfHeatTransfer = Real(final quantity="SurfaceCoefficientOfHeatTransfer",
+					     final unit ="W/(m^2.K)");
+type ThermalInsulance                 = Real(final quantity="ThermalInsulance",
+					     final unit ="m^2.K/W");
+type ThermalResistance                = Real(final quantity="ThermalResistance",
+					     final unit ="K/W");
+type ThermalConductance               = Real(final quantity="ThermalConductance",
+					     final unit ="W/K");
+type ThermalDiffusivity               = Real(final quantity="ThermalDiffusivity",
+					     final unit ="m^2/s");
+type HeatCapacity                     = Real(final quantity="HeatCapacity",
+					     final unit ="J/K");
+type SpecificHeatCapacity             = Real(final quantity="SpecificHeatCapacity",
+					     final unit ="J/(kg.K)");
+
+/* The specific heat capacity is most often taken in a "direction"
+   i. e. at constant pressure or constant volume. which one is meant 
+   should be specified in the appropriate aliases
+*/
+
+type RatioOfSpecificHeatCapacities = Real(final quantity="RatioOfSpecificHeatCapacities",
+					  final unit ="1");
+type IsentropicExponent            = Real(final quantity="IsentropicExponent",
+					  final unit ="1");
+type Entropy                       = Real(final quantity="Entropy",
+					  final unit ="J/K");
+type SpecificEntropy               = Real(final quantity="SpecificEntropy",
+					  final unit ="J/(kg.K)");
+type SpecificEnergy                = Real(final quantity="SpecificEnergy",
+					  final unit ="J/kg");
+
+/* In thermodynamics, energy comes in many flavors. The ones defined by the ISO 
+   are defined as aliases to the basic one. All of these energy forms are also 
+   defined in a specific, i. e. divided by mass version.
+*/
+
+type ThermodynamicEnergy         = Energy;
+type HelmholtzFreeEnergy         = Energy;
+type GibbsFreeEnergy             = Energy;
+type Enthalpy                    = Energy;
+
+type SpecificThermodynamicEnergy = SpecificEnergy;
+type SpecificHelmholtzFreeEnergy = SpecificEnergy;
+type SpecificGibbsFreeEnergy     = SpecificEnergy;
+type SpecificEnthalpy            = SpecificEnergy;
+
+
+type PlanckFunction  = Real(final quantity="PlanckFunction",
+			    final unit ="J/kg");
+
+
+// Part 5: Electricity and magnetism
+type ElectricCurrent   = Real(final quantity="ElectricCurrent",
+			      final unit    ="A");
+type ElectricCharge    = Real(final quantity="ElectricCharge",
+			      final unit    ="C");
+type ElectricPotential = Real(final quantity="ElectricPotential",
+			      final unit    ="V");
+type Capacitance       = Real(final quantity="Capacitance",
+			      final unit    ="F", min=0);
+type Inductance        = Real(final quantity="Inductance",
+			      final unit    ="H", min=0);
+type Resistance        = Real(final quantity="Resistance",
+			      final unit    ="Ohm", min=0);
+type Conductance       = Real(final quantity="Conductance",
+			      final unit    ="S", min=0);
+//...
+
+
+// Part 6: Light and related electromagnetic radiations
+type LuminousIntensity = Real(final quantity="LuminousIntensity",
+			      final unit    ="cd");
+//...
+
+// Part 7: Acoustics
+//...
+
+// Part 8: Physical chemistry and molecular physics
+type AmountOfSubstance = Real(final quantity="AmountOfSubstance",
+			      final unit    ="mol", min=0);
+//...
+
+// Part 9: Atomic and nuclear physics
+//...
+
+// Part 10: Nuclear reactions and ionizing radiations
+//...
+
+// Part 11: Characteristic numbers
+// Momentum transport
+type ReynoldsNumber = Real(final quantity="ReynoldsNumber",
+			   final unit ="1"); 
+type EulerNumber    = Real(final quantity="EulerNumber",
+			   final unit ="1");
+type FroudeNumber   = Real(final quantity="FroudeNumber",
+			   final unit ="1");
+type GrashofNumber  = Real(final quantity="GrashofNumber",
+			   final unit ="1");
+type WeberNumber    = Real(final quantity="WeberNumber",
+			   final unit ="1");
+type MachNumber     = Real(final quantity="MachNumber",
+			   final unit ="1");
+type KnudsenNumber  = Real(final quantity="KnudsenNumber",
+			   final unit ="1");
+type StrouhalNumber = Real(final quantity="StrouhalNumber",
+			   final unit ="1");
+
+// Transport of heat
+type FourierNumber  = Real(final quantity="FourierNumber",
+			   final unit ="1");
+type PecletNumber   = Real(final quantity="PecletNumber",
+			   final unit ="1");
+type RayleighNumber = Real(final quantity="RayleighNumber",
+			   final unit ="1");
+type NusseltNumber  = Real(final quantity="NusseltNumber",
+			   final unit ="1");
+type BiotNumber     = NusseltNumber;   // The name Biot number, Bi, is used
+				       // when the Nusselt number is reserved
+				       // for convective transport of heat.
+type StantonNumber  = Real(final quantity="StantonNumber",
+			   final unit ="1");
+
+// Constants of matter
+type PrandtlNumber = Real(final quantity="PrandtlNumber",
+			  final unit ="1");
+type SchmidtNumber = Real(final quantity="SchmidtNumber",
+			  final unit ="1");
+type LewisNumber   = Real(final quantity="Number",
+			  final unit ="1");
+
+// Part 12: Solid state physics
+//...
+
+end SIunit;
+
+
+package Constant
+
+/* This package provides often needed constants */
+extends SIunit;
+
+// Mathematical constants
+constant Real PI = 3.14159265358979;
+constant Real E  = 2.71828182845904;
+
+/* Constants of nature 
+   (from: E.R. Cohen, and B.N. Taylor: The 1986 Adjustment of the Fundamental
+   Physical Constants, CODATA Bulletin, Pergamon: Elmsford, NY, 1986.
+   see also: http://physics.nist.gov/PhysRefData/codata86/article.html
+   http://physics.nist.gov/PhysRefData/codata86/codata86.html)
+*/
+
+constant Real         N_A     (final unit="mol-1")
+  = 6.0221367e23  "Avogadro constant";
+constant Velocity     C       = 299792458     "Velocity of light in vacuum";
+constant Real         G       (final unit="m3.kg-1.s-2")
+  = 6.67259e-11   "Universal gravity constant";
+constant Acceleration G_EARTH = 9.81          "Gravity acceleration on earth";
+constant Real         H       (final unit="J.s")
+  = 6.6260755e-34 "Plancks constant";
+constant Real         K       (final unit="J.K-1") 
+  = 1.380658e-23  "Boltzmann constant";
+constant Real         R0      (final unit="J.mol-1.K-1")
+  = 8.314510      "Universal gas constant";
+constant Real         SIGMA   (final unit="W.m-2.K-4")
+  = 5.67051e-8    "Stefan Boltzmann constant";
+constant Real         T_ZERO  (final unit="degC")
+  = -273.15       "Absolute zero temperature";
+// ...
+
+end Constant;
+
+
+package Interface
+
+/* This package provides interface definitions, i.e.,types, connectors and
+   partial models, in various disciplines. It is organized in sub-packages:
+
+   Block        : Interfaces for input/output blocks.
+   BondGraph    : Interfaces for bondgraphs.
+   Electric     : Interfaces for electric systems.
+   Mechanic     : Interfaces for mechanic systems.
+   Thermodynamic: Interfaces for thermodynamic systems.
+*/
+
+
+package Block
+
+/* This package provides types, connectors and partial models for
+   input/output blocks.
+*/
+extends SIunit;
+
+// Partial models for continuous input/output control blocks
+partial block SISO "Single input, single output (continuous) block"
+  input  Real u  "Input signal";
+  output Real y  "Output signal";
+end SISO;
+
+partial block MISO "Multiple input, single output (continuous) block"
+  input  Real u[:]  "Input signal vector";
+  output Real y    "Output signal";
+end MISO;
+
+partial block MIMO "Multiple input, multiple output (continuous) block"
+  input  Real u[:]  "Input signal vector";
+  output Real y[:]  "Output signal vector";
+end MIMO;
+
+partial block MIMOs "Multiple input, single output (continuous) block"
+		    "with equal number of inputs and outputs"
+  input  Real u[:]           "Input signal vector";
+  output Real y[size(u,1)]  "Output signal vector";
+end MIMOs;
+
+partial block SO "Single output (continuous) block"
+  output Real y  "Output signal";
+end SO;
+
+partial block MO "Multiple output (continuous) block"
+  output Real y[:]  "Output signal vector";
+end MO;
+
+// Partial models for Boolean input/output blocks
+partial block SISOb "Single input, single output (Boolean) block"
+  input  Boolean u  "Input signal";
+  output Boolean y  "Output signal";
+end SISOb;
+
+partial block MISOb "Multiple input, single output (Boolean) block"
+  input  Boolean u[:]  "Input signal vector";
+  output Boolean y    "Output signal";
+end MISOb;
+
+partial block MIMOb "Multiple input, multiple output (Boolean) block"
+  input  Boolean u[:]  "Input signal vector";
+  output Boolean y[:]  "Output signal vector";
+end MIMOb;
+
+partial block MIMOsb "Multiple input, single output (Boolean) block"
+		     "with equal number of inputs and outputs"
+  input  Boolean u[:]           "Input signal vector";
+  output Boolean y[size(u,1)]  "Output signal vector";
+end MIMOsb;
+
+partial block SOb "Single output (Boolean) block"
+  output Boolean y  "Output signal";
+end SOb;
+
+partial block MOb "Multiple output (Boolean) block"
+  output Boolean y[:]  "Output signal vector";
+end MOb;
+end Block;
+
+
+
+package BondGraph
+
+/* This package provides types, connectors and partial models for 
+   bond graphs
+*/
+extends SIunit;
+
+// Bond Graph power connector. 
+// Both effort and flow are "across" variables. 
+
+connector BondPort "Bond Graph power port"
+  Real e  "Effort variable";
+  Real f  "Flow variable";
+end BondPort;
+
+partial model OnePortPassive "One port passive bond graph element"
+  BondPort p "Generic power port p";
+equation
+  assert(cardinality(p)==1, "Power ports have only one edge connected to");
+  assert(direction(p)  ==1, "Power direction towards element for passivity");
+end OnePortPassive;
+
+partial model OnePortEnergetic "One port storage element, being passive"
+  extends OnePortPassive;
+
+  Real state "Conserved quantity";
+end OnePortEnergetic;
+
+partial model OnePortActive "One port active bond graph element: the sources"
+  BondPort p;
+equation
+  assert(cardinality(p)== 1, "Power ports have only one edge connected to");
+  assert(direction(p)  ==-1, "Power direction from the element for active elements");
+end OnePortActive;
+
+partial model TwoPortPassive "Two port passive bond graph element"
+  BondPort PowIn, PowOut;
+equation
+  assert(cardinality(Powin) == 1, "Power ports have only one edge connected to");
+  assert(direction  (PowIn) ==+1, "power direction towards the element for passivity");
+  assert(cardinality(Powout)== 1, "Power ports have only one edge connected to");
+  assert(direction  (PowOut)==-1, "Power direction from the element for passivity");
+end TwoPortPassive;
+
+end BondGraph;
+
+
+
+package Electric
+
+/* This package providestypes, connectors and partial models for
+   the electric domain.
+*/
+extends SIunit;
+
+// Commonly used short names for electric types
+type Current = ElectricCurrent;
+type Charge  = ElectricCharge;
+type Voltage = ElectricPotential;
+
+// Connector types for electric components
+connector Pin "Pin of an electric component"
+  Voltage      v  "Potential at the pin";
+  flow Current i  "Current flowing into the pin";
+end Pin;
+
+// Partial models for electric components
+partial model TwoPin "Component with two electric pins"
+  Pin     p  "Positive pin";
+  Pin     n  "Negative pin";
+  Voltage v  "Voltage drop between the two pins";
+equation
+  v = p.v - n.v;
+end TwoPin;
+
+partial model TwoPort "Component with two electric ports"
+  Pin     pl  "Positive pin of the left port";
+  Pin     nl  "Negative pin of the left port";
+  Pin     pr  "Positive pin of the right port";
+  Pin     nr  "Negative pin of the right port";
+  Voltage vl  "Voltage drop over the left port";
+  Voltage vr  "Voltage drop over the right port";
+equation
+  vl = pl.v - nl.v;
+  vr = pr.v - nr.v;
+end TwoPort;
+end Electric;
+
+
+
+package Mechanic
+
+/* This package provides types, connectors and partial models for
+   the mechanic domain.
+*/
+extends SIunit;
+
+// Commonly used short names for mechanic types
+type Position = Length;
+type Distance = Length(final min=0);
+type Inertia  = MomentOfInertia;
+type Torque   = MomentOfForce;
+
+// Connector types for mechanic components
+connector TransVel  "1D translational mechanical flange cut on velocity level."
+  Velocity   v  "Absolute velocity of the flange with respect to base";
+  flow Force f  "Cut-force directed into the flange to drive it";
+end TransVel;
+
+connector DriveVel  "1D rotational mechanical flange cut on velocity level."
+  AngularVelocity w  "Absolute angular velocity of flange with respect to base";
+  flow Torque     t  "Cut-torque directed into the flange to drive it";
+end DriveVel;
+
+connector TransPos "1D translational mechanical flange cut" 
+  Position     s  "Absolute position of flange with respect to base";
+  Velocity     v  "Absolute velocity of flange with respect to base";
+  Acceleration a  "Absolute acceleration of flange with respect to base";
+  flow Force   f  "Cut-force directed into flange to drive it";
+end TransPos;
+
+connector DrivePos "1D rotational mechanical flange cut"
+		   "for positional drive trains."
+  Angle               r  "Absolute rotation angle of flange cut with respect to base";
+  AngularVelocity     w  "Absolute angular velocity of flange with respect to base";
+  AngularAcceleration a  "Absolute angular acceleration of flange with "
+			 "respect to base";
+  flow Torque         t  "Cut-torque directed into flange to drive it";
+end DrivePos;
+
+connector CutFrame "3D mechanical cut-frame for multibody systems" 
+  Real                S[3,3] "Rotation matrix describing the cut-frame "
+			     "with respect to the inertial frame";
+  Position            r0[3]  "Vector from the origin of the inertial frame to the "
+			     "origin of the cut-frame, resolved in the inertial frame";
+  Velocity            v[3]   "Absolute translational velocity of the cut-frame, "
+			     "resolved in the cut-frame ( v = S'*der(r0) )";
+  AngularVelocity     w[3]   "Absolute angular velocity of the cut-frame, "
+			     "resolved in the cut-frame ( w = vec(S'*der(S)) )";
+  Acceleration        a[3]   "Absolute translational acceleration of the cut-frame, "
+			     "resolved in the cut-frame ( a = S'*der(S*v) )";
+  AngularAcceleration z[3]   "Absolute angular acceleration of the cut-frame, "
+			     "resolved in the cut-frame ( z = S'*der(S*w) )";
+  flow Force          f[3]   "Resultant cut-force acting at the origin of the "
+			     "cut-frame, resolved in the cut-frame";
+  flow Torque         t[3]   "Resultant cut-torque with respect to the origin of the "
+			     "cut-frame, resolved in the cut-frame";
+end CutFrame;
+
+// Partial models for mechanic components
+partial model TransVel2 "1D translational component with two cuts" 
+  TransVel a  "Cut a of component";
+  TransVel b  "Cut b of component";
+end TransVel2;
+
+partial model DriveVel2 "1D rotational component with two cuts" 
+  DriveVel a  "Flange a of component";
+  DriveVel b  "Flange b of component";
+end DriveVel2;
+
+partial model TransPos2 "1D translational component with two cuts" 
+			"for positional drive trains."
+  TransPos a  "Cut a of component";
+  TransPos b  "Cut b of component";
+end TransPos2;
+
+partial model DrivePos2 "1D rotational component with two cuts" 
+			"for positional drive trains."
+  DrivePos a  "Flange a of component";
+  DrivePos b  "Flange b of component";
+end DrivePos2;
+
+partial model CutFrame2 "Multi-body system component with two cut frames" 
+  CutFrame a  "cut frame a";
+  CutFrame b  "cut frame b";
+end CutFrame2;
+end Mechanic;
+
+
+
+package Thermodynamic
+
+/* Connector types for thermodynamical components. This is a minimum 
+   set! Defining more is not difficult, but only useful if a library 
+   based on them is provided as well. Shorthands for basic types 
+   used here are provided as well.
+*/
+
+// Short hands
+type HeatFlux = HeatFlowRate;
+type Temp_K   = ThermodynamicTemperature;
+type Temp_C   = CelsiusTemperature;
+
+// connectors
+connector TQ  "Heat exchange interface"
+  Temp_C         T  "Temperature";
+  flow HeatFlux  q  "Transported heat into interface";
+end TQ;
+
+connector MT  "Single directional flow of tempered fluid, no pressure"
+  flow MassFlow  m_dot  "Massflow into port";
+  Temp_C         T      "Fluid temperature";
+end MT;
+
+connector PM  "Bidirectional flow of a fluid"
+  Pressure       p      "Fluid total pressure";
+  flow MassFlow  m_dot  "Massflow into port";
+end PM;
+
+connector PMT  "Single directional flow of tempered fluid"
+  Pressure       p      "Fluid total pressure";
+  flow MassFlow  m_dot  "Massflow into port";
+  Temp_C         T      "Fluid temperature";
+end PMT;
+
+connector PMH  "Single directional flow of tempered fluid"
+  Pressure          p      "Fluid total pressure";
+  flow MassFlow     m_dot  "Massflow into port";
+  SpecificEnthalpy  h      "Fluid enthalpy";
+end PMH;
+
+connector PMTQ  "Bidirectional flow of tempered fluid"
+  Pressure       p       "Fluid total pressure";
+  flow MassFlow  m_dot   "Massflow into port";
+  Temp_C         T       "Fluid temperature";
+  flow HeatFlux  q       "Heat convected by fluid into port";
+end PMTQ;
+
+connector PMHQ  "Bidirectional flow of tempered fluid"
+  Pressure          p      "Fluid total pressure";
+  flow Massflow     m_dot  "Massflow into port";
+  SpecificEnthalpy  h      "Fluid enthalpy";
+  flow HeatFlux     q      "Heat convected by fluid into port";
+end PMHQ;
+
+end Thermodynamic;
+
+
+end Interface;
+
+end Modelica;
Index: tags/v1_0_dk2/modeq/testsuite/Modification1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Modification1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Modification1.mo	(revision 344)
@@ -0,0 +1,36 @@
+// name:     Modification1
+// keywords: modification
+// status:   correct
+// 
+// This file tests simple modifications of variables
+//
+
+type Real = RealType;
+
+model Motor
+
+  model Foo
+    parameter Real q;
+  end Foo;
+  
+  parameter Real j = 1.0;
+  Foo f(q=2.0);
+
+end Motor;
+
+model Modification1
+  Motor m(j = 3.0);
+  Motor n(f(q=5.0));
+end Modification1;
+
+// fclass Modification1
+//   parameter Real m.j;
+//   parameter Real m.f.q;
+//   parameter Real n.j;
+//   parameter Real n.f.q;
+// equation
+//   m.j   = 3.0;
+//   m.f.q = 2.0;
+//   n.j   = 1.0;
+//   n.f.q = 5.0;
+// end Modification1;
Index: tags/v1_0_dk2/modeq/testsuite/Modification10.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Modification10.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Modification10.mo	(revision 344)
@@ -0,0 +1,31 @@
+// name:     Modification10
+// keywords: modification,unknown
+// status:   correct
+// 
+// This tests some of the hairy consequenxes of class modifications.
+// 
+
+class B
+  Real x = 1.0;
+end B;
+
+class C
+  B b;
+end C;
+
+class A
+  C c;
+  B b;
+end A;
+
+class Modification10
+  A a(B(x = 17.0));
+end Modification10;
+
+// fclass Modification10
+//   Real    a.c.b.x;
+//   Real    a.b.x;
+// equation
+//   a.c.b.x = 17.0;
+//   a.b.x = 17.0;
+// end Modification10;
Index: tags/v1_0_dk2/modeq/testsuite/Modification11.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Modification11.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Modification11.mo	(revision 344)
@@ -0,0 +1,27 @@
+// name:     Modification11
+// keywords: modification,unknown
+// status:   correct
+// 
+// This tests some of the hairy consequenxes of class modifications.
+// 
+
+class B
+  Real x = 1.0;
+end B;
+
+class A
+  B b;
+  B B;
+end A;
+
+class Modification10
+  A a(B(x = 17.0));
+end Modification10;
+
+// fclass Modification11
+//   Real    a.c.b.x;
+//   Real    a.b.x;
+// equation
+//   a.b.x = 17.0;
+//   a.B.x = 17.0;
+// end Modification11;
Index: tags/v1_0_dk2/modeq/testsuite/Modification2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Modification2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Modification2.mo	(revision 344)
@@ -0,0 +1,22 @@
+// name:     Modification2
+// keywords: modification
+// status:   correct
+// 
+
+class A
+  parameter Real p=1.0;
+end A;
+
+class B
+  A a;
+end B;
+
+class Modification2
+  B b(A(p=2.0));
+end Modification2;
+
+// fclass Modification2
+//   parameter Real b.a.p;
+// equation
+//   b.a.p = 2.0;
+// end Modification2;
Index: tags/v1_0_dk2/modeq/testsuite/Modification3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Modification3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Modification3.mo	(revision 344)
@@ -0,0 +1,25 @@
+// name:     Modification3
+// keywords: modification
+// status:   correct
+
+
+class A
+  class AA
+    parameter Real p=1.0;
+  end AA;
+  AA aa;
+end A;
+
+class B
+  A a;
+end B;
+
+class Modification3
+  B b(A.AA(p=2.0));
+end Modification3;
+
+// fclass Modification3
+//   parameter Real b.a.aa.p;
+// equation
+//   b.a.aa.p = 2.0;
+// end Modification3;
Index: tags/v1_0_dk2/modeq/testsuite/Modification4.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Modification4.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Modification4.mo	(revision 344)
@@ -0,0 +1,25 @@
+// name:     Modification4
+// keywords: modification
+// status:   correct
+
+class A
+  class AA
+    parameter Integer p=1;
+  end AA;
+  Integer x = AA.p;
+end A;
+
+class B
+  A a;
+end B;
+
+class Modification4
+  B b(A.AA(p=2));
+end Modification4;
+
+// fclass Modification4;
+// equation
+//   b.a.x = 2
+// end Modification4;
+//
+// Or what? How would the paramter be described?
Index: tags/v1_0_dk2/modeq/testsuite/Modification5.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Modification5.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Modification5.mo	(revision 344)
@@ -0,0 +1,19 @@
+// name:     Modification5
+// keywords: modification,scoping,unknown
+// status:   incorrect
+//
+// This file tests equation modifications, and in particular what
+// happens if the variable is being used on the right-hand side.
+//
+// I don't think this is an error, so no error or warning message
+// should be produced. The type checker should, for instance know how
+// the variable is declared.
+
+class A
+  Real x = 17 + x;
+end A;
+
+// fclass Modification5
+// equation
+//   x = real(17) +(real) x
+// end Modification5;
Index: tags/v1_0_dk2/modeq/testsuite/Modification6.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Modification6.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Modification6.mo	(revision 344)
@@ -0,0 +1,26 @@
+// name:     Modification6
+// keywords: modification,unknown
+// status:   correct
+// 
+// This file tests modification precedence.
+//
+
+model Motor
+  model Foo
+    parameter Real q = 1.0;
+  end Foo;
+  Foo f(q=2.0);
+end Motor;
+
+model Modification1
+  Motor m1(Foo(q=3.0), f(q=4.0));
+  Motor m2(f(q=4.0), Foo(q=3.0));
+end Modification1;
+
+// fclass Modification1
+//   parameter Real m1.f.q;
+//   parameter Real m2.f.q;
+// equation
+//   m1.f.q = 3.0;
+//   m2.f.q = 3.0;
+// end Modification1;
Index: tags/v1_0_dk2/modeq/testsuite/Modification7.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Modification7.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Modification7.mo	(revision 344)
@@ -0,0 +1,29 @@
+// name:     Modification7
+// keywords: modification
+// status:   correct
+// 
+// This test checks that two modification of subsubcomponents are both
+// taken care of. 
+// 
+
+class Modification7
+  class A
+    Real x,y;
+  end A;
+  class B
+    A a;
+  end B;
+
+  // This could be written as
+  //   B b(a(x = 1.0, y = 2.0))
+  // This tests whether it works in the following way too.
+  B b(a.x = 1.0, a.y = 2.0);
+end Modification7;
+
+// fclass Modification7
+//   Real b.a.x;
+//   Real b.a.y;
+// equation
+//   b.a.x = 1.0;
+//   b.a.y = 2.0;
+// end Modification7;
Index: tags/v1_0_dk2/modeq/testsuite/Modification8.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Modification8.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Modification8.mo	(revision 344)
@@ -0,0 +1,20 @@
+// name:     Modification8
+// keywords: modification
+// status:   incorrect
+// 
+// Either this is a priority issue, or it is incorrect.  The
+// Manchester minutes says it's incorrect to have two modifiers for
+// the same component.
+//
+// I'm not convinced that it is even possible to enforce this rule.
+// 
+
+class Modification8
+  class A
+    Real x;
+  end A;
+  class B
+    A a;
+  end B;
+  B b(a.x = 1.0, a(x = 2.0));
+end Modification8;
Index: tags/v1_0_dk2/modeq/testsuite/Modification9.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Modification9.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Modification9.mo	(revision 344)
@@ -0,0 +1,12 @@
+// name:     Modification9
+// keywords: modification,equation,array
+// status:   incorrect
+// 
+// Two arguments of a modifier shall not designate the same element.
+//
+
+class E
+  Real x[3,3] = zeros(3,3);
+end E;
+
+class Overwriting4 = E(x=eye(3), x[1]=2); // Error: x[1] defined twice
Index: tags/v1_0_dk2/modeq/testsuite/ModifyConstant1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ModifyConstant1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ModifyConstant1.mo	(revision 344)
@@ -0,0 +1,31 @@
+// name:     ModifyConstant1
+// keywords: scoping,modification
+// status:   correct
+// 
+// Constants can be redeclared.
+//
+
+class A
+  constant Real c = 1.0;
+end A;
+
+class B
+  A a(redeclare constant Real c = 2.0);
+end B;
+
+class C
+  A a;
+end C;
+
+class ModifyConstant1
+  B b;
+  C c;
+end ModifyConstant1;
+
+// fclass ModifyConstant1
+//   constant Real b.a.c;
+//   constant Real c.a.c;
+// equation
+//   b.a.c = 2.0;
+//   c.a.c = 1.0;
+// end ModifyConstant1;
Index: tags/v1_0_dk2/modeq/testsuite/ModifyConstant2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ModifyConstant2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ModifyConstant2.mo	(revision 344)
@@ -0,0 +1,31 @@
+// name:     ModifyConstant2
+// keywords: scoping,modification
+// status:   correct
+// 
+// Constant values may be changed in modifications.
+//
+
+class A
+  constant Real c = 1.0;
+end A;
+
+class B
+  A a(c = 2.0);
+end B;
+
+class C
+  A a;
+end C;
+
+class ModifyConstant2
+  B b;
+  C c;
+end ModifyConstant2;
+
+// fclass ModifyConstant2
+//   constant Real b.a.c;
+//   constant Real c.a.c;
+// equation
+//   b.a.c = 2.0;
+//   c.a.c = 1.0;
+// end ModifyConstant2;
Index: tags/v1_0_dk2/modeq/testsuite/ModifyConstant3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ModifyConstant3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ModifyConstant3.mo	(revision 344)
@@ -0,0 +1,24 @@
+// name:     ModifyConstant3
+// keywords: scoping,modification
+// status:   incorrect
+// 
+// Only declared members may be redeclared. Using A.c in a redeclaration 
+// is a syntactic error.
+//
+
+class A
+  constant Real c = 1.0;
+end A;
+
+class B
+  A a(redeclare constant Real A.c = 2.0);
+end B;
+
+class C
+  A a;
+end C;
+
+class ModifyConstant3
+  B b;
+  C c;
+end ModifyConstant3;
Index: tags/v1_0_dk2/modeq/testsuite/ModifyConstant4.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ModifyConstant4.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ModifyConstant4.mo	(revision 344)
@@ -0,0 +1,23 @@
+// name:     ModifyConstant4
+// keywords: scoping,modification
+// status:   incorrect
+// 
+// Only members may be modified.
+//
+
+class A
+  constant Real c = 1.0;
+end A;
+
+class B
+  A a(A.c = 2.0);
+end B;
+
+class C
+  A a;
+end C;
+
+class ModifyConstant4
+  B b;
+  C c;
+end ModifyConstant4;
Index: tags/v1_0_dk2/modeq/testsuite/ModifyConstant5.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ModifyConstant5.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ModifyConstant5.mo	(revision 344)
@@ -0,0 +1,23 @@
+// name:     ModifyConstant5
+// keywords: scoping,modification
+// status:   incorrect
+//
+// Finalized members can not be redeclared.
+//
+
+class A
+  final constant Real c = 1.0;
+end A;
+
+class B
+  A a(redeclare constant Real c = 2.0);
+end B;
+
+class C
+  A a;
+end C;
+
+class ModifyConstant5
+  B b;
+  C c;
+end ModifyConstant5;
Index: tags/v1_0_dk2/modeq/testsuite/ModifyConstant6.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ModifyConstant6.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ModifyConstant6.mo	(revision 344)
@@ -0,0 +1,23 @@
+// name:     ModifyConstant6
+// keywords: scoping,modification
+// status:   incorrect
+//
+// Finalized constants can not be modified.
+//
+
+class A
+  final constant Real c = 1.0;
+end A;
+
+class B
+  A a(c = 2.0);
+end B;
+
+class C
+  A a;
+end C;
+
+class ModifyConstant6
+  B b;
+  C c;
+end ModifyConstant6;
Index: tags/v1_0_dk2/modeq/testsuite/ModifyUnknown1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ModifyUnknown1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ModifyUnknown1.mo	(revision 344)
@@ -0,0 +1,12 @@
+// name:     ModifyUnknown1
+// keywords: modification
+// status:   incorrect
+// 
+// Try to introduce a new member via modification.
+//
+
+class A
+  Real a;
+end A;
+
+class ModifyUnknown1 = A(b = 5);
Index: tags/v1_0_dk2/modeq/testsuite/ModifyUnknown2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ModifyUnknown2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ModifyUnknown2.mo	(revision 344)
@@ -0,0 +1,12 @@
+// name:     ModifyUnknown2
+// keywords: modification
+// status:   incorrect
+// 
+// Try to introduce a new member via modification.
+//
+
+class A
+  Real a;
+end A;
+
+class ModifyUnknown2 = A(redeclare Real b = 5);
Index: tags/v1_0_dk2/modeq/testsuite/Overwriting1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Overwriting1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Overwriting1.mo	(revision 344)
@@ -0,0 +1,23 @@
+// name:     Overwriting1
+// keywords: modification,equation,unknown
+// status:   correct
+// 
+// The modification for 'x' replaces the equation in the original
+// class. Or maybe not.
+//
+
+partial class A
+  Real x, u;
+equation
+  x = 2.0 * u;
+end A;
+
+class Overwriting1 = A(x = 5.0);
+
+// fclass Overwriting1
+//   Real x;
+//   Real u;
+// equation
+//   x = 5.0;
+//   x = 2.0 * u;
+// end Overwriting1;
Index: tags/v1_0_dk2/modeq/testsuite/Overwriting2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Overwriting2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Overwriting2.mo	(revision 344)
@@ -0,0 +1,19 @@
+// name:     Overwriting2
+// keywords: modification,equation,unknown
+// status:   correct
+// 
+// The modification for `x' does not overwrite the equation.  Or does it?
+//
+
+class Overwriting2
+  Real x = 5.0;
+equation
+  x = 2.0;
+end Overwriting2;
+
+// fclass Overwriting2
+//   Real x;
+// equation
+//   x = 5.0;
+//   x = 2.0;
+// end Overwriting2;
Index: tags/v1_0_dk2/modeq/testsuite/Overwriting3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Overwriting3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Overwriting3.mo	(revision 344)
@@ -0,0 +1,23 @@
+// name:     Overwriting3
+// keywords: modification,equation
+// status:   correct
+// 
+// The declaration in class A defines three quations for x[1], x[2],
+// and x[3]. The equation for x[1] is modified in Overwriting3.
+//
+
+class A 
+  Real x[3] = zeros(3);
+end A;
+
+class Overwriting3 = A(x[1]=1.0);
+
+// fclass Overwriting3
+//   Real x[1];
+//   Real x[2];
+//   Real x[3];
+// equation
+//   x[1] = 1.0;
+//   x[2] = 0.0;
+//   x[3] = 0.0;
+// end Overwriting3;
Index: tags/v1_0_dk2/modeq/testsuite/Partial1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Partial1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Partial1.mo	(revision 344)
@@ -0,0 +1,15 @@
+// name:     Partial1
+// keywords: partial
+// status:   incorrect
+// 
+// This is a test of the `partial' keyword.  The class `A' is declared
+// as `partial' which means that it cannot be instantiated.
+// 
+
+partial class A
+  Real x;
+end A;
+
+model Partial1
+  A a;
+end Partial1;
Index: tags/v1_0_dk2/modeq/testsuite/Protected1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Protected1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Protected1.mo	(revision 344)
@@ -0,0 +1,27 @@
+// name:     Protected1
+// keywords: protected
+// status:   incorrect
+// 
+// This file tests information hiding using the 'protect' keyword
+// 
+// The file is not valid, the compiler should complaint about y and a
+// being protected.
+
+type Real = RealType;
+
+class A
+  Real a = 1;
+end A;
+
+class B
+  Real x = 1;
+protected
+  extends A;
+  Real y = 1;
+end B;
+
+model Protected1
+  B a(y=18);
+  B b(a=3);
+  B c;
+end Protected1;
Index: tags/v1_0_dk2/modeq/testsuite/Range1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Range1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Range1.mo	(revision 344)
@@ -0,0 +1,40 @@
+// name:     Range1
+// keywords: array
+// status:   correct
+// 
+// Some tests of range expressions.
+// 
+
+class Range1
+  Integer x[5] = 1:5;
+equation
+  for i in 1:5 loop
+    x[i] = x[i] + 1;
+  end for;
+
+  for i in 1:2:5 loop
+    x[i] = x[i] + 2;
+  end for;
+end Range1;
+
+// fclass Range1
+//   Integer x[1];
+//   Integer x[2];
+//   Integer x[3];
+//   Integer x[4];
+//   Integer x[5];
+// equation
+//   x[1] = (1:5)[1];
+//   x[2] = (1:5)[2];
+//   x[3] = (1:5)[3];
+//   x[4] = (1:5)[4];
+//   x[5] = (1:5)[5];
+//   x[1] = x[1] + 1;
+//   x[2] = x[2] + 1;
+//   x[3] = x[3] + 1;
+//   x[4] = x[4] + 1;
+//   x[5] = x[5] + 1;
+//   x[1] = x[1] + 2;
+//   x[3] = x[3] + 2;
+//   x[5] = x[5] + 2;
+// end Range1;
Index: tags/v1_0_dk2/modeq/testsuite/Real2Integer1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Real2Integer1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Real2Integer1.mo	(revision 344)
@@ -0,0 +1,20 @@
+// name:     Real2Integer1
+// keywords: type,unknown
+// status:   erroneous
+//
+// No implicit conversion from 'Real' to 'Integer'. But integers are 
+// converted to reals in equations with real-expressions.
+// 
+
+class Real2Integer1
+  Real a = 5.6;
+  Integer n = a;
+end Real2Integer1;
+
+// fclass Real2Integer1
+//   Real a;
+//   Integer n;
+// equation
+//   a = 5.6;
+//   Real(n) = a;
+// end Real2Integer1;
Index: tags/v1_0_dk2/modeq/testsuite/Real2Integer2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Real2Integer2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Real2Integer2.mo	(revision 344)
@@ -0,0 +1,14 @@
+// name:     Real2Integer2
+// keywords: type
+// status:   incorrect
+// 
+// No implicit conversion from Real to Integer. Division via '/' always 
+// gives a Real.
+// 
+
+class Real2Integer2
+  Integer n1, n2;
+algorithm
+  n1 := 6;
+  n2 := n1 / 2;
+end Real2Integer2;
Index: tags/v1_0_dk2/modeq/testsuite/Record1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Record1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Record1.mo	(revision 344)
@@ -0,0 +1,24 @@
+// name:     Record1
+// keywords: type
+// status:   correct
+// 
+// This file tests that records work.
+//
+// THe implicit equation "x = 16" should not be counted as a "real"
+// equation, as that would break the record restricion.
+
+type Real = RealType;
+
+record A
+  Real x = 17.0;
+end A;
+
+model World
+  A a(x=18.0);
+end World;
+
+// fclass World
+//   Real a.x;
+// equation
+//   a.x = 18.0;
+// end World;
Index: tags/v1_0_dk2/modeq/testsuite/Redeclare1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Redeclare1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Redeclare1.mo	(revision 344)
@@ -0,0 +1,27 @@
+// name:     Redeclare1
+// keywords: redeclare,type
+// status:   correct
+// 
+// Redeclaration and subtyping.
+// 
+
+model A
+  Real x;
+end A;
+
+model B
+  extends A;
+  Real z;
+end B;
+
+model M
+  A a(x(unit = "m"));
+equation
+  a.x = 17.0;
+end M;
+
+model Redeclare1
+  M m(redeclare B a);
+equation
+  m.z = m.x;
+end Redeclare1;
Index: tags/v1_0_dk2/modeq/testsuite/Redeclare2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Redeclare2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Redeclare2.mo	(revision 344)
@@ -0,0 +1,28 @@
+// name:     Redeclare2
+// keywords: redeclare
+// status:   correct
+// 
+// Replaceable classes.
+
+class A
+  Real x;
+equation
+  x = 1.0;
+end A;
+
+class B
+  Real x,y;
+equation
+  y = x;
+end B;
+
+class Redeclare2
+  replaceable class Q = A;
+  Q x;
+end Redeclare2;
+
+// fclass Redeclare2
+//   Real x.x;
+// equation
+//   x.x = 1.0;
+// end Redeclare2;
Index: tags/v1_0_dk2/modeq/testsuite/Redeclare3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Redeclare3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Redeclare3.mo	(revision 344)
@@ -0,0 +1,30 @@
+// name:     Redeclare3
+// keywords: redeclare
+// status:   correct
+// 
+
+class A
+  Real x;
+equation
+  x = 1;
+end A;
+
+class B
+  Real x,y;
+equation
+  y = x;
+end B;
+
+class C
+  replaceable class Q = A;
+  Q x;
+end C;
+
+class Redeclare3
+  C c(redeclare class Q = B);
+end Redeclare3;
+
+// fclass Redeclare3
+// equation
+//   c.x.y = c.x.x
+// end Redeclare3;
Index: tags/v1_0_dk2/modeq/testsuite/RedeclareFlowEffort.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/RedeclareFlowEffort.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/RedeclareFlowEffort.mo	(revision 344)
@@ -0,0 +1,17 @@
+// name:     RedeclareFlowEffort
+// keywords: modification
+// status:   incorrect
+// 
+// Redeclaration that changes flow/non-flow is not allowed.
+//
+
+connector Connector
+  flow Real f;
+  Real e;
+end Connector;
+
+class RedeclareFlowEffort
+  Connector c1, c2(redeclare flow Real e);
+equation
+  connect(c1, c2);
+end RedeclareFlowEffort;
Index: tags/v1_0_dk2/modeq/testsuite/ReplaceFunction.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ReplaceFunction.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ReplaceFunction.mo	(revision 344)
@@ -0,0 +1,25 @@
+// name:     ReplaceFunction
+// keywords: modification
+// status:   incorrect
+//
+// Function arguments must be identical, including their names,
+// in functions of the same type.
+//
+
+function Sin
+  input Real x;
+  output Real y;
+external
+end Sin;
+
+function Cos
+  input Real xx;
+  output Real yy;
+external
+end Cos;
+
+model M 
+  replaceable function f = Sin; 
+end M;
+
+model ReplaceFunction = M(redeclare function f = Cos);   // Error
Index: tags/v1_0_dk2/modeq/testsuite/ScopeDeclaration1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ScopeDeclaration1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ScopeDeclaration1.mo	(revision 344)
@@ -0,0 +1,12 @@
+// name:     ScopeDeclaration1
+// keywords: scoping,declaration
+// status:   incorrect
+// 
+// Modelica is a strict define-before-use language. A variable must be
+// fully instantiated (defined after end of declaration, semicolon) 
+// before it is referenced. 
+//
+
+class ScopeDeclaration1
+  Real a = a;
+end ScopeDeclaration1;
Index: tags/v1_0_dk2/modeq/testsuite/ScopeDeclaration2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ScopeDeclaration2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ScopeDeclaration2.mo	(revision 344)
@@ -0,0 +1,25 @@
+// name:     ScopeDeclaration2
+// keywords: scoping,declaration
+// status:   correct
+// 
+// An element (e.g. a variable) is added to the partially instantiated 
+// parent AFTER the element has been completely instantiated.
+//
+
+class ScopeDeclaration2
+  constant Real a = 3.0;
+  class B
+    Real a(min = a);
+  end B;
+  B b;
+end ScopeDeclaration2;
+
+// fclass ScopeDeclaration2
+//   constant Real a;
+//   Real b.a;
+//   parameter Real b.a.min;
+// equation
+//   a = 3.0;
+//   b.a.min = a;
+//   assert(b.a >= b.a.min);
+// end ScopeDeclaration2;
Index: tags/v1_0_dk2/modeq/testsuite/ScopeModification1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ScopeModification1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ScopeModification1.mo	(revision 344)
@@ -0,0 +1,25 @@
+// name:     ScopeModification1
+// keywords: scoping,modification
+// status:   correct
+// 
+// In class modifications the scope of the outer class is used for
+// looking up variables. Consequently 'a' of the outer class is used 
+// in the modification.
+//
+
+class ScopeModification1
+  class Inner
+    Real a;
+    Real b;
+  end Inner;
+  Real a;
+  Inner m(b = a);
+end ScopeModification1;
+
+// fclass ScopeModification1
+//   Real a;
+//   Real m.a;
+//   Real m.b;
+// equation
+//   m.b = a;
+// end ScopeModification1;
Index: tags/v1_0_dk2/modeq/testsuite/ScopeModification2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/ScopeModification2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/ScopeModification2.mo	(revision 344)
@@ -0,0 +1,15 @@
+// name:     ScopeModification2
+// keywords: scoping,modification
+// status:   incorrect
+// 
+// In class modifications the scope of the outer class is used for
+// looking up variables. There is no 'a' known in the example.
+//
+
+class ScopeModification2
+  class Inner
+    Real a;
+    Real b;
+  end Inner;
+  Inner m(b = a);
+end ScopeModification2;
Index: tags/v1_0_dk2/modeq/testsuite/Shadow1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Shadow1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Shadow1.mo	(revision 344)
@@ -0,0 +1,30 @@
+// name:     Shadow1
+// keywords: modification,shadow
+// status:   correct
+// 
+// This test shows what shadowing of variable names can do. Especially
+// the replacing of equation where the LHS is a simple variable name.
+//
+// In my opinion, this is a very dubious feature, which I'm not sure
+// is a good idea at all.
+//
+// The x = 1 equation is shadowed by the modification.
+
+class A
+  Real x=1.0;
+  // Real y[17];
+equation
+  x = 1;
+  // y[3] = 4;
+end A;
+
+model Shadow1
+  A a(x = 2.0 /*, y[3] = 5.0 */ );
+end Shadow1;
+
+// fclass Shadow1
+//   Real a.x;
+// equation
+//   a.x = 2.0;
+// end Shadow1;
+
Index: tags/v1_0_dk2/modeq/testsuite/SimpleIntegrator1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/SimpleIntegrator1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/SimpleIntegrator1.mo	(revision 344)
@@ -0,0 +1,24 @@
+// name:     SimpleIntegrator1
+// keywords: declaration,equation
+// status:   erroneous
+// 
+// In this example 'x' is defined twice: constant and
+// non-constant. But this is not something we need to worry about.
+//
+
+model SimpleIntegrator1
+  Real u = 1.0;
+  Real x = 2.0;
+equation
+  der(x) = u;
+end SimpleIntegrator1;
+
+// fclass SimpleIntegrator1
+//   Real u;
+//   Real x;
+// equation
+//   u = 1.0;
+//   x = 2.0;
+//   der(x) = u;
+// end SimpleIntegrator1;
+
Index: tags/v1_0_dk2/modeq/testsuite/SimpleIntegrator2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/SimpleIntegrator2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/SimpleIntegrator2.mo	(revision 344)
@@ -0,0 +1,23 @@
+// name:     SimpleIntegrator2
+// keywords: declaration,equation,modification
+// status:   correct
+// 
+// Correct formulation of a simple integrator example.
+//
+
+model SimpleIntegrator2
+  Real u = 1.0;
+  Real x(start = 2.0);
+equation
+  der(x) = u;
+end SimpleIntegrator2;
+
+// fclass SimpleIntegrator2
+//   Real u;
+//   Real x;
+//   parameter Real x.start;
+// equation
+//   u = 1.0;
+//   x.start = 2.0;
+//   der(x) = u;
+// end SimpleIntegrator2;
Index: tags/v1_0_dk2/modeq/testsuite/SimpleIntegrator3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/SimpleIntegrator3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/SimpleIntegrator3.mo	(revision 344)
@@ -0,0 +1,24 @@
+// name:     SimpleIntegrator3
+// keywords: declaration,equation
+// status:   correct
+// 
+// Specify predefined attribute in an equation section.
+//
+
+model SimpleIntegrator3
+  Real u = 1.0;
+  Real x;
+equation
+  x.start = 2.0;
+  der(x) = u;
+end SimpleIntegrator3;
+
+// fclass SimpleIntegrator3
+//   Real u;
+//   Real x;
+//   parameter Real x.start;
+// equation
+//   u = 1.0;
+//   x.start = 2.0;
+//   der(x) = u;
+// end SimpleIntegrator3;
Index: tags/v1_0_dk2/modeq/testsuite/SimpleIntegrator4.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/SimpleIntegrator4.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/SimpleIntegrator4.mo	(revision 344)
@@ -0,0 +1,13 @@
+// name:     SimpleIntegrator4
+// keywords: declaration,modification
+// status:   incorrect
+// 
+// Try to access non-existend attribute 'initial'.
+//
+
+model SimpleIntegrator4
+  Real u = 1.0;
+  Real x(initial = 2.0);
+equation
+  der(x) = u;
+end SimpleIntegrator4;
Index: tags/v1_0_dk2/modeq/testsuite/Type1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Type1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Type1.mo	(revision 344)
@@ -0,0 +1,10 @@
+// name:     Type1
+// keywords: type
+// status:   incorrect
+// 
+// You cannot define your own types, only derive them from the builtings.
+// 
+
+type T
+  Real x;
+end T;
Index: tags/v1_0_dk2/modeq/testsuite/Type2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Type2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Type2.mo	(revision 344)
@@ -0,0 +1,16 @@
+// name:     Type2
+// keywords: type,unknown
+// status:   incorrect
+// 
+// What are valid connectors?  According to the report, only classes
+// declared with `connector', or classes declared with `class' which
+// adher to the restrictions for `connector'.
+//
+// On the other hand, records always adher to those restrictions.
+// 
+
+record A
+  Real x;
+end A;
+
+connector C = A;
Index: tags/v1_0_dk2/modeq/testsuite/Type3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Type3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Type3.mo	(revision 344)
@@ -0,0 +1,13 @@
+// name:     Type3
+// keywords: type
+// status:   incorrect
+// 
+// This should give a type error because the expression i/4 is not of
+// type Real.
+
+class A
+  Integer i = 17;
+  Real x[100];
+equation
+  x[i/4] = 0.5;
+end A;
Index: tags/v1_0_dk2/modeq/testsuite/Type4.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Type4.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Type4.mo	(revision 344)
@@ -0,0 +1,25 @@
+// name:     Type4
+// keywords: type,declaration
+// status:   correct
+// 
+// Simple variable declarations.
+// 
+
+model Type4
+  Integer i = 17                "an integer";
+  Real r = 18.0                 "a real value";
+  String s = "hej"              "a string";
+  Boolean b = false             "a boolean";
+end Type4;
+
+// fclass Type4
+//   Integer i;
+//   Real r;
+//   String s;
+//   Boolean b;
+// equation
+//   i = 17;
+//   r = 18.0;
+//   s = "hej";
+//   b = false;
+// end Type4;
Index: tags/v1_0_dk2/modeq/testsuite/Type5.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Type5.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Type5.mo	(revision 344)
@@ -0,0 +1,18 @@
+// name:     Type5
+// keywords: type,declaration
+// status:   correct
+// 
+// Simple variable declarations.
+// 
+
+type Voltage = Real(unit="V");
+
+model Type5
+  Voltage v;
+end Type5;
+
+// fclass Type5
+//   Real v;
+// equation
+//   v.unit = "V";
+// end Type5;
Index: tags/v1_0_dk2/modeq/testsuite/Type6.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Type6.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Type6.mo	(revision 344)
@@ -0,0 +1,21 @@
+// name:     Type6
+// keywords: type,declaration
+// status:   correct
+// 
+// Simple variable declarations, take two.
+// 
+
+model Type6
+  Integer i             "an integer";
+  Real r                "a real value";
+  String s              "a string";
+  Boolean b             "a boolean";
+end Type6;
+
+// fclass Type6
+//   Integer i;
+//   Real r;
+//   String s;
+//   Boolean b;
+// equation
+// end Type6;
Index: tags/v1_0_dk2/modeq/testsuite/Units1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Units1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Units1.mo	(revision 344)
@@ -0,0 +1,32 @@
+// name:     Units1
+// keywords: connect,modification
+// status:   erroneous
+// 
+// Conversion between units is not supported within the Modelica 
+// language. Consequently in the following example the generation 
+// of equations from connect statements does not depend on the 
+// specified units.
+//
+
+type Voltage = Real(unit = "V");
+type Current = Real(unit = "A");
+
+model Units1
+  Voltage v1, v2(unit = "kV");
+  Current i;
+equation
+  connect(v1, v2);
+  connect(v1, i);
+end Units1;
+
+// fclass Units1
+//   Real v1;
+//   Real v2;
+//   Real i;
+// equation
+//   v1.unit = "V";
+//   v2.unit = "kV";
+//   i.unit = "A";
+//   v1 = v2;
+//   v2 = i;
+// end Units1;
Index: tags/v1_0_dk2/modeq/testsuite/Units2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/Units2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/Units2.mo	(revision 344)
@@ -0,0 +1,17 @@
+// name:     Units2
+// keywords: connect
+// status:   incorrect
+// 
+// Connections of flow variables with non-flow variables are not 
+// possible.
+//
+
+type Voltage = Real(unit = "V");
+type Current = Real(unit = "A");
+
+model Units2
+  Voltage v;
+  flow Current i;
+equation
+  connect(v, i);
+end Units2;
Index: tags/v1_0_dk2/modeq/testsuite/VERSION
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/VERSION	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/VERSION	(revision 344)
@@ -0,0 +1,1 @@
+1.0-dk1
Index: tags/v1_0_dk2/modeq/testsuite/XPowers1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/XPowers1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/XPowers1.mo	(revision 344)
@@ -0,0 +1,30 @@
+// name:     XPowers1
+// keywords: equation,array
+// status:   correct
+// 
+// The powers of 'x' are defined by using array syntax. The dimension  
+// 'n' needs to be fixed in order to expand the formulation. 
+// Furthermore 'n' is treated fixed in the declaration of 'xpowers'.
+//
+// This also uses multiplication of an array with a scalar.
+//
+
+model XPowers1
+  constant Integer n = 3;
+  Real x = 2.0, xpowers[n];
+equation
+  xpowers[1] = x;
+  xpowers[2:n] = xpowers[1:n-1] * x;
+end XPowers1;
+
+// fclass XPowers1
+//   Integer n;
+//   Real x;
+//   Real xpowers[3];
+// equation
+//   n = 3;
+//   x = 2.0;
+//   xpowers[1] = x;
+//   xpowers[2] = xpowers[1] * x;
+//   xpowers[3] = xpowers[2] * x;
+// end XPowers1;
Index: tags/v1_0_dk2/modeq/testsuite/XPowers2.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/XPowers2.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/XPowers2.mo	(revision 344)
@@ -0,0 +1,34 @@
+// name:     XPowers2
+// keywords: equation
+// status:   correct
+// 
+// The powers of 'x' are defined by using a for loop. The dimension 'n'
+// needs to be fixed in order to expand the formulation. Furthermore 'n'
+// is treated fixed in the declaration of 'xpowers'.
+//
+
+model XPowers2
+  Integer i;
+  constant Integer n = 3;
+  Real x = 2.0, xpowers[n];
+equation
+  xpowers[1] = x;
+  for i in 1:n-1 loop
+    xpowers[i+1] = xpowers[i] * x;
+  end for;
+end XPowers2;
+
+// fclass XPowers2
+//   Integer i;
+//   constant Integer n;
+//   Real x;
+//   Real xpowers[1];
+//   Real xpowers[2];
+//   Real xpowers[3];
+// equation
+//   n = 3;
+//   x = 2.0;
+//   xpowers[1] = x;
+//   xpowers[1+1] = xpowers[1] * x;
+//   xpowers[2+1] = xpowers[2] * x;
+// end XPowers2;
Index: tags/v1_0_dk2/modeq/testsuite/XPowers3.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/XPowers3.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/XPowers3.mo	(revision 344)
@@ -0,0 +1,19 @@
+// name:     XPowers3
+// keywords: equation
+// status:   incorrect
+// 
+// The powers of 'x' are defined by using a for loop. The dimension 'n'
+// is defined constant but not declared constant. The integer 'n' must 
+// be declared as constant. 
+//
+
+model XPowers3
+  Integer i;
+  Integer n = 3;
+  Real x = 2.0, xpowers[n];
+equation
+  xpowers[1] = x;
+  for i in 1:n-1 loop
+    xpowers[i+1] = xpowers[i] * x;
+  end for;
+end XPowers3;
Index: tags/v1_0_dk2/modeq/testsuite/index.html
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/index.html	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/index.html	(revision 344)
@@ -0,0 +1,16 @@
+<html>
+<head>
+<title>The Modelica testsuite and list of open issues</title>
+</head>
+
+<body>
+
+<h1>The Modelica testsuite and list of open issues</h1>
+
+<ul>
+  <li><a href="modtest_toc.html">The document as HTML</a>
+  <li><a href="modtest.ps">The document as PostScript for printing</a>
+</ul>
+
+</body>
+</html>
Index: tags/v1_0_dk2/modeq/testsuite/modtest.texi
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/modtest.texi	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/modtest.texi	(revision 344)
@@ -0,0 +1,1055 @@
+\input texinfo   @c -*-texinfo-*-
+@c $Id$
+@c %**start of header
+@setfilename modtest.info
+@settitle Modelica Testsuite
+@c %**end of header
+
+@c translation to HTML:
+@c   texi2html -split_node -number -menu modtest.texi
+
+@setchapternewpage odd
+@paragraphindent 0
+@iftex
+@afourpaper
+@parindent 0pt
+@parskip = @medskipamount
+@end iftex
+
+@include VERSION.texi
+@set UPDATED 13 July 1998
+@set UPDATED-MONTH July 1998
+
+@ifinfo
+This is version @value{VERSION},
+last updated @value{UPDATED},
+of @cite{the Modelica testsuite},
+version @value{VERSION}.
+
+Copyright @copyright{} 1998 Modelica Design Group
+@end ifinfo
+
+@titlepage
+@sp 10
+@comment The title is printed in a large font.
+@title Modelica Testsuite
+@subtitle Version @value{VERSION}
+@subtitle @value{UPDATED-MONTH}
+@author{Modelica Design Group}
+
+@c The following two commands start the copyright page.
+@page
+@vskip 0pt plus 1filll
+Copyright @copyright{} 1998 Modelica Design Group
+@end titlepage
+
+@node    Top, Conventions, (dir), (dir)
+@comment node-name, next,          previous, up
+
+This is version @value{VERSION} of @cite{the Modelica testsuite}.
+
+This document is made to provide a collection of issues that need to be
+resolved in the Modelica design process.  It also contains the full set
+of Modelica test cases currently defined.
+
+A Modelica test case is an example Modelica model that illustrates one
+ore more semantical aspects of the Modelica language.  It serves several
+purposes, both to provide a testbed for new implementations and to make
+unresolved design issues clearer.  For testing a new implementation of
+the language, the set of test cases needs to be very large, as the
+number of semantic rules is large, and there are many ways in which they
+interact.  Only some of these test cases are interesting for the design
+process, but it seems useful to keep it as one set of test cases, and
+this discussions in this document only references a selected subset of
+the test cases.
+
+@menu
+* Conventions::                 
+* Open Issues::                 
+* Closed Issues::               
+* Test Cases::                  Collection of files with test cases.
+
+* Change-Log::                  
+
+ --- The Detailed Node Listing ---
+
+Conventions
+
+* General Conventions::         
+* Classification::              
+* Flat Modelica::               
+
+Open Issues
+
+* Types::                       
+* Overloading and automatic type conversions::  
+* Array syntax::                
+* Parameters::                  
+* Expression Properties::       
+* Functions::                   
+* Scoping::                     
+* Declarations::                
+* Connections::                 
+* Built-in types as connectors::  
+* Integer expressions::         
+* Redeclaration of parameter as variable::  
+* Equations::                   
+@end menu
+
+@c ********************************************************************
+
+@comment node-name,     next,          previous, up
+@node     Conventions, Open Issues, Top, Top
+@chapter Conventions
+
+This chapter lists the conventions used in the text.
+
+@menu
+* General Conventions::         
+* Classification::              
+* Flat Modelica::               
+@end menu
+
+@node General Conventions, Classification, Conventions, Conventions
+@section General Conventions
+
+A test case is given in two formulations, first the Modelica code, and
+second a ``flat'' representation that specifies the semantics of the
+example.  Furthermore, each test case is classifies according to a
+couple of criteria.
+
+Each test case is formulated in one Modelica file, consisting of
+
+@enumerate
+@item
+A header containing some explanatory text to describe what it tests.
+@item
+A classification entry. (@xref{Classification}.)
+@item
+The Modelica code.
+@item
+A flat representation. (@xref{Flat Modelica}.)
+@end enumerate
+
+Everything except the Modelica code is given as comment in the file. No
+flat representation is given for incorrect examples.
+
+@node Classification, Flat Modelica, General Conventions, Conventions
+@section Classification
+
+Each test case contains a classification entry of the form
+
+@samp{keywords:}  @var{keyword}  [@samp{,} @var{keyword}]* @*
+@samp{status:}    @var{correctness}
+
+The @var{keyword} clauses are used to tag each test with a number of
+keywords to indicate what aspect of the semantic specification it tests.
+
+The following list contains all the keywords used.
+@var{aspect}(s):
+@table @samp
+@item algorithm
+@item array
+@item connect
+@item constant
+@item declaration
+@item equation
+@item extends
+@item function
+@item modification
+@item partial
+@item protected
+@item redeclare
+@item scoping
+@item shadow
+@item type
+@item unknown
+@end table
+
+The @var{correctness} of a test case is given as one of:
+@table @samp
+@item correct
+The example is correct.
+@item incorrect
+The example is incorrect according to the formal Modelica semantics or
+syntax.
+@item erroneous
+The example is formally correct, but it contains a modeling error that 
+should be outlined.
+
+<david: What does this really mean and why is it needed here?>
+@end table
+
+@node Flat Modelica,  , Classification, Conventions
+@section Flat Modelica
+
+The aim of the flat representation is to clearly specify the semantics
+of a test case. This is done using a low-level format. The format has the 
+same basic syntax as Modelica.
+
+The following restrictions apply:
+
+@itemize @bullet
+
+@item 
+Flat models contain only components of predefined types. Predefined
+attributes, e.g. @code{start}, @code{unit}, @code{min}, @code{max},
+@dots{} are declared as separate variables.
+
+@item 
+A flat model has one declaration section, optionally followed by an
+equation section, which is followed by zero or more algorithm
+sections.
+
+@item
+The order of equations is undefined.
+
+@item
+The order of statements in each algorithm section is kept intact, but
+the order in which the algorithm sections appear is undefined.
+
+@item
+No modifications are used, i.e. equation modifications made in the
+Modelica source code are stated in the equation section of the flat
+representation.  Redeclarations are taken care of while flattening the
+model.
+
+@item
+No connect statements are used, i.e. the corresponding connection
+equations are stated.
+
+@item
+For loops are not used in equations.  They are unrolled in the flat
+representation.
+
+@end itemize
+
+The following extensions are made:
+
+@itemize @bullet
+
+@item
+All array components are declared separately.  If the Modelica model
+contains the declaration
+
+@example
+Real x[2,3];
+@end example
+
+the flat model will contain the following declarations:
+
+@example
+Real x[1,1];
+Real x[1,2];
+Real x[1,3];
+Real x[2,1];
+Real x[2,2];
+Real x[2,3];
+@end example
+
+This means that the brackets in declaration do not denote array size, as
+they do in normal Modelica.
+
+<david: This is a consequence of how the semantic specification looks at
+the components.  Using the simple @samp{x[2,3]} could be done instead,
+as it is shorter and introduces no ambuguities.>
+
+@item
+Identifiers may contain dots @samp{.} (resulting from subcomponents in the
+originating Modelica code) and tilde signs @samp{~} (see below).
+Identifiers may also contain subscripts, as in @samp{x[1]}.  This is a
+consequence of the fact that all array components are declared separately.
+
+@item
+In order to be able to declare a local variable @var{var} of a function 
+@var{funcname}, an identifier of the form 
+@example
+@var{funcname}@samp{~}@var{n}@samp{.}@var{var}
+@end example
+with @var{n} a number is introduced. In this way calls to internal
+functions (that are defined in Modelica) can be expanded, e.g. to
+express the semantics of assigning input and output variables.
+The number @var{n} should be incremented for each call to the same
+function from the same class.
+
+<Peter: The expansion is not possible for recursive functions.>
+
+<david: This is still experimental. It might be removed.>
+
+Calls to predefined and external functions remain in the flat
+representation as they are in the Modelica code.
+
+@item
+Automatic type conversions defined in the Modelica semantics, e.g. from 
+an @code{Integer} @code{i} to @code{Real}, are stated using the target
+type name as conversion operator, i.e. @code{Real(i)}.
+
+@item
+A new postfix subscripting operator is introduced.  In the flat model,
+it is necessary to be able to subscript expression, so the syntax
+@samp{expression[x]} is allowed.  This is currently not allowed in
+Modelica.
+
+@item
+Almost no overloading of operators occus in the flat Modelica.  If a
+model contains an array multiplied by a scalar, the flat model does not
+use the multiplication sign, but an operator that is specialized for
+that particular operation.
+
+The normal integer and real arithmetic operators are still overloaded,
+but they should not, really.
+
+@item
+Due to the extensions a flat model representation is not valid
+Modelica.  Therefore, the class definition in the flat code is declared
+as @code{fclass} to differentiate it from Modelica's @code{class}.
+
+@end itemize
+
+The flat modelica grammar is probably not even context-free.
+
+@c ********************************************************************
+
+@comment node-name,     next,          previous, up
+@node    Open Issues, Closed Issues, Conventions, Top
+@chapter Open Issues
+
+The issues brought up here are not yet clarified in the current
+Modelica language specification (Version 1c of the Modelica report).
+
+@menu
+* Types::                       
+* Overloading and automatic type conversions::  
+* Array syntax::                
+* Parameters::                  
+* Expression Properties::       
+* Functions::                   
+* Scoping::                     
+* Declarations::                
+* Connections::                 
+* Built-in types as connectors::  
+* Integer expressions::         
+* Redeclaration of parameter as variable::  
+* Equations::                   
+@end menu
+
+@c --------------------------------------------------------- 
+@node Types, Overloading and automatic type conversions, Open Issues, Open Issues
+@section Types
+
+Modelica needs a well-defined type system, with a clear notion of what a
+type actually is.
+
+@subsection Functions
+
+Functions have a type, which looks something like @code{Real => Real}
+for a function from reals to reals.  This goes for the builtin functions
+too.
+
+This causes a few problems.  For instance, the function @code{size} is
+not well-defined.  What is the type of its first argument?  There is no
+type called ``Array''.
+
+@subsection Multidimensional arrays
+
+One very important issue is whether a multidimensional matrix is
+equivalent to an array of arrays.  This decision affects many parts of
+the semantic specification and needs to be thought about thoroughly.
+
+<david: Thanks to Henrik Nilsson for his thoughts on this subject>
+
+Let's see what happens if we make it equivalent:
+
+@itemize @bullet
+
+@item
+Partial indexing becomes very natural.  If the variable @code{x} is
+defined as a n*m matrix, it can also be regarded as an array of size n
+of arrays of size m.
+
+@example
+Real x[2,2];
+@dots{}
+x[1] = [ 1.0, 2.0 ];
+@end example
+
+This can be solved by writing @code{x[1,:]} even if we don't equate the
+types. (@xref{ArrayModification5})
+
+@item
+If @code{A} is a m*n matrix, then @code{A[x,y] = A[x][y]}, but
+@code{A[:,y] /= A[:][y]}.
+
+This might not be a disaster, but it might be a little surprising on
+first encouter.
+
+@item
+From the report:
+
+@example
+type Point = Real[2];
+@dots{}
+Point points[:];
+@end example
+
+This will mean that @code{points} is a matrix, i.e. @code{ndims(points)
+= 2}.  Both @code{points[17,2]} and @code{[17][2]} denote the same thing
+(provided that the Modelica syntax is extended @xref{Array syntax}).
+
+@item
+We get a simple and useful means to construct multidimensional arrays.
+For example, @code{[[1,2],[3,4]]} is a 2*2 matrix.  This syntax might be
+introduced even if arrays of arrays is not the same as a
+multidimensional array, but it might bring nast consequences. In the
+example below, @code{C} and @code{D} would become different.
+
+@example
+A = [1,2]
+B = [3,4]
+C = [A,B]
+D = [[1,2],[3,4]]
+@end example
+
+A related issue is the splicing of vectors in the syntax. @xref{Array
+syntax}.
+
+@item
+The internal representation of both types must be the same.  This might
+be problematic.  Say that you store the size of an array together with
+the array.  If the types are not the same, you only have to store the
+multi-dimensional size once for the whole multidimensional array.  It
+they are the same, then each secondary array needs to be tagged with its
+size, which would introduce irregularities in the representation.
+
+@end itemize
+
+Some random notes:
+
+@itemize @bullet
+
+@item
+Defining arrays of arrays is already possible by derived type
+declarations
+
+@example
+type T1 = Real[3];
+type T2 = T1[2];
+@end example
+
+Does this mean that @code{T2} is the same as @code{Real[2,3]}?  If not,
+this is the only way to describe this type, as @code{Real[2][3]} is not
+a valid type.
+
+@xref{Array4}
+
+@item
+One could use a @code{reshape} function to construct multidimensional
+arrays, similar to Fortran 90.
+
+@end itemize
+
+@subsection Array types
+
+What is an array type?  How do the concepts of subtypes and equivalent
+types apply to arrays?  What about array types where one or more of the
+sizes are unknown?
+
+@subsection Determining types of expressions
+
+One desired property of the type system would be if the type of
+expressions can be determined without regard for the context it appears
+in.  This is the case for C and C++, for instance.
+
+This seems to be feasible.  At least as long as no strange array
+constructors are introduced.  If, say, a ``function'' @code{ones()}
+which created an array of arbitrary size to match whatever expresseion
+is appeared together with was added to the language, this would cause
+problems for the type system.
+
+@c --------------------------------------------------------- 
+@node Overloading and automatic type conversions, Array syntax, Types, Open Issues
+@section Overloading and automatic type conversions
+
+Many of the operators in Modelica are overloaded on the types of its
+arguments.  The plus operator is e.g. both an integer addition operator
+and a real addition operator.  These two operations are similar, but not
+the same.  It also doubles as a string concatenation operator, which is
+a completely different operation, with other properties (it is not
+associative, for instance).  The overloading of the asterisk operator is
+even more extensive with both scalar and matrix multiplication.
+
+@subsection Defining the operators
+
+All operators need to be defined in terms of what they operate on.  A
+short table of types and operations should be sufficient.
+
+@subsection Vectors and scalar functions
+
+It also seems to be the view of most people that functions defined on
+scalars should be possible to apply to arrays (vectors at least), which
+would apply the function element-wise.  Exactly how does this work?
+
+On idea is to say that if @var{f} is defined as a function which takes
+an argument of type @var{a} and returns a value of type @var{b}, then
+@var{f} may be applied to a vector of @var{a}, returning a vector of
+@var{b}.
+
+Should this be generalized to n-dimensional arrays?
+
+Should this be valid for any types @var{a} and @var{b}?
+
+Another idea is to skip this idea, and introduce a function (or operator
+of some sort) @code{elementwise} with takes an array and a function.
+This is not easy to describe, as functions are not first-class objects
+in Modelica.
+
+@subsection Type conversions
+
+Then there is the problem of type conversions.  There hasn't been much
+discussion about this topic, but I believe it was brought up in
+Manchester.  <david: The Manchester minutes mention an explicit
+@code{integer} type cast operator, but that seems so strange that I'll
+ignore it for now.>
+
+Having implicit type casts is a convenience to the programmer. Take the
+following model as an example:
+
+@example
+model Circuit
+  parameter Integer N, Integer Rtot;
+  Resistor r1(R = 5);
+  Resistor rr[N](R = Rtot/N);
+@dots{}
+end Circuit;
+@end example
+
+In this example, implicit promotion (casts) of integer expressions to
+real expressions need to occur in three places for the model to be
+valid.
+
+First, the @code{R} parameter to @code{Resistor} is a @code{Real}
+parameter, but to make it equal the integer expression @code{5}, the
+expression has to be converted into a real expression.
+
+Second, the division operator is only defined for reals, which means
+that both the sub-expressions @code{Rtot} and @code{N} have to be promoted
+to reals before the division takes place.
+
+If automatic type promotions didn't exist, the model would have to be
+written as:
+
+@example
+model Circuit
+  parameter Integer N, Integer Rtot;
+  Resistor r1(R = 5.0);
+  Resistor rr[N](R = Real(Rtot)/Real(N));
+@dots{}
+end Circuit;
+@end example
+
+This, in my (David's) opinion, is unnecessarly cluttered.
+
+@c --------------------------------------------------------- 
+@node Array syntax, Parameters, Overloading and automatic type conversions, Open Issues
+@section Array syntax
+
+@subsection Declaring arrays of arrays
+
+If it is decided that arrays of arrays are not the same as
+multidimensional arrays, should it not be possible to declare a variable
+to be an array of arrays in a simple way?
+
+@xref{Array4}
+
+@subsection Array indexing operator
+
+Should the indexing operator @code{[]} be a real postfix operator on
+arbitrary array expressions?  Currently, the indexing is part of the
+@code{component_reference} grammar rule, which means that you can only
+index variables.
+
+
+The following is currently not allowed:
+
+@example
+x = cross(A,B)[2]
+@end example
+
+@subsection Array splicing
+
+What does the expression @code{[[1,2],[3,4]]} denote? Is it the vector
+@code{[1,2,3,4]} or a 2*2 matrix?
+
+The question is whether the vector splicing syntas (from MATLAB, I
+believe) should be used.  A little more realistic example might be the
+following:
+
+@example
+block Foo
+  input Real x[:];
+protected
+  Real y[sizeof(x)+3] = [0,1,2,x];
+end Foo;
+@end example
+
+In my (David's) opinion, this introduces unnecessary irregularities in
+the syntax, and makes it difficult to do other things, like writing
+@var{n}-dimensional array constants.  If I see the expression
+@code{[a,b,c,d]}, I want to be able to know that it is a vector
+(one-dimensional array or whatever) of four element.
+                                      
+The previous example can be solved in other ways, either by an explicit
+vector concatenation function, or by using several equations, as in the
+following example:
+
+@example
+block Foo
+  input Real x[:];
+protected
+  Real y[size(x,1)+3];
+equation
+  y[1:3] = [0,1,2];
+  y[4:size(x,1)+3] = x;
+end Foo;
+@end example
+
+@c --------------------------------------------------------- 
+@node Parameters, Expression Properties, Array syntax, Open Issues
+@section Parameters
+
+Saying that parameter setting should be left until after compile-time
+might not be so easy.
+
+@subsection Compile-time? What compile-time?
+
+The term ``compile-time'' is used several times in the discussion about
+Modelica, but it is never clearly defined what is meant by this.
+
+The following might be a starting-point for the discussion for what
+compile-time means:
+
+@itemize @bullet
+
+@item
+Equations can be generated from the structured model.
+
+@item
+Parameter values are unknown.
+
+@item
+Constant values are known.
+
+@end itemize
+
+@subsection Array sizes
+
+One of the obvious problems is parameterized array sizes.  If a vector
+is declared as @code{Real x[N]}, where @code{N} is a parameter, then the
+equations in the model might not be possible to determine.  As an
+example, the following @code{for} loop (@xref{EquationFor3}) can not be
+unrolled.
+
+@example
+class EquationFor3
+  parameter Integer N = 4;
+  Real a[N];
+equation
+  a[1] = 1.0;
+  for i in 1:N-1 loop
+    a[i+1] = a[i] + 1.0;
+  end for;
+end EquationFor3;
+@end example
+
+This might be taken as a quality-of-implementation issue.  If the
+parameter is reset, some systems will need to recompile the model, and
+some won't.
+
+@subsection Parameterized connections
+
+A more serious problem occurs when @code{connect} clauses are
+involved.  In some cases the connections can not be used to generate
+equations until the parameters are set. @xref{Connect7} and
+@ref{Connect8}.
+
+The only way to prevent recompilation in this case seems to be to
+prohibit constructions like this.
+
+@subsection Structural parameters
+
+The semantic specification gets around all of this by describing the
+semantics when the parameters are set in stone, but there are other
+observations that can be made.
+
+If a full set of equations is generated from the model, then some
+parameters have to be set, but not all.  Many parameters (restistances
+etc.) can still be reset.  This means that two different kinds of
+parameters are identifiable, one that may affect the number and
+structure of the equations, and one that don't.  Let's call the first
+type @dfn{structural parameters} and the second kind something else
+(what about @dfn{value parameters}?).
+
+Not that I know exactly what to do with this classification, but it
+might be useful.
+
+@c --------------------------------------------------------- 
+@node Expression Properties, Functions, Parameters, Open Issues
+@section Expression Properties
+
+In several places in the discussions about what may or may not appear in
+expressions there are restrictions applied in a somewhat ad-hoc manner.
+This should be cleared up and formalized.
+
+Each expression has a number of properties that can be derivd by
+analyzing its subexpressions.
+
+@itemize @bullet
+
+@item
+A type. For each kind of expression (addition, logical-and etc.) it is
+well-defined what the type of the expression is.  The only exception are
+overloaded operators, but that problem is another issue (@xref{Overloading and automatic type conversions}.)
+
+@item
+A ``constancy'' property, which describes whether the expression is a
+constant expression or not.  This can be stratified into the levels
+constant / parameter / discrete / variable, just as components can be
+declared constant etc.
+
+@item
+A ``differentiability'' property.  I'm not so sure about what this is,
+but it seems to be needed.  For instance, the report states that the
+@code{div()} function is not differentiable.
+
+How is this property determined for function calls in the general case?
+
+@end itemize
+
+When these properties are defined, they can be used to define what may
+appear where.  Some examples:
+
+@itemize @bullet
+
+@item
+An array index must have type @code{Integer}.
+
+@item
+An array index in a @code{connect} statement must be a constant
+expression of type @code{Integer}.
+
+@item
+Expressions in equations must be differentiable.
+
+@end itemize
+
+@c --------------------------------------------------------- 
+@node Functions, Scoping, Expression Properties, Open Issues
+@section Functions
+
+Saying that functions are classes is simply silly and
+counter-productive.
+
+<david: I haven't had time to elaborate more on this>
+
+@c --------------------------------------------------------- 
+@node Scoping, Declarations, Functions, Open Issues
+@section Scoping
+
+@subsection Recursive declarations
+
+Is the declared variable already known in its declaration equation?
+
+@xref{ScopeDeclaration1}, and @ref{ScopeDeclaration2}, as well as
+@ref{Lookup5}, and @ref{Lookup6}.
+
+If @code{ScopeDeclaration1} was correct, then the following declaration
+should also be correct:
+
+@example
+constant Real a[3] = [a[2]/a[3]; 2*a[3]; 3];
+@end example
+
+<david: The Manchester meeting decided that the declared thing does not
+exist in the scope until it is completely defined.>
+
+@c --------------------------------------------------------- 
+@node Declarations, Connections, Scoping, Open Issues
+@section Declarations
+
+@subsection Model modification
+What are the ``named'' equations that can be replaced via
+modifications?  Only equations in declarations or all equations with a
+single name on the left hand side?
+
+<david: The Manchester meeting seems to have decided that ony equations
+in the declaration section can be replaced by modifications.  I seem to
+recall that Hilding or someone else thought that the other equations
+should be replaeable too.>
+
+(@xref{Overwriting1}, and @ref{Overwriting2}.)
+
+@subsection Typing
+
+A surprising but correct example that shows a consequence of treating
+declaration equations like ordinary equations is given in
+@ref{Real2Integer1}.
+
+@xref{Overloading and automatic type conversions}
+
+@subsection Array modifications
+
+The type system makes the test case @ref{ArrayModification7} illegal.
+This seems natural too me, but I just want to make sure that nobody
+complains about this.
+
+
+@c --------------------------------------------------------- 
+@node Connections, Built-in types as connectors, Declarations, Open Issues
+@section Connections
+
+@subsection Parameters and constants in connectors
+Should connection equations be generated for parameters and
+constants? This issue has been discussed at the 10th design meeting. But 
+no decision was made there.
+@* (@xref{ConnectTypes}.)
+
+<david: The Manchester meeting decided that they should.>
+
+<Ruediger: If no connection equations are generated, should then
+@code{assert} statements be generated for two connected constants 
+(or parameters) @code{c1} and @code{c2}, i.e. @code{assert(c1 == c1)},
+so that no model information is lost in a flat representation?>
+
+@subsection Integers in connectors
+
+Are integers allowed in connectors?
+
+@xref{Connect4}
+
+@subsection Booleans in connectors
+
+Are booleans allowed in connectors?
+
+@xref{Connect5}
+
+@subsection Strings in connectors
+
+Are strings allowed in connectors?
+
+@xref{Connect6}
+
+@subsection Constant connectors
+
+Is it legal to declare a connector as @code{constant}?
+
+@xref{ConnectConst1}
+
+@c --------------------------------------------------------- 
+@node Built-in types as connectors, Integer expressions, Connections, Open Issues
+@section Built-in types as connectors
+
+Are variables of predefined types, e.g. @code{Real}, valid
+connectors? This is not specified in the Modelica 1c report.
+It is assumed to be true here.
+@* (@xref{Units1}, and @ref{Units2}.)
+
+In the Modelica 1c report, section 4.6 ``Matrices'', subsection ``Block
+Diagrams'', vectors of type @code{Real} are used as inputs and
+outputs. But no example is given in the discussion about connection of
+inputs and outputs there.
+
+@c --------------------------------------------------------- 
+@node Integer expressions, Redeclaration of parameter as variable, Built-in types as connectors, Open Issues
+@section Integer expressions
+
+Version 1c of the Modelica report, appendix B.9, introduces built-in
+functions for doing things like integer division. Most of the functions
+have return type @code{Real}. But should not the following be allowed?
+
+@example
+model Foo
+  Real a[10];
+  Real b[20];
+  Integer i;
+equation
+  for i in 2:20 loop
+    a[div(i,2)] = b[i];
+  end for;
+end Foo;
+@end example
+
+There are two problems with the current specification:
+
+@enumerate
+@item 
+Possibly not only the built-in function @code{size}, but also
+@code{div}, @code{ceil}, @code{floor}, and @code{ndims} should have
+return type @code{Integer}. If used in @code{Real} expressions, then
+the result should be converted from @code{Integer} to @code{Real}
+(as for any integer used in a real expression). 
+
+(@xref{Integer2Real}.)
+
+But this solution has another problem, which is more an implementation
+problem. The @code{Integer} type is often implemented as a limited type
+of typically 32 bits, which would mean that if you call
+ceiling(large_real_numer) you would overflow the integer type.
+
+One solution taken by some other languages (like C) is to introduce a
+double set of functions that conceptually do the same thing. On set that
+returns integers, and one that returns reals.  A ``smaller'' solution
+would be to only introduce an integer version of the @code{floor}
+function, and write @code{int_floor(div(n,m))}, but then the gain would
+be very small.
+
+@item 
+The use of the mentioned built-in functions should not only be allowed
+in @code{Boolean} equations and expressions, but also in @code{Integer}
+equations and expressions (e.g. index expressions). (See the example
+above and @ref{Expression Properties})
+@end enumerate
+
+<david: The Manchester minutes say ``Require same type, introduce type
+cast: operation integer(div(i,2))'', which seems to be to be a strange
+thing to say. It doesn't really answer the question.>
+
+@c --------------------------------------------------------- 
+@node Redeclaration of parameter as variable, Equations, Integer expressions, Open Issues
+@section Redeclaration of parameter as variable
+
+Version 1c of the Modelica report, appendix B2, section ``Redeclaration'',
+says that variability constraints may only become stronger in
+redeclarations. (@xref{DisturbedResistance2}.)
+
+It should be noted that, using inheritance, one can formulate examples
+that break the rule. Should this be valid? (@xref{DisturbedResistance3},
+@ref{DisturbedResistance4}.)
+
+@subsection Resolutions from the Manchester meeting
+
+@itemize @bullet
+@item
+Type prefix is not part of type equivalence. 
+@item
+Multiple inheritance should be forced to be equivalent. 
+@item
+Problem with correctness of equations, for example 
+@example
+C*der(v) = i 
+der(C*v) = i 
+@end example
+@item
+Open issue! Should add constraints to extends, similar to
+redeclare. Should require that type-prefix is identical for extends.
+@end itemize
+
+@c --------------------------------------------------------- 
+@node Equations,  , Redeclaration of parameter as variable, Open Issues
+@section Equations
+
+@subsection Discretes and equations
+
+The test case Discrete2 (@ref{Discrete2}) depends on the expression
+properties. If it is said that equations can only contain differentiable
+expressions, then this is clearly illegal.
+
+@xref{Expression Properties}
+
+@c ********************************************************************
+
+@node Closed Issues, Test Cases, Open Issues, Top
+@chapter Closed Issues
+
+@c ********************************************************************
+
+@node Test Cases, Change-Log, Closed Issues, Top
+@appendix Test Cases
+
+@c
+@c generated by Makefile
+@c
+
+@include cases.texi
+
+@c
+@c end Makefile
+@c
+
+@c ======================================================================
+@node Change-Log,  , Test Cases, Top
+@appendix Change-Log
+
+@appendixsec Version 1.0 to 1.0-dk1
+
+A lot of things were added and changed by David.
+
+@appendixsec Version 0.9.1 to 1.0
+
+The following changes result from the discussion at the 12th Modelica
+design meeting in Manchester. It is referred to the minutes of the
+12th Modelica design meeting.
+
+@enumerate
+@item
+New test cases, @ref{Overwriting3}, and @ref{Modification9}, according to
+N.1 and N.2, respectively, given in the minutes.
+@item
+@xref{ScopeDeclaration1}, @ref{ScopeDeclaration2}, @ref{Lookup5}: new
+header.
+@item
+@xref{Faculty1}: changed correctness to @samp{incorrect}.
+@item
+New test case, @ref{ReplaceFunction}, according to N.3 of section 2.2 ``Is
+Modelica a strict define­before­use language?'' of the minutes. 
+@item
+@xref{DeclareConstant1}, @ref{DeclareConstant3}: new header.
+@item
+@xref{ModifyConstant2}: changed correctness to @samp{correct}.
+@item
+New test cases, @ref{ModifyConstant5}, @ref{ModifyConstant6}, to check
+modification of final constants.
+@item
+@xref{ConnectTypes}: introduced connection equations for parameters and
+constants in the flat representation.
+@item
+@xref{ConnectHierarchical2}: changed correctness to @samp{correct}.
+@item
+@xref{ConnectFlowEffort}: simplified; 
+added new test case, @ref{RedeclareFlowEffort}. 
+@item
+@xref{ConstructParameters}: added keywords @samp{input} and
+@samp{output} to declarations in the flat model representation.
+
+@c @item 
+@c @xref{Overwriting1}: use term @samp{replace} instead of @samp{overwrite}.
+@item
+@xref{Real2Integer1}: changed correctness to @samp{erroneous} and corrected
+flat model representation.
+@c @item
+@c @xref{XPowers3}: The integer 'n' must be declared as constant.
+@end enumerate
+
+With these modifications most unclear issues of version 0.9.1 are
+resolved. (@xref{Open Issues}, for remaining questions.)
+
+@appendixsec Version 0.9 to 0.9.1
+
+@enumerate
+@item 
+@xref{ConditionalArrayExpression1}: corrected classification (&array).
+
+@ignore
+@item
+@xref{Connections}, @ref{ConnectTypes}: extended discussion in
+subsection ``Parameters and constants in connectors''
+(generation of assertions?).
+@item
+@xref{Connections}: new subsection ``Connections and Modifications''.
+@item
+@xref{Connections}: new subsection ``Directed connections''.
+@end ignore
+
+@end enumerate
+
+@contents
+@bye
Index: tags/v1_0_dk2/modeq/testsuite/package-s-1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/package-s-1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/package-s-1.mo	(revision 344)
@@ -0,0 +1,18 @@
+//
+// Equations:
+//
+//   a.unit = "m2"
+//
+
+package P
+
+class C
+  Real x;
+end C;
+
+end P;
+
+model World
+  P.C c;
+  Modelica.SIunit.Area a;
+end World;
Index: tags/v1_0_dk2/modeq/testsuite/partial-s-1.mo
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/partial-s-1.mo	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/partial-s-1.mo	(revision 344)
@@ -0,0 +1,17 @@
+// This file will make the translater fall into infinite recursion.
+
+// Equations:
+//
+
+class A
+
+  class B
+    A x;
+  equation
+    x.y = 1;
+  end B;
+
+  // Commented out for now
+  // B b;
+  Real y;
+end A;
Index: tags/v1_0_dk2/modeq/testsuite/rfdk.pike
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/rfdk.pike	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/rfdk.pike	(revision 344)
@@ -0,0 +1,41 @@
+
+
+void main(int argc, array argv)
+{
+  foreach(argv[1..], string fn)
+  {
+    string test = ((fn/"/")[-1]/".")[0];
+    array data = Stdio.read_file(fn)/"\n";
+    string status;
+    array(string) keywords;
+    int i=1, cl = 0;
+
+    write("Changing "+test+"...");
+    while(!cl && i < sizeof(data))
+    {
+      array a;
+      if (a = Regexp("^// classification: (.*)-(.*)$")->split(data[i]))
+      {
+	status = a[1];
+	keywords = a[0]/"&";
+	cl = i;
+      }
+      i++;
+    }
+
+    if(status)
+    {
+      write("yes\n");
+      rm(fn);
+      Stdio.write_file(fn,
+		       "// name:     "+test+"\n"
+		       "// keywords: "+keywords*","+"\n"
+		       "// status:   "+status+"\n"
+		       "// \n"+
+		       data[..cl-1]*"\n"+"\n"+
+		       data[cl+1..]*"\n");
+    }
+    else
+      write("no\n");
+  }
+}
Index: tags/v1_0_dk2/modeq/testsuite/rtest
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/rtest	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/rtest	(revision 344)
@@ -0,0 +1,228 @@
+#!/usr/local/bin/perl -w
+
+$successes=0;
+$total=0;
+$verbose="no";
+$pager="cat";
+$log="";
+$tmp1 = "/tmp/equations-1";
+$tmp2 = "/tmp/equations-2";
+$tmp3 = "/tmp/equations-diff";
+@keys = ();
+$collectkeys = 0;
+$collectcases = 0;
+%knownkeys = ();
+$filearg = 0;
+$status = 0;
+$statusfilter = "all";
+
+sub runone
+{
+    my $mismatch = 0;
+    my ($f,%info) = @_;
+    system "../modeq $f >$log 2>&1";
+    
+    if ( $? != 0 ) {
+	if ($info{"status"} eq "incorrect") {
+	    print "ok\n";
+	    return 0;
+	}
+	print "nonzero exit status\n";
+	return 1;
+    }
+
+    system "egrep -s '^#|Execution failed!' $log";
+    if ( $? == 0 ) {
+	if ($info{"status"} eq "incorrect") {
+	    print "ok\n";
+	    return 0;
+	}
+	print "execution failed\n";
+	return 1;
+    }
+
+    if ($info{"status"} eq "incorrect") {
+	print "this test should have failed\n";
+	return 1;
+    }
+
+    # Extract the result
+    open(RES,">$tmp1");
+    open(LOG,"<$log");
+    while(<LOG>) {
+	if (/^fclass/../^end/) {
+	    s/^[ \t]*//;
+	    s/[ \t]+/ /;
+	    print RES $_;
+	}
+    }
+    close LOG;
+    close RES;
+
+    # Compare
+    system "sort $tmp1 > $tmp1-sorted";
+    system "sort $tmp2 > $tmp2-sorted";
+    system "diff -w $tmp1-sorted $tmp2-sorted > $tmp3";
+
+    if ( $? != 0 ) {
+	  open(LOG,">>$log");
+	  print LOG "\n";
+	  print LOG "Equation diff:\n\n";
+
+	  open(DIFF,"<$tmp3");
+	  while(<DIFF>) {
+	      if (/^>(.*)$/) {
+		  print LOG "expected:$1\n";
+		  $mismatch = 1;
+	      } elsif (/^<(.*)$/) {
+		  if (/^< *String(.*)\.unit;$/) {
+		      # igore missing units
+		  } else {
+		      print LOG "got:     $1\n";
+		      $mismatch = 1;
+		  }
+	      }
+	  }
+	  close DIFF;
+	  close LOG;
+
+	  if ($mismatch) {
+	      print "equation mismatch\n";
+	      return 1;
+	  }
+      }
+
+    print "ok\n";
+    return 0;
+}
+
+sub dofile
+{
+    my $f = shift;
+    my %info = ("status"   => "unknown",
+		"name"     => $f,
+		"keywords" => "unknown");
+    $log = "/tmp/log-$f";
+
+    # Find the expected result
+    open(OUT,">$tmp2");
+    open(IN,"<$f");
+    while(<IN>) {
+	if (/^\/\/[ \\|]([a-z]*): *(.*)$/) {
+	    $info{$1} = $2;
+	    # print "Noticed $1 = $2\n";
+	} elsif (/^\/\/ fclass/../^\/\/ end/) {
+	    s/^[ \t]*//;
+	    s/[ \t]+/ /;
+	    print OUT substr($_,3);
+	}
+    }
+    close IN;
+    close OUT;
+
+    # Check for keyword match
+    if ($#keys >=0) {
+	my %ks;
+	for (split(/ *, */,$info{"keywords"})) { $ks{$_} = 1; }
+	for (@keys) {
+	    if (! $ks{$_}) {
+		return 0;
+	    }
+	}
+    }
+
+    # Check for status match
+     if ($statusfilter ne "all") {
+ 	if ($info{"status"} ne $statusfilter) {
+ 	    return 0;
+ 	}
+     }
+
+    # Collecting files
+    if ($collectcases) {
+	if ($info{'status'} ne "unknown") {
+	    print $info{'name'}."\n";
+	}
+	return 0;
+    }
+
+    # Collecting keys?
+    if ($collectkeys) {
+	if ($info{"keywords"}) {
+	    for (split(/ *, */, $info{"keywords"})) {
+		if (!$knownkeys{$_}) {
+		    $knownkeys{$_} = 1;
+		} else {
+		    $knownkeys{$_} += 1;
+		}
+	    }
+	}
+	return 0;
+    }
+
+    printf(" %s %-31s... ",
+	   $info{'status'} eq 'correct'?'+':'-', $info{'name'});
+    $total = $total + 1;
+
+    if ( $info{"status"} !~ /^(erroneous|(in|)correct)$/ ) {
+	print "unknown testcase status\n";
+	return 1;
+    }
+
+    $status = runone $f,%info;
+    if ($status == 0) {
+	$successes = $successes + 1;
+    } else {
+	if ($verbose eq "yes" ) {
+	    print "\n";
+	    print "==== Log $log\n";
+	    system "$pager $log";
+	}
+    }
+}
+
+while ($#ARGV >= 0) {
+    $arg = shift(@ARGV);
+    if ($arg eq "-v") {
+	$verbose="yes";
+    } elsif ($arg eq "-p") {
+	if ($ENV{"PAGER"} eq "") {
+	    $pager="more";
+	} else {
+	    $pager=$ENV{"PAGER"};
+	}
+    } elsif ($arg eq "-k") {
+	if ($#ARGV < 0) {
+	    print "-m needs an argument\n";
+	    exit 1;
+	}
+	@keys = split(/,/,shift(@ARGV));
+    } elsif ($arg eq "-s") {
+	if ($#ARGV < 0) {
+	    print "-s needs an argument\n";
+	    exit 1;
+	}
+	$statusfilter = shift;
+    } elsif ($arg eq "-l") {
+	$collectkeys = 1;
+    } elsif ($arg eq "-L") {
+	$collectcases = 1;
+    } else {	
+	$filearg = 1;
+	dofile $arg;
+    }
+}
+
+# Check for no file args
+if ($filearg == 0) {
+    for (glob '*.mo') { dofile $_; }
+}
+
+# Final output. Statistics and stuff
+if ($collectkeys || $collectcases) {
+    for (sort(keys %knownkeys)) {
+	printf "  %3d %s\n", $knownkeys{$_}, $_;
+    }
+} else {
+    printf "\n== %d out of %d tests succeeded\n", $successes, $total;
+}
Index: tags/v1_0_dk2/modeq/testsuite/runtest
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/runtest	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/runtest	(revision 344)
@@ -0,0 +1,92 @@
+#!/bin/sh
+
+successes=0
+total=0
+verbose=no
+page=cat
+
+runone ()
+{
+    f=$1
+    
+    log=/tmp/log-$f
+    
+    ../modeq $f >$log 2>&1;
+    
+    if [ $? -ne 0 ]; then
+	echo nonzero exit status
+	return 1
+    fi
+    
+    if egrep '^#|Execution failed!' $log; then
+#	echo Log saved in $log
+	return 1
+    fi
+
+    tmp1=/tmp/equations-1
+    tmp2=/tmp/equations-2
+
+    cp $log $tmp1
+    ed $tmp1 >/dev/null 2>&1 <<EOF
+1,/^fclass/d
+/^(end|equation|algorithm)/,\$d
+w
+q
+EOF
+
+    cut -c 4- $f > $tmp2
+    ed $tmp2 >/dev/null 2>&1 <<EOF
+1,/^fclass/d
+/^(end|equation|algorithm)/,\$d
+w
+q
+EOF
+
+    sort $tmp1 > $tmp1-sorted
+    sort $tmp2 > $tmp2-sorted
+
+    diff -w $tmp1-sorted $tmp2-sorted > $tmp1
+
+    if [ $? != 0 ]; then
+	  echo "equation mismatch"
+	  echo >> $log
+	  echo Equation diff: >> $log
+	  sed -n -e 's/^>\(.*\)/expected:\1/p' \
+		 -e 's/^<\(.*\)/got:     \1/p' \
+	      < $tmp1 >> $log
+	  return 1
+    fi
+    return 0
+}
+
+for arg in $*; do
+    case $arg in
+
+    -v)
+	verbose=yes
+	;;
+
+    -p)
+	page=${PAGER:-more}
+	;;
+
+    *)
+	printf "  %-24s... " $arg
+	total=`expr $total + 1`
+	runone $arg
+	if [ $? -eq 0 ]; then
+	    printf 'ok\n'
+	    successes=`expr $successes + 1`
+	else
+	    if [ $verbose = yes ]; then
+		echo
+		echo ==== Log $log
+		$page $log
+	    fi
+    #	printf 'failed\n'
+	fi
+	;;
+    esac
+done
+
+printf '\n== %d out of %d tests succeeded\n' $successes $total
Index: tags/v1_0_dk2/modeq/testsuite/template.el
===================================================================
--- tags/v1_0_dk2/modeq/testsuite/template.el	(revision 344)
+++ tags/v1_0_dk2/modeq/testsuite/template.el	(revision 344)
@@ -0,0 +1,10 @@
+(tempo-define-template "testhead"
+		       '("// name:     "
+			 (let ((f (file-name-nondirectory (buffer-file-name))))
+			   (substring f 0 (string-match "\\." f))) n
+			 "// keywords: " (p "keywords: ") n
+			 "// status:   " (p "status: ") n
+			 "// " n
+			 "// " p n
+			 "// " n
+			 ))
