Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #111764 > unrolled thread

#111764

Started by
First post
Last post
Articles 1 — 0 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  #111764 

#111764 — #111764

From
Date
Subject#111764
Message-ID<mailman.58.1469203276.22221.python-list@python.org>
We're working on a DSL (domain specific language) that we translate into
a list of tokenized expressions. My challenge is to figure out how to
sequence evaluation of these expressions so that we evaluate these
expressions in the proper order given that expressions have dependencies
on other expressions.
 
We've done the work to determine the full list of tokens associated with
each expression (after referencing other expressions) and we've detected
expressions that result in loops.
 
Here's an example of expressions and their full list of dependencies:
 
a = b + b + b + c + c   > b, c, d, e, s, t, x
b = c + d + e > c, d, e, s, t, x
c = s + 3 > s, x
d = t + 1 > t
e = t + 2 > t
s = x + 100 > x
t = 10 > None
x = 1 > None
y = 2 > None
 
I'm looking for an algorithm/data structure that will me to start with
the least dependent expression (t, x, y) and move through the list of
expressions in dependency order ending with the expression with the most
dependencies.
 
I imagine that spreadsheets have to perform a similar type of analysis
to figure out how to recalculate their cells.
 
Suggestions on algorithms and/or data structures (some form of graph?)
to support the above goals?
 
Thank you,
Malcolm

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web