<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">
<blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">
Hi,<br>>>> Possibly, in this case, you needed a "1" in the middle of the term?<br><br>Yes this did the trick.
Thanks a ton... It reduced:-)<br><br>But should it not raise an error when a number was passed and my pattern was string.<br><br>Thanks<br>Hari<br><br>--- On <b>Sat, 17/10/09, Robby Findler <i><<a href="mailto:robby@eecs.northwestern.edu" target="_blank">robby@eecs.northwestern.edu</a>></i></b> wrote:<br>
<blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Robby Findler <<a href="mailto:robby@eecs.northwestern.edu" target="_blank">robby@eecs.northwestern.edu</a>><br>
Subject: Re: [plt-scheme] New to PLT Redex. Need some help.<br>To: "Hari Prashanth" <<a href="mailto:mail.prashanthkr@gmail.com" target="_blank">mail.prashanthkr@gmail.com</a>><br>Cc: <a href="mailto:plt-scheme@list.cs.brown.edu" target="_blank">plt-scheme@list.cs.brown.edu</a><br>
Date: Saturday, 17 October, 2009, 5:57 PM<br><br><div>2009/10/16 Hari Prashanth <<a rel="nofollow">mail.prashanthkr@gmail.com</a>>:<br>> Hi Everyone,<br>> I took the code given in the Redex website<br>> (<a rel="nofollow" href="http://redex.plt-scheme.org/lam-v.html" target="_blank">http://redex.plt-scheme.org/lam-v.html</a>) and made the following changes
to<br>> it.<br>> 1. changed number pattern to string<br>><br>> 2. Instead of +(in reduction-relation), I used string-append<br>><br>> 3. (if0 0 e_1 e_2) to (if0 "true" e_1 e_2) and for the other case any other<br>
> string except "true".<br>><br>> And called traces like this<br>><br>> (traces red<br>> (term<br>> ((ë (n)<br>> (if0<br>> n<br>>
1<br>> ((ë (x) (x x))<br>> (ë (x) (x x)))))<br>> (+ "2" "2"))))...<br>><br>> But it did not reduce the expression in any way. Basically The output was<br>
> just<br>> ((ë (n)<br>> (if0<br>> n<br>> 1<br>> ((ë (x) (x x))<br>> (ë (x) (x x)))))<br>>
(+ "2" "2")).<br>><br>> Where am I going wrong?<br><br>That should work. Probably there was some other small mistake<br>somewhere that is tripping you up.<br><br>My best advice for debugging Redex programs is to start playing with<br>
redex-match. Make sure the expression above really is an "e". If it<br>isn't one, make a smaller and smaller example to understand why not.<br><br>Possibly, in this case, you needed a "1" in the middle of the term?<br>
<br>> How can I use symbol instead of string? When I used symbol, I got an error<br>> saying expected a non-terminal pattern but got one of Expr, Var, Val, Cntxt<br>> in symbol_1.<br>> Why did I get that error?<br>
<br>symbol isn't a built-in non-terminal. variable is, however.<br><br><br>Robby<br></div></blockquote></td></tr></tbody></table><br>
<hr size="1"> From cricket scores to your friends. Try the <a rel="nofollow" href="http://in.rd.yahoo.com/tagline_metro_4/*http://in.yahoo.com/trynew" target="_blank">Yahoo! India Homepage!</a></div></blockquote></td>
</tr></tbody></table><br><div class="hm">
<hr size="1"> Connect more, do more and share more with Yahoo! India Mail. <a href="http://in.rd.yahoo.com/tagline_galaxy_3/*http://in.overview.mail.yahoo.com/" target="_blank"> Learn more</a>.</div></blockquote></div>
<br>