1 |
REQUIRE "system.a4l"; |
2 |
(* => system.a4l, basemodel.a4l *) |
3 |
PROVIDE "z-alike.a4c"; |
4 |
(* |
5 |
* This file is part of the ASCEND Modeling Library and is released |
6 |
* under the GNU Public License as described at the end of this file. |
7 |
* |
8 |
* Use of this module is in an empty ascend system. |
9 |
*) |
10 |
|
11 |
(*********************************************************************\ |
12 |
\*********************************************************************) |
13 |
|
14 |
MODEL test_alike_base; |
15 |
NOTES 'purpose' SELF |
16 |
{ This library exercises parser error checking. All models with fail_ |
17 |
in the name should fail. All models with pass_ in the name should pass |
18 |
but make AA noise. |
19 |
} |
20 |
END NOTES; |
21 |
|
22 |
END test_alike_base; |
23 |
|
24 |
MODEL a (x WILL_BE real;) REFINES test_alike_base; |
25 |
(* simple dummy parameterized object *) |
26 |
END a; |
27 |
|
28 |
MODEL fail_1_illegal_aa_of_ATOM_children REFINES test_alike_base; |
29 |
(* bad *) |
30 |
x IS_A solver_var; |
31 |
z1,z2 IS_A a(x); |
32 |
x.lower_bound,z1.upper_bound ARE_ALIKE; |
33 |
END fail_1_illegal_aa_of_ATOM_children; |
34 |
|
35 |
MODEL fail_2_illegal_aa_of_missing_children REFINES test_alike_base; |
36 |
(* bad *) |
37 |
x IS_A solver_var; |
38 |
z1,z2 IS_A a(x); |
39 |
x.lower_bound.y,z1.upper_bound.y ARE_ALIKE; |
40 |
END fail_2_illegal_aa_of_missing_children; |
41 |
|
42 |
MODEL fail_3_illegal_aa_down_in_parameterized_object REFINES test_alike_base; |
43 |
(* bad *) |
44 |
x IS_A solver_var; |
45 |
z1,z2 IS_A a(x); |
46 |
z1.x,z2.x ARE_ALIKE; |
47 |
END fail_3_illegal_aa_down_in_parameterized_object; |
48 |
|
49 |
MODEL fail_4_illegal_aa_of_parameterized_object REFINES test_alike_base; |
50 |
(* bad *) |
51 |
x IS_A solver_var; |
52 |
z1,z2 IS_A a(x); |
53 |
z1,z2 ARE_ALIKE; |
54 |
END fail_4_illegal_aa_of_parameterized_object; |
55 |
|
56 |
MODEL fail_5_illegal_aa_of_real_with_array REFINES test_alike_base; |
57 |
(* bad *) |
58 |
a[1..2] IS_A real; |
59 |
b[1..3] IS_A real; |
60 |
a[1],b ARE_ALIKE; |
61 |
END fail_5_illegal_aa_of_real_with_array; |
62 |
|
63 |
MODEL fail_6_illegal_aa_of_relations REFINES test_alike_base; |
64 |
(* bad *) |
65 |
x IS_A real; |
66 |
a: x=1; |
67 |
b: x=1; |
68 |
a,b ARE_ALIKE; |
69 |
END fail_6_illegal_aa_of_relations; |
70 |
|
71 |
MODEL pass_1 REFINES test_alike_base; |
72 |
a,b IS_A solver_var; |
73 |
a,b ARE_ALIKE; |
74 |
END pass_1; |
75 |
|
76 |
MODEL box REFINES test_alike_base; |
77 |
(* another little test MODEL part *) |
78 |
x IS_A solver_var; |
79 |
END box; |
80 |
|
81 |
MODEL pass_2_legal_aa_down_in_unparameterized_object REFINES test_alike_base; |
82 |
a,b IS_A box; |
83 |
a.x,b.x ARE_ALIKE; |
84 |
END pass_2_legal_aa_down_in_unparameterized_object; |
85 |
|
86 |
|
87 |
(* |
88 |
* z-arealike.a4c |
89 |
* by Benjamin Allan |
90 |
* Part of the ASCEND Library |
91 |
* $Date: 1998/06/17 19:39:31 $ |
92 |
* $Revision: 1.3 $ |
93 |
* $Author: mthomas $ |
94 |
* $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/z-alike.a4c,v $ |
95 |
* |
96 |
* This file is part of the ASCEND Modeling Library. |
97 |
* |
98 |
* Copyright (C) 1997 Benjamin Allan |
99 |
* |
100 |
* The ASCEND Modeling Library is free software; you can redistribute |
101 |
* it and/or modify it under the terms of the GNU General Public |
102 |
* License as published by the Free Software Foundation; either |
103 |
* version 2 of the License, or (at your option) any later version. |
104 |
* |
105 |
* The ASCEND Modeling Library is distributed in hope that it |
106 |
* will be useful, but WITHOUT ANY WARRANTY; without even the implied |
107 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
108 |
* See the GNU General Public License for more details. |
109 |
* |
110 |
* You should have received a copy of the GNU General Public License |
111 |
* along with the program; if not, write to the Free Software |
112 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check |
113 |
* the file named COPYING. |
114 |
*) |