[cvs-nhc98] patch applied (hat): In Hat combinator library reintroduce stack for entered redexes and use a buffer only for deferred updating of reduced redexes.

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Tue Oct 10 07:17:14 EDT 2006


Mon May  6 04:31:29 PDT 2002  olaf
  * In Hat combinator library reintroduce stack for entered redexes and use a buffer only for deferred updating of reduced redexes.
  
  The main advantage is that we obtain a good entry point for hat-trail into the trace if the computation was interrupted or aborted with an error that was only caught as an exception in Haskell or on the C-side. The entry point is the last redex that was entered but not yet reduced.
  
  The reference of a reduced redex is always compared with the reference on top of the stack to recognise the situation where a Haskell exception renders part of the stack garbage. Then the stack is popped until an entry with the same reference is found. The popped entries (except for the last) are written as Entered into the trace. However, it seems there are never any such entries anyway, because IO-actions always reduce successfully to Abstract "IO". Need good test case.
  
  Interruptions often happen at an entered Forward. These do not however have a parent in the trace. Hence the combinator library at least keeps a parent for every Forward on the stack, so that the entry point can be that parent. (Actually unevaluated and entered Forwards should have a parent; but that needs change of trace file format).
  
  Stack plus buffer also seems to be slightly more efficient than the previous buffering method.

    M ./src/hatlib/Hat.hs -3 +4
    M ./src/hatlib/hat-c.c -59 +204
    M ./src/hatlib/hat-c.h -4 +7
    M ./src/hattools/Makefile -4 +4


More information about the Cvs-nhc98 mailing list