/home/doxygen/libascend/compiler/anonmerg.h File Reference


Detailed Description

Minimalist merge detection for anonymous type detection.
  When including anonmerg.h, make sure these files are included first:
         include "utilities/ascConfig.h"
         include "instance_enum.h"

  The idea is to find and mark all the merges that need to be
  marked to disambiguate the anontype classification scheme
  which can be mislead into believing identical anontypes when
  one instance has some children merged but the other doesn't.
  Put another way, we want to record the minimum set of merges
  that can account for the identity of all variables/constants
  in any relation,logical relation, or when statement.

  Assumptions:


  Desirables:


  Problems:

     Because there is no simple indexing of parents of an instance
     (i.e. I can't travel from a parent p to a child c and easily
     know which of the back (parent) links of c I should follow
     to return to the parent) we must store paths for navigation
     in terms of child number/instance context pairs. Following
     back a parent trail requires a search for the child being
     left which is unacceptable.

  These functions maintain all their own data and do not use any
  global information, EXCEPT that they use instance InterfacePtrs
  tmpnums and anon_flags.
 

(the following is moved from anonmerg.c, needs editing and deduping against above comments)

The idea is to find and mark all the merges that need to be marked to disambiguate the anontype classification scheme which can be mislead into believing identical anontypes when one instance has some children merged but the other doesn't. Put another way, we want to record the minimum set of merges that can account for the identity of all variables/constants in any relation,logical relation, or when statement.

Assumptions:

Desirables:

Problems: Because there is no simple indexing of parents of an instance (i.e. I can't travel from a parent p to a child c and easily know which of the back (parent) links of c I should follow to return to the parent) we must store paths for navigation in terms of child number/instance context pairs. Following back a parent trail requires a search for the child being left which is unacceptable. This is the same as an io NameNode, unless we decide to play a reference count game to avoid memory consumption.

Much of this process is readily explained in terms of a global list of childnumber/context pairs which maps the entire namespace. Fortunately we don't need to build this list, we can build parts of it only, but the overall algorithm becomes obscured. Because we are mapping the LINK space, rather than the node space, we have to write our own bizarre set of VisitName functions. We will have to visit each link between any two objects once.

These functions maintain all their own data and do not use any global information, EXCEPT that they use instance InterfacePtrs. For this reason they are not thread-safe. They also build data structures with references to instances, so no instance moving actions should be performed while there are structures from this module in use.

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define AMSTAT   0

Functions

VOIDPTR Asc_AnonMergeMarkIPs (struct Instance *root)
int Asc_AnonMergeCmpInstances (CONST struct Instance *i1, CONST struct Instance *i2)
void Asc_AnonMergeUnmarkIPs (VOIDPTR vp)
void Asc_AnonMergeWriteList (FILE *fp, struct Instance *i)


Generated on Thu Jul 17 04:00:19 2008 for libascend by  doxygen 1.5.1