/[ascend]/trunk/base/generic/compiler/mathinst.h
ViewVC logotype

Diff of /trunk/base/generic/compiler/mathinst.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 300 by jds, Tue Aug 2 11:20:09 2005 UTC revision 301 by johnpye, Mon Feb 20 07:39:14 2006 UTC
# Line 42  Line 42 
42   *  </pre>   *  </pre>
43   */   */
44    
45  #ifndef __MATHINST_H_SEEN__  #ifndef ASC_MATHINST_H
46  #define __MATHINST_H_SEEN__  #define ASC_MATHINST_H
47    
48  extern enum Expr_enum GetInstanceRelationType(CONST struct Instance *i);  extern enum Expr_enum GetInstanceRelationType(CONST struct Instance *i);
49  /**<  /**<
  *  <!--  enum Expr_enum GetInstanceRelationType(i);                   -->  
  *  <!--  const struct Instance *i;                                    -->  
50   *  This returns the type of the relation associated with this relations   *  This returns the type of the relation associated with this relations
51   *  instance (REL_INST).   *  instance (REL_INST).
52   *  This should be one of e_token, e_opcode, e_glassbox or e_blackbox.   *  This should be one of e_token, e_opcode, e_glassbox or e_blackbox.
# Line 56  extern enum Expr_enum GetInstanceRelatio Line 54  extern enum Expr_enum GetInstanceRelatio
54    
55  extern CONST struct relation *GetInstanceRelationOnly(CONST struct Instance *i);  extern CONST struct relation *GetInstanceRelationOnly(CONST struct Instance *i);
56  /**<  /**<
  *  <!--  const struct relation *GetInstanceRelationOnly(i)            -->  
  *  <!--  const struct Instance *i;                                    -->  
57   *  This returns the guts of a relation instance (REL_INST).   *  This returns the guts of a relation instance (REL_INST).
58   *  These should be treated as read only usually because you don't   *  These should be treated as read only usually because you don't
59   *  know who is sharing those guts.   *  know who is sharing those guts.
# Line 66  extern CONST struct relation *GetInstanc Line 62  extern CONST struct relation *GetInstanc
62  extern CONST struct relation *GetInstanceRelation(CONST struct Instance *i,  extern CONST struct relation *GetInstanceRelation(CONST struct Instance *i,
63                                                    enum Expr_enum *type);                                                    enum Expr_enum *type);
64  /**<  /**<
  *  <!--  const struct relation *GetInstanceRelation(i,type)           -->  
  *  <!--  const struct Instance *i;                                    -->  
  *  <!--  enum Expr_enum *type;                                        -->  
65   *  This returns the value of a relation inst(REL_INST). It will fill in   *  This returns the value of a relation inst(REL_INST). It will fill in
66   *  the type of the relation associated with this relation instance.   *  the type of the relation associated with this relation instance.
67   *  This will be one of e_token, e_opcode, e_glassbox or e_blackbox,   *  This will be one of e_token, e_opcode, e_glassbox or e_blackbox,
# Line 78  extern CONST struct relation *GetInstanc Line 71  extern CONST struct relation *GetInstanc
71  extern struct relation *GetInstanceRelToModify(struct Instance *i,  extern struct relation *GetInstanceRelToModify(struct Instance *i,
72                                                 enum Expr_enum *type);                                                 enum Expr_enum *type);
73  /**<  /**<
  *  <!--  struct relation *GetInstanceRelToModify(i,type)              -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  enum Expr_enum *type;                                        -->  
74   *  This returns the value of a relation inst(REL_INST). In this function   *  This returns the value of a relation inst(REL_INST). In this function
75   *  we do not get a CONST structure and therefore we can modify it. This   *  we do not get a CONST structure and therefore we can modify it. This
76   *  is useful while marking conditional relations.   *  is useful while marking conditional relations.
# Line 90  extern void SetInstanceRelation(struct I Line 80  extern void SetInstanceRelation(struct I
80                                           struct relation *rel,                                           struct relation *rel,
81                                           enum Expr_enum type);                                           enum Expr_enum type);
82  /**<  /**<
  *  <!--  void SetInstanceRelation(i,rel,type)                         -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  struct relation *rel;                                        -->  
  *  <!--  enum Expr_enum type;                                         -->  
83   *  Set the relation to rel.  rel will be incorporated into the instance,   *  Set the relation to rel.  rel will be incorporated into the instance,
84   *  so rel should not be modified or destroyed. The type of the relation   *  so rel should not be modified or destroyed. The type of the relation
85   *  *has* to be provided.   *  *has* to be provided.
# Line 102  extern void SetInstanceRelation(struct I Line 88  extern void SetInstanceRelation(struct I
88    
89  extern CONST struct logrelation *GetInstanceLogRelOnly(CONST struct Instance*i);  extern CONST struct logrelation *GetInstanceLogRelOnly(CONST struct Instance*i);
90  /**<  /**<
  *  <!--  const struct logrelation *GetInstanceLogRelOnly(i)           -->  
  *  <!--  const struct Instance *i;                                    -->  
91   *  This returns the guts of a logical relation instance (LREL_INST).   *  This returns the guts of a logical relation instance (LREL_INST).
92   *  These should be treated as read only usually because you don't   *  These should be treated as read only usually because you don't
93   *  know who is sharing those guts.   *  know who is sharing those guts.
# Line 111  extern CONST struct logrelation *GetInst Line 95  extern CONST struct logrelation *GetInst
95    
96  extern CONST struct logrelation *GetInstanceLogRel(CONST struct Instance *i);  extern CONST struct logrelation *GetInstanceLogRel(CONST struct Instance *i);
97  /**<  /**<
  *  <!--  const struct logrelation *GetInstanceLogRel(i)               -->  
  *  <!--  const struct Instance *i;                                    -->  
98   *  This returns the value of a logrelation inst(LREL_INST).   *  This returns the value of a logrelation inst(LREL_INST).
99   */   */
100    
101  extern struct logrelation *GetInstanceLogRelToModify(struct Instance *i);  extern struct logrelation *GetInstanceLogRelToModify(struct Instance *i);
102  /**<  /**<
  *  <!--  struct logrelation *GetInstanceLogRelToModify(i)             -->  
  *  <!--  struct Instance *i;                                          -->  
103   *  This returns the value of a logrelation inst(LREL_INST). In this function   *  This returns the value of a logrelation inst(LREL_INST). In this function
104   *  we do not get a CONST structure and therefore we can modify it. This   *  we do not get a CONST structure and therefore we can modify it. This
105   *  is useful while marking conditional logrelations.   *  is useful while marking conditional logrelations.
# Line 127  extern struct logrelation *GetInstanceLo Line 107  extern struct logrelation *GetInstanceLo
107    
108  extern void SetInstanceLogRel(struct Instance *i, struct logrelation *lrel);  extern void SetInstanceLogRel(struct Instance *i, struct logrelation *lrel);
109  /**<  /**<
  *  <!--  void SetInstanceLogRel(i,lrel)                               -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  struct logrelation *lrel;                                    -->  
110   *  Set the logical relation to lrel.  rel will be incorporated into the   *  Set the logical relation to lrel.  rel will be incorporated into the
111   *  instance, so rel should not be modified or destroyed.   *  instance, so rel should not be modified or destroyed.
112   */   */
113    
114  extern struct gl_list_t *GetInstanceOperands(CONST struct Instance *i);  extern struct gl_list_t *GetInstanceOperands(CONST struct Instance *i);
115  /**<  /**<
  * <!--  l = GetInstanceOperands(i);                                   -->  
116   * Returns list of vars/models/equations in a mathematical relationship.   * Returns list of vars/models/equations in a mathematical relationship.
117   * Accepts all instance kinds. returns list only if the query makes   * Accepts all instance kinds. returns list only if the query makes
118   * sense, but list may be empty. List is yours to destroy, but its   * sense, but list may be empty. List is yours to destroy, but its
# Line 145  extern struct gl_list_t *GetInstanceOper Line 121  extern struct gl_list_t *GetInstanceOper
121    
122  extern struct gl_list_t *GetInstanceWhenVars(CONST struct Instance *i);  extern struct gl_list_t *GetInstanceWhenVars(CONST struct Instance *i);
123  /**<  /**<
  *  <!--  gl_list_t *GetInstanceWhenVars(i);                           -->  
  *  <!--  struct Instance *i;                                          -->  
124   *  This returns the list of variables associated with this when   *  This returns the list of variables associated with this when
125   *  instance (WHEN_INST)   *  instance (WHEN_INST)
126   */   */
127    
128  extern struct gl_list_t *GetInstanceWhenCases(CONST struct Instance *i);  extern struct gl_list_t *GetInstanceWhenCases(CONST struct Instance *i);
129  /**<  /**<
  *  <!--  gl_list_t *GetInstanceWhenCases(i);                          -->  
  *  <!--  struct Instance *i;                                          -->  
130   *  This returns the list of cases associated with this when   *  This returns the list of cases associated with this when
131   *  instance (WHEN_INST)   *  instance (WHEN_INST)
132   */   */
133    
134  extern struct gl_list_t *GetInstanceWhens(CONST struct Instance *i);  extern struct gl_list_t *GetInstanceWhens(CONST struct Instance *i);
135  /**<  /**<
  *  <!--  strcut gl_list_t *GetInstanceWhens(i);                       -->  
  *  <!--  struct Instance *i;                                          -->  
136   *  This returns the list of whens associated with this instance.   *  This returns the list of whens associated with this instance.
137   *  Instance can be a model, relation,when,boolean, integer or symbol.   *  Instance can be a model, relation,when,boolean, integer or symbol.
138   */   */
139    
140  extern void SetWhenVarList(struct Instance *i, struct gl_list_t *whenvars);  extern void SetWhenVarList(struct Instance *i, struct gl_list_t *whenvars);
141  /**<  /**<
  *  <!--  void SetWhenVarList(i,whenvars);                             -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  struct gl_list_t *whenvars;                                  -->  
142   *  Set the list of variables of a when instance to whenvars   *  Set the list of variables of a when instance to whenvars
143   */   */
144    
145  extern void SetWhenCases(struct Instance *i, struct gl_list_t *whencases);  extern void SetWhenCases(struct Instance *i, struct gl_list_t *whencases);
146  /**<  /**<
  *  <!--  void SetWhenCases(i,whencases);                              -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  struct gl_list_t *whencases;                                 -->  
147   *  Set the list of cases of a when instance to whencases   *  Set the list of cases of a when instance to whencases
148   */   */
149    
# Line 193  extern void SetWhenCases(struct Instance Line 157  extern void SetWhenCases(struct Instance
157    
158  extern unsigned long RelationsCount(CONST struct Instance *i);  extern unsigned long RelationsCount(CONST struct Instance *i);
159  /**<  /**<
  *  <!--  unsigned long RelationsCount(i)                              -->  
  *  <!--  struct Instance *i;                                          -->  
160   *  This will return the number of relations that instance "i" appears in.   *  This will return the number of relations that instance "i" appears in.
161   *  "i" must be a REAL_ATOM_INST.  Otherwise, this routine will   *  "i" must be a REAL_ATOM_INST.  Otherwise, this routine will
162   *  bomb.   *  bomb.
# Line 203  extern unsigned long RelationsCount(CONS Line 165  extern unsigned long RelationsCount(CONS
165  extern struct Instance *RelationsForAtom(CONST struct Instance *i,  extern struct Instance *RelationsForAtom(CONST struct Instance *i,
166                                           unsigned long c);                                           unsigned long c);
167  /**<  /**<
  *  <!--  struct Instance *Relation(i,c)                               -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  unsigned long c;                                             -->  
168   *  This routine will return the c'th relation in instance i's relation list.   *  This routine will return the c'th relation in instance i's relation list.
169   *  "i" must be a REAL_ATOM_INST and 0 < c <= RelationsCount(i).   *  "i" must be a REAL_ATOM_INST and 0 < c <= RelationsCount(i).
170   */   */
171    
172  extern void AddRelation(struct Instance *i, struct Instance *reln);  extern void AddRelation(struct Instance *i, struct Instance *reln);
173  /**<  /**<
  *  <!--  void AddRelation(i,reln)                                     -->  
  *  <!--  struct Instance *i,*reln;                                    -->  
174   *  Add the relation instance reln to instance i's relation list.  "i" must   *  Add the relation instance reln to instance i's relation list.  "i" must
175   *  be of type REAL_ATOM_INST and reln must be of type REL_INST.   *  be of type REAL_ATOM_INST and reln must be of type REL_INST.
176   */   */
177    
178  extern void RemoveRelation(struct Instance *i, struct Instance *reln);  extern void RemoveRelation(struct Instance *i, struct Instance *reln);
179  /**<  /**<
  *  <!--  void RemoveRelation(i,reln)                                  -->  
  *  <!--  struct Instance *i,*reln;                                    -->  
180   *  Remove reln from i's relation list.  If 'reln' isn't found in i's relation   *  Remove reln from i's relation list.  If 'reln' isn't found in i's relation
181   *  list, execution continues with a warning message.   *  list, execution continues with a warning message.
182   */   */
183    
184  extern unsigned long LogRelationsCount(CONST struct Instance *i);  extern unsigned long LogRelationsCount(CONST struct Instance *i);
185  /**<  /**<
  *  <!--  unsigned long LogRelationsCount(i)                           -->  
  *  <!--  struct Instance *i;                                          -->  
186   *  This will return the number of logical relations that instance "i"   *  This will return the number of logical relations that instance "i"
187   *  appears in. "i" must be a BOOLEAN_ATOM_INST, REL_INST or LREL_INST   *  appears in. "i" must be a BOOLEAN_ATOM_INST, REL_INST or LREL_INST
188   */   */
# Line 237  extern unsigned long LogRelationsCount(C Line 190  extern unsigned long LogRelationsCount(C
190  extern struct Instance *LogRelationsForInstance(CONST struct Instance *i,  extern struct Instance *LogRelationsForInstance(CONST struct Instance *i,
191                                                  unsigned long c);                                                  unsigned long c);
192  /**<  /**<
  *  <!--  struct Instance *LogRelationsForInstance(i,c)                -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  unsigned long c;                                             -->  
193   *  This routine will return the c'th logical relation in instance i's   *  This routine will return the c'th logical relation in instance i's
194   *  logical relation list. "i" must be  BOOLEAN_ATOM_INST, REL_INST or   *  logical relation list. "i" must be  BOOLEAN_ATOM_INST, REL_INST or
195   *  LREL_INST  and  0 < c <= LogRelationsCount(i).   *  LREL_INST  and  0 < c <= LogRelationsCount(i).
# Line 247  extern struct Instance *LogRelationsForI Line 197  extern struct Instance *LogRelationsForI
197    
198  extern void AddLogRel(struct Instance *i, struct Instance *reln);  extern void AddLogRel(struct Instance *i, struct Instance *reln);
199  /**<  /**<
  *  <!--  void AddLogRel(i,reln)                                       -->  
  *  <!--  struct Instance *i,*lreln;                                   -->  
200   *  Add the logical relation instance lreln to instance i's logical relation   *  Add the logical relation instance lreln to instance i's logical relation
201   *  list.  "i" must be of type BOOLEAN_ATOM_INST, REL_INST or LREL_INST   *  list.  "i" must be of type BOOLEAN_ATOM_INST, REL_INST or LREL_INST
202   *  and lreln must be of type LREL_INST. REL_INST and LREL_INST are   *  and lreln must be of type LREL_INST. REL_INST and LREL_INST are
# Line 257  extern void AddLogRel(struct Instance *i Line 205  extern void AddLogRel(struct Instance *i
205    
206  extern void RemoveLogRel(struct Instance *i, struct Instance *lreln);  extern void RemoveLogRel(struct Instance *i, struct Instance *lreln);
207  /**<  /**<
  *  <!--  void RemoveLogRel(i,lreln)                                   -->  
  *  <!--  struct Instance *i,*lreln;                                   -->  
208   *  Remove lreln from i's logical relation list.  If 'lreln' isn't found in   *  Remove lreln from i's logical relation list.  If 'lreln' isn't found in
209   *  i's logical relation list, execution continues with a warning message.   *  i's logical relation list, execution continues with a warning message.
210   */   */
211    
212  extern unsigned long WhensCount(struct Instance *i);  extern unsigned long WhensCount(struct Instance *i);
213  /**<  /**<
  *  <!--  unsigned long WhensCount(i)                                  -->  
  *  <!--  struct Instance *i;                                          -->  
214   *  This will return the number of whens that instance "i" is referenced in.   *  This will return the number of whens that instance "i" is referenced in.
215   */   */
216    
217  extern struct Instance *WhensForInstance(struct Instance *i,  extern struct Instance *WhensForInstance(struct Instance *i,
218                                           unsigned long c);                                           unsigned long c);
219  /**<  /**<
  *  <!--  struct Instance *WhensForInstance(i,c)                       -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  unsigned long c;                                             -->  
220   *  This routine will return the c'th when in instance i's when list.   *  This routine will return the c'th when in instance i's when list.
221   *  0 < c <= WhensCount(i).   *  0 < c <= WhensCount(i).
222   */   */
223    
224  extern void AddWhen(struct Instance *i, struct Instance *when);  extern void AddWhen(struct Instance *i, struct Instance *when);
225  /**<  /**<
  *  <!--  void AddWhen(i,when)                                         -->  
  *  <!--  struct Instance *i,*when;                                    -->  
226   *  Add the when instance when to instance i's when list.  when must be of   *  Add the when instance when to instance i's when list.  when must be of
227   *  type WHEN_INST.   *  type WHEN_INST.
228   */   */
229    
230  extern void RemoveWhen(struct Instance *i, struct Instance *when);  extern void RemoveWhen(struct Instance *i, struct Instance *when);
231  /**<  /**<
  *  <!--  void RemoveWhen(i,when)                                      -->  
  *  <!--  struct Instance *i,*when;                                    -->  
232   *  Remove when from i's when list.  If 'when' isn't found in i's when   *  Remove when from i's when list.  If 'when' isn't found in i's when
233   *  list, execution continues with a warning message.   *  list, execution continues with a warning message.
234   */   */
235    
236  #endif  /* __MATHINST_H_SEEN__ */  #endif  /* ASC_MATHINST_H */
237    

Legend:
Removed from v.300  
changed lines
  Added in v.301

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22