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

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

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

revision 271 by johnpye, Mon Jan 30 06:09:52 2006 UTC revision 272 by johnpye, Sun Feb 5 06:43:19 2006 UTC
# Line 58  extern struct gl_list_t *ShortestPath(CO Line 58  extern struct gl_list_t *ShortestPath(CO
58                                        /* CONST */ unsigned int height,                                        /* CONST */ unsigned int height,
59                                        /* CONST */ unsigned int best);                                        /* CONST */ unsigned int best);
60  /**<  /**<
  *  <!--  struct gl_list_t *ShortestPath(inst,ref,height,best)         -->  
  *  <!--  const struct Instance *inst, *ref;                           -->  
  *  <!--  const unsigned int height,best;                              -->  
61   *  Collect all instances in path connecting inst with ref and returns   *  Collect all instances in path connecting inst with ref and returns
62   *  them in a list.  If path doesn't exist, it returns NULL.  Path will   *  them in a list.  If path doesn't exist, it returns NULL.  Path will
63   *  be such that the smallest number of intermediate instances are used.   *  be such that the smallest number of intermediate instances are used.
# Line 73  extern struct gl_list_t *ShortestPath(CO Line 70  extern struct gl_list_t *ShortestPath(CO
70    
71  extern struct gl_list_t *AllPaths(CONST struct Instance *inst);  extern struct gl_list_t *AllPaths(CONST struct Instance *inst);
72  /**<  /**<
  *  <!--  struct gl_list_t *AllPaths(inst)                             -->  
  *  <!--  const struct Instance *i;                                    -->  
  *  
73   *  AllPaths makes and returns a list of lists of NameNode structures.   *  AllPaths makes and returns a list of lists of NameNode structures.
74   *  Each member of list AllPaths returns is a path from the given instance   *  Each member of list AllPaths returns is a path from the given instance
75   *  to root.<br><br>   *  to root.<br><br>
# Line 96  extern struct gl_list_t *AllPaths(CONST Line 90  extern struct gl_list_t *AllPaths(CONST
90    
91  extern struct gl_list_t *ISAPaths(CONST struct gl_list_t *pathlist);  extern struct gl_list_t *ISAPaths(CONST struct gl_list_t *pathlist);
92  /**<  /**<
  *  <!--  struct gl_list_t *ISAPaths(pathlist)                         -->  
  *  <!--  struct gl_list_t *pathlist, *list;                           -->  
  *  <!--  isalist = ISAPaths(pathlist);                                -->  
  *  
93   *  Given pathlist, the output of AllPaths, returns the list of   *  Given pathlist, the output of AllPaths, returns the list of
94   *  names which are real: that is names which have been constructed   *  names which are real: that is names which have been constructed
95   *  without ALIASES or WILL_BE's intermediate.   *  without ALIASES or WILL_BE's intermediate.
# Line 113  extern int WriteInstanceName(FILE *f, Line 103  extern int WriteInstanceName(FILE *f,
103                               CONST struct Instance *i,                               CONST struct Instance *i,
104                               CONST struct Instance *ref);                               CONST struct Instance *ref);
105  /**<  /**<
  *  <!--  int WriteInstanceName(f,i,ref)                               -->  
  *  <!--  const struct Instance *i,*ref;                               -->  
  *  <!--  FILE *f;                                                     -->  
106   *  Print the instance's name to the specified file.  The name that is   *  Print the instance's name to the specified file.  The name that is
107   *  printed is derived from the shortest path between i and ref.  If   *  printed is derived from the shortest path between i and ref.  If
108   *  ref is NULL, the shortest path to root is used. The number of   *  ref is NULL, the shortest path to root is used. The number of
# Line 127  extern void WriteInstanceNameDS(Asc_DStr Line 114  extern void WriteInstanceNameDS(Asc_DStr
114                                  CONST struct Instance *i,                                  CONST struct Instance *i,
115                                  CONST struct Instance *ref);                                  CONST struct Instance *ref);
116  /**<  /**<
  *  <!--  WriteInstanceNameDS(dsPtr,i,ref)                             -->  
  *  <!--  const struct Instance *i,*ref;                               -->  
  *  <!--  Asc_DString *dsPtr;                                          -->  
117   *  Print the instance's name to the specified dstring.  The name that is   *  Print the instance's name to the specified dstring.  The name that is
118   *  printed is derived from the shortest path between i and ref.  If   *  printed is derived from the shortest path between i and ref.  If
119   *  ref is NULL, the shortest path to root is used.   *  ref is NULL, the shortest path to root is used.
# Line 141  extern void WriteInstanceNameDS(Asc_DStr Line 125  extern void WriteInstanceNameDS(Asc_DStr
125  extern char *WriteInstanceNameString(CONST struct Instance *i,  extern char *WriteInstanceNameString(CONST struct Instance *i,
126                                       CONST struct Instance *ref);                                       CONST struct Instance *ref);
127  /**<  /**<
  *  <!--  result = WriteInstanceNameString(i,ref)                      -->  
  *  <!--  const struct Instance *i,*ref;                               -->  
  *  <!--  char *result;                                                -->  
128   *  Return a string (that the user must destroy eventually).  The name that is   *  Return a string (that the user must destroy eventually).  The name that is
129   *  printed is derived from the shortest path between i and ref.  If   *  printed is derived from the shortest path between i and ref.  If
130   *  ref is NULL, the shortest path to root is used.   *  ref is NULL, the shortest path to root is used.
# Line 153  extern char *WriteInstanceNameString(CON Line 134  extern char *WriteInstanceNameString(CON
134    
135  extern int WriteAnyInstanceName(FILE *f, struct Instance *i);  extern int WriteAnyInstanceName(FILE *f, struct Instance *i);
136  /**<  /**<
  *  <!--  int  WriteAnyInstanceName(f,i);                              -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  FILE *f;                                                     -->  
137   *  Print the instance's name to the specified file.   *  Print the instance's name to the specified file.
138   *  Very similar to WriteInstanceName().  The name that is   *  Very similar to WriteInstanceName().  The name that is
139   *  printed is derived from *any* path from i to NULL.   *  printed is derived from *any* path from i to NULL.
# Line 166  extern int WriteAnyInstanceName(FILE *f, Line 144  extern int WriteAnyInstanceName(FILE *f,
144    
145  extern unsigned long CountAliases(CONST struct Instance *i);  extern unsigned long CountAliases(CONST struct Instance *i);
146  /**<  /**<
  *  <!--  unsigned long CountAliases(i)                                -->  
147   *  Count all the known names of the instance given.   *  Count all the known names of the instance given.
148   */   */
149    
150  extern unsigned long CountISAs(CONST struct Instance *i);  extern unsigned long CountISAs(CONST struct Instance *i);
151  /**<  /**<
  *  <!--  unsigned long CountISAs(i)                                   -->  
152   *  Count the names with which the instance given was created.   *  Count the names with which the instance given was created.
153   */   */
154    
155  extern void WriteAliases(FILE *f, CONST struct Instance *i);  extern void WriteAliases(FILE *f, CONST struct Instance *i);
156  /**<  /**<
  *  <!--  void WriteAliases(f,i)                                       -->  
  *  <!--  FILE *f;                                                     -->  
  *  <!--  struct Instance *i;                                          -->  
157   *  Print all the instance's names to the specified file.   *  Print all the instance's names to the specified file.
158   */   */
159    
160  extern void WriteISAs(FILE *f, CONST struct Instance *i);  extern void WriteISAs(FILE *f, CONST struct Instance *i);
161  /**<  /**<
  *  <!--  void WriteISAs(f,i)                                          -->  
  *  <!--  FILE *f;                                                     -->  
  *  <!--  struct Instance *i;                                          -->  
162   *  Print the instance's constructed names to the specified file.   *  Print the instance's constructed names to the specified file.
163   *  (there may not be any in bizarre circumstances).   *  (there may not be any in bizarre circumstances).
164   */   */
165    
166  extern struct gl_list_t *WriteAliasStrings(CONST struct Instance *i);  extern struct gl_list_t *WriteAliasStrings(CONST struct Instance *i);
167  /**<  /**<
  *  <!--  aliases=WriteAliasStrings(i);                                -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  struct gl_list_t *aliases;                                   -->  
  *  
168   *  Return a list of strings of all the possible instance names for i.   *  Return a list of strings of all the possible instance names for i.
169   *  The list AND the strings on it are the user's responsibility to destroy.   *  The list AND the strings on it are the user's responsibility to destroy.
170   *  gl_free_and_destroy(aliases) would be convenient.   *  gl_free_and_destroy(aliases) would be convenient.
# Line 206  extern struct gl_list_t *WriteAliasStrin Line 172  extern struct gl_list_t *WriteAliasStrin
172    
173  extern struct gl_list_t *WriteISAStrings(CONST struct Instance *i);  extern struct gl_list_t *WriteISAStrings(CONST struct Instance *i);
174  /**<  /**<
  *  <!--  aliases=WriteISAStrings(i);                                  -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  struct gl_list_t *aliases;                                   -->  
  *  
175   *  Return a list of strings of all the constructed instance names for i.   *  Return a list of strings of all the constructed instance names for i.
176   *  Names created by WILL_BE/ALIASES are not returned.   *  Names created by WILL_BE/ALIASES are not returned.
177   *  Under bizarre circumstances, the list may be empty.   *  Under bizarre circumstances, the list may be empty.
# Line 223  extern struct gl_list_t *WriteISAStrings Line 185  extern struct gl_list_t *WriteISAStrings
185    
186  extern void WriteClique(FILE *f, CONST struct Instance *i);  extern void WriteClique(FILE *f, CONST struct Instance *i);
187  /**<  /**<
  *  <!--  void WriteClique(f,i)                                        -->  
  *  <!--  FILE *f;                                                     -->  
  *  <!--  struct Instance *i;                                          -->  
188   *  Print all the instance's clique members.   *  Print all the instance's clique members.
189   */   */
190    
191  extern void WriteInstance(FILE *f, CONST struct Instance *i);            extern void WriteInstance(FILE *f, CONST struct Instance *i);          
192  /**<  /**<
  *  <!--  void WriteInstance(f,i)                                      -->  
  *  <!--  FILE *f;                                                     -->  
  *  <!--  struct Instance *i;                                          -->  
193   *  Print the information contained in i.   *  Print the information contained in i.
194   */   */
195    
196  extern int WritePath(FILE *f, CONST struct gl_list_t *path);  extern int WritePath(FILE *f, CONST struct gl_list_t *path);
197  /**<  /**<
  *  <!--  l =  WritePath(f,path);                                      -->  
  *  <!--  FILE *f;                                                     -->  
  *  <!--  CONST struct gl_list_t *path;                                -->  
  *  <!--  int l;                                                       -->  
198   *  Returns the number of name pieces written.   *  Returns the number of name pieces written.
199   */   */
200    
# Line 257  extern char *WritePathString(CONST struc Line 209  extern char *WritePathString(CONST struc
209    
210  extern void SaveInstance(FILE *f, CONST struct Instance *inst, int dorelations);  extern void SaveInstance(FILE *f, CONST struct Instance *inst, int dorelations);
211  /**<  /**<
  *  <!--  void SaveInstance(fp,inst,dorelations);                      -->  
  *  <!--  FILE *fp,                                                    -->  
  *  <!--  const struct Instance *inst;                                 -->  
  *  <!--  int dorelations;                                             -->  
212   *  Save the information contained in inst in a format that will allow   *  Save the information contained in inst in a format that will allow
213   *  efficient reconstruction of the instance. This will be followed up   *  efficient reconstruction of the instance. This will be followed up
214   *  with RestoreInstance.   *  with RestoreInstance.
# Line 268  extern void SaveInstance(FILE *f, CONST Line 216  extern void SaveInstance(FILE *f, CONST
216    
217  extern void WriteInstanceList(struct gl_list_t *list);  extern void WriteInstanceList(struct gl_list_t *list);
218  /**<  /**<
  *  <!--  void WriteInstanceList(list);                                -->  
  *  <!--  struct gl_list_t *list;                                      -->  
219   *  This is a debugging aid and not intended for general use.   *  This is a debugging aid and not intended for general use.
220   *  It assumes that this is a list of instances and will try to write   *  It assumes that this is a list of instances and will try to write
221   *  out the instance name for each element on the list.   *  out the instance name for each element on the list.
# Line 277  extern void WriteInstanceList(struct gl_ Line 223  extern void WriteInstanceList(struct gl_
223    
224  extern void WriteAtomValue(FILE *fp, CONST struct Instance *i);  extern void WriteAtomValue(FILE *fp, CONST struct Instance *i);
225  /**<  /**<
  *  <!--  void WriteAtomValue(fp,i);                                   -->  
  *  <!--  FILE *fp;                                                    -->  
  *  <!--  CONST struct Instance *i;                                    -->  
226   *  Write an instance value to fp.   *  Write an instance value to fp.
227   */   */
228    
# Line 319  extern struct gl_list_t *PushInterfacePt Line 262  extern struct gl_list_t *PushInterfacePt
262                                             int visitorder,                                             int visitorder,
263                                             VOIDPTR vp);                                             VOIDPTR vp);
264  /**<  /**<
  *  <!--  oldips = PushInterfacePtrs(i,ipcreatef,iest,visitorder,vp);  -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  IPFunc ipcreatef;                                            -->  
  *  <!--  unsigned long iest;                                          -->  
  *  <!--  int visitorder;                                              -->  
  *  <!--  struct gl_list_t *oldips;                                    -->  
  *  <!--  VOIDPTR vp;                                                  -->  
  *  
265   *  Creates a gl_list and returns it to you.   *  Creates a gl_list and returns it to you.
266   *  It contains the information needed to restore the state of the   *  It contains the information needed to restore the state of the
267   *  instance interface pointers ipcreatef returns non-NULL values for.   *  instance interface pointers ipcreatef returns non-NULL values for.
# Line 355  extern struct gl_list_t *PushInterfacePt Line 290  extern struct gl_list_t *PushInterfacePt
290    
291  typedef VOIDPTR (*IPDeleteFunc)(struct Instance *, VOIDPTR, VOIDPTR);  typedef VOIDPTR (*IPDeleteFunc)(struct Instance *, VOIDPTR, VOIDPTR);
292  /**<  /**<
  *  <!--  func(i,ipdata,vp);                                           -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  VOIDPTR ipdata;   (you gave us with your IPFunc)             -->  
  *  <!--  VOIDPTR vp;       (the vp you pass to PopInterfacePtrs)      -->  
293   *  This is a function you supply. It will be called with the pointer   *  This is a function you supply. It will be called with the pointer
294   *  you returned in IPFunc and the matching instance and the void   *  you returned in IPFunc and the matching instance and the void
295   *  you passed to PopInterfacePtrs.   *  you passed to PopInterfacePtrs.
# Line 369  extern void PopInterfacePtrs(struct gl_l Line 300  extern void PopInterfacePtrs(struct gl_l
300                               IPDeleteFunc ipdestroyf,                               IPDeleteFunc ipdestroyf,
301                               VOIDPTR vp);                               VOIDPTR vp);
302  /**<  /**<
  *  <!--  PopInterfacePtrs(oldips,ipdestroyf,vp);                      -->  
  *  <!--  IPDeleteFunc ipdestroyf;                                     -->  
  *  <!--  struct gl_list_t *oldips;                                    -->  
  *  <!--  VOIDPTR userdata;                                            -->  
303   *  This function restores the previous state of interface pointers.   *  This function restores the previous state of interface pointers.
304   *  oldips is from a call to PushInterfacePtrs.   *  oldips is from a call to PushInterfacePtrs.
305   *  ipdestroyf is a function you provide.  If you provide NULL   *  ipdestroyf is a function you provide.  If you provide NULL
# Line 384  extern void PopInterfacePtrs(struct gl_l Line 311  extern void PopInterfacePtrs(struct gl_l
311    
312  extern int ArrayIsRelation(struct Instance *i);  extern int ArrayIsRelation(struct Instance *i);
313  /**<  /**<
  *  <!--  r = ArrayIsRelation(i);                                      -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  int r;                                                       -->  
314   *  Returns 1 if the instance sent in is a good relation array or relation,   *  Returns 1 if the instance sent in is a good relation array or relation,
315   *  0 OTHERWISE.   *  0 OTHERWISE.
316   */   */
317    
318  extern int ArrayIsLogRel(struct Instance *i);  extern int ArrayIsLogRel(struct Instance *i);
319  /**<  /**<
  *  <!--  r = ArrayIsLogRel(i);                                        -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  int r;                                                       -->  
320   *  Returns 1 if the instance sent in is a good logical relation array   *  Returns 1 if the instance sent in is a good logical relation array
321   *  or logical relation, 0 OTHERWISE.   *  or logical relation, 0 OTHERWISE.
322   */   */
323    
324  extern int ArrayIsWhen(struct Instance *i);  extern int ArrayIsWhen(struct Instance *i);
325  /**<  /**<
  *  <!--  r = ArrayIsWhen(i);                                          -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  int r;                                                       -->  
326   *  Returns 1 if the instance sent in is a good when array   *  Returns 1 if the instance sent in is a good when array
327   *  or when, 0 OTHERWISE.   *  or when, 0 OTHERWISE.
328   */   */
329    
330  extern int ArrayIsModel(struct Instance *i);  extern int ArrayIsModel(struct Instance *i);
331  /**<  /**<
  *  <!--  r = ArrayIsModel(i);                                         -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  int r;                                                       -->  
332   *  Returns 1 if the instance sent in is a good model array   *  Returns 1 if the instance sent in is a good model array
333   *  or when, 0 OTHERWISE.   *  or when, 0 OTHERWISE.
334   */   */

Legend:
Removed from v.271  
changed lines
  Added in v.272

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