[EMAIL PROTECTED] wrote:
> 
> jn wrote:
> > Consider the (unedited) transcript below:
> >
> >     >> print form b
> >     b b 1 b
> >     >> print b
> >     b b b 1 b 1 b
> >     >> print reduce b
> >     b b 1 b b b 1 b 1 b
> >     >> print reduce reduce b
> >     b b 1 b b b 1 b 1 b
> >
> > How did I construct the value of 'b?
> 
> >> b: ['b b 1 "b"]
>

Yep.

> 
> Consider:
> >> print b
> b b b 1 b b 1 b b b 1 b b
> >> print form b
> b b 1 b b
> >> print reduce b
> b b 1 b b b b 1 b b 1 b b b 1 b b
> >> print reduce reduce b
> b b 1 b b b b 1 b b 1 b b b 1 b b
> 
> How did I construct the value of 'b?
> 

Nice extension.  I'll hold off posting a solution to give
someone else a chance to play.

However, this just made me think of a meta-problem:  Can we find
one of these that has more than one solution?  That is, can
we find two different values for 'b such that

    print reduce reduce b

yields the same string for both?  Just to make it interesting,
let's also require that

    print reduce b

be different for the two values of 'b, just to rule out easier
solutions such as

    b: [ b 1 "b"]                   b: ['b 1 "b"]

    >> b: [b 1 "b"]                 >> b: ['b 1 "b"]
    == [b 1 "b"]                    == ['b 1 "b"]
    >> print b                      >> print b
    b 1 b 1 b                       b 1 b
    >> print form b                 >> print form b
    b 1 b                           b 1 b
    >> print reduce b               >> print reduce b
    b 1 b 1 b                       b 1 b 1 b
    >> print reduce reduce b        >> print reduce reduce b
    b 1 b 1 b                       b 1 b 1 b

-jn-

Reply via email to