home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!usc!cs.utexas.edu!rutgers!faatcrl!iecc!compilers-sender
- From: coatta@cs.ubc.ca (Terry Coatta)
- Newsgroups: comp.compilers
- Subject: Set Generators
- Keywords: question, theory
- Message-ID: <92-08-125@comp.compilers>
- Date: 20 Aug 92 18:32:36 GMT
- Sender: compilers-sender@iecc.cambridge.ma.us
- Reply-To: coatta@cs.ubc.ca (Terry Coatta)
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Lines: 31
- Approved: compilers@iecc.cambridge.ma.us
-
- In a system that I am working on, sets of objects are often specified via
- membership predicates. In order to generate the sets involved the
- membership predicate is essentially evaluated for all objects in the
- system, and when it evaluates to true, the object is added to the set
- being generated. For many of the predicates I can, however, generate (by
- hand) a recursive procedure which enumerates the set. For example, the
- set of objects in a tree can be specified via a predicate something like:
-
- All X such that Path(Root, X)
-
- where Path(X, Y) =
- Y is a child of X
- OR
- there exists a Z, which is a child of X
- AND Path(Z, Y)
-
- (the actual syntax for this specification within the system is, of course,
- quite different from the above, but I hope the example is clear).
-
- This set can be very easily generated simply by doing a depth first
- traversal of the tree.
-
- What I am looking for are hints or help on a ``mechanical'' process for
- taking membership predicates and ``compiling'' them in to (imperative)
- procedures which will generate the set in question.
- --
- Terry Coatta (coatta@cs.ubc.ca)
- Dept. of Computer Science, UBC, Vancouver BC, Canada
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-