[plt-scheme] New to PLT Redex. Need some help.

From: Hari Prashanth (mail.prashanthkr at gmail.com)
Date: Sat Oct 17 17:04:18 EDT 2009

>
> Hi,
> >>> Possibly, in this case, you needed a "1" in the middle of the term?
>
> Yes this did the trick. Thanks a ton... It reduced:-)
>
> But should it not raise an error when a number was passed and my pattern
> was string.
>
> Thanks
> Hari
>
> --- On *Sat, 17/10/09, Robby Findler <robby at eecs.northwestern.edu>* wrote:
>
>
> From: Robby Findler <robby at eecs.northwestern.edu>
> Subject: Re: [plt-scheme] New to PLT Redex. Need some help.
> To: "Hari Prashanth" <mail.prashanthkr at gmail.com>
> Cc: plt-scheme at list.cs.brown.edu
> Date: Saturday, 17 October, 2009, 5:57 PM
>
> 2009/10/16 Hari Prashanth <mail.prashanthkr at gmail.com>:
> > Hi Everyone,
> > I took the code given in the Redex website
> > (http://redex.plt-scheme.org/lam-v.html) and made the following changes
> to
> > it.
> > 1. changed number pattern to string
> >
> > 2. Instead of +(in reduction-relation), I used string-append
> >
> > 3. (if0 0 e_1 e_2) to (if0 "true" e_1 e_2) and for the other case any
> other
> > string except "true".
> >
> > And called traces like this
> >
> > (traces red
> >         (term
> >          ((λ (n)
> >             (if0
> >              n
> >              1
> >              ((λ (x) (x x))
> >               (λ (x) (x x)))))
> >           (+ "2" "2"))))...
> >
> > But it did not reduce the expression in any way. Basically The output was
> > just
> > ((λ (n)
> >             (if0
> >              n
> >              1
> >              ((λ (x) (x x))
> >               (λ (x) (x x)))))
> >           (+ "2" "2")).
> >
> > Where am I going wrong?
>
> That should work. Probably there was some other small mistake
> somewhere that is tripping you up.
>
> My best advice for debugging Redex programs is to start playing with
> redex-match. Make sure the expression above really is an "e". If it
> isn't one, make a smaller and smaller example to understand why not.
>
> Possibly, in this case, you needed a "1" in the middle of the term?
>
> > How can I use symbol instead of string? When I used symbol, I got an
> error
> > saying expected a non-terminal pattern but got one of Expr, Var, Val,
> Cntxt
> > in symbol_1.
> > Why did I get that error?
>
> symbol isn't a built-in non-terminal. variable is, however.
>
>
> Robby
>
>
> ------------------------------
> From cricket scores to your friends. Try the Yahoo! India Homepage!<http://in.rd.yahoo.com/tagline_metro_4/*http://in.yahoo.com/trynew>
>
>
> ------------------------------
> Connect more, do more and share more with Yahoo! India Mail. Learn more<http://in.rd.yahoo.com/tagline_galaxy_3/*http://in.overview.mail.yahoo.com/>
> .
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20091017/4642b650/attachment.html>

Posted on the users mailing list.