[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Sep 28 08:30:36 2003 
Subject:Re: Poplog Dll & Other Issues 
From:Richard 
Volume-ID:1030928.01 

I know people are up at night pondering my questions; as such, I just wanted
to close the loop on at least this one ;)

After some research, I discovered that what I was actually looking for was
an alogorithm to perform a Topological Sort on an acyclic graph with some
kind of trigger to begin the sort each time it is needed. Turns out that
this is material taught in any basic CS course covering SORT techniques.

Oh well, if I had a CS degree perhaps I would have known this and/or could
have phrased my question better so that someone out there could have
recognized it for what it was ;)

Thanks
Richard


>
> > Is there a way to determine if one variable is dependent on another? To
> > explain what I mean, image a spreadsheet:
> >
> > A1=5  and  A2=A1+2
> >
> > When I change A1, the interpreter knows that A2 is a decendent of A1 and
> > automatically calculates and displays a new result for A2.
> >
> > Anyone have any ideas on how to emulate this behavior in poplog?
>
> I'm also not quite sure what you are asking, as emulating the behaviour
> seems different from determining the dependencies.
>
> In case it's relevant, I once wrote a program to maintain a set of
> relationships between a set of Pop-11 variables. For the case above,
> you'd write this:
>
>     maintain A1 = 5, A2;
>         A1 + 2 -> A2;
>     endmaintain;
>
> Then you can get this kind of behaviour:
>
>     100 -> A1;
>     A2 =>
>     ** 102
>
> The statements between maintain and endmaintain are automatically
> re-executed as necessary to maintain the relationships between the
> variables. These can be expressed in pretty much any Pop-11 code.
> Loopy relationships will cause problems, but indirect relationships are
> handled. There are a few restrictions because of the way it's
> implemented - e.g. only permanent variables are handled.
>
> The statements are executed only when necessary - so in the case above
> the sum 100+2 is done when A2 is printed, not when A1 is updated. (This
> is important if you have one variable dependent on several others via a
> costly procedure and you want to change several inputs before inspecting
> the output.)
>
> I think the library hasn't propagated out of the local tree at Sussex,
> but I'll put it on my website if you (or anyone) thinks it might be
> useful.
>
> David
>
>
>
>
>
>
>
>
>