unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Mistakes in the R7RS-small formal denotational semantics
@ 2017-06-21  2:45 Mark H Weaver
  2017-06-21 12:14 ` John Cowan
  0 siblings, 1 reply; 2+ messages in thread
From: Mark H Weaver @ 2017-06-21  2:45 UTC (permalink / raw)
  To: Alex Shinn, cowan; +Cc: guile-devel

Hi Alex and John,

I believe I've found a few mistakes in the formal denotational semantics
for R7RS-small.  The scheme-reports mailing list seems to be gone, so
I'm not sure where to send this.

First, if I understand correctly, the 'pathup' and 'pathdown' auxiliary
functions associate the wrong dynamic point with each before/after
thunk.  In 'pathup', the first element of the result sequence:

  <(ω₁,ω₁|(F×F×P)↓2)>

should be:

  <(ω₁|(F×F×P)↓3,ω₁|(F×F×P)↓2)>

and similarly, in 'pathdown', the final element of the result sequence:

  <(ω₂,ω₂|(F×F×P)↓1)>

should be:

  <(ω₂|(F×F×P)↓3,ω₂|(F×F×P)↓1)>

These changes are needed to match the english description of
'dynamic-wind' in R7RS, which says "The before and after thunks are
called in the same dynamic environment as the call to 'dynamic-wind'".

They are also needed for consistency with the 'dynamicwind' auxiliary
function, which calls the before and after thunks in accordance with the
english specification during the normal code path through 'dynamic-wind'
(e.g. when call/cc is not used).

Because of the mistakes above, the current R7RS formal semantics specify
that the before and after thunks, when called implicitly by invoking a
first-class continuation, are called in the same dynamic environment as
the call to the inner thunk of 'dynamic-wind'.

Another problem: 'travelpath' contains a type error.  ((π*↓1)↓2) has
type F (a procedure value), but what's needed in that context is the
second member of F, which has type E* -> P -> K -> C.  The easiest fix
would be to insert 'applicate' before ((π*↓1)↓2).

These mistakes were inherited from the paper "How to Add Threads to a
Sequential Language Without Getting Tangled Up" by Gasbichler, Knauel,
Sperber and Kelsey.

I also found a mistake that was apparently inherited from R5RS: in
'cwv', the final call to 'applicate' is missing its continuation
argument κ.

     Regards,
       Mark



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Mistakes in the R7RS-small formal denotational semantics
  2017-06-21  2:45 Mistakes in the R7RS-small formal denotational semantics Mark H Weaver
@ 2017-06-21 12:14 ` John Cowan
  0 siblings, 0 replies; 2+ messages in thread
From: John Cowan @ 2017-06-21 12:14 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 320 bytes --]

On Tue, Jun 20, 2017 at 10:45 PM, Mark H Weaver <mhw@netris.org> wrote:

I believe I've found a few mistakes in the formal denotational semantics
> for R7RS-small.  The scheme-reports mailing list seems to be gone, so
> I'm not sure where to send this.
>

I'm forwarding this to scheme-reports-wg1@groups.google.com and

[-- Attachment #2: Type: text/html, Size: 804 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-21 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-21  2:45 Mistakes in the R7RS-small formal denotational semantics Mark H Weaver
2017-06-21 12:14 ` John Cowan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).