Alpha-vary problem

3 views
Skip to first unread message

Brad Seebeck

unread,
Apr 8, 2011, 4:52:12 PM4/8/11
to byu-cs-330-Winter-2011
My partner and I are having a really tough time figuring out how to
even start writing the alpha-vary function. We thought through a few
ways to do it, but we realized they would not work with nested
expressions and what not. Does anyone have any pointers on how to
write that function?

Any help would be great!
Thanks

Bryan Morse

unread,
Apr 8, 2011, 4:57:32 PM4/8/11
to byu-cs-330-...@googlegroups.com
Write function to recursively traverse the AST (like interp or type-check). Have it take an additional parameter that acts like an environment (again, like interp or type-check), only this time rather than binding identifiers to values (like interp) or identifiers to types (like type-check), it should bind variables to the unique variable names you're binding things to. Have it traverse from the root and on the way back out of the recursion rebuild the new tree (like parse).
Reply all
Reply to author
Forward
0 new messages