at15 / reika

[WIP] A DSL for query and benchmark TSDB
MIT License
1 stars 0 forks source link

[tapl] Untyped lambda-calculus left side for Application does not have to be Abs node, can be a var node #8

Closed at15 closed 7 years ago

at15 commented 7 years ago

At first I defined abs as type Node and ASTBuilder works, but after switching to Abs, it broke

public static class App extends Node {
  public final Abs abs;
  public final Node param;

guess it is due to (lambda x. x) (lambda x. x x);, in (lambda x. x x) there is a application and x is a var instead of a abs, it can become abs if some one bind it, the var here can be anything ... and (lambda x. x x) seems never terminate?

java.lang.ClassCastException: me.at15.tapl.untyped.UntypedAst$Var cannot be cast to me.at15.tapl.untyped.UntypedAst$Abs