Advertisement
sci4me

Lambda Calculus AST

Jul 30th, 2018
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. true := λx.λy.x;
  2. false := λx.λy.y;
  3.  
  4. not := λx.x false true;
  5.  
  6. ----------------------------------------------------------------------
  7.  
  8. {
  9. "name-bindings" (
  10. {
  11. "type" "AST-NAME-BINDING"
  12. "name" "true"
  13. "value" {
  14. "type" "AST-ABSTRACTION"
  15. "param" "x"
  16. "body" {
  17. "type" "AST-ABSTRACTION"
  18. "param" "y"
  19. "body" {
  20. "type" "AST-IDENT"
  21. "text" "x"
  22. }
  23. }
  24. }
  25. }
  26. {
  27. "type" "AST-NAME-BINDING"
  28. "name" "false"
  29. "value" {
  30. "type" "AST-ABSTRACTION"
  31. "param" "x"
  32. "body" {
  33. "type" "AST-ABSTRACTION"
  34. "param" "y"
  35. "body" {
  36. "type" "AST-IDENT"
  37. "text" "y"
  38. }
  39. }
  40. }
  41. }
  42. {
  43. "type" "AST-NAME-BINDING"
  44. "name" "not"
  45. "value" {
  46. "type" "AST-ABSTRACTION"
  47. "param" "x"
  48. "body" {
  49. "type" "AST-APPLICATION"
  50. "lhs" {
  51. "type" "AST-APPLICATION"
  52. "lhs" {
  53. "text" "x"
  54. "type" "AST-IDENT"
  55. }
  56. "rhs" {
  57. "text" "false"
  58. "type" "AST-IDENT"
  59. }
  60. }
  61. "rhs" {
  62. "text" "true"
  63. "type" "AST-IDENT"
  64. }
  65. }
  66. }
  67. }
  68. )
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement