Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!bloom-beacon!eru!luth!sunic!liuida!mikpe From: mikpe@senilix.ida.liu.se (Mikael Pettersson) Newsgroups: comp.lang.scheme Subject: better permute/unpermute Summary: can be made more general Keywords: r3.99rs, formal sematics, function application Message-ID: <1428@senilix.ida.liu.se> Date: 11 Nov 89 04:15:55 GMT Organization: CIS Dept, Univ of Linkoping, Sweden Lines: 37 I see that in the R3.99RS (draft of Aug. 31) the sematics for function application still uses the old definition of |permute| and |unpermute| as global functions with constant behaviour for any number N of arguments. I think I may have a simple solution that more accurately models the intended meaning of allowing the evaluation order to vary not only based on the _number_ of arguments, but also on the argument expressions themselves, the environment and the receiving expression continuation. Let us define a function |order| as follows: order : U -> K -> Exp* -> (Exp* -> Exp*)x(E* -> E*) axiom : if
=order rho kappa E*,
then p is a permutation,
u is a permutation,
and p and u are each others inverses. (*)
(*) I'm a bit uneasy with this wording since there's a type conflict
there. However, the same conflict is in the R3.99RS soo...
The idea is to allow |order| to rearrange the arguments freely based on
all the information a compiler might want to use. Non-determinism at
run-time is ruled out however.
The equation for application can then be modified to read:
E[(E0 E*)] = lambda rho kappa .
(lambda