On Sun, 28 Nov 1999, S.D.Mechveliani wrote:
> Is there any problem?
> Introduce the program variables x,y... and bound them to the symbolic
> indeterminates.
> For example, in DoCon program, it is arranged about like this:
>
> let { s = cToPol ["x","y"] 1; [x,y] = varPs s }
> in
> x^2*(x - x*y) ...
>
> Here cToPol, varPs are the "standard" functions.
> cToPol creates a sample polynomial s in needed indeterminates.
> varPs f extracts indeterminates from f and converts them to the
> domain of f.
> `let' describes the algebraic domain - once.
> Hence, in many computations after `in', x,y denote what is needed.
This sounds fascinating: is this approach powerful enough that if I have
a definition of a haskell function purely as a definition for actual
values and then apply it to an indeterminate I automatically get the
expected result (no evaluation)? (ie,can I write
harmonic n = (sum.map (\x->1/x)) [1..n]
result=let { s = cToPol ["x"];[x] = varPs s }
in harmonic x
to get result => harmonic(x)?) This would be very useful if you could
write do such things (I presume that you can also do the equivalent of
evaluating an expression in an indeterminate for a given value of the
indeterminate in this framework) since that (as far as I can see) would
let you alter existing programs so that they partially evaluate themselves
as they run without the need to alter any of the worker functions. (In
spare time a couple of years ago I pottered about trying to do such a
thing for trivial image processing type tasks but couldn't see any way to
do it in Haskell and so cobbled together an interpreter (written in
Haskell :-) ) with roughly mathematica type semantics. Working in native
Haskell would have been _much_ less work.)
___cheers,_dave________________________________________________________
www.cs.bris.ac.uk/~tweed/pi.htm Farenheit 451 is the temperature at
email: [EMAIL PROTECTED] which paper burns. Let's do an experiment to
work tel: (0117) 954-5253 see what temperature melts human brain cells.