Re: Puzzle

From: Wolfgang Lux <lux_at_helios.uni-muenster.de>
Date: Wed, 2 Dec 1998 17:45:30 +0100 (MET)

> Unfortunately (or suprisingly), even this does not work
> as long as we interpret f = g as f x = g x at the top-level:
>
> f5 (.) g 3 ->* g (g 3)
> -> incr (g 3) (with rule g x = incr x)
> -> (g 3) + 1
> -> (decr 3) + 1 (with rule g x = decr x)
> ->* 3

Hmmm, I should have thought of that!

Anyway, here are two more cases. Given the definitions

  coin = 0
  coin = 1
  f6 h g = h g g
  f7 h g = h g0 g0 where g0 = g

what are the solutions of:

  f6 (\x y -> x + y) coin
  f7 (\x y -> x + y) coin

I suppose that 1 is a possible solution in the former case, while it isn't in the latter. (Or will the use of the parameter g for both arguments of h in f6 already introduce sharing?)

Regards
Wolfgang

--
Wolfgang Lux				  Phone: +49-251-83-38263
Institut fuer Wirtschaftinformatik	    FAX: +49-251-83-38259
Universitaet Muenster		Email: lux_at_helios.uni-muenster.de
Received on Mi Dez 02 1998 - 17:49:00 CET

This archive was generated by hypermail 2.3.0 : Do Feb 01 2024 - 07:15:05 CET