[mercury-users] Visual Programming (again)

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Nov 5 01:47:40 AEDT 1999


On 04-Nov-1999, Samuel Sean Watkins <108703 at bud.cc.swin.edu.au> wrote:
> [Richard O'Keefe wrote:] 
> | There's a moderately large literature on Constraint Programming Languages,
> | which can handle things like your
> | (1)     disp  = initial*time + accel*time*time/2,
> | (2)     final = initial + accel*time
> | example.  [...]
> | The claim that "in a serial language, such as normal algebra,
> | English or Mercury, it is impossible to represent such a complex
> | relationship elegantly and symmetrically" is completely baffling,
> | I just *did* express the relationships between these five parameters
> | elegantly and symmetrically.
> 
> The asymmetry of your two 'expressions' is the following:
> 
> If I am given 'inital', 'time' and 'accel', it is easy to compute 'disp'
> and 'final' by simple substitution of values into your equations. 
> 
> If, on the other hand, I have been given values for *any other* triplet of
> the variables, (e.g. final = -1, accel = -9.8 and disp = 4) I will need to
> considerably rearrange your equations, which may involve solving 
> a quadratic, in order to find values for the other two variables.
>
> If the relation is expressed graphically (see the attachment), then most
> of this algebraic reexpression is rendered unnecessary, as there are no
> '=' signs (or else each link is an '=' or 'unify' sign), and no variable
> is favoured above the others.

I think you missed Richard O'Keefe's point.  In Constraint Programming
Languages, in principle the language implementation will do the rearranging
for you.  The "=" signs are bidirectional, they're not like "=" in C.
Mercury supports this kind of programming -- see extras/clpr/samples/*.m for
some examples.

In practice I think most constraint programming languages will just delay
nonlinear equations, rather than solving them, but using a graphical notation
won't change that.

P.S.
I'm afraid I didn't read your attachment, because it would be too much trouble
to save the attachment, download it, log in to X windows, start up Star Office,
and view it.  So if there was anything crucial in the attachment, then
I may have misunderstood you. ;-)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list