Article View: comp.lang.misc
Article #5684Re: a simple miranda problem
From: James Caldwell
Date: Wed, 10 Aug 1988 13:45
Date: Wed, 10 Aug 1988 13:45
63 lines
3927 bytes
3927 bytes
twice f x = f (f x)
s x = x + 1
answer = twice twice twice s 0
= twice (twice twice) s 0
= twice twice (twice twice s) 0
= twice (twice (twice twice s)) 0
= twice (twice twice s)((twice (twice twice s)) 0)
= (twice twice s)((twice twice s))((twice (twice twice s)) 0)
= twice (twice s)((twice twice s))((twice (twice twice s)) 0)
= (twice s)((twice s)((twice twice s)))((twice (twice twice s)) 0)
= s (s ((twice s)((twice twice s))))((twice (twice twice s)) 0)
= s ((twice s)((twice twice s)))((twice (twice twice s)) 0) + 1
= ((twice s)((twice twice s)))((twice (twice twice s)) 0) + 1 + 1
= s (s (((twice twice s))))((twice (twice twice s)) 0) + 1 + 1
= s (((twice twice s)))((twice (twice twice s)) 0) + 1 + 1 + 1
= (twice twice s)((twice (twice twice s)) 0) + 1 + 1 + 1 + 1
= twice (twice s)((twice (twice twice s)) 0) + 1 + 1 + 1 + 1
= (twice s)((twice s)((twice (twice twice s)) 0)) + 1 + 1 + 1 + 1
= (s (s((twice s)((twice (twice twice s)) 0)))) + 1 + 1 + 1 + 1
= (s((twice s)((twice (twice twice s)) 0))) + 1 + 1 + 1 + 1 + 1
= ((twice s)((twice (twice twice s)) 0))) + 1 + 1 + 1 + 1 + 1 + 1
= (s (s (((twice (twice twice s)) 0)))) + 1 + 1 + 1 + 1 + 1 + 1
= (s (((twice (twice twice s)) 0))) + 1 + 1 + 1 + 1 + 1 + 1 + 1
= ((twice (twice twice s)) 0) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= ((twice twice s) ((twice twice s) 0)) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= ((twice (twice s)) ((twice twice s) 0)) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= ((twice s) ((twice s) ((twice twice s) 0))) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= (s (s ((twice s) ((twice twice s) 0)))) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= (s ((twice s) ((twice twice s) 0))) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= ((twice s) ((twice twice s) 0)) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= (s (s ((twice twice s) 0))) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= (s ((twice twice s) 0)) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= ((twice twice s) 0) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= ((twice (twice s)) 0) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= ((twice s) ((twice s) 0)) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= (s (s ((twice s) 0))) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= (s ((twice s) 0)) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= ((twice s) 0) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= (s (s 0)) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= (s 0) + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= 2 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= 3 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= 4 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= 5 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= 6 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= 7 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= 8 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= 9 + 1 + 1 + 1 + 1 + 1 + 1 + 1
= 10 + 1 + 1 + 1 + 1 + 1 + 1
= 11 + 1 + 1 + 1 + 1 + 1
= 12 + 1 + 1 + 1 + 1
= 13 + 1 + 1 + 1
= 14 + 1 + 1
= 15 + 1
= 16
--
Jim Caldwell caldwell%akhenaten@steinmetz.UUCP
uunet!steinmetz!akhenaten!caldwell
Technical Details
Message-ID:
<CALDWELL.88Aug10094531@akhenaten.steinmetz.ge.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!steinmetz!kbsvax!caldwellReferences:
<FELDMARK.88Aug9114727@hanako.stars.flab.Fujitsu.JUNET>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!steinmetz!kbsvax!caldwell From: caldwell@akhenaten.steinmetz.ge.com (James Caldwell) Newsgroups: comp.lang.misc Subject: Re: a simple miranda problem Message-ID: <CALDWELL.88Aug10094531@akhenaten.steinmetz.ge.com> Date: 10 Aug 88 13:45:42 GMT References: <FELDMARK.88Aug9114727@hanako.stars.flab.Fujitsu.JUNET> Sender: news@steinmetz.ge.com Reply-To: caldwell@akhenaten.steinmetz.ge.com Distribution: comp Organization: GE Corporate Research & Development Center. Schenectady, NY Lines: 63 In-reply-to: feldmark@hanako.stars.flab.Fujitsu.JUNET's message of 9 Aug 88 02:47:27 GMT