From 3c66451b2c028fadd182f4d7215f9058e8c683b1 Mon Sep 17 00:00:00 2001 From: waterlens Date: Wed, 31 Jul 2024 19:42:56 +0800 Subject: [PATCH 1/2] Use implicit conversion to avoid repeating `raw` --- .../mlscript/compiler/codegen/CppAst.scala | 109 +++++------ .../main/scala/mlscript/compiler/ir/IR.scala | 173 +++++++++--------- 2 files changed, 147 insertions(+), 135 deletions(-) diff --git a/compiler/shared/main/scala/mlscript/compiler/codegen/CppAst.scala b/compiler/shared/main/scala/mlscript/compiler/codegen/CppAst.scala index ab5915d85..f826c2162 100644 --- a/compiler/shared/main/scala/mlscript/compiler/codegen/CppAst.scala +++ b/compiler/shared/main/scala/mlscript/compiler/codegen/CppAst.scala @@ -5,6 +5,10 @@ import mlscript.utils._ import mlscript.utils.shorthands._ import mlscript.compiler.utils._ +import scala.language.implicitConversions + +given Conversion[String, Document] = raw + enum Specifier: case Extern case Static @@ -50,16 +54,16 @@ enum Type: def toDocument(extraTypename: Bool = false): Document = def aux(x: Type): Document = x match - case Prim(name) => name |> raw - case Ptr(inner) => aux(inner) <#> raw("*") - case Ref(inner) => aux(inner) <#> raw("&") - case Array(inner, size) => aux(inner) <#> raw("[") <#> size.fold(raw(""))(x => x.toString |> raw) <#> raw("]") - case FuncPtr(ret, args) => aux(ret) <#> raw("(") <#> Type.toDocuments(args, sep = raw(", ")) <#> raw(")") - case Struct(name) => raw(s"struct $name") - case Enum(name) => raw(s"enum $name") - case Template(name, args) => raw(s"$name") <#> raw("<") <#> Type.toDocuments(args, sep = raw(", ")) <#> raw(">") - case Var(name) => name |> raw - case Qualifier(inner, qual) => aux(inner) <:> raw(qual) + case Prim(name) => name + case Ptr(inner) => aux(inner) <#> "*" + case Ref(inner) => aux(inner) <#> "&" + case Array(inner, size) => aux(inner) <#> "[" <#> size.fold(raw(""))(x => x.toString) <#> "]" + case FuncPtr(ret, args) => aux(ret) <#> "(" <#> Type.toDocuments(args, sep = ", ") <#> ")" + case Struct(name) => s"struct $name" + case Enum(name) => s"enum $name" + case Template(name, args) => s"$name" <#> "<" <#> Type.toDocuments(args, sep = ", ") <#> ">" + case Var(name) => name + case Qualifier(inner, qual) => aux(inner) <:> qual aux(this) override def toString: Str = toDocument().print @@ -87,28 +91,29 @@ enum Stmt: case AutoBind(lhs, rhs) => lhs match case Nil => rhs.toDocument - case x :: Nil => raw("auto") <:> raw(x) <:> raw("=") <:> rhs.toDocument <#> raw(";") - case _ => raw("auto") <:> raw(lhs.mkString("[", ",", "]")) <:> raw("=") <:> rhs.toDocument <#> raw(";") - case Assign(lhs, rhs) => raw(lhs) <#> raw(" = ") <#> rhs.toDocument <#> raw(";") - case Return(expr) => raw("return ") <#> expr.toDocument <#> raw(";") + case x :: Nil => "auto" <:> x <:> "=" <:> rhs.toDocument <#> ";" + case _ => "auto" <:> lhs.mkString("[", ",", "]") <:> "=" <:> rhs.toDocument <#> ";" + case Assign(lhs, rhs) => lhs <#> " = " <#> rhs.toDocument <#> ";" + case Return(expr) => "return " <#> expr.toDocument <#> ";" case If(cond, thenStmt, elseStmt) => - raw("if (") <#> cond.toDocument <#> raw(")") <#> thenStmt.toDocument <:> elseStmt.fold(raw(""))(x => raw("else") <:> x.toDocument) + "if (" <#> cond.toDocument <#> ")" <#> thenStmt.toDocument <:> elseStmt.fold(raw(""))(x => "else" <:> x.toDocument) case While(cond, body) => - raw("while (") <#> cond.toDocument <#> raw(")") <#> body.toDocument + "while (" <#> cond.toDocument <#> ")" <#> body.toDocument case For(init, cond, update, body) => - raw("for (") <#> init.toDocument <#> raw("; ") <#> cond.toDocument <#> raw("; ") <#> update.toDocument <#> raw(")") <#> body.toDocument - case ExprStmt(expr) => expr.toDocument <#> raw(";") - case Break => raw("break;") - case Continue => raw("continue;") + "for (" <#> init.toDocument <#> "; " <#> cond.toDocument <#> "; " <#> update.toDocument <#> ")" <#> body.toDocument + case ExprStmt(expr) => expr.toDocument <#> ";" + case Break => "break;" + case Continue => "continue;" case Block(decl, stmts) => - stack(raw("{"), + stack( + "{", Stmt.toDocuments(decl, stmts) |> indent, - raw("}")) + "}") case Switch(expr, cases) => - raw("switch (") <#> expr.toDocument <#> raw(")") <#> raw("{") <#> stack_list(cases.map { - case (cond, stmt) => raw("case ") <#> cond.toDocument <#> raw(":") <#> stmt.toDocument - }) <#> raw("}") - case Raw(stmt) => stmt |> raw + "switch (" <#> expr.toDocument <#> ")" <#> "{" <#> stack_list(cases.map { + case (cond, stmt) => "case " <#> cond.toDocument <#> ":" <#> stmt.toDocument + }) <#> "}" + case Raw(stmt) => stmt aux(this) object Expr: @@ -135,18 +140,18 @@ enum Expr: def toDocument: Document = def aux(x: Expr): Document = x match - case Var(name) => name |> raw - case IntLit(value) => value.toString |> raw - case DoubleLit(value) => value.toString |> raw - case StrLit(value) => s"\"$value\"" |> raw // need more reliable escape utils - case CharLit(value) => value.toInt.toString |> raw - case Call(func, args) => aux(func) <#> raw("(") <#> Expr.toDocuments(args, sep = raw(", ")) <#> raw(")") - case Member(expr, member) => aux(expr) <#> raw("->") <#> raw(member) - case Index(expr, index) => aux(expr) <#> raw("[") <#> aux(index) <#> raw("]") - case Unary(op, expr) => raw("(") <#> raw(op) <#> aux(expr) <#> raw(")") - case Binary(op, lhs, rhs) => raw("(") <#> aux(lhs) <#> raw(op) <#> aux(rhs) <#> raw(")") - case Initializer(exprs) => raw("{") <#> Expr.toDocuments(exprs, sep = raw(", ")) <#> raw("}") - case Constructor(name, init) => raw(name) <#> init.toDocument + case Var(name) => name + case IntLit(value) => value.toString + case DoubleLit(value) => value.toString + case StrLit(value) => s"\"$value\"" // need more reliable escape utils + case CharLit(value) => value.toInt.toString + case Call(func, args) => aux(func) <#> "(" <#> Expr.toDocuments(args, sep = ", ") <#> ")" + case Member(expr, member) => aux(expr) <#> "->" <#> member + case Index(expr, index) => aux(expr) <#> "[" <#> aux(index) <#> "]" + case Unary(op, expr) => "(" <#> op <#> aux(expr) <#> ")" + case Binary(op, lhs, rhs) => "(" <#> aux(lhs) <#> op <#> aux(rhs) <#> ")" + case Initializer(exprs) => "{" <#> Expr.toDocuments(exprs, sep = ", ") <#> "}" + case Constructor(name, init) => name <#> init.toDocument aux(this) case class CompilationUnit(includes: Ls[Str], decls: Ls[Decl], defs: Ls[Def]): @@ -161,10 +166,10 @@ enum Decl: def toDocument: Document = def aux(x: Decl): Document = x match - case StructDecl(name) => raw(s"struct $name;") - case EnumDecl(name) => raw(s"enum $name;") - case FuncDecl(ret, name, args) => ret.toDocument() <#> raw(s" $name(") <#> Type.toDocuments(args, sep = raw(", ")) <#> raw(");") - case VarDecl(name, typ) => typ.toDocument() <#> raw(s" $name;") + case StructDecl(name) => s"struct $name;" + case EnumDecl(name) => s"enum $name;" + case FuncDecl(ret, name, args) => ret.toDocument() <#> s" $name(" <#> Type.toDocuments(args, sep = ", ") <#> ");" + case VarDecl(name, typ) => typ.toDocument() <#> s" $name;" aux(this) enum Def: @@ -178,21 +183,21 @@ enum Def: def aux(x: Def): Document = x match case StructDef(name, fields, inherit, defs) => stack( - raw(s"struct $name") <#> (if inherit.nonEmpty then raw(": public") <:> raw(inherit.get.mkString(", ")) else raw("") ) <:> raw("{"), + s"struct $name" <#> (if inherit.nonEmpty then ": public" <:> inherit.get.mkString(", ") else "" ) <:> "{", stack_list(fields.map { - case (name, typ) => typ.toDocument() <#> raw(" ") <#> raw(name) <#> raw(";") + case (name, typ) => typ.toDocument() <#> " " <#> name <#> ";" }) |> indent, stack_list(defs.map(_.toDocument)) |> indent, - raw("};") + "};" ) case EnumDef(name, fields) => - raw(s"enum $name") <:> raw("{") <#> stack_list(fields.map { - case (name, value) => value.fold(raw(s"$name"))(x => raw(s"$name = $x")) - }) <#> raw("};") + s"enum $name" <:> "{" <#> stack_list(fields.map { + case (name, value) => value.fold(s"$name")(x => s"$name = $x") + }) <#> "};" case FuncDef(specret, name, args, body, or, virt) => - (if virt then raw("virtual ") else raw("")) - <#> specret.toDocument() <#> raw(s" $name(") <#> Type.toDocuments(args, sep = raw(", ")) <#> raw(")") <#> (if or then raw(" override") else raw("")) <#> body.toDocument + (if virt then "virtual " else "") + <#> specret.toDocument() <#> s" $name(" <#> Type.toDocuments(args, sep = ", ") <#> ")" <#> (if or then " override" else "") <#> body.toDocument case VarDef(typ, name, init) => - typ.toDocument() <#> raw(s" $name") <#> init.fold(raw(""))(x => raw(" = ") <#> x.toDocument) <#> raw(";") - case RawDef(x) => x |> raw + typ.toDocument() <#> s" $name" <#> init.fold(raw(""))(x => " = " <#> x.toDocument) <#> raw(";") + case RawDef(x) => x aux(this) \ No newline at end of file diff --git a/compiler/shared/main/scala/mlscript/compiler/ir/IR.scala b/compiler/shared/main/scala/mlscript/compiler/ir/IR.scala index c1990deb3..95fb77a10 100644 --- a/compiler/shared/main/scala/mlscript/compiler/ir/IR.scala +++ b/compiler/shared/main/scala/mlscript/compiler/ir/IR.scala @@ -11,6 +11,7 @@ import collection.mutable.{Map as MutMap, Set as MutSet, HashMap, ListBuffer} import annotation.unused import util.Sorting import scala.collection.immutable.SortedSet +import scala.language.implicitConversions final case class IRError(message: String) extends Exception(message) @@ -126,19 +127,21 @@ enum Expr: def show: String = toDocument.print - def toDocument: Document = this match - case Ref(s) => s.toString |> raw - case Literal(IntLit(lit)) => s"$lit" |> raw - case Literal(DecLit(lit)) => s"$lit" |> raw - case Literal(StrLit(lit)) => s"$lit" |> raw - case Literal(CharLit(lit)) => s"$lit" |> raw - case Literal(UnitLit(lit)) => s"$lit" |> raw + def toDocument: Document = + given Conversion[String, Document] = raw + this match + case Ref(s) => s.toString + case Literal(IntLit(lit)) => s"$lit" + case Literal(DecLit(lit)) => s"$lit" + case Literal(StrLit(lit)) => s"$lit" + case Literal(CharLit(lit)) => s"$lit" + case Literal(UnitLit(lit)) => s"$lit" case CtorApp(cls, args) => - raw(cls.name) <#> raw("(") <#> raw(args |> showArguments) <#> raw(")") + cls.name <#> "(" <#> (args |> showArguments) <#> ")" case Select(s, cls, fld) => - raw(cls.name) <#> raw(".") <#> raw(fld) <#> raw("(") <#> raw(s.toString) <#> raw(")") + cls.name <#> "." <#> fld <#> "(" <#> s.toString <#> ")" case BasicOp(name: Str, args) => - raw(name) <#> raw("(") <#> raw(args |> showArguments) <#> raw(")") + name <#> "(" <#> (args |> showArguments) <#> ")" def mapName(f: Name => Name): Expr = this match case Ref(name) => Ref(f(name)) @@ -221,67 +224,69 @@ enum Node: val names_copy = names.map(_.copy) LetCall(names_copy, defn, args.map(_.mapNameOfTrivialExpr(_.trySubst(ctx))), body.copy(ctx ++ names_copy.map(x => x.str -> x))) - private def toDocument: Document = this match - case Result(res) => raw(res |> showArguments) <:> raw(s"-- $tag") + private def toDocument: Document = + given Conversion[String, Document] = raw + this match + case Result(res) => (res |> showArguments) <:> s"-- $tag" case Jump(jp, args) => - raw("jump") - <:> raw(jp.name) - <#> raw("(") - <#> raw(args |> showArguments) - <#> raw(")") - <:> raw(s"-- $tag") + "jump" + <:> jp.name + <#> "(" + <#> (args |> showArguments) + <#> ")" + <:> s"-- $tag" case Case(x, Ls((tpat, tru), (fpat, fls)), N) if tpat.isTrue && fpat.isFalse => - val first = raw("if") <:> raw(x.toString) <:> raw(s"-- $tag") - val tru2 = indent(stack(raw("true") <:> raw ("=>"), tru.toDocument |> indent)) - val fls2 = indent(stack(raw("false") <:> raw ("=>"), fls.toDocument |> indent)) + val first = "if" <:> x.toString <:> s"-- $tag" + val tru2 = indent(stack("true" <:> "=>", tru.toDocument |> indent)) + val fls2 = indent(stack("false" <:> "=>", fls.toDocument |> indent)) Document.Stacked(Ls(first, tru2, fls2)) case Case(x, cases, default) => - val first = raw("case") <:> raw(x.toString) <:> raw("of") <:> raw(s"-- $tag") + val first = "case" <:> x.toString <:> "of" <:> s"-- $tag" val other = cases flatMap { case (pat, node) => - Ls(raw(pat.toString) <:> raw("=>"), node.toDocument |> indent) + Ls(pat.toString <:> "=>", node.toDocument |> indent) } default match case N => stack(first, (Document.Stacked(other) |> indent)) case S(dc) => - val default = Ls(raw("_") <:> raw("=>"), dc.toDocument |> indent) + val default = Ls("_" <:> "=>", dc.toDocument |> indent) stack(first, (Document.Stacked(other ++ default) |> indent)) case LetExpr(x, expr, body) => stack( - raw("let") - <:> raw(x.toString) - <:> raw("=") + "let" + <:> x.toString + <:> "=" <:> expr.toDocument - <:> raw("in") - <:> raw(s"-- $tag"), + <:> "in" + <:> s"-- $tag", body.toDocument) case LetMethodCall(xs, cls, method, args, body) => stack( - raw("let") - <:> raw(xs.map(_.toString).mkString(",")) - <:> raw("=") - <:> raw(cls.name) - <#> raw(".") - <#> raw(method.toString) - <#> raw("(") - <#> raw(args.map{ x => x.toString }.mkString(",")) - <#> raw(")") - <:> raw("in") - <:> raw(s"-- $tag"), + "let" + <:> xs.map(_.toString).mkString(",") + <:> "=" + <:> cls.name + <#> "." + <#> method.toString + <#> "(" + <#> args.map{ x => x.toString }.mkString(",") + <#> ")" + <:> "in" + <:> s"-- $tag", body.toDocument) case LetCall(xs, defn, args, body) => stack( - raw("let*") - <:> raw("(") - <#> raw(xs.map(_.toString).mkString(",")) - <#> raw(")") - <:> raw("=") - <:> raw(defn.name) - <#> raw("(") - <#> raw(args.map{ x => x.toString }.mkString(",")) - <#> raw(")") - <:> raw("in") - <:> raw(s"-- $tag"), + "let*" + <:> "(" + <#> xs.map(_.toString).mkString(",") + <#> ")" + <:> "=" + <:> defn.name + <#> "(" + <#> args.map{ x => x.toString }.mkString(",") + <#> ")" + <:> "in" + <:> s"-- $tag", body.toDocument) def locMarker: LocMarker = @@ -484,44 +489,46 @@ enum LocMarker: case MLetCall(names: Ls[Str], defn: Str, args: Ls[LocMarker]) var tag = DefnTag(-1) - def toDocument: Document = this match - case MResult(res) => raw("...") + def toDocument: Document = + given Conversion[String, Document] = raw + this match + case MResult(res) => "..." case MJump(jp, args) => - raw("jump") - <:> raw(jp) - <:> raw("...") + "jump" + <:> jp + <:> "..." case MCase(x, Ls(tpat, fpat), false) if tpat.isTrue && fpat.isFalse => - raw("if") <:> raw(x.toString) <:> raw("...") + "if" <:> x.toString <:> "..." case MCase(x, cases, default) => - raw("case") <:> raw(x.toString) <:> raw("of") <:> raw("...") + "case" <:> x.toString <:> "of" <:> "..." case MLetExpr(x, expr) => - raw("let") - <:> raw(x.toString) - <:> raw("=") - <:> raw("...") + "let" + <:> x.toString + <:> "=" + <:> "..." case MLetMethodCall(xs, cls, method, args) => - raw("let") - <:> raw(xs.map(_.toString).mkString(",")) - <:> raw("=") - <:> raw(cls.name) - <:> raw(".") - <:> raw(method) - <:> raw("...") + "let" + <:> xs.map(_.toString).mkString(",") + <:> "=" + <:> cls.name + <:> "." + <:> method + <:> "..." case MLetCall(xs, defn, args) => - raw("let*") - <:> raw("(") - <#> raw(xs.map(_.toString).mkString(",")) - <#> raw(")") - <:> raw("=") - <:> raw(defn) - <:> raw("...") - case MRef(s) => s.toString |> raw - case MLit(IntLit(lit)) => s"$lit" |> raw - case MLit(DecLit(lit)) => s"$lit" |> raw - case MLit(StrLit(lit)) => s"$lit" |> raw - case MLit(CharLit(lit)) => s"$lit" |> raw - case MLit(UnitLit(undefinedOrNull)) => (if undefinedOrNull then "undefined" else "null") |> raw - case _ => raw("...") + "let*" + <:> "(" + <#> xs.map(_.toString).mkString(",") + <#> ")" + <:> "=" + <:> defn + <:> "..." + case MRef(s) => s.toString + case MLit(IntLit(lit)) => s"$lit" + case MLit(DecLit(lit)) => s"$lit" + case MLit(StrLit(lit)) => s"$lit" + case MLit(CharLit(lit)) => s"$lit" + case MLit(UnitLit(undefinedOrNull)) => if undefinedOrNull then "undefined" else "null" + case _ => "..." def show = s"$tag-" + toDocument.print From 62ebc06f565c41c1c258017d1202e6249029efe0 Mon Sep 17 00:00:00 2001 From: waterlens Date: Wed, 31 Jul 2024 20:15:58 +0800 Subject: [PATCH 2/2] Pretty print the items --- .../main/scala/mlscript/compiler/ir/IR.scala | 39 +- compiler/shared/test/diff-ir/Class.mls | 334 +- compiler/shared/test/diff-ir/Currying.mls | 370 +- compiler/shared/test/diff-ir/IR.mls | 2988 +++----- compiler/shared/test/diff-ir/IRComplex.mls | 1466 ++-- compiler/shared/test/diff-ir/IRRec.mls | 6620 ++++++----------- compiler/shared/test/diff-ir/LiftClass.mls | 740 +- compiler/shared/test/diff-ir/LiftFun.mls | 956 +-- compiler/shared/test/diff-ir/LiftLambda.mls | 326 +- compiler/shared/test/diff-ir/Override.mls | 252 +- compiler/shared/test/diff-ir/gcd.mls | 3284 +++----- .../test/scala/mlscript/compiler/TestIR.scala | 4 +- 12 files changed, 5690 insertions(+), 11689 deletions(-) diff --git a/compiler/shared/main/scala/mlscript/compiler/ir/IR.scala b/compiler/shared/main/scala/mlscript/compiler/ir/IR.scala index 95fb77a10..89c823329 100644 --- a/compiler/shared/main/scala/mlscript/compiler/ir/IR.scala +++ b/compiler/shared/main/scala/mlscript/compiler/ir/IR.scala @@ -27,6 +27,21 @@ case class Program( Sorting.quickSort(t2) s"Program({${t1.mkString(",\n")}}, {\n${t2.mkString("\n")}\n},\n$main)" + def show = toDocument.print + + def toDocument: Document = + val t1 = classes.toArray + val t2 = defs.toArray + Sorting.quickSort(t1) + Sorting.quickSort(t2) + given Conversion[String, Document] = raw + stack( + "Program:", + stack_list(t1.map(_.toDocument).toList) |> indent, + stack_list(t2.map(_.toDocument).toList) |> indent, + main.toDocument |> indent + ) + implicit object ClassInfoOrdering extends Ordering[ClassInfo] { def compare(a: ClassInfo, b: ClassInfo) = a.id.compare(b.id) } @@ -42,6 +57,19 @@ case class ClassInfo( override def toString: String = s"ClassInfo($id, $name, [${fields mkString ","}], parents: ${parents mkString ","}, methods:\n${methods mkString ",\n"})" + def show = toDocument.print + def toDocument: Document = + given Conversion[String, Document] = raw + val extension = if parents.isEmpty then "" else " extends " + parents.mkString(", ") + if methods.isEmpty then + "class" <:> name <#> "(" <#> fields.mkString(",") <#> ")" <#> extension + else + stack( + "class" <:> name <#> "(" <#> fields.mkString(",") <#> ")" <#> extension <:> "{", + stack_list( methods.map { (_, defn) => defn.toDocument |> indent }.toList), + "}" + ) + case class Name(val str: Str): private var intro: Opt[Intro] = None private var elim: Set[Elim] = Set.empty @@ -103,6 +131,15 @@ case class Defn( val ars = activeResults.map(_.toString).mkString("[", ",", "]") s"Def($id, $name, $ps, $naps,\nI: $ais,\nR: $ars,\nRec: $recBoundary,\n$resultNum, \n$body\n)" + def show = toDocument.print + + def toDocument: Document = + given Conversion[String, Document] = raw + stack( + "def" <:> name <#> "(" <#> params.map(_.toString).mkString(",") <#> ")" <:> "=", + body.toDocument |> indent + ) + sealed trait TrivialExpr: import Expr._ override def toString: String @@ -224,7 +261,7 @@ enum Node: val names_copy = names.map(_.copy) LetCall(names_copy, defn, args.map(_.mapNameOfTrivialExpr(_.trySubst(ctx))), body.copy(ctx ++ names_copy.map(x => x.str -> x))) - private def toDocument: Document = + def toDocument: Document = given Conversion[String, Document] = raw this match case Result(res) => (res |> showArguments) <:> s"-- $tag" diff --git a/compiler/shared/test/diff-ir/Class.mls b/compiler/shared/test/diff-ir/Class.mls index 71cf5d528..0e0b1c294 100644 --- a/compiler/shared/test/diff-ir/Class.mls +++ b/compiler/shared/test/diff-ir/Class.mls @@ -32,234 +32,116 @@ main() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(7, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #62 -//│ ), -//│ apply1 -> Def(3, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #58 -//│ ), -//│ apply0 -> Def(2, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #57 -//│ ), -//│ apply4 -> Def(6, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #61 -//│ ), -//│ apply3 -> Def(5, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #60 -//│ ), -//│ apply2 -> Def(4, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #59 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Fn, [], parents: Callable, methods: -//│ apply1 -> Def(8, apply1, [x$11], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$12 = Callable.apply2(builtin,println,x$11) in -- #70 -//│ x$12 -- #69 -//│ )), -//│ ClassInfo(10, Fn2, [a], parents: Callable, methods: -//│ apply1 -> Def(9, apply1, [x$13], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$14 = Callable.apply2(builtin,println,a) in -- #86 -//│ let x$15 = Callable.apply2(builtin,println,x$13) in -- #85 -//│ x$15 -- #84 -//│ )), -//│ ClassInfo(11, Demo, [n], parents: , methods: -//│ x -> Def(10, x, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ n -- #87 -//│ ))}, { -//│ Def(0, f, [fn$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = Callable.apply1(fn$0,1) in -- #8 -//│ x$1 -- #7 -//│ ) -//│ Def(1, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = Demo(2) in -- #56 -//│ let x$3 = Demo.x(x$2) in -- #55 -//│ let x$4 = Fn() in -- #54 -//│ let x$5 = Fn.apply1(x$4,3) in -- #53 -//│ let* (x$6) = f(x$4) in -- #52 -//│ let x$7 = Fn2(4) in -- #51 -//│ let x$8 = Fn2.apply1(x$7,5) in -- #50 -//│ let x$9 = Callable.apply1(x$7,6) in -- #49 -//│ let* (x$10) = f(x$7) in -- #48 -//│ x$10 -- #47 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #62 +//│ def apply1(x0$0) = +//│ 0 -- #58 +//│ def apply0() = +//│ 0 -- #57 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #61 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #60 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #59 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Fn() extends Callable { +//│ def apply1(x$11) = +//│ let x$12 = Callable.apply2(builtin,println,x$11) in -- #70 +//│ x$12 -- #69 +//│ } +//│ class Fn2(a) extends Callable { +//│ def apply1(x$13) = +//│ let x$14 = Callable.apply2(builtin,println,a) in -- #86 +//│ let x$15 = Callable.apply2(builtin,println,x$13) in -- #85 +//│ x$15 -- #84 +//│ } +//│ class Demo(n) { +//│ def x() = +//│ n -- #87 +//│ } +//│ def f(fn$0) = +//│ let x$1 = Callable.apply1(fn$0,1) in -- #8 +//│ x$1 -- #7 +//│ def main() = +//│ let x$2 = Demo(2) in -- #56 +//│ let x$3 = Demo.x(x$2) in -- #55 +//│ let x$4 = Fn() in -- #54 +//│ let x$5 = Fn.apply1(x$4,3) in -- #53 +//│ let* (x$6) = f(x$4) in -- #52 +//│ let x$7 = Fn2(4) in -- #51 +//│ let x$8 = Fn2.apply1(x$7,5) in -- #50 +//│ let x$9 = Callable.apply1(x$7,6) in -- #49 +//│ let* (x$10) = f(x$7) in -- #48 +//│ x$10 -- #47 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(7, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #62 -//│ ), -//│ apply1 -> Def(3, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #58 -//│ ), -//│ apply0 -> Def(2, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #57 -//│ ), -//│ apply4 -> Def(6, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #61 -//│ ), -//│ apply3 -> Def(5, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #60 -//│ ), -//│ apply2 -> Def(4, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #59 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Fn, [], parents: Callable, methods: -//│ apply1 -> Def(8, apply1, [x$11], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$12 = Callable.apply2(builtin,println,x$11) in -- #70 -//│ x$12 -- #69 -//│ )), -//│ ClassInfo(10, Fn2, [a], parents: Callable, methods: -//│ apply1 -> Def(9, apply1, [x$13], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$14 = Callable.apply2(builtin,println,a) in -- #86 -//│ let x$15 = Callable.apply2(builtin,println,x$13) in -- #85 -//│ x$15 -- #84 -//│ )), -//│ ClassInfo(11, Demo, [n], parents: , methods: -//│ x -> Def(10, x, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ n -- #87 -//│ ))}, { -//│ Def(0, f, [fn$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = Callable.apply1(fn$0,1) in -- #8 -//│ x$1 -- #7 -//│ ) -//│ Def(1, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = Demo(2) in -- #56 -//│ let x$3 = Demo.x(x$2) in -- #55 -//│ let x$4 = Fn() in -- #54 -//│ let x$5 = Fn.apply1(x$4,3) in -- #53 -//│ let* (x$6) = f(x$4) in -- #52 -//│ let x$7 = Fn2(4) in -- #51 -//│ let x$8 = Fn2.apply1(x$7,5) in -- #50 -//│ let x$9 = Callable.apply1(x$7,6) in -- #49 -//│ let* (x$10) = f(x$7) in -- #48 -//│ x$10 -- #47 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #62 +//│ def apply1(x0$0) = +//│ 0 -- #58 +//│ def apply0() = +//│ 0 -- #57 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #61 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #60 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #59 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Fn() extends Callable { +//│ def apply1(x$11) = +//│ let x$12 = Callable.apply2(builtin,println,x$11) in -- #70 +//│ x$12 -- #69 +//│ } +//│ class Fn2(a) extends Callable { +//│ def apply1(x$13) = +//│ let x$14 = Callable.apply2(builtin,println,a) in -- #86 +//│ let x$15 = Callable.apply2(builtin,println,x$13) in -- #85 +//│ x$15 -- #84 +//│ } +//│ class Demo(n) { +//│ def x() = +//│ n -- #87 +//│ } +//│ def f(fn$0) = +//│ let x$1 = Callable.apply1(fn$0,1) in -- #8 +//│ x$1 -- #7 +//│ def main() = +//│ let x$2 = Demo(2) in -- #56 +//│ let x$3 = Demo.x(x$2) in -- #55 +//│ let x$4 = Fn() in -- #54 +//│ let x$5 = Fn.apply1(x$4,3) in -- #53 +//│ let* (x$6) = f(x$4) in -- #52 +//│ let x$7 = Fn2(4) in -- #51 +//│ let x$8 = Fn2.apply1(x$7,5) in -- #50 +//│ let x$9 = Callable.apply1(x$7,6) in -- #49 +//│ let* (x$10) = f(x$7) in -- #48 +//│ x$10 -- #47 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ //│ Execution succeeded: diff --git a/compiler/shared/test/diff-ir/Currying.mls b/compiler/shared/test/diff-ir/Currying.mls index 690deec63..b457f8b7c 100644 --- a/compiler/shared/test/diff-ir/Currying.mls +++ b/compiler/shared/test/diff-ir/Currying.mls @@ -18,262 +18,124 @@ main() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(9, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #48 -//│ ), -//│ apply1 -> Def(5, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #44 -//│ ), -//│ apply0 -> Def(4, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #43 -//│ ), -//│ apply4 -> Def(8, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #47 -//│ ), -//│ apply3 -> Def(7, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #46 -//│ ), -//│ apply2 -> Def(6, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #45 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Lambda$0, [a], parents: Callable, methods: -//│ apply1 -> Def(10, apply1, [b$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$12 = +(a,b$1) in -- #52 -//│ x$12 -- #51 -//│ )), -//│ ClassInfo(10, Lambda$1, [a], parents: Callable, methods: -//│ apply1 -> Def(11, apply1, [b$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$14 = Lambda$2(a,b$2) in -- #54 -//│ x$14 -- #53 -//│ )), -//│ ClassInfo(11, Lambda$2, [a,b], parents: Callable, methods: -//│ apply1 -> Def(12, apply1, [c$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$15 = +(a,b) in -- #61 -//│ let x$16 = +(x$15,c$0) in -- #60 -//│ x$16 -- #59 -//│ ))}, { -//│ Def(0, add2c, [a$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = Lambda$0(a$0) in -- #4 -//│ x$2 -- #3 -//│ ) -//│ Def(1, add2, [a$1,b$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$3 = +(a$1,b$0) in -- #8 -//│ x$3 -- #7 -//│ ) -//│ Def(2, add3c, [a$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$5 = Lambda$1(a$2) in -- #10 -//│ x$5 -- #9 -//│ ) -//│ Def(3, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$6) = add2c(1) in -- #42 -//│ let x$7 = Callable.apply1(x$6,2) in -- #41 -//│ let* (x$8) = add2(1,2) in -- #40 -//│ let* (x$9) = add3c(1) in -- #39 -//│ let x$10 = Callable.apply1(x$9,2) in -- #38 -//│ let x$11 = Callable.apply1(x$10,3) in -- #37 -//│ x$11 -- #36 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #48 +//│ def apply1(x0$0) = +//│ 0 -- #44 +//│ def apply0() = +//│ 0 -- #43 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #47 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #46 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #45 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Lambda$0(a) extends Callable { +//│ def apply1(b$1) = +//│ let x$12 = +(a,b$1) in -- #52 +//│ x$12 -- #51 +//│ } +//│ class Lambda$1(a) extends Callable { +//│ def apply1(b$2) = +//│ let x$14 = Lambda$2(a,b$2) in -- #54 +//│ x$14 -- #53 +//│ } +//│ class Lambda$2(a,b) extends Callable { +//│ def apply1(c$0) = +//│ let x$15 = +(a,b) in -- #61 +//│ let x$16 = +(x$15,c$0) in -- #60 +//│ x$16 -- #59 +//│ } +//│ def add2c(a$0) = +//│ let x$2 = Lambda$0(a$0) in -- #4 +//│ x$2 -- #3 +//│ def add2(a$1,b$0) = +//│ let x$3 = +(a$1,b$0) in -- #8 +//│ x$3 -- #7 +//│ def add3c(a$2) = +//│ let x$5 = Lambda$1(a$2) in -- #10 +//│ x$5 -- #9 +//│ def main() = +//│ let* (x$6) = add2c(1) in -- #42 +//│ let x$7 = Callable.apply1(x$6,2) in -- #41 +//│ let* (x$8) = add2(1,2) in -- #40 +//│ let* (x$9) = add3c(1) in -- #39 +//│ let x$10 = Callable.apply1(x$9,2) in -- #38 +//│ let x$11 = Callable.apply1(x$10,3) in -- #37 +//│ x$11 -- #36 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(9, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #48 -//│ ), -//│ apply1 -> Def(5, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #44 -//│ ), -//│ apply0 -> Def(4, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #43 -//│ ), -//│ apply4 -> Def(8, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #47 -//│ ), -//│ apply3 -> Def(7, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #46 -//│ ), -//│ apply2 -> Def(6, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #45 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Lambda$0, [a], parents: Callable, methods: -//│ apply1 -> Def(10, apply1, [b$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$12 = +(a,b$1) in -- #52 -//│ x$12 -- #51 -//│ )), -//│ ClassInfo(10, Lambda$1, [a], parents: Callable, methods: -//│ apply1 -> Def(11, apply1, [b$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$14 = Lambda$2(a,b$2) in -- #54 -//│ x$14 -- #53 -//│ )), -//│ ClassInfo(11, Lambda$2, [a,b], parents: Callable, methods: -//│ apply1 -> Def(12, apply1, [c$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$15 = +(a,b) in -- #61 -//│ let x$16 = +(x$15,c$0) in -- #60 -//│ x$16 -- #59 -//│ ))}, { -//│ Def(0, add2c, [a$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = Lambda$0(a$0) in -- #4 -//│ x$2 -- #3 -//│ ) -//│ Def(1, add2, [a$1,b$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$3 = +(a$1,b$0) in -- #8 -//│ x$3 -- #7 -//│ ) -//│ Def(2, add3c, [a$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$5 = Lambda$1(a$2) in -- #10 -//│ x$5 -- #9 -//│ ) -//│ Def(3, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$6) = add2c(1) in -- #42 -//│ let x$7 = Callable.apply1(x$6,2) in -- #41 -//│ let* (x$8) = add2(1,2) in -- #40 -//│ let* (x$9) = add3c(1) in -- #39 -//│ let x$10 = Callable.apply1(x$9,2) in -- #38 -//│ let x$11 = Callable.apply1(x$10,3) in -- #37 -//│ x$11 -- #36 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #48 +//│ def apply1(x0$0) = +//│ 0 -- #44 +//│ def apply0() = +//│ 0 -- #43 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #47 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #46 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #45 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Lambda$0(a) extends Callable { +//│ def apply1(b$1) = +//│ let x$12 = +(a,b$1) in -- #52 +//│ x$12 -- #51 +//│ } +//│ class Lambda$1(a) extends Callable { +//│ def apply1(b$2) = +//│ let x$14 = Lambda$2(a,b$2) in -- #54 +//│ x$14 -- #53 +//│ } +//│ class Lambda$2(a,b) extends Callable { +//│ def apply1(c$0) = +//│ let x$15 = +(a,b) in -- #61 +//│ let x$16 = +(x$15,c$0) in -- #60 +//│ x$16 -- #59 +//│ } +//│ def add2c(a$0) = +//│ let x$2 = Lambda$0(a$0) in -- #4 +//│ x$2 -- #3 +//│ def add2(a$1,b$0) = +//│ let x$3 = +(a$1,b$0) in -- #8 +//│ x$3 -- #7 +//│ def add3c(a$2) = +//│ let x$5 = Lambda$1(a$2) in -- #10 +//│ x$5 -- #9 +//│ def main() = +//│ let* (x$6) = add2c(1) in -- #42 +//│ let x$7 = Callable.apply1(x$6,2) in -- #41 +//│ let* (x$8) = add2(1,2) in -- #40 +//│ let* (x$9) = add3c(1) in -- #39 +//│ let x$10 = Callable.apply1(x$9,2) in -- #38 +//│ let x$11 = Callable.apply1(x$10,3) in -- #37 +//│ x$11 -- #36 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 6 diff --git a/compiler/shared/test/diff-ir/IR.mls b/compiler/shared/test/diff-ir/IR.mls index d87a1d999..725338e5a 100644 --- a/compiler/shared/test/diff-ir/IR.mls +++ b/compiler/shared/test/diff-ir/IR.mls @@ -14,184 +14,78 @@ foo() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(8, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #29 -//│ ), -//│ apply1 -> Def(4, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #25 -//│ ), -//│ apply0 -> Def(3, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #24 -//│ ), -//│ apply4 -> Def(7, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #28 -//│ ), -//│ apply3 -> Def(6, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #27 -//│ ), -//│ apply2 -> Def(5, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #26 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, mktup2, [x$1,y$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$2) = mktup(x$1,y$0) in -- #9 -//│ x$2 -- #8 -//│ ) -//│ Def(1, mktup, [x$3,y$1], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$4 = Pair(x$3,y$1) in -- #16 -//│ x$4 -- #15 -//│ ) -//│ Def(2, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$5) = mktup2(1,2) in -- #23 -//│ x$5 -- #22 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #29 +//│ def apply1(x0$0) = +//│ 0 -- #25 +//│ def apply0() = +//│ 0 -- #24 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #28 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #27 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #26 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Pair(x,y) +//│ def mktup2(x$1,y$0) = +//│ let* (x$2) = mktup(x$1,y$0) in -- #9 +//│ x$2 -- #8 +//│ def mktup(x$3,y$1) = +//│ let x$4 = Pair(x$3,y$1) in -- #16 +//│ x$4 -- #15 +//│ def foo() = +//│ let* (x$5) = mktup2(1,2) in -- #23 +//│ x$5 -- #22 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(8, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #29 -//│ ), -//│ apply1 -> Def(4, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #25 -//│ ), -//│ apply0 -> Def(3, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #24 -//│ ), -//│ apply4 -> Def(7, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #28 -//│ ), -//│ apply3 -> Def(6, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #27 -//│ ), -//│ apply2 -> Def(5, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #26 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, mktup2, [x$1,y$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$2) = mktup(x$1,y$0) in -- #9 -//│ x$2 -- #8 -//│ ) -//│ Def(1, mktup, [x$3,y$1], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$4 = Pair(x$3,y$1) in -- #16 -//│ x$4 -- #15 -//│ ) -//│ Def(2, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$5) = mktup2(1,2) in -- #23 -//│ x$5 -- #22 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #29 +//│ def apply1(x0$0) = +//│ 0 -- #25 +//│ def apply0() = +//│ 0 -- #24 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #28 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #27 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #26 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Pair(x,y) +//│ def mktup2(x$1,y$0) = +//│ let* (x$2) = mktup(x$1,y$0) in -- #9 +//│ x$2 -- #8 +//│ def mktup(x$3,y$1) = +//│ let x$4 = Pair(x$3,y$1) in -- #16 +//│ x$4 -- #15 +//│ def foo() = +//│ let* (x$5) = mktup2(1,2) in -- #23 +//│ x$5 -- #22 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ Pair(1,2) @@ -209,192 +103,86 @@ bar() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(8, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #40 -//│ ), -//│ apply1 -> Def(4, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #36 -//│ ), -//│ apply0 -> Def(3, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #35 -//│ ), -//│ apply4 -> Def(7, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #39 -//│ ), -//│ apply3 -> Def(6, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #38 -//│ ), -//│ apply2 -> Def(5, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #37 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, foo, [pair$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case pair$0 of -- #23 -//│ Pair => -//│ let x$2 = Pair.y(pair$0) in -- #22 -//│ let x$3 = Pair.x(pair$0) in -- #21 -//│ let x$4 = Pair(x$3,x$2) in -- #20 -//│ jump j$0(x$4) -- #19 -//│ ) -//│ Def(1, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$1 -- #4 -//│ ) -//│ Def(2, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$5 = Pair(1,2) in -- #34 -//│ let* (x$6) = foo(x$5) in -- #33 -//│ x$6 -- #32 -//│ ) -//│ }, -//│ let* (x$0) = bar() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #40 +//│ def apply1(x0$0) = +//│ 0 -- #36 +//│ def apply0() = +//│ 0 -- #35 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #39 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #38 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #37 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Pair(x,y) +//│ def foo(pair$0) = +//│ case pair$0 of -- #23 +//│ Pair => +//│ let x$2 = Pair.y(pair$0) in -- #22 +//│ let x$3 = Pair.x(pair$0) in -- #21 +//│ let x$4 = Pair(x$3,x$2) in -- #20 +//│ jump j$0(x$4) -- #19 +//│ def j$0(x$1) = +//│ x$1 -- #4 +//│ def bar() = +//│ let x$5 = Pair(1,2) in -- #34 +//│ let* (x$6) = foo(x$5) in -- #33 +//│ x$6 -- #32 +//│ let* (x$0) = bar() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(8, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #40 -//│ ), -//│ apply1 -> Def(4, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #36 -//│ ), -//│ apply0 -> Def(3, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #35 -//│ ), -//│ apply4 -> Def(7, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #39 -//│ ), -//│ apply3 -> Def(6, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #38 -//│ ), -//│ apply2 -> Def(5, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #37 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, foo, [pair$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case pair$0 of -- #23 -//│ Pair => -//│ let x$2 = Pair.y(pair$0) in -- #22 -//│ let x$3 = Pair.x(pair$0) in -- #21 -//│ let x$4 = Pair(x$3,x$2) in -- #20 -//│ jump j$0(x$4) -- #19 -//│ ) -//│ Def(1, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$1 -- #4 -//│ ) -//│ Def(2, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$5 = Pair(1,2) in -- #34 -//│ let* (x$6) = foo(x$5) in -- #33 -//│ x$6 -- #32 -//│ ) -//│ }, -//│ let* (x$0) = bar() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #40 +//│ def apply1(x0$0) = +//│ 0 -- #36 +//│ def apply0() = +//│ 0 -- #35 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #39 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #38 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #37 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Pair(x,y) +//│ def foo(pair$0) = +//│ case pair$0 of -- #23 +//│ Pair => +//│ let x$2 = Pair.y(pair$0) in -- #22 +//│ let x$3 = Pair.x(pair$0) in -- #21 +//│ let x$4 = Pair(x$3,x$2) in -- #20 +//│ jump j$0(x$4) -- #19 +//│ def j$0(x$1) = +//│ x$1 -- #4 +//│ def bar() = +//│ let x$5 = Pair(1,2) in -- #34 +//│ let* (x$6) = foo(x$5) in -- #33 +//│ x$6 -- #32 +//│ let* (x$0) = bar() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ Pair(1,2) @@ -420,218 +208,102 @@ foo() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(9, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #59 -//│ ), -//│ apply1 -> Def(5, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #55 -//│ ), -//│ apply0 -> Def(4, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #54 -//│ ), -//│ apply4 -> Def(8, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #58 -//│ ), -//│ apply3 -> Def(7, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #57 -//│ ), -//│ apply2 -> Def(6, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #56 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, silly, [pair$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = 0 in -- #40 -//│ case pair$0 of -- #39 -//│ Pair => -//│ let x$4 = Pair.y(pair$0) in -- #38 -//│ let x$5 = Pair.x(pair$0) in -- #37 -//│ case pair$0 of -- #36 +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #59 +//│ def apply1(x0$0) = +//│ 0 -- #55 +//│ def apply0() = +//│ 0 -- #54 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #58 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #57 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #56 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Pair(x,y) +//│ def silly(pair$0) = +//│ let x$1 = 0 in -- #40 +//│ case pair$0 of -- #39 //│ Pair => -//│ let x$7 = Pair.y(pair$0) in -- #35 -//│ let x$8 = Pair.x(pair$0) in -- #34 -//│ let x$9 = +(x$8,1) in -- #33 -//│ jump j$1(x$9) -- #32 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$3 = +(x$2,1) in -- #9 -//│ x$3 -- #8 -//│ ) -//│ Def(2, j$1, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$0(x$6) -- #20 -//│ ) -//│ Def(3, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$10 = Pair(0,1) in -- #53 -//│ let* (x$11) = silly(x$10) in -- #52 -//│ x$11 -- #51 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ let x$4 = Pair.y(pair$0) in -- #38 +//│ let x$5 = Pair.x(pair$0) in -- #37 +//│ case pair$0 of -- #36 +//│ Pair => +//│ let x$7 = Pair.y(pair$0) in -- #35 +//│ let x$8 = Pair.x(pair$0) in -- #34 +//│ let x$9 = +(x$8,1) in -- #33 +//│ jump j$1(x$9) -- #32 +//│ def j$0(x$2) = +//│ let x$3 = +(x$2,1) in -- #9 +//│ x$3 -- #8 +//│ def j$1(x$6) = +//│ jump j$0(x$6) -- #20 +//│ def foo() = +//│ let x$10 = Pair(0,1) in -- #53 +//│ let* (x$11) = silly(x$10) in -- #52 +//│ x$11 -- #51 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(9, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #59 -//│ ), -//│ apply1 -> Def(5, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #55 -//│ ), -//│ apply0 -> Def(4, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #54 -//│ ), -//│ apply4 -> Def(8, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #58 -//│ ), -//│ apply3 -> Def(7, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #57 -//│ ), -//│ apply2 -> Def(6, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #56 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, silly, [pair$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = 0 in -- #40 -//│ case pair$0 of -- #39 -//│ Pair => -//│ let x$4 = Pair.y(pair$0) in -- #38 -//│ let x$5 = Pair.x(pair$0) in -- #37 -//│ case pair$0 of -- #36 +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #59 +//│ def apply1(x0$0) = +//│ 0 -- #55 +//│ def apply0() = +//│ 0 -- #54 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #58 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #57 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #56 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Pair(x,y) +//│ def silly(pair$0) = +//│ let x$1 = 0 in -- #40 +//│ case pair$0 of -- #39 //│ Pair => -//│ let x$7 = Pair.y(pair$0) in -- #35 -//│ let x$8 = Pair.x(pair$0) in -- #34 -//│ let x$9 = +(x$8,1) in -- #33 -//│ jump j$1(x$9) -- #32 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$3 = +(x$2,1) in -- #9 -//│ x$3 -- #8 -//│ ) -//│ Def(2, j$1, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$0(x$6) -- #20 -//│ ) -//│ Def(3, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$10 = Pair(0,1) in -- #53 -//│ let* (x$11) = silly(x$10) in -- #52 -//│ x$11 -- #51 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ let x$4 = Pair.y(pair$0) in -- #38 +//│ let x$5 = Pair.x(pair$0) in -- #37 +//│ case pair$0 of -- #36 +//│ Pair => +//│ let x$7 = Pair.y(pair$0) in -- #35 +//│ let x$8 = Pair.x(pair$0) in -- #34 +//│ let x$9 = +(x$8,1) in -- #33 +//│ jump j$1(x$9) -- #32 +//│ def j$0(x$2) = +//│ let x$3 = +(x$2,1) in -- #9 +//│ x$3 -- #8 +//│ def j$1(x$6) = +//│ jump j$0(x$6) -- #20 +//│ def foo() = +//│ let x$10 = Pair(0,1) in -- #53 +//│ let* (x$11) = silly(x$10) in -- #52 +//│ x$11 -- #51 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 2 @@ -655,194 +327,88 @@ foo() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(8, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #41 -//│ ), -//│ apply1 -> Def(4, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #37 -//│ ), -//│ apply0 -> Def(3, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #36 -//│ ), -//│ apply4 -> Def(7, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #40 -//│ ), -//│ apply3 -> Def(6, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #39 -//│ ), -//│ apply2 -> Def(5, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #38 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, inc_fst, [pair$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = 2 in -- #22 -//│ case pair$0 of -- #21 -//│ Pair => -//│ let x$3 = Pair.y(pair$0) in -- #20 -//│ let x$4 = Pair.x(pair$0) in -- #19 -//│ let x$5 = +(x$4,x$1) in -- #18 -//│ jump j$0(x$5) -- #17 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #5 -//│ ) -//│ Def(2, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$6 = Pair(0,1) in -- #35 -//│ let* (x$7) = inc_fst(x$6) in -- #34 -//│ x$7 -- #33 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #41 +//│ def apply1(x0$0) = +//│ 0 -- #37 +//│ def apply0() = +//│ 0 -- #36 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #40 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #39 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #38 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Pair(x,y) +//│ def inc_fst(pair$0) = +//│ let x$1 = 2 in -- #22 +//│ case pair$0 of -- #21 +//│ Pair => +//│ let x$3 = Pair.y(pair$0) in -- #20 +//│ let x$4 = Pair.x(pair$0) in -- #19 +//│ let x$5 = +(x$4,x$1) in -- #18 +//│ jump j$0(x$5) -- #17 +//│ def j$0(x$2) = +//│ x$2 -- #5 +//│ def foo() = +//│ let x$6 = Pair(0,1) in -- #35 +//│ let* (x$7) = inc_fst(x$6) in -- #34 +//│ x$7 -- #33 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(8, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #41 -//│ ), -//│ apply1 -> Def(4, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #37 -//│ ), -//│ apply0 -> Def(3, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #36 -//│ ), -//│ apply4 -> Def(7, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #40 -//│ ), -//│ apply3 -> Def(6, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #39 -//│ ), -//│ apply2 -> Def(5, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #38 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, inc_fst, [pair$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = 2 in -- #22 -//│ case pair$0 of -- #21 -//│ Pair => -//│ let x$3 = Pair.y(pair$0) in -- #20 -//│ let x$4 = Pair.x(pair$0) in -- #19 -//│ let x$5 = +(x$4,x$1) in -- #18 -//│ jump j$0(x$5) -- #17 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #5 -//│ ) -//│ Def(2, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$6 = Pair(0,1) in -- #35 -//│ let* (x$7) = inc_fst(x$6) in -- #34 -//│ x$7 -- #33 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #41 +//│ def apply1(x0$0) = +//│ 0 -- #37 +//│ def apply0() = +//│ 0 -- #36 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #40 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #39 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #38 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Pair(x,y) +//│ def inc_fst(pair$0) = +//│ let x$1 = 2 in -- #22 +//│ case pair$0 of -- #21 +//│ Pair => +//│ let x$3 = Pair.y(pair$0) in -- #20 +//│ let x$4 = Pair.x(pair$0) in -- #19 +//│ let x$5 = +(x$4,x$1) in -- #18 +//│ jump j$0(x$5) -- #17 +//│ def j$0(x$2) = +//│ x$2 -- #5 +//│ def foo() = +//│ let x$6 = Pair(0,1) in -- #35 +//│ let* (x$7) = inc_fst(x$6) in -- #34 +//│ x$7 -- #33 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 2 @@ -862,194 +428,88 @@ foo() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(8, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #40 -//│ ), -//│ apply1 -> Def(4, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #36 -//│ ), -//│ apply0 -> Def(3, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #35 -//│ ), -//│ apply4 -> Def(7, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #39 -//│ ), -//│ apply3 -> Def(6, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #38 -//│ ), -//│ apply2 -> Def(5, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #37 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, inc_fst, [pair$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = 0 in -- #22 -//│ case pair$0 of -- #21 -//│ Pair => -//│ let x$3 = Pair.y(pair$0) in -- #20 -//│ let x$4 = Pair.x(pair$0) in -- #19 -//│ let x$5 = +(x$3,1) in -- #18 -//│ jump j$0(x$5) -- #17 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #5 -//│ ) -//│ Def(2, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$6 = Pair(0,1) in -- #34 -//│ let* (x$7) = inc_fst(x$6) in -- #33 -//│ x$7 -- #32 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #40 +//│ def apply1(x0$0) = +//│ 0 -- #36 +//│ def apply0() = +//│ 0 -- #35 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #39 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #38 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #37 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Pair(x,y) +//│ def inc_fst(pair$0) = +//│ let x$1 = 0 in -- #22 +//│ case pair$0 of -- #21 +//│ Pair => +//│ let x$3 = Pair.y(pair$0) in -- #20 +//│ let x$4 = Pair.x(pair$0) in -- #19 +//│ let x$5 = +(x$3,1) in -- #18 +//│ jump j$0(x$5) -- #17 +//│ def j$0(x$2) = +//│ x$2 -- #5 +//│ def foo() = +//│ let x$6 = Pair(0,1) in -- #34 +//│ let* (x$7) = inc_fst(x$6) in -- #33 +//│ x$7 -- #32 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(8, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #40 -//│ ), -//│ apply1 -> Def(4, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #36 -//│ ), -//│ apply0 -> Def(3, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #35 -//│ ), -//│ apply4 -> Def(7, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #39 -//│ ), -//│ apply3 -> Def(6, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #38 -//│ ), -//│ apply2 -> Def(5, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #37 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, inc_fst, [pair$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = 0 in -- #22 -//│ case pair$0 of -- #21 -//│ Pair => -//│ let x$3 = Pair.y(pair$0) in -- #20 -//│ let x$4 = Pair.x(pair$0) in -- #19 -//│ let x$5 = +(x$3,1) in -- #18 -//│ jump j$0(x$5) -- #17 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #5 -//│ ) -//│ Def(2, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$6 = Pair(0,1) in -- #34 -//│ let* (x$7) = inc_fst(x$6) in -- #33 -//│ x$7 -- #32 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #40 +//│ def apply1(x0$0) = +//│ 0 -- #36 +//│ def apply0() = +//│ 0 -- #35 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #39 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #38 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #37 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Pair(x,y) +//│ def inc_fst(pair$0) = +//│ let x$1 = 0 in -- #22 +//│ case pair$0 of -- #21 +//│ Pair => +//│ let x$3 = Pair.y(pair$0) in -- #20 +//│ let x$4 = Pair.x(pair$0) in -- #19 +//│ let x$5 = +(x$3,1) in -- #18 +//│ jump j$0(x$5) -- #17 +//│ def j$0(x$2) = +//│ x$2 -- #5 +//│ def foo() = +//│ let x$6 = Pair(0,1) in -- #34 +//│ let* (x$7) = inc_fst(x$6) in -- #33 +//│ x$7 -- #32 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 2 @@ -1072,230 +532,112 @@ bar() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(9, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #64 -//│ ), -//│ apply1 -> Def(5, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #60 -//│ ), -//│ apply0 -> Def(4, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #59 -//│ ), -//│ apply4 -> Def(8, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #63 -//│ ), -//│ apply3 -> Def(7, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #62 -//│ ), -//│ apply2 -> Def(6, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #61 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Left, [x], parents: , methods: -//│ ), -//│ ClassInfo(10, Right, [y], parents: , methods: -//│ )}, { -//│ Def(0, foo, [a$0,b$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case a$0 of -- #47 -//│ Left => -//│ let x$5 = Left.x(a$0) in -- #35 -//│ let x$6 = +(x$5,1) in -- #34 -//│ let x$7 = Left(x$6) in -- #33 -//│ jump j$0(x$7) -- #32 -//│ Right => -//│ let x$8 = Right.y(a$0) in -- #46 -//│ let x$9 = Right(b$0) in -- #45 -//│ jump j$0(x$9) -- #44 -//│ ) -//│ Def(1, j$1, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #6 -//│ ) -//│ Def(2, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$1 of -- #21 -//│ Left => -//│ let x$3 = Left.x(x$1) in -- #13 -//│ jump j$1(x$3) -- #12 -//│ Right => -//│ let x$4 = Right.y(x$1) in -- #20 -//│ jump j$1(x$4) -- #19 -//│ ) -//│ Def(3, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$10 = Right(2) in -- #58 -//│ let* (x$11) = foo(x$10,2) in -- #57 -//│ x$11 -- #56 -//│ ) -//│ }, -//│ let* (x$0) = bar() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #64 +//│ def apply1(x0$0) = +//│ 0 -- #60 +//│ def apply0() = +//│ 0 -- #59 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #63 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #62 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #61 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Left(x) +//│ class Right(y) +//│ def foo(a$0,b$0) = +//│ case a$0 of -- #47 +//│ Left => +//│ let x$5 = Left.x(a$0) in -- #35 +//│ let x$6 = +(x$5,1) in -- #34 +//│ let x$7 = Left(x$6) in -- #33 +//│ jump j$0(x$7) -- #32 +//│ Right => +//│ let x$8 = Right.y(a$0) in -- #46 +//│ let x$9 = Right(b$0) in -- #45 +//│ jump j$0(x$9) -- #44 +//│ def j$1(x$2) = +//│ x$2 -- #6 +//│ def j$0(x$1) = +//│ case x$1 of -- #21 +//│ Left => +//│ let x$3 = Left.x(x$1) in -- #13 +//│ jump j$1(x$3) -- #12 +//│ Right => +//│ let x$4 = Right.y(x$1) in -- #20 +//│ jump j$1(x$4) -- #19 +//│ def bar() = +//│ let x$10 = Right(2) in -- #58 +//│ let* (x$11) = foo(x$10,2) in -- #57 +//│ x$11 -- #56 +//│ let* (x$0) = bar() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(9, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #64 -//│ ), -//│ apply1 -> Def(5, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #60 -//│ ), -//│ apply0 -> Def(4, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #59 -//│ ), -//│ apply4 -> Def(8, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #63 -//│ ), -//│ apply3 -> Def(7, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #62 -//│ ), -//│ apply2 -> Def(6, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #61 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Left, [x], parents: , methods: -//│ ), -//│ ClassInfo(10, Right, [y], parents: , methods: -//│ )}, { -//│ Def(0, foo, [a$0,b$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case a$0 of -- #47 -//│ Left => -//│ let x$5 = Left.x(a$0) in -- #35 -//│ let x$6 = +(x$5,1) in -- #34 -//│ let x$7 = Left(x$6) in -- #33 -//│ jump j$0(x$7) -- #32 -//│ Right => -//│ let x$8 = Right.y(a$0) in -- #46 -//│ let x$9 = Right(b$0) in -- #45 -//│ jump j$0(x$9) -- #44 -//│ ) -//│ Def(1, j$1, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #6 -//│ ) -//│ Def(2, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$1 of -- #21 -//│ Left => -//│ let x$3 = Left.x(x$1) in -- #13 -//│ jump j$1(x$3) -- #12 -//│ Right => -//│ let x$4 = Right.y(x$1) in -- #20 -//│ jump j$1(x$4) -- #19 -//│ ) -//│ Def(3, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$10 = Right(2) in -- #58 -//│ let* (x$11) = foo(x$10,2) in -- #57 -//│ x$11 -- #56 -//│ ) -//│ }, -//│ let* (x$0) = bar() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #64 +//│ def apply1(x0$0) = +//│ 0 -- #60 +//│ def apply0() = +//│ 0 -- #59 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #63 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #62 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #61 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Left(x) +//│ class Right(y) +//│ def foo(a$0,b$0) = +//│ case a$0 of -- #47 +//│ Left => +//│ let x$5 = Left.x(a$0) in -- #35 +//│ let x$6 = +(x$5,1) in -- #34 +//│ let x$7 = Left(x$6) in -- #33 +//│ jump j$0(x$7) -- #32 +//│ Right => +//│ let x$8 = Right.y(a$0) in -- #46 +//│ let x$9 = Right(b$0) in -- #45 +//│ jump j$0(x$9) -- #44 +//│ def j$1(x$2) = +//│ x$2 -- #6 +//│ def j$0(x$1) = +//│ case x$1 of -- #21 +//│ Left => +//│ let x$3 = Left.x(x$1) in -- #13 +//│ jump j$1(x$3) -- #12 +//│ Right => +//│ let x$4 = Right.y(x$1) in -- #20 +//│ jump j$1(x$4) -- #19 +//│ def bar() = +//│ let x$10 = Right(2) in -- #58 +//│ let* (x$11) = foo(x$10,2) in -- #57 +//│ x$11 -- #56 +//│ let* (x$0) = bar() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 2 @@ -1313,182 +655,82 @@ bar() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(7, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #31 -//│ ), -//│ apply1 -> Def(3, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #27 -//│ ), -//│ apply0 -> Def(2, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #26 -//│ ), -//│ apply4 -> Def(6, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #30 -//│ ), -//│ apply3 -> Def(5, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #29 -//│ ), -//│ apply2 -> Def(4, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #28 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, True, [], parents: , methods: -//│ ), -//│ ClassInfo(10, False, [], parents: , methods: -//│ ), -//│ ClassInfo(11, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, foo, [a$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = Pair.x(a$0) in -- #14 -//│ let x$2 = Pair.y(a$0) in -- #13 -//│ let x$3 = +(x$1,x$2) in -- #12 -//│ x$3 -- #11 -//│ ) -//│ Def(1, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$4 = Pair(1,0) in -- #25 -//│ let* (x$5) = foo(x$4) in -- #24 -//│ x$5 -- #23 -//│ ) -//│ }, -//│ let* (x$0) = bar() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #31 +//│ def apply1(x0$0) = +//│ 0 -- #27 +//│ def apply0() = +//│ 0 -- #26 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #30 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #29 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #28 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class True() +//│ class False() +//│ class Pair(x,y) +//│ def foo(a$0) = +//│ let x$1 = Pair.x(a$0) in -- #14 +//│ let x$2 = Pair.y(a$0) in -- #13 +//│ let x$3 = +(x$1,x$2) in -- #12 +//│ x$3 -- #11 +//│ def bar() = +//│ let x$4 = Pair(1,0) in -- #25 +//│ let* (x$5) = foo(x$4) in -- #24 +//│ x$5 -- #23 +//│ let* (x$0) = bar() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(7, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #31 -//│ ), -//│ apply1 -> Def(3, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #27 -//│ ), -//│ apply0 -> Def(2, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #26 -//│ ), -//│ apply4 -> Def(6, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #30 -//│ ), -//│ apply3 -> Def(5, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #29 -//│ ), -//│ apply2 -> Def(4, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #28 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, True, [], parents: , methods: -//│ ), -//│ ClassInfo(10, False, [], parents: , methods: -//│ ), -//│ ClassInfo(11, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, foo, [a$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = Pair.x(a$0) in -- #14 -//│ let x$2 = Pair.y(a$0) in -- #13 -//│ let x$3 = +(x$1,x$2) in -- #12 -//│ x$3 -- #11 -//│ ) -//│ Def(1, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$4 = Pair(1,0) in -- #25 -//│ let* (x$5) = foo(x$4) in -- #24 -//│ x$5 -- #23 -//│ ) -//│ }, -//│ let* (x$0) = bar() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #31 +//│ def apply1(x0$0) = +//│ 0 -- #27 +//│ def apply0() = +//│ 0 -- #26 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #30 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #29 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #28 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class True() +//│ class False() +//│ class Pair(x,y) +//│ def foo(a$0) = +//│ let x$1 = Pair.x(a$0) in -- #14 +//│ let x$2 = Pair.y(a$0) in -- #13 +//│ let x$3 = +(x$1,x$2) in -- #12 +//│ x$3 -- #11 +//│ def bar() = +//│ let x$4 = Pair(1,0) in -- #25 +//│ let* (x$5) = foo(x$4) in -- #24 +//│ x$5 -- #23 +//│ let* (x$0) = bar() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 1 @@ -1508,200 +750,92 @@ bar() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(8, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #41 -//│ ), -//│ apply1 -> Def(4, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #37 -//│ ), -//│ apply0 -> Def(3, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #36 -//│ ), -//│ apply4 -> Def(7, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #40 -//│ ), -//│ apply3 -> Def(6, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #39 -//│ ), -//│ apply2 -> Def(5, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #38 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, C1, [x,y], parents: , methods: -//│ ), -//│ ClassInfo(10, C2, [z], parents: , methods: -//│ )}, { -//│ Def(0, foo, [a$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case a$0 of -- #24 -//│ C1 => -//│ let x$2 = C1.y(a$0) in -- #16 -//│ let x$3 = C1.x(a$0) in -- #15 -//│ jump j$0(x$3) -- #14 -//│ C2 => -//│ let x$4 = C2.z(a$0) in -- #23 -//│ jump j$0(x$4) -- #22 -//│ ) -//│ Def(1, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$1 -- #4 -//│ ) -//│ Def(2, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$5 = C1(0,1) in -- #35 -//│ let* (x$6) = foo(x$5) in -- #34 -//│ x$6 -- #33 -//│ ) -//│ }, -//│ let* (x$0) = bar() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #41 +//│ def apply1(x0$0) = +//│ 0 -- #37 +//│ def apply0() = +//│ 0 -- #36 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #40 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #39 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #38 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class C1(x,y) +//│ class C2(z) +//│ def foo(a$0) = +//│ case a$0 of -- #24 +//│ C1 => +//│ let x$2 = C1.y(a$0) in -- #16 +//│ let x$3 = C1.x(a$0) in -- #15 +//│ jump j$0(x$3) -- #14 +//│ C2 => +//│ let x$4 = C2.z(a$0) in -- #23 +//│ jump j$0(x$4) -- #22 +//│ def j$0(x$1) = +//│ x$1 -- #4 +//│ def bar() = +//│ let x$5 = C1(0,1) in -- #35 +//│ let* (x$6) = foo(x$5) in -- #34 +//│ x$6 -- #33 +//│ let* (x$0) = bar() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(8, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #41 -//│ ), -//│ apply1 -> Def(4, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #37 -//│ ), -//│ apply0 -> Def(3, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #36 -//│ ), -//│ apply4 -> Def(7, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #40 -//│ ), -//│ apply3 -> Def(6, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #39 -//│ ), -//│ apply2 -> Def(5, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #38 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, C1, [x,y], parents: , methods: -//│ ), -//│ ClassInfo(10, C2, [z], parents: , methods: -//│ )}, { -//│ Def(0, foo, [a$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case a$0 of -- #24 -//│ C1 => -//│ let x$2 = C1.y(a$0) in -- #16 -//│ let x$3 = C1.x(a$0) in -- #15 -//│ jump j$0(x$3) -- #14 -//│ C2 => -//│ let x$4 = C2.z(a$0) in -- #23 -//│ jump j$0(x$4) -- #22 -//│ ) -//│ Def(1, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$1 -- #4 -//│ ) -//│ Def(2, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$5 = C1(0,1) in -- #35 -//│ let* (x$6) = foo(x$5) in -- #34 -//│ x$6 -- #33 -//│ ) -//│ }, -//│ let* (x$0) = bar() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #41 +//│ def apply1(x0$0) = +//│ 0 -- #37 +//│ def apply0() = +//│ 0 -- #36 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #40 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #39 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #38 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class C1(x,y) +//│ class C2(z) +//│ def foo(a$0) = +//│ case a$0 of -- #24 +//│ C1 => +//│ let x$2 = C1.y(a$0) in -- #16 +//│ let x$3 = C1.x(a$0) in -- #15 +//│ jump j$0(x$3) -- #14 +//│ C2 => +//│ let x$4 = C2.z(a$0) in -- #23 +//│ jump j$0(x$4) -- #22 +//│ def j$0(x$1) = +//│ x$1 -- #4 +//│ def bar() = +//│ let x$5 = C1(0,1) in -- #35 +//│ let* (x$6) = foo(x$5) in -- #34 +//│ x$6 -- #33 +//│ let* (x$0) = bar() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 0 @@ -1726,210 +860,104 @@ baz() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(8, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #94 -//│ ), -//│ apply1 -> Def(4, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #90 -//│ ), -//│ apply0 -> Def(3, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #89 -//│ ), -//│ apply4 -> Def(7, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #93 -//│ ), -//│ apply3 -> Def(6, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #92 -//│ ), -//│ apply2 -> Def(5, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #91 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, foo, [a$0,b$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = Pair.x(a$0) in -- #32 -//│ let x$2 = Pair.y(a$0) in -- #31 -//│ let x$3 = Pair.x(b$0) in -- #30 -//│ let x$4 = Pair.y(b$0) in -- #29 -//│ let x$5 = +(x$1,x$2) in -- #28 -//│ let x$6 = +(x$5,x$3) in -- #27 -//│ let x$7 = +(x$6,x$4) in -- #26 -//│ x$7 -- #25 -//│ ) -//│ Def(1, bar, [c$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$8 = Pair(0,1) in -- #77 -//│ let* (x$9) = foo(x$8,c$0) in -- #76 -//│ let x$10 = Pair(2,3) in -- #75 -//│ let* (x$11) = foo(c$0,x$10) in -- #74 -//│ let x$12 = Pair(0,1) in -- #73 -//│ let x$13 = Pair(2,3) in -- #72 -//│ let* (x$14) = foo(x$12,x$13) in -- #71 -//│ x$14 -- #70 -//│ ) -//│ Def(2, baz, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$15 = Pair(4,5) in -- #88 -//│ let* (x$16) = bar(x$15) in -- #87 -//│ x$16 -- #86 -//│ ) -//│ }, -//│ let* (x$0) = baz() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #94 +//│ def apply1(x0$0) = +//│ 0 -- #90 +//│ def apply0() = +//│ 0 -- #89 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #93 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #92 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #91 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Pair(x,y) +//│ def foo(a$0,b$0) = +//│ let x$1 = Pair.x(a$0) in -- #32 +//│ let x$2 = Pair.y(a$0) in -- #31 +//│ let x$3 = Pair.x(b$0) in -- #30 +//│ let x$4 = Pair.y(b$0) in -- #29 +//│ let x$5 = +(x$1,x$2) in -- #28 +//│ let x$6 = +(x$5,x$3) in -- #27 +//│ let x$7 = +(x$6,x$4) in -- #26 +//│ x$7 -- #25 +//│ def bar(c$0) = +//│ let x$8 = Pair(0,1) in -- #77 +//│ let* (x$9) = foo(x$8,c$0) in -- #76 +//│ let x$10 = Pair(2,3) in -- #75 +//│ let* (x$11) = foo(c$0,x$10) in -- #74 +//│ let x$12 = Pair(0,1) in -- #73 +//│ let x$13 = Pair(2,3) in -- #72 +//│ let* (x$14) = foo(x$12,x$13) in -- #71 +//│ x$14 -- #70 +//│ def baz() = +//│ let x$15 = Pair(4,5) in -- #88 +//│ let* (x$16) = bar(x$15) in -- #87 +//│ x$16 -- #86 +//│ let* (x$0) = baz() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(8, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #94 -//│ ), -//│ apply1 -> Def(4, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #90 -//│ ), -//│ apply0 -> Def(3, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #89 -//│ ), -//│ apply4 -> Def(7, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #93 -//│ ), -//│ apply3 -> Def(6, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #92 -//│ ), -//│ apply2 -> Def(5, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #91 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, foo, [a$0,b$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = Pair.x(a$0) in -- #32 -//│ let x$2 = Pair.y(a$0) in -- #31 -//│ let x$3 = Pair.x(b$0) in -- #30 -//│ let x$4 = Pair.y(b$0) in -- #29 -//│ let x$5 = +(x$1,x$2) in -- #28 -//│ let x$6 = +(x$5,x$3) in -- #27 -//│ let x$7 = +(x$6,x$4) in -- #26 -//│ x$7 -- #25 -//│ ) -//│ Def(1, bar, [c$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$8 = Pair(0,1) in -- #77 -//│ let* (x$9) = foo(x$8,c$0) in -- #76 -//│ let x$10 = Pair(2,3) in -- #75 -//│ let* (x$11) = foo(c$0,x$10) in -- #74 -//│ let x$12 = Pair(0,1) in -- #73 -//│ let x$13 = Pair(2,3) in -- #72 -//│ let* (x$14) = foo(x$12,x$13) in -- #71 -//│ x$14 -- #70 -//│ ) -//│ Def(2, baz, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$15 = Pair(4,5) in -- #88 -//│ let* (x$16) = bar(x$15) in -- #87 -//│ x$16 -- #86 -//│ ) -//│ }, -//│ let* (x$0) = baz() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #94 +//│ def apply1(x0$0) = +//│ 0 -- #90 +//│ def apply0() = +//│ 0 -- #89 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #93 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #92 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #91 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Pair(x,y) +//│ def foo(a$0,b$0) = +//│ let x$1 = Pair.x(a$0) in -- #32 +//│ let x$2 = Pair.y(a$0) in -- #31 +//│ let x$3 = Pair.x(b$0) in -- #30 +//│ let x$4 = Pair.y(b$0) in -- #29 +//│ let x$5 = +(x$1,x$2) in -- #28 +//│ let x$6 = +(x$5,x$3) in -- #27 +//│ let x$7 = +(x$6,x$4) in -- #26 +//│ x$7 -- #25 +//│ def bar(c$0) = +//│ let x$8 = Pair(0,1) in -- #77 +//│ let* (x$9) = foo(x$8,c$0) in -- #76 +//│ let x$10 = Pair(2,3) in -- #75 +//│ let* (x$11) = foo(c$0,x$10) in -- #74 +//│ let x$12 = Pair(0,1) in -- #73 +//│ let x$13 = Pair(2,3) in -- #72 +//│ let* (x$14) = foo(x$12,x$13) in -- #71 +//│ x$14 -- #70 +//│ def baz() = +//│ let x$15 = Pair(4,5) in -- #88 +//│ let* (x$16) = bar(x$15) in -- #87 +//│ x$16 -- #86 +//│ let* (x$0) = baz() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 6 @@ -1946,154 +974,68 @@ foo() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #21 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #17 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #16 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #20 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #19 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #18 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = Pair(0,1) in -- #15 -//│ let x$2 = Pair.x(x$1) in -- #14 -//│ x$2 -- #13 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #21 +//│ def apply1(x0$0) = +//│ 0 -- #17 +//│ def apply0() = +//│ 0 -- #16 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #20 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #19 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #18 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Pair(x,y) +//│ def foo() = +//│ let x$1 = Pair(0,1) in -- #15 +//│ let x$2 = Pair.x(x$1) in -- #14 +//│ x$2 -- #13 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #21 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #17 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #16 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #20 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #19 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #18 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Pair, [x,y], parents: , methods: -//│ )}, { -//│ Def(0, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = Pair(0,1) in -- #15 -//│ let x$2 = Pair.x(x$1) in -- #14 -//│ x$2 -- #13 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #21 +//│ def apply1(x0$0) = +//│ 0 -- #17 +//│ def apply0() = +//│ 0 -- #16 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #20 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #19 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #18 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Pair(x,y) +//│ def foo() = +//│ let x$1 = Pair(0,1) in -- #15 +//│ let x$2 = Pair.x(x$1) in -- #14 +//│ x$2 -- #13 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 0 @@ -2115,214 +1057,96 @@ foo() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(9, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #35 -//│ ), -//│ apply1 -> Def(5, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #31 -//│ ), -//│ apply0 -> Def(4, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #30 -//│ ), -//│ apply4 -> Def(8, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #34 -//│ ), -//│ apply3 -> Def(7, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #33 -//│ ), -//│ apply2 -> Def(6, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #32 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, S, [s], parents: , methods: -//│ ), -//│ ClassInfo(10, O, [], parents: , methods: -//│ )}, { -//│ Def(0, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = O() in -- #12 -//│ let x$2 = S(x$1) in -- #11 -//│ let* (x$3) = bar(x$2) in -- #10 -//│ x$3 -- #9 -//│ ) -//│ Def(1, bar, [x$4], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$5) = baz(x$4) in -- #17 -//│ x$5 -- #16 -//│ ) -//│ Def(2, baz, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$6 of -- #29 -//│ S => -//│ let x$8 = S.s(x$6) in -- #26 -//│ jump j$0(x$8) -- #25 -//│ O => -//│ jump j$0(x$6) -- #28 -//│ ) -//│ Def(3, j$0, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #19 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #35 +//│ def apply1(x0$0) = +//│ 0 -- #31 +//│ def apply0() = +//│ 0 -- #30 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #34 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #33 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #32 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class S(s) +//│ class O() +//│ def foo() = +//│ let x$1 = O() in -- #12 +//│ let x$2 = S(x$1) in -- #11 +//│ let* (x$3) = bar(x$2) in -- #10 +//│ x$3 -- #9 +//│ def bar(x$4) = +//│ let* (x$5) = baz(x$4) in -- #17 +//│ x$5 -- #16 +//│ def baz(x$6) = +//│ case x$6 of -- #29 +//│ S => +//│ let x$8 = S.s(x$6) in -- #26 +//│ jump j$0(x$8) -- #25 +//│ O => +//│ jump j$0(x$6) -- #28 +//│ def j$0(x$7) = +//│ x$7 -- #19 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(9, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #35 -//│ ), -//│ apply1 -> Def(5, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #31 -//│ ), -//│ apply0 -> Def(4, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #30 -//│ ), -//│ apply4 -> Def(8, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #34 -//│ ), -//│ apply3 -> Def(7, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #33 -//│ ), -//│ apply2 -> Def(6, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #32 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, S, [s], parents: , methods: -//│ ), -//│ ClassInfo(10, O, [], parents: , methods: -//│ )}, { -//│ Def(0, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = O() in -- #12 -//│ let x$2 = S(x$1) in -- #11 -//│ let* (x$3) = bar(x$2) in -- #10 -//│ x$3 -- #9 -//│ ) -//│ Def(1, bar, [x$4], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$5) = baz(x$4) in -- #17 -//│ x$5 -- #16 -//│ ) -//│ Def(2, baz, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$6 of -- #29 -//│ S => -//│ let x$8 = S.s(x$6) in -- #26 -//│ jump j$0(x$8) -- #25 -//│ O => -//│ jump j$0(x$6) -- #28 -//│ ) -//│ Def(3, j$0, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #19 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #35 +//│ def apply1(x0$0) = +//│ 0 -- #31 +//│ def apply0() = +//│ 0 -- #30 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #34 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #33 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #32 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class S(s) +//│ class O() +//│ def foo() = +//│ let x$1 = O() in -- #12 +//│ let x$2 = S(x$1) in -- #11 +//│ let* (x$3) = bar(x$2) in -- #10 +//│ x$3 -- #9 +//│ def bar(x$4) = +//│ let* (x$5) = baz(x$4) in -- #17 +//│ x$5 -- #16 +//│ def baz(x$6) = +//│ case x$6 of -- #29 +//│ S => +//│ let x$8 = S.s(x$6) in -- #26 +//│ jump j$0(x$8) -- #25 +//│ O => +//│ jump j$0(x$6) -- #28 +//│ def j$0(x$7) = +//│ x$7 -- #19 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ O() diff --git a/compiler/shared/test/diff-ir/IRComplex.mls b/compiler/shared/test/diff-ir/IRComplex.mls index 30c34f74c..87598e8e0 100644 --- a/compiler/shared/test/diff-ir/IRComplex.mls +++ b/compiler/shared/test/diff-ir/IRComplex.mls @@ -23,250 +23,132 @@ bar() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(9, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #116 -//│ ), -//│ apply1 -> Def(5, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #112 -//│ ), -//│ apply0 -> Def(4, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #111 -//│ ), -//│ apply4 -> Def(8, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #115 -//│ ), -//│ apply3 -> Def(7, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #114 -//│ ), -//│ apply2 -> Def(6, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #113 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, A, [x,y,z], parents: , methods: -//│ ), -//│ ClassInfo(10, B, [m,n], parents: , methods: -//│ )}, { -//│ Def(0, complex_foo, [t$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case t$0 of -- #86 -//│ A => -//│ let x$10 = A.z(t$0) in -- #70 -//│ let x$11 = A.y(t$0) in -- #69 -//│ let x$12 = A.x(t$0) in -- #68 -//│ let x$13 = *(x$11,x$10) in -- #67 -//│ let x$14 = +(x$12,x$13) in -- #66 -//│ jump j$0(x$14) -- #65 -//│ B => -//│ let x$15 = B.n(t$0) in -- #85 -//│ let x$16 = B.m(t$0) in -- #84 -//│ let x$17 = -(x$16,x$15) in -- #83 -//│ jump j$0(x$17) -- #82 -//│ ) -//│ Def(1, j$1, [x$3,x$1], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$4 = +(x$1,x$3) in -- #16 -//│ x$4 -- #15 -//│ ) -//│ Def(2, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = B(1,2) in -- #47 -//│ case x$2 of -- #46 -//│ A => -//│ let x$5 = A.z(x$2) in -- #33 -//│ let x$6 = A.y(x$2) in -- #32 -//│ let x$7 = A.x(x$2) in -- #31 -//│ jump j$1(3,x$1) -- #30 -//│ B => -//│ let x$8 = B.n(x$2) in -- #45 -//│ let x$9 = B.m(x$2) in -- #44 -//│ jump j$1(4,x$1) -- #43 -//│ ) -//│ Def(3, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$18 = A(6,7,8) in -- #110 -//│ let* (x$19) = complex_foo(x$18) in -- #109 -//│ let x$20 = B(9,10) in -- #108 -//│ let* (x$21) = complex_foo(x$20) in -- #107 -//│ x$21 -- #106 -//│ ) -//│ }, -//│ let* (x$0) = bar() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #116 +//│ def apply1(x0$0) = +//│ 0 -- #112 +//│ def apply0() = +//│ 0 -- #111 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #115 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #114 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #113 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class A(x,y,z) +//│ class B(m,n) +//│ def complex_foo(t$0) = +//│ case t$0 of -- #86 +//│ A => +//│ let x$10 = A.z(t$0) in -- #70 +//│ let x$11 = A.y(t$0) in -- #69 +//│ let x$12 = A.x(t$0) in -- #68 +//│ let x$13 = *(x$11,x$10) in -- #67 +//│ let x$14 = +(x$12,x$13) in -- #66 +//│ jump j$0(x$14) -- #65 +//│ B => +//│ let x$15 = B.n(t$0) in -- #85 +//│ let x$16 = B.m(t$0) in -- #84 +//│ let x$17 = -(x$16,x$15) in -- #83 +//│ jump j$0(x$17) -- #82 +//│ def j$1(x$3,x$1) = +//│ let x$4 = +(x$1,x$3) in -- #16 +//│ x$4 -- #15 +//│ def j$0(x$1) = +//│ let x$2 = B(1,2) in -- #47 +//│ case x$2 of -- #46 +//│ A => +//│ let x$5 = A.z(x$2) in -- #33 +//│ let x$6 = A.y(x$2) in -- #32 +//│ let x$7 = A.x(x$2) in -- #31 +//│ jump j$1(3,x$1) -- #30 +//│ B => +//│ let x$8 = B.n(x$2) in -- #45 +//│ let x$9 = B.m(x$2) in -- #44 +//│ jump j$1(4,x$1) -- #43 +//│ def bar() = +//│ let x$18 = A(6,7,8) in -- #110 +//│ let* (x$19) = complex_foo(x$18) in -- #109 +//│ let x$20 = B(9,10) in -- #108 +//│ let* (x$21) = complex_foo(x$20) in -- #107 +//│ x$21 -- #106 +//│ let* (x$0) = bar() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(9, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #116 -//│ ), -//│ apply1 -> Def(5, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #112 -//│ ), -//│ apply0 -> Def(4, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #111 -//│ ), -//│ apply4 -> Def(8, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #115 -//│ ), -//│ apply3 -> Def(7, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #114 -//│ ), -//│ apply2 -> Def(6, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #113 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, A, [x,y,z], parents: , methods: -//│ ), -//│ ClassInfo(10, B, [m,n], parents: , methods: -//│ )}, { -//│ Def(0, complex_foo, [t$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case t$0 of -- #86 -//│ A => -//│ let x$10 = A.z(t$0) in -- #70 -//│ let x$11 = A.y(t$0) in -- #69 -//│ let x$12 = A.x(t$0) in -- #68 -//│ let x$13 = *(x$11,x$10) in -- #67 -//│ let x$14 = +(x$12,x$13) in -- #66 -//│ jump j$0(x$14) -- #65 -//│ B => -//│ let x$15 = B.n(t$0) in -- #85 -//│ let x$16 = B.m(t$0) in -- #84 -//│ let x$17 = -(x$16,x$15) in -- #83 -//│ jump j$0(x$17) -- #82 -//│ ) -//│ Def(1, j$1, [x$3,x$1], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$4 = +(x$1,x$3) in -- #16 -//│ x$4 -- #15 -//│ ) -//│ Def(2, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = B(1,2) in -- #47 -//│ case x$2 of -- #46 -//│ A => -//│ let x$5 = A.z(x$2) in -- #33 -//│ let x$6 = A.y(x$2) in -- #32 -//│ let x$7 = A.x(x$2) in -- #31 -//│ jump j$1(3,x$1) -- #30 -//│ B => -//│ let x$8 = B.n(x$2) in -- #45 -//│ let x$9 = B.m(x$2) in -- #44 -//│ jump j$1(4,x$1) -- #43 -//│ ) -//│ Def(3, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$18 = A(6,7,8) in -- #110 -//│ let* (x$19) = complex_foo(x$18) in -- #109 -//│ let x$20 = B(9,10) in -- #108 -//│ let* (x$21) = complex_foo(x$20) in -- #107 -//│ x$21 -- #106 -//│ ) -//│ }, -//│ let* (x$0) = bar() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #116 +//│ def apply1(x0$0) = +//│ 0 -- #112 +//│ def apply0() = +//│ 0 -- #111 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #115 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #114 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #113 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class A(x,y,z) +//│ class B(m,n) +//│ def complex_foo(t$0) = +//│ case t$0 of -- #86 +//│ A => +//│ let x$10 = A.z(t$0) in -- #70 +//│ let x$11 = A.y(t$0) in -- #69 +//│ let x$12 = A.x(t$0) in -- #68 +//│ let x$13 = *(x$11,x$10) in -- #67 +//│ let x$14 = +(x$12,x$13) in -- #66 +//│ jump j$0(x$14) -- #65 +//│ B => +//│ let x$15 = B.n(t$0) in -- #85 +//│ let x$16 = B.m(t$0) in -- #84 +//│ let x$17 = -(x$16,x$15) in -- #83 +//│ jump j$0(x$17) -- #82 +//│ def j$1(x$3,x$1) = +//│ let x$4 = +(x$1,x$3) in -- #16 +//│ x$4 -- #15 +//│ def j$0(x$1) = +//│ let x$2 = B(1,2) in -- #47 +//│ case x$2 of -- #46 +//│ A => +//│ let x$5 = A.z(x$2) in -- #33 +//│ let x$6 = A.y(x$2) in -- #32 +//│ let x$7 = A.x(x$2) in -- #31 +//│ jump j$1(3,x$1) -- #30 +//│ B => +//│ let x$8 = B.n(x$2) in -- #45 +//│ let x$9 = B.m(x$2) in -- #44 +//│ jump j$1(4,x$1) -- #43 +//│ def bar() = +//│ let x$18 = A(6,7,8) in -- #110 +//│ let* (x$19) = complex_foo(x$18) in -- #109 +//│ let x$20 = B(9,10) in -- #108 +//│ let* (x$21) = complex_foo(x$20) in -- #107 +//│ x$21 -- #106 +//│ let* (x$0) = bar() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 3 @@ -309,368 +191,218 @@ bar() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(12, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #210 -//│ ), -//│ apply1 -> Def(8, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #206 -//│ ), -//│ apply0 -> Def(7, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #205 -//│ ), -//│ apply4 -> Def(11, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #209 -//│ ), -//│ apply3 -> Def(10, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #208 -//│ ), -//│ apply2 -> Def(9, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #207 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, A, [w,x], parents: , methods: -//│ ), -//│ ClassInfo(10, B, [y], parents: , methods: -//│ ), -//│ ClassInfo(11, C, [z], parents: , methods: -//│ )}, { -//│ Def(0, complex_foo, [t$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = +(1,2) in -- #183 -//│ let x$2 = *(1,2) in -- #182 -//│ case t$0 of -- #181 -//│ A => -//│ let x$28 = A.x(t$0) in -- #155 -//│ let x$29 = A.w(t$0) in -- #154 -//│ jump j$0(x$28,x$1,x$2) -- #153 -//│ B => -//│ let x$30 = B.y(t$0) in -- #169 -//│ let x$31 = +(x$30,x$2) in -- #168 -//│ let x$32 = B(x$31) in -- #167 -//│ jump j$0(x$32,x$1,x$2) -- #166 -//│ C => -//│ let x$33 = C.z(t$0) in -- #180 -//│ let x$34 = C(0) in -- #179 -//│ jump j$0(x$34,x$1,x$2) -- #178 -//│ ) -//│ Def(1, j$2, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #24 -//│ ) -//│ Def(2, j$3, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$2(x$12) -- #50 -//│ ) -//│ Def(3, j$1, [x$6,x$4,x$5], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$4 of -- #79 -//│ A => -//│ let x$8 = A.x(x$4) in -- #36 -//│ let x$9 = A.w(x$4) in -- #35 -//│ jump j$2(x$9) -- #34 -//│ B => -//│ let x$10 = B.y(x$4) in -- #43 -//│ jump j$2(4) -- #42 -//│ C => -//│ let x$11 = C.z(x$4) in -- #78 -//│ case x$5 of -- #77 +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #210 +//│ def apply1(x0$0) = +//│ 0 -- #206 +//│ def apply0() = +//│ 0 -- #205 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #209 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #208 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #207 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class A(w,x) +//│ class B(y) +//│ class C(z) +//│ def complex_foo(t$0) = +//│ let x$1 = +(1,2) in -- #183 +//│ let x$2 = *(1,2) in -- #182 +//│ case t$0 of -- #181 +//│ A => +//│ let x$28 = A.x(t$0) in -- #155 +//│ let x$29 = A.w(t$0) in -- #154 +//│ jump j$0(x$28,x$1,x$2) -- #153 +//│ B => +//│ let x$30 = B.y(t$0) in -- #169 +//│ let x$31 = +(x$30,x$2) in -- #168 +//│ let x$32 = B(x$31) in -- #167 +//│ jump j$0(x$32,x$1,x$2) -- #166 +//│ C => +//│ let x$33 = C.z(t$0) in -- #180 +//│ let x$34 = C(0) in -- #179 +//│ jump j$0(x$34,x$1,x$2) -- #178 +//│ def j$2(x$7) = +//│ x$7 -- #24 +//│ def j$3(x$12) = +//│ jump j$2(x$12) -- #50 +//│ def j$1(x$6,x$4,x$5) = +//│ case x$4 of -- #79 //│ A => -//│ let x$13 = A.x(x$5) in -- #62 -//│ let x$14 = A.w(x$5) in -- #61 -//│ jump j$3(x$14) -- #60 +//│ let x$8 = A.x(x$4) in -- #36 +//│ let x$9 = A.w(x$4) in -- #35 +//│ jump j$2(x$9) -- #34 //│ B => -//│ let x$15 = B.y(x$5) in -- #69 -//│ jump j$3(7) -- #68 +//│ let x$10 = B.y(x$4) in -- #43 +//│ jump j$2(4) -- #42 //│ C => -//│ let x$16 = C.z(x$5) in -- #76 -//│ jump j$3(8) -- #75 -//│ ) -//│ Def(4, j$4, [x$21,x$4,x$5], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$1(x$21,x$4,x$5) -- #95 -//│ ) -//│ Def(5, j$0, [x$3,x$1,x$2], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$4 = A(5,x$3) in -- #143 -//│ let x$5 = B(6) in -- #142 -//│ case x$3 of -- #141 -//│ A => -//│ let x$17 = A.x(x$3) in -- #126 -//│ let x$18 = A.w(x$3) in -- #125 -//│ let x$19 = +(x$18,x$1) in -- #124 -//│ let x$20 = +(x$19,x$2) in -- #123 -//│ case x$17 of -- #122 +//│ let x$11 = C.z(x$4) in -- #78 +//│ case x$5 of -- #77 +//│ A => +//│ let x$13 = A.x(x$5) in -- #62 +//│ let x$14 = A.w(x$5) in -- #61 +//│ jump j$3(x$14) -- #60 +//│ B => +//│ let x$15 = B.y(x$5) in -- #69 +//│ jump j$3(7) -- #68 +//│ C => +//│ let x$16 = C.z(x$5) in -- #76 +//│ jump j$3(8) -- #75 +//│ def j$4(x$21,x$4,x$5) = +//│ jump j$1(x$21,x$4,x$5) -- #95 +//│ def j$0(x$3,x$1,x$2) = +//│ let x$4 = A(5,x$3) in -- #143 +//│ let x$5 = B(6) in -- #142 +//│ case x$3 of -- #141 //│ A => -//│ let x$22 = A.x(x$17) in -- #107 -//│ let x$23 = A.w(x$17) in -- #106 -//│ jump j$4(x$23,x$4,x$5) -- #105 +//│ let x$17 = A.x(x$3) in -- #126 +//│ let x$18 = A.w(x$3) in -- #125 +//│ let x$19 = +(x$18,x$1) in -- #124 +//│ let x$20 = +(x$19,x$2) in -- #123 +//│ case x$17 of -- #122 +//│ A => +//│ let x$22 = A.x(x$17) in -- #107 +//│ let x$23 = A.w(x$17) in -- #106 +//│ jump j$4(x$23,x$4,x$5) -- #105 +//│ B => +//│ let x$24 = B.y(x$17) in -- #114 +//│ jump j$4(x$20,x$4,x$5) -- #113 +//│ C => +//│ let x$25 = C.z(x$17) in -- #121 +//│ jump j$4(0,x$4,x$5) -- #120 //│ B => -//│ let x$24 = B.y(x$17) in -- #114 -//│ jump j$4(x$20,x$4,x$5) -- #113 +//│ let x$26 = B.y(x$3) in -- #133 +//│ jump j$1(2,x$4,x$5) -- #132 //│ C => -//│ let x$25 = C.z(x$17) in -- #121 -//│ jump j$4(0,x$4,x$5) -- #120 -//│ B => -//│ let x$26 = B.y(x$3) in -- #133 -//│ jump j$1(2,x$4,x$5) -- #132 -//│ C => -//│ let x$27 = C.z(x$3) in -- #140 -//│ jump j$1(3,x$4,x$5) -- #139 -//│ ) -//│ Def(6, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$35 = B(10) in -- #204 -//│ let x$36 = A(9,x$35) in -- #203 -//│ let x$37 = A(10,x$36) in -- #202 -//│ let* (x$38) = complex_foo(x$37) in -- #201 -//│ x$38 -- #200 -//│ ) -//│ }, -//│ let* (x$0) = bar() in -- #2 -//│ x$0 -- #1) +//│ let x$27 = C.z(x$3) in -- #140 +//│ jump j$1(3,x$4,x$5) -- #139 +//│ def bar() = +//│ let x$35 = B(10) in -- #204 +//│ let x$36 = A(9,x$35) in -- #203 +//│ let x$37 = A(10,x$36) in -- #202 +//│ let* (x$38) = complex_foo(x$37) in -- #201 +//│ x$38 -- #200 +//│ let* (x$0) = bar() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(12, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #210 -//│ ), -//│ apply1 -> Def(8, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #206 -//│ ), -//│ apply0 -> Def(7, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #205 -//│ ), -//│ apply4 -> Def(11, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #209 -//│ ), -//│ apply3 -> Def(10, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #208 -//│ ), -//│ apply2 -> Def(9, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #207 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, A, [w,x], parents: , methods: -//│ ), -//│ ClassInfo(10, B, [y], parents: , methods: -//│ ), -//│ ClassInfo(11, C, [z], parents: , methods: -//│ )}, { -//│ Def(0, complex_foo, [t$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = +(1,2) in -- #183 -//│ let x$2 = *(1,2) in -- #182 -//│ case t$0 of -- #181 -//│ A => -//│ let x$28 = A.x(t$0) in -- #155 -//│ let x$29 = A.w(t$0) in -- #154 -//│ jump j$0(x$28,x$1,x$2) -- #153 -//│ B => -//│ let x$30 = B.y(t$0) in -- #169 -//│ let x$31 = +(x$30,x$2) in -- #168 -//│ let x$32 = B(x$31) in -- #167 -//│ jump j$0(x$32,x$1,x$2) -- #166 -//│ C => -//│ let x$33 = C.z(t$0) in -- #180 -//│ let x$34 = C(0) in -- #179 -//│ jump j$0(x$34,x$1,x$2) -- #178 -//│ ) -//│ Def(1, j$2, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #24 -//│ ) -//│ Def(2, j$3, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$2(x$12) -- #50 -//│ ) -//│ Def(3, j$1, [x$6,x$4,x$5], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$4 of -- #79 -//│ A => -//│ let x$8 = A.x(x$4) in -- #36 -//│ let x$9 = A.w(x$4) in -- #35 -//│ jump j$2(x$9) -- #34 -//│ B => -//│ let x$10 = B.y(x$4) in -- #43 -//│ jump j$2(4) -- #42 -//│ C => -//│ let x$11 = C.z(x$4) in -- #78 -//│ case x$5 of -- #77 +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #210 +//│ def apply1(x0$0) = +//│ 0 -- #206 +//│ def apply0() = +//│ 0 -- #205 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #209 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #208 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #207 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class A(w,x) +//│ class B(y) +//│ class C(z) +//│ def complex_foo(t$0) = +//│ let x$1 = +(1,2) in -- #183 +//│ let x$2 = *(1,2) in -- #182 +//│ case t$0 of -- #181 //│ A => -//│ let x$13 = A.x(x$5) in -- #62 -//│ let x$14 = A.w(x$5) in -- #61 -//│ jump j$3(x$14) -- #60 +//│ let x$28 = A.x(t$0) in -- #155 +//│ let x$29 = A.w(t$0) in -- #154 +//│ jump j$0(x$28,x$1,x$2) -- #153 //│ B => -//│ let x$15 = B.y(x$5) in -- #69 -//│ jump j$3(7) -- #68 +//│ let x$30 = B.y(t$0) in -- #169 +//│ let x$31 = +(x$30,x$2) in -- #168 +//│ let x$32 = B(x$31) in -- #167 +//│ jump j$0(x$32,x$1,x$2) -- #166 //│ C => -//│ let x$16 = C.z(x$5) in -- #76 -//│ jump j$3(8) -- #75 -//│ ) -//│ Def(4, j$4, [x$21,x$4,x$5], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$1(x$21,x$4,x$5) -- #95 -//│ ) -//│ Def(5, j$0, [x$3,x$1,x$2], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$4 = A(5,x$3) in -- #143 -//│ let x$5 = B(6) in -- #142 -//│ case x$3 of -- #141 -//│ A => -//│ let x$17 = A.x(x$3) in -- #126 -//│ let x$18 = A.w(x$3) in -- #125 -//│ let x$19 = +(x$18,x$1) in -- #124 -//│ let x$20 = +(x$19,x$2) in -- #123 -//│ case x$17 of -- #122 +//│ let x$33 = C.z(t$0) in -- #180 +//│ let x$34 = C(0) in -- #179 +//│ jump j$0(x$34,x$1,x$2) -- #178 +//│ def j$2(x$7) = +//│ x$7 -- #24 +//│ def j$3(x$12) = +//│ jump j$2(x$12) -- #50 +//│ def j$1(x$6,x$4,x$5) = +//│ case x$4 of -- #79 //│ A => -//│ let x$22 = A.x(x$17) in -- #107 -//│ let x$23 = A.w(x$17) in -- #106 -//│ jump j$4(x$23,x$4,x$5) -- #105 +//│ let x$8 = A.x(x$4) in -- #36 +//│ let x$9 = A.w(x$4) in -- #35 +//│ jump j$2(x$9) -- #34 //│ B => -//│ let x$24 = B.y(x$17) in -- #114 -//│ jump j$4(x$20,x$4,x$5) -- #113 +//│ let x$10 = B.y(x$4) in -- #43 +//│ jump j$2(4) -- #42 //│ C => -//│ let x$25 = C.z(x$17) in -- #121 -//│ jump j$4(0,x$4,x$5) -- #120 -//│ B => -//│ let x$26 = B.y(x$3) in -- #133 -//│ jump j$1(2,x$4,x$5) -- #132 -//│ C => -//│ let x$27 = C.z(x$3) in -- #140 -//│ jump j$1(3,x$4,x$5) -- #139 -//│ ) -//│ Def(6, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$35 = B(10) in -- #204 -//│ let x$36 = A(9,x$35) in -- #203 -//│ let x$37 = A(10,x$36) in -- #202 -//│ let* (x$38) = complex_foo(x$37) in -- #201 -//│ x$38 -- #200 -//│ ) -//│ }, -//│ let* (x$0) = bar() in -- #2 -//│ x$0 -- #1) +//│ let x$11 = C.z(x$4) in -- #78 +//│ case x$5 of -- #77 +//│ A => +//│ let x$13 = A.x(x$5) in -- #62 +//│ let x$14 = A.w(x$5) in -- #61 +//│ jump j$3(x$14) -- #60 +//│ B => +//│ let x$15 = B.y(x$5) in -- #69 +//│ jump j$3(7) -- #68 +//│ C => +//│ let x$16 = C.z(x$5) in -- #76 +//│ jump j$3(8) -- #75 +//│ def j$4(x$21,x$4,x$5) = +//│ jump j$1(x$21,x$4,x$5) -- #95 +//│ def j$0(x$3,x$1,x$2) = +//│ let x$4 = A(5,x$3) in -- #143 +//│ let x$5 = B(6) in -- #142 +//│ case x$3 of -- #141 +//│ A => +//│ let x$17 = A.x(x$3) in -- #126 +//│ let x$18 = A.w(x$3) in -- #125 +//│ let x$19 = +(x$18,x$1) in -- #124 +//│ let x$20 = +(x$19,x$2) in -- #123 +//│ case x$17 of -- #122 +//│ A => +//│ let x$22 = A.x(x$17) in -- #107 +//│ let x$23 = A.w(x$17) in -- #106 +//│ jump j$4(x$23,x$4,x$5) -- #105 +//│ B => +//│ let x$24 = B.y(x$17) in -- #114 +//│ jump j$4(x$20,x$4,x$5) -- #113 +//│ C => +//│ let x$25 = C.z(x$17) in -- #121 +//│ jump j$4(0,x$4,x$5) -- #120 +//│ B => +//│ let x$26 = B.y(x$3) in -- #133 +//│ jump j$1(2,x$4,x$5) -- #132 +//│ C => +//│ let x$27 = C.z(x$3) in -- #140 +//│ jump j$1(3,x$4,x$5) -- #139 +//│ def bar() = +//│ let x$35 = B(10) in -- #204 +//│ let x$36 = A(9,x$35) in -- #203 +//│ let x$37 = A(10,x$36) in -- #202 +//│ let* (x$38) = complex_foo(x$37) in -- #201 +//│ x$38 -- #200 +//│ let* (x$0) = bar() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 5 @@ -713,372 +445,222 @@ bar() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(12, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #220 -//│ ), -//│ apply1 -> Def(8, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #216 -//│ ), -//│ apply0 -> Def(7, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #215 -//│ ), -//│ apply4 -> Def(11, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #219 -//│ ), -//│ apply3 -> Def(10, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #218 -//│ ), -//│ apply2 -> Def(9, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #217 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, A, [w,x], parents: , methods: -//│ ), -//│ ClassInfo(10, B, [y], parents: , methods: -//│ ), -//│ ClassInfo(11, C, [z], parents: , methods: -//│ )}, { -//│ Def(0, complex_foo, [t$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = +(1,2) in -- #193 -//│ let x$2 = *(1,2) in -- #192 -//│ case t$0 of -- #191 -//│ A => -//│ let x$28 = A.x(t$0) in -- #165 -//│ let x$29 = A.w(t$0) in -- #164 -//│ let x$30 = C(0) in -- #163 -//│ let x$31 = A(x$29,x$30) in -- #162 -//│ jump j$0(x$31,x$1,x$2) -- #161 -//│ B => -//│ let x$32 = B.y(t$0) in -- #179 -//│ let x$33 = +(x$32,x$2) in -- #178 -//│ let x$34 = B(x$33) in -- #177 -//│ jump j$0(x$34,x$1,x$2) -- #176 -//│ C => -//│ let x$35 = C.z(t$0) in -- #190 -//│ let x$36 = C(0) in -- #189 -//│ jump j$0(x$36,x$1,x$2) -- #188 -//│ ) -//│ Def(1, j$2, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #24 -//│ ) -//│ Def(2, j$3, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$2(x$12) -- #50 -//│ ) -//│ Def(3, j$1, [x$6,x$4,x$5], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$4 of -- #79 -//│ A => -//│ let x$8 = A.x(x$4) in -- #36 -//│ let x$9 = A.w(x$4) in -- #35 -//│ jump j$2(x$9) -- #34 -//│ B => -//│ let x$10 = B.y(x$4) in -- #43 -//│ jump j$2(4) -- #42 -//│ C => -//│ let x$11 = C.z(x$4) in -- #78 -//│ case x$5 of -- #77 +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #220 +//│ def apply1(x0$0) = +//│ 0 -- #216 +//│ def apply0() = +//│ 0 -- #215 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #219 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #218 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #217 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class A(w,x) +//│ class B(y) +//│ class C(z) +//│ def complex_foo(t$0) = +//│ let x$1 = +(1,2) in -- #193 +//│ let x$2 = *(1,2) in -- #192 +//│ case t$0 of -- #191 +//│ A => +//│ let x$28 = A.x(t$0) in -- #165 +//│ let x$29 = A.w(t$0) in -- #164 +//│ let x$30 = C(0) in -- #163 +//│ let x$31 = A(x$29,x$30) in -- #162 +//│ jump j$0(x$31,x$1,x$2) -- #161 +//│ B => +//│ let x$32 = B.y(t$0) in -- #179 +//│ let x$33 = +(x$32,x$2) in -- #178 +//│ let x$34 = B(x$33) in -- #177 +//│ jump j$0(x$34,x$1,x$2) -- #176 +//│ C => +//│ let x$35 = C.z(t$0) in -- #190 +//│ let x$36 = C(0) in -- #189 +//│ jump j$0(x$36,x$1,x$2) -- #188 +//│ def j$2(x$7) = +//│ x$7 -- #24 +//│ def j$3(x$12) = +//│ jump j$2(x$12) -- #50 +//│ def j$1(x$6,x$4,x$5) = +//│ case x$4 of -- #79 //│ A => -//│ let x$13 = A.x(x$5) in -- #62 -//│ let x$14 = A.w(x$5) in -- #61 -//│ jump j$3(x$14) -- #60 +//│ let x$8 = A.x(x$4) in -- #36 +//│ let x$9 = A.w(x$4) in -- #35 +//│ jump j$2(x$9) -- #34 //│ B => -//│ let x$15 = B.y(x$5) in -- #69 -//│ jump j$3(7) -- #68 +//│ let x$10 = B.y(x$4) in -- #43 +//│ jump j$2(4) -- #42 //│ C => -//│ let x$16 = C.z(x$5) in -- #76 -//│ jump j$3(8) -- #75 -//│ ) -//│ Def(4, j$4, [x$21,x$4,x$5], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$1(x$21,x$4,x$5) -- #95 -//│ ) -//│ Def(5, j$0, [x$3,x$1,x$2], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$4 = A(5,x$3) in -- #143 -//│ let x$5 = B(6) in -- #142 -//│ case x$3 of -- #141 -//│ A => -//│ let x$17 = A.x(x$3) in -- #126 -//│ let x$18 = A.w(x$3) in -- #125 -//│ let x$19 = +(x$18,x$1) in -- #124 -//│ let x$20 = +(x$19,x$2) in -- #123 -//│ case x$17 of -- #122 +//│ let x$11 = C.z(x$4) in -- #78 +//│ case x$5 of -- #77 +//│ A => +//│ let x$13 = A.x(x$5) in -- #62 +//│ let x$14 = A.w(x$5) in -- #61 +//│ jump j$3(x$14) -- #60 +//│ B => +//│ let x$15 = B.y(x$5) in -- #69 +//│ jump j$3(7) -- #68 +//│ C => +//│ let x$16 = C.z(x$5) in -- #76 +//│ jump j$3(8) -- #75 +//│ def j$4(x$21,x$4,x$5) = +//│ jump j$1(x$21,x$4,x$5) -- #95 +//│ def j$0(x$3,x$1,x$2) = +//│ let x$4 = A(5,x$3) in -- #143 +//│ let x$5 = B(6) in -- #142 +//│ case x$3 of -- #141 //│ A => -//│ let x$22 = A.x(x$17) in -- #107 -//│ let x$23 = A.w(x$17) in -- #106 -//│ jump j$4(x$23,x$4,x$5) -- #105 +//│ let x$17 = A.x(x$3) in -- #126 +//│ let x$18 = A.w(x$3) in -- #125 +//│ let x$19 = +(x$18,x$1) in -- #124 +//│ let x$20 = +(x$19,x$2) in -- #123 +//│ case x$17 of -- #122 +//│ A => +//│ let x$22 = A.x(x$17) in -- #107 +//│ let x$23 = A.w(x$17) in -- #106 +//│ jump j$4(x$23,x$4,x$5) -- #105 +//│ B => +//│ let x$24 = B.y(x$17) in -- #114 +//│ jump j$4(x$20,x$4,x$5) -- #113 +//│ C => +//│ let x$25 = C.z(x$17) in -- #121 +//│ jump j$4(0,x$4,x$5) -- #120 //│ B => -//│ let x$24 = B.y(x$17) in -- #114 -//│ jump j$4(x$20,x$4,x$5) -- #113 +//│ let x$26 = B.y(x$3) in -- #133 +//│ jump j$1(2,x$4,x$5) -- #132 //│ C => -//│ let x$25 = C.z(x$17) in -- #121 -//│ jump j$4(0,x$4,x$5) -- #120 -//│ B => -//│ let x$26 = B.y(x$3) in -- #133 -//│ jump j$1(2,x$4,x$5) -- #132 -//│ C => -//│ let x$27 = C.z(x$3) in -- #140 -//│ jump j$1(3,x$4,x$5) -- #139 -//│ ) -//│ Def(6, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$37 = B(10) in -- #214 -//│ let x$38 = A(9,x$37) in -- #213 -//│ let x$39 = A(10,x$38) in -- #212 -//│ let* (x$40) = complex_foo(x$39) in -- #211 -//│ x$40 -- #210 -//│ ) -//│ }, -//│ let* (x$0) = bar() in -- #2 -//│ x$0 -- #1) +//│ let x$27 = C.z(x$3) in -- #140 +//│ jump j$1(3,x$4,x$5) -- #139 +//│ def bar() = +//│ let x$37 = B(10) in -- #214 +//│ let x$38 = A(9,x$37) in -- #213 +//│ let x$39 = A(10,x$38) in -- #212 +//│ let* (x$40) = complex_foo(x$39) in -- #211 +//│ x$40 -- #210 +//│ let* (x$0) = bar() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(12, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #220 -//│ ), -//│ apply1 -> Def(8, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #216 -//│ ), -//│ apply0 -> Def(7, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #215 -//│ ), -//│ apply4 -> Def(11, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #219 -//│ ), -//│ apply3 -> Def(10, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #218 -//│ ), -//│ apply2 -> Def(9, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #217 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, A, [w,x], parents: , methods: -//│ ), -//│ ClassInfo(10, B, [y], parents: , methods: -//│ ), -//│ ClassInfo(11, C, [z], parents: , methods: -//│ )}, { -//│ Def(0, complex_foo, [t$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = +(1,2) in -- #193 -//│ let x$2 = *(1,2) in -- #192 -//│ case t$0 of -- #191 -//│ A => -//│ let x$28 = A.x(t$0) in -- #165 -//│ let x$29 = A.w(t$0) in -- #164 -//│ let x$30 = C(0) in -- #163 -//│ let x$31 = A(x$29,x$30) in -- #162 -//│ jump j$0(x$31,x$1,x$2) -- #161 -//│ B => -//│ let x$32 = B.y(t$0) in -- #179 -//│ let x$33 = +(x$32,x$2) in -- #178 -//│ let x$34 = B(x$33) in -- #177 -//│ jump j$0(x$34,x$1,x$2) -- #176 -//│ C => -//│ let x$35 = C.z(t$0) in -- #190 -//│ let x$36 = C(0) in -- #189 -//│ jump j$0(x$36,x$1,x$2) -- #188 -//│ ) -//│ Def(1, j$2, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #24 -//│ ) -//│ Def(2, j$3, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$2(x$12) -- #50 -//│ ) -//│ Def(3, j$1, [x$6,x$4,x$5], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$4 of -- #79 -//│ A => -//│ let x$8 = A.x(x$4) in -- #36 -//│ let x$9 = A.w(x$4) in -- #35 -//│ jump j$2(x$9) -- #34 -//│ B => -//│ let x$10 = B.y(x$4) in -- #43 -//│ jump j$2(4) -- #42 -//│ C => -//│ let x$11 = C.z(x$4) in -- #78 -//│ case x$5 of -- #77 +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #220 +//│ def apply1(x0$0) = +//│ 0 -- #216 +//│ def apply0() = +//│ 0 -- #215 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #219 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #218 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #217 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class A(w,x) +//│ class B(y) +//│ class C(z) +//│ def complex_foo(t$0) = +//│ let x$1 = +(1,2) in -- #193 +//│ let x$2 = *(1,2) in -- #192 +//│ case t$0 of -- #191 +//│ A => +//│ let x$28 = A.x(t$0) in -- #165 +//│ let x$29 = A.w(t$0) in -- #164 +//│ let x$30 = C(0) in -- #163 +//│ let x$31 = A(x$29,x$30) in -- #162 +//│ jump j$0(x$31,x$1,x$2) -- #161 +//│ B => +//│ let x$32 = B.y(t$0) in -- #179 +//│ let x$33 = +(x$32,x$2) in -- #178 +//│ let x$34 = B(x$33) in -- #177 +//│ jump j$0(x$34,x$1,x$2) -- #176 +//│ C => +//│ let x$35 = C.z(t$0) in -- #190 +//│ let x$36 = C(0) in -- #189 +//│ jump j$0(x$36,x$1,x$2) -- #188 +//│ def j$2(x$7) = +//│ x$7 -- #24 +//│ def j$3(x$12) = +//│ jump j$2(x$12) -- #50 +//│ def j$1(x$6,x$4,x$5) = +//│ case x$4 of -- #79 //│ A => -//│ let x$13 = A.x(x$5) in -- #62 -//│ let x$14 = A.w(x$5) in -- #61 -//│ jump j$3(x$14) -- #60 +//│ let x$8 = A.x(x$4) in -- #36 +//│ let x$9 = A.w(x$4) in -- #35 +//│ jump j$2(x$9) -- #34 //│ B => -//│ let x$15 = B.y(x$5) in -- #69 -//│ jump j$3(7) -- #68 +//│ let x$10 = B.y(x$4) in -- #43 +//│ jump j$2(4) -- #42 //│ C => -//│ let x$16 = C.z(x$5) in -- #76 -//│ jump j$3(8) -- #75 -//│ ) -//│ Def(4, j$4, [x$21,x$4,x$5], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$1(x$21,x$4,x$5) -- #95 -//│ ) -//│ Def(5, j$0, [x$3,x$1,x$2], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$4 = A(5,x$3) in -- #143 -//│ let x$5 = B(6) in -- #142 -//│ case x$3 of -- #141 -//│ A => -//│ let x$17 = A.x(x$3) in -- #126 -//│ let x$18 = A.w(x$3) in -- #125 -//│ let x$19 = +(x$18,x$1) in -- #124 -//│ let x$20 = +(x$19,x$2) in -- #123 -//│ case x$17 of -- #122 +//│ let x$11 = C.z(x$4) in -- #78 +//│ case x$5 of -- #77 +//│ A => +//│ let x$13 = A.x(x$5) in -- #62 +//│ let x$14 = A.w(x$5) in -- #61 +//│ jump j$3(x$14) -- #60 +//│ B => +//│ let x$15 = B.y(x$5) in -- #69 +//│ jump j$3(7) -- #68 +//│ C => +//│ let x$16 = C.z(x$5) in -- #76 +//│ jump j$3(8) -- #75 +//│ def j$4(x$21,x$4,x$5) = +//│ jump j$1(x$21,x$4,x$5) -- #95 +//│ def j$0(x$3,x$1,x$2) = +//│ let x$4 = A(5,x$3) in -- #143 +//│ let x$5 = B(6) in -- #142 +//│ case x$3 of -- #141 //│ A => -//│ let x$22 = A.x(x$17) in -- #107 -//│ let x$23 = A.w(x$17) in -- #106 -//│ jump j$4(x$23,x$4,x$5) -- #105 +//│ let x$17 = A.x(x$3) in -- #126 +//│ let x$18 = A.w(x$3) in -- #125 +//│ let x$19 = +(x$18,x$1) in -- #124 +//│ let x$20 = +(x$19,x$2) in -- #123 +//│ case x$17 of -- #122 +//│ A => +//│ let x$22 = A.x(x$17) in -- #107 +//│ let x$23 = A.w(x$17) in -- #106 +//│ jump j$4(x$23,x$4,x$5) -- #105 +//│ B => +//│ let x$24 = B.y(x$17) in -- #114 +//│ jump j$4(x$20,x$4,x$5) -- #113 +//│ C => +//│ let x$25 = C.z(x$17) in -- #121 +//│ jump j$4(0,x$4,x$5) -- #120 //│ B => -//│ let x$24 = B.y(x$17) in -- #114 -//│ jump j$4(x$20,x$4,x$5) -- #113 +//│ let x$26 = B.y(x$3) in -- #133 +//│ jump j$1(2,x$4,x$5) -- #132 //│ C => -//│ let x$25 = C.z(x$17) in -- #121 -//│ jump j$4(0,x$4,x$5) -- #120 -//│ B => -//│ let x$26 = B.y(x$3) in -- #133 -//│ jump j$1(2,x$4,x$5) -- #132 -//│ C => -//│ let x$27 = C.z(x$3) in -- #140 -//│ jump j$1(3,x$4,x$5) -- #139 -//│ ) -//│ Def(6, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$37 = B(10) in -- #214 -//│ let x$38 = A(9,x$37) in -- #213 -//│ let x$39 = A(10,x$38) in -- #212 -//│ let* (x$40) = complex_foo(x$39) in -- #211 -//│ x$40 -- #210 -//│ ) -//│ }, -//│ let* (x$0) = bar() in -- #2 -//│ x$0 -- #1) +//│ let x$27 = C.z(x$3) in -- #140 +//│ jump j$1(3,x$4,x$5) -- #139 +//│ def bar() = +//│ let x$37 = B(10) in -- #214 +//│ let x$38 = A(9,x$37) in -- #213 +//│ let x$39 = A(10,x$38) in -- #212 +//│ let* (x$40) = complex_foo(x$39) in -- #211 +//│ x$40 -- #210 +//│ let* (x$0) = bar() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 5 diff --git a/compiler/shared/test/diff-ir/IRRec.mls b/compiler/shared/test/diff-ir/IRRec.mls index dfe1ae6bb..d936dc8b6 100644 --- a/compiler/shared/test/diff-ir/IRRec.mls +++ b/compiler/shared/test/diff-ir/IRRec.mls @@ -11,180 +11,86 @@ fib(20) //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(7, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #49 -//│ ), -//│ apply1 -> Def(3, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #45 -//│ ), -//│ apply0 -> Def(2, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #44 -//│ ), -//│ apply4 -> Def(6, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #48 -//│ ), -//│ apply3 -> Def(5, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #47 -//│ ), -//│ apply2 -> Def(4, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #46 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, fib, [n$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = <(n$0,2) in -- #43 -//│ if x$1 -- #42 -//│ true => -//│ jump j$0(n$0) -- #13 -//│ false => -//│ let x$3 = -(n$0,1) in -- #41 -//│ let* (x$4) = fib(x$3) in -- #40 -//│ let x$5 = -(n$0,2) in -- #39 -//│ let* (x$6) = fib(x$5) in -- #38 -//│ let x$7 = +(x$4,x$6) in -- #37 -//│ jump j$0(x$7) -- #36 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #11 -//│ ) -//│ }, -//│ let* (x$0) = fib(20) in -- #4 -//│ x$0 -- #3) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #49 +//│ def apply1(x0$0) = +//│ 0 -- #45 +//│ def apply0() = +//│ 0 -- #44 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #48 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #47 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #46 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def fib(n$0) = +//│ let x$1 = <(n$0,2) in -- #43 +//│ if x$1 -- #42 +//│ true => +//│ jump j$0(n$0) -- #13 +//│ false => +//│ let x$3 = -(n$0,1) in -- #41 +//│ let* (x$4) = fib(x$3) in -- #40 +//│ let x$5 = -(n$0,2) in -- #39 +//│ let* (x$6) = fib(x$5) in -- #38 +//│ let x$7 = +(x$4,x$6) in -- #37 +//│ jump j$0(x$7) -- #36 +//│ def j$0(x$2) = +//│ x$2 -- #11 +//│ let* (x$0) = fib(20) in -- #4 +//│ x$0 -- #3 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(7, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #49 -//│ ), -//│ apply1 -> Def(3, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #45 -//│ ), -//│ apply0 -> Def(2, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #44 -//│ ), -//│ apply4 -> Def(6, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #48 -//│ ), -//│ apply3 -> Def(5, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #47 -//│ ), -//│ apply2 -> Def(4, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #46 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, fib, [n$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = <(n$0,2) in -- #43 -//│ if x$1 -- #42 -//│ true => -//│ jump j$0(n$0) -- #13 -//│ false => -//│ let x$3 = -(n$0,1) in -- #41 -//│ let* (x$4) = fib(x$3) in -- #40 -//│ let x$5 = -(n$0,2) in -- #39 -//│ let* (x$6) = fib(x$5) in -- #38 -//│ let x$7 = +(x$4,x$6) in -- #37 -//│ jump j$0(x$7) -- #36 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #11 -//│ ) -//│ }, -//│ let* (x$0) = fib(20) in -- #4 -//│ x$0 -- #3) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #49 +//│ def apply1(x0$0) = +//│ 0 -- #45 +//│ def apply0() = +//│ 0 -- #44 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #48 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #47 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #46 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def fib(n$0) = +//│ let x$1 = <(n$0,2) in -- #43 +//│ if x$1 -- #42 +//│ true => +//│ jump j$0(n$0) -- #13 +//│ false => +//│ let x$3 = -(n$0,1) in -- #41 +//│ let* (x$4) = fib(x$3) in -- #40 +//│ let x$5 = -(n$0,2) in -- #39 +//│ let* (x$6) = fib(x$5) in -- #38 +//│ let x$7 = +(x$4,x$6) in -- #37 +//│ jump j$0(x$7) -- #36 +//│ def j$0(x$2) = +//│ x$2 -- #11 +//│ let* (x$0) = fib(20) in -- #4 +//│ x$0 -- #3 //│ //│ Interpreted: //│ 6765 @@ -201,236 +107,112 @@ foo() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(10, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #61 -//│ ), -//│ apply1 -> Def(6, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #57 -//│ ), -//│ apply0 -> Def(5, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #56 -//│ ), -//│ apply4 -> Def(9, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #60 -//│ ), -//│ apply3 -> Def(8, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #59 -//│ ), -//│ apply2 -> Def(7, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #58 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, odd, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = ==(x$1,0) in -- #26 -//│ if x$2 -- #25 -//│ true => -//│ let x$4 = False() in -- #12 -//│ jump j$0(x$4) -- #11 -//│ false => -//│ let x$5 = -(x$1,1) in -- #24 -//│ let* (x$6) = even(x$5) in -- #23 -//│ jump j$0(x$6) -- #22 -//│ ) -//│ Def(1, j$0, [x$3], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$3 -- #9 -//│ ) -//│ Def(2, even, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$8 = ==(x$7,0) in -- #50 -//│ if x$8 -- #49 -//│ true => -//│ let x$10 = True() in -- #36 -//│ jump j$1(x$10) -- #35 -//│ false => -//│ let x$11 = -(x$7,1) in -- #48 -//│ let* (x$12) = odd(x$11) in -- #47 -//│ jump j$1(x$12) -- #46 -//│ ) -//│ Def(3, j$1, [x$9], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$9 -- #33 -//│ ) -//│ Def(4, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$13) = odd(10) in -- #55 -//│ x$13 -- #54 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #61 +//│ def apply1(x0$0) = +//│ 0 -- #57 +//│ def apply0() = +//│ 0 -- #56 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #60 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #59 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #58 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def odd(x$1) = +//│ let x$2 = ==(x$1,0) in -- #26 +//│ if x$2 -- #25 +//│ true => +//│ let x$4 = False() in -- #12 +//│ jump j$0(x$4) -- #11 +//│ false => +//│ let x$5 = -(x$1,1) in -- #24 +//│ let* (x$6) = even(x$5) in -- #23 +//│ jump j$0(x$6) -- #22 +//│ def j$0(x$3) = +//│ x$3 -- #9 +//│ def even(x$7) = +//│ let x$8 = ==(x$7,0) in -- #50 +//│ if x$8 -- #49 +//│ true => +//│ let x$10 = True() in -- #36 +//│ jump j$1(x$10) -- #35 +//│ false => +//│ let x$11 = -(x$7,1) in -- #48 +//│ let* (x$12) = odd(x$11) in -- #47 +//│ jump j$1(x$12) -- #46 +//│ def j$1(x$9) = +//│ x$9 -- #33 +//│ def foo() = +//│ let* (x$13) = odd(10) in -- #55 +//│ x$13 -- #54 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(10, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #61 -//│ ), -//│ apply1 -> Def(6, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #57 -//│ ), -//│ apply0 -> Def(5, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #56 -//│ ), -//│ apply4 -> Def(9, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #60 -//│ ), -//│ apply3 -> Def(8, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #59 -//│ ), -//│ apply2 -> Def(7, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #58 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, odd, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = ==(x$1,0) in -- #26 -//│ if x$2 -- #25 -//│ true => -//│ let x$4 = False() in -- #12 -//│ jump j$0(x$4) -- #11 -//│ false => -//│ let x$5 = -(x$1,1) in -- #24 -//│ let* (x$6) = even(x$5) in -- #23 -//│ jump j$0(x$6) -- #22 -//│ ) -//│ Def(1, j$0, [x$3], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$3 -- #9 -//│ ) -//│ Def(2, even, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$8 = ==(x$7,0) in -- #50 -//│ if x$8 -- #49 -//│ true => -//│ let x$10 = True() in -- #36 -//│ jump j$1(x$10) -- #35 -//│ false => -//│ let x$11 = -(x$7,1) in -- #48 -//│ let* (x$12) = odd(x$11) in -- #47 -//│ jump j$1(x$12) -- #46 -//│ ) -//│ Def(3, j$1, [x$9], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$9 -- #33 -//│ ) -//│ Def(4, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$13) = odd(10) in -- #55 -//│ x$13 -- #54 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #61 +//│ def apply1(x0$0) = +//│ 0 -- #57 +//│ def apply0() = +//│ 0 -- #56 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #60 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #59 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #58 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def odd(x$1) = +//│ let x$2 = ==(x$1,0) in -- #26 +//│ if x$2 -- #25 +//│ true => +//│ let x$4 = False() in -- #12 +//│ jump j$0(x$4) -- #11 +//│ false => +//│ let x$5 = -(x$1,1) in -- #24 +//│ let* (x$6) = even(x$5) in -- #23 +//│ jump j$0(x$6) -- #22 +//│ def j$0(x$3) = +//│ x$3 -- #9 +//│ def even(x$7) = +//│ let x$8 = ==(x$7,0) in -- #50 +//│ if x$8 -- #49 +//│ true => +//│ let x$10 = True() in -- #36 +//│ jump j$1(x$10) -- #35 +//│ false => +//│ let x$11 = -(x$7,1) in -- #48 +//│ let* (x$12) = odd(x$11) in -- #47 +//│ jump j$1(x$12) -- #46 +//│ def j$1(x$9) = +//│ x$9 -- #33 +//│ def foo() = +//│ let* (x$13) = odd(10) in -- #55 +//│ x$13 -- #54 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ False() @@ -453,246 +235,116 @@ main() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(10, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #43 -//│ ), -//│ apply1 -> Def(6, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #39 -//│ ), -//│ apply0 -> Def(5, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #38 -//│ ), -//│ apply4 -> Def(9, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #42 -//│ ), -//│ apply3 -> Def(8, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #41 -//│ ), -//│ apply2 -> Def(7, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #40 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, AorB, [], parents: , methods: -//│ ), -//│ ClassInfo(10, A, [], parents: AorB, methods: -//│ ), -//│ ClassInfo(11, B, [b], parents: AorB, methods: -//│ )}, { -//│ Def(0, not, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ if x$1 -- #11 -//│ true => -//│ let x$3 = False() in -- #7 -//│ jump j$0(x$3) -- #6 -//│ false => -//│ let x$4 = True() in -- #10 -//│ jump j$0(x$4) -- #9 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #4 -//│ ) -//│ Def(2, foo, [x$5], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ if x$5 -- #31 -//│ true => -//│ let x$7 = A() in -- #16 -//│ jump j$1(x$7) -- #15 -//│ false => -//│ let* (x$8) = not(x$5) in -- #30 -//│ let* (x$9) = foo(x$8) in -- #29 -//│ let x$10 = B(x$9) in -- #28 -//│ jump j$1(x$10) -- #27 -//│ ) -//│ Def(3, j$1, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$6 -- #13 -//│ ) -//│ Def(4, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$11 = False() in -- #37 -//│ let* (x$12) = foo(x$11) in -- #36 -//│ x$12 -- #35 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #43 +//│ def apply1(x0$0) = +//│ 0 -- #39 +//│ def apply0() = +//│ 0 -- #38 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #42 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #41 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #40 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class AorB() +//│ class A() extends AorB +//│ class B(b) extends AorB +//│ def not(x$1) = +//│ if x$1 -- #11 +//│ true => +//│ let x$3 = False() in -- #7 +//│ jump j$0(x$3) -- #6 +//│ false => +//│ let x$4 = True() in -- #10 +//│ jump j$0(x$4) -- #9 +//│ def j$0(x$2) = +//│ x$2 -- #4 +//│ def foo(x$5) = +//│ if x$5 -- #31 +//│ true => +//│ let x$7 = A() in -- #16 +//│ jump j$1(x$7) -- #15 +//│ false => +//│ let* (x$8) = not(x$5) in -- #30 +//│ let* (x$9) = foo(x$8) in -- #29 +//│ let x$10 = B(x$9) in -- #28 +//│ jump j$1(x$10) -- #27 +//│ def j$1(x$6) = +//│ x$6 -- #13 +//│ def main() = +//│ let x$11 = False() in -- #37 +//│ let* (x$12) = foo(x$11) in -- #36 +//│ x$12 -- #35 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(10, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #43 -//│ ), -//│ apply1 -> Def(6, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #39 -//│ ), -//│ apply0 -> Def(5, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #38 -//│ ), -//│ apply4 -> Def(9, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #42 -//│ ), -//│ apply3 -> Def(8, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #41 -//│ ), -//│ apply2 -> Def(7, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #40 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, AorB, [], parents: , methods: -//│ ), -//│ ClassInfo(10, A, [], parents: AorB, methods: -//│ ), -//│ ClassInfo(11, B, [b], parents: AorB, methods: -//│ )}, { -//│ Def(0, not, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ if x$1 -- #11 -//│ true => -//│ let x$3 = False() in -- #7 -//│ jump j$0(x$3) -- #6 -//│ false => -//│ let x$4 = True() in -- #10 -//│ jump j$0(x$4) -- #9 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #4 -//│ ) -//│ Def(2, foo, [x$5], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ if x$5 -- #31 -//│ true => -//│ let x$7 = A() in -- #16 -//│ jump j$1(x$7) -- #15 -//│ false => -//│ let* (x$8) = not(x$5) in -- #30 -//│ let* (x$9) = foo(x$8) in -- #29 -//│ let x$10 = B(x$9) in -- #28 -//│ jump j$1(x$10) -- #27 -//│ ) -//│ Def(3, j$1, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$6 -- #13 -//│ ) -//│ Def(4, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$11 = False() in -- #37 -//│ let* (x$12) = foo(x$11) in -- #36 -//│ x$12 -- #35 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #43 +//│ def apply1(x0$0) = +//│ 0 -- #39 +//│ def apply0() = +//│ 0 -- #38 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #42 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #41 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #40 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class AorB() +//│ class A() extends AorB +//│ class B(b) extends AorB +//│ def not(x$1) = +//│ if x$1 -- #11 +//│ true => +//│ let x$3 = False() in -- #7 +//│ jump j$0(x$3) -- #6 +//│ false => +//│ let x$4 = True() in -- #10 +//│ jump j$0(x$4) -- #9 +//│ def j$0(x$2) = +//│ x$2 -- #4 +//│ def foo(x$5) = +//│ if x$5 -- #31 +//│ true => +//│ let x$7 = A() in -- #16 +//│ jump j$1(x$7) -- #15 +//│ false => +//│ let* (x$8) = not(x$5) in -- #30 +//│ let* (x$9) = foo(x$8) in -- #29 +//│ let x$10 = B(x$9) in -- #28 +//│ jump j$1(x$10) -- #27 +//│ def j$1(x$6) = +//│ x$6 -- #13 +//│ def main() = +//│ let x$11 = False() in -- #37 +//│ let* (x$12) = foo(x$11) in -- #36 +//│ x$12 -- #35 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ B(A()) @@ -728,322 +380,162 @@ main() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(13, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #102 -//│ ), -//│ apply1 -> Def(9, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #98 -//│ ), -//│ apply0 -> Def(8, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #97 -//│ ), -//│ apply4 -> Def(12, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #101 -//│ ), -//│ apply3 -> Def(11, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #100 -//│ ), -//│ apply2 -> Def(10, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #99 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, AorB, [], parents: , methods: -//│ ), -//│ ClassInfo(10, A, [], parents: AorB, methods: -//│ ), -//│ ClassInfo(11, B, [b], parents: AorB, methods: -//│ )}, { -//│ Def(0, aaa, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = 1 in -- #29 -//│ let x$2 = 2 in -- #28 -//│ let x$3 = 3 in -- #27 -//│ let x$4 = 4 in -- #26 -//│ let x$5 = +(x$1,x$2) in -- #25 -//│ let x$6 = -(x$5,x$3) in -- #24 -//│ let x$7 = +(x$6,x$4) in -- #23 -//│ x$7 -- #22 -//│ ) -//│ Def(1, bbb, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$8) = aaa() in -- #45 -//│ let x$9 = *(x$8,100) in -- #44 -//│ let x$10 = +(x$9,4) in -- #43 -//│ x$10 -- #42 -//│ ) -//│ Def(2, not, [x$11], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ if x$11 -- #54 -//│ true => -//│ let x$13 = False() in -- #50 -//│ jump j$0(x$13) -- #49 -//│ false => -//│ let x$14 = True() in -- #53 -//│ jump j$0(x$14) -- #52 -//│ ) -//│ Def(3, j$0, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$12 -- #47 -//│ ) -//│ Def(4, foo, [x$15], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ if x$15 -- #74 -//│ true => -//│ let x$17 = A() in -- #59 -//│ jump j$1(x$17) -- #58 -//│ false => -//│ let* (x$18) = not(x$15) in -- #73 -//│ let* (x$19) = foo(x$18) in -- #72 -//│ let x$20 = B(x$19) in -- #71 -//│ jump j$1(x$20) -- #70 -//│ ) -//│ Def(5, j$1, [x$16], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$16 -- #56 -//│ ) -//│ Def(6, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$21 = False() in -- #96 -//│ let* (x$22) = foo(x$21) in -- #95 -//│ case x$22 of -- #94 -//│ A => -//│ let* (x$24) = aaa() in -- #84 -//│ jump j$2(x$24) -- #83 -//│ B => -//│ let x$25 = B.b(x$22) in -- #93 -//│ let* (x$26) = bbb() in -- #92 -//│ jump j$2(x$26) -- #91 -//│ ) -//│ Def(7, j$2, [x$23], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$23 -- #80 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #102 +//│ def apply1(x0$0) = +//│ 0 -- #98 +//│ def apply0() = +//│ 0 -- #97 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #101 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #100 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #99 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class AorB() +//│ class A() extends AorB +//│ class B(b) extends AorB +//│ def aaa() = +//│ let x$1 = 1 in -- #29 +//│ let x$2 = 2 in -- #28 +//│ let x$3 = 3 in -- #27 +//│ let x$4 = 4 in -- #26 +//│ let x$5 = +(x$1,x$2) in -- #25 +//│ let x$6 = -(x$5,x$3) in -- #24 +//│ let x$7 = +(x$6,x$4) in -- #23 +//│ x$7 -- #22 +//│ def bbb() = +//│ let* (x$8) = aaa() in -- #45 +//│ let x$9 = *(x$8,100) in -- #44 +//│ let x$10 = +(x$9,4) in -- #43 +//│ x$10 -- #42 +//│ def not(x$11) = +//│ if x$11 -- #54 +//│ true => +//│ let x$13 = False() in -- #50 +//│ jump j$0(x$13) -- #49 +//│ false => +//│ let x$14 = True() in -- #53 +//│ jump j$0(x$14) -- #52 +//│ def j$0(x$12) = +//│ x$12 -- #47 +//│ def foo(x$15) = +//│ if x$15 -- #74 +//│ true => +//│ let x$17 = A() in -- #59 +//│ jump j$1(x$17) -- #58 +//│ false => +//│ let* (x$18) = not(x$15) in -- #73 +//│ let* (x$19) = foo(x$18) in -- #72 +//│ let x$20 = B(x$19) in -- #71 +//│ jump j$1(x$20) -- #70 +//│ def j$1(x$16) = +//│ x$16 -- #56 +//│ def main() = +//│ let x$21 = False() in -- #96 +//│ let* (x$22) = foo(x$21) in -- #95 +//│ case x$22 of -- #94 +//│ A => +//│ let* (x$24) = aaa() in -- #84 +//│ jump j$2(x$24) -- #83 +//│ B => +//│ let x$25 = B.b(x$22) in -- #93 +//│ let* (x$26) = bbb() in -- #92 +//│ jump j$2(x$26) -- #91 +//│ def j$2(x$23) = +//│ x$23 -- #80 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(13, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #102 -//│ ), -//│ apply1 -> Def(9, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #98 -//│ ), -//│ apply0 -> Def(8, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #97 -//│ ), -//│ apply4 -> Def(12, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #101 -//│ ), -//│ apply3 -> Def(11, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #100 -//│ ), -//│ apply2 -> Def(10, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #99 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, AorB, [], parents: , methods: -//│ ), -//│ ClassInfo(10, A, [], parents: AorB, methods: -//│ ), -//│ ClassInfo(11, B, [b], parents: AorB, methods: -//│ )}, { -//│ Def(0, aaa, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = 1 in -- #29 -//│ let x$2 = 2 in -- #28 -//│ let x$3 = 3 in -- #27 -//│ let x$4 = 4 in -- #26 -//│ let x$5 = +(x$1,x$2) in -- #25 -//│ let x$6 = -(x$5,x$3) in -- #24 -//│ let x$7 = +(x$6,x$4) in -- #23 -//│ x$7 -- #22 -//│ ) -//│ Def(1, bbb, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$8) = aaa() in -- #45 -//│ let x$9 = *(x$8,100) in -- #44 -//│ let x$10 = +(x$9,4) in -- #43 -//│ x$10 -- #42 -//│ ) -//│ Def(2, not, [x$11], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ if x$11 -- #54 -//│ true => -//│ let x$13 = False() in -- #50 -//│ jump j$0(x$13) -- #49 -//│ false => -//│ let x$14 = True() in -- #53 -//│ jump j$0(x$14) -- #52 -//│ ) -//│ Def(3, j$0, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$12 -- #47 -//│ ) -//│ Def(4, foo, [x$15], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ if x$15 -- #74 -//│ true => -//│ let x$17 = A() in -- #59 -//│ jump j$1(x$17) -- #58 -//│ false => -//│ let* (x$18) = not(x$15) in -- #73 -//│ let* (x$19) = foo(x$18) in -- #72 -//│ let x$20 = B(x$19) in -- #71 -//│ jump j$1(x$20) -- #70 -//│ ) -//│ Def(5, j$1, [x$16], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$16 -- #56 -//│ ) -//│ Def(6, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$21 = False() in -- #96 -//│ let* (x$22) = foo(x$21) in -- #95 -//│ case x$22 of -- #94 -//│ A => -//│ let* (x$24) = aaa() in -- #84 -//│ jump j$2(x$24) -- #83 -//│ B => -//│ let x$25 = B.b(x$22) in -- #93 -//│ let* (x$26) = bbb() in -- #92 -//│ jump j$2(x$26) -- #91 -//│ ) -//│ Def(7, j$2, [x$23], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$23 -- #80 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #102 +//│ def apply1(x0$0) = +//│ 0 -- #98 +//│ def apply0() = +//│ 0 -- #97 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #101 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #100 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #99 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class AorB() +//│ class A() extends AorB +//│ class B(b) extends AorB +//│ def aaa() = +//│ let x$1 = 1 in -- #29 +//│ let x$2 = 2 in -- #28 +//│ let x$3 = 3 in -- #27 +//│ let x$4 = 4 in -- #26 +//│ let x$5 = +(x$1,x$2) in -- #25 +//│ let x$6 = -(x$5,x$3) in -- #24 +//│ let x$7 = +(x$6,x$4) in -- #23 +//│ x$7 -- #22 +//│ def bbb() = +//│ let* (x$8) = aaa() in -- #45 +//│ let x$9 = *(x$8,100) in -- #44 +//│ let x$10 = +(x$9,4) in -- #43 +//│ x$10 -- #42 +//│ def not(x$11) = +//│ if x$11 -- #54 +//│ true => +//│ let x$13 = False() in -- #50 +//│ jump j$0(x$13) -- #49 +//│ false => +//│ let x$14 = True() in -- #53 +//│ jump j$0(x$14) -- #52 +//│ def j$0(x$12) = +//│ x$12 -- #47 +//│ def foo(x$15) = +//│ if x$15 -- #74 +//│ true => +//│ let x$17 = A() in -- #59 +//│ jump j$1(x$17) -- #58 +//│ false => +//│ let* (x$18) = not(x$15) in -- #73 +//│ let* (x$19) = foo(x$18) in -- #72 +//│ let x$20 = B(x$19) in -- #71 +//│ jump j$1(x$20) -- #70 +//│ def j$1(x$16) = +//│ x$16 -- #56 +//│ def main() = +//│ let x$21 = False() in -- #96 +//│ let* (x$22) = foo(x$21) in -- #95 +//│ case x$22 of -- #94 +//│ A => +//│ let* (x$24) = aaa() in -- #84 +//│ jump j$2(x$24) -- #83 +//│ B => +//│ let x$25 = B.b(x$22) in -- #93 +//│ let* (x$26) = bbb() in -- #92 +//│ jump j$2(x$26) -- #91 +//│ def j$2(x$23) = +//│ x$23 -- #80 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 404 @@ -1069,252 +561,122 @@ foo() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(10, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #60 -//│ ), -//│ apply1 -> Def(6, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #56 -//│ ), -//│ apply0 -> Def(5, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #55 -//│ ), -//│ apply4 -> Def(9, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #59 -//│ ), -//│ apply3 -> Def(8, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #58 -//│ ), -//│ apply2 -> Def(7, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #57 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Nat, [], parents: , methods: -//│ ), -//│ ClassInfo(10, S, [s], parents: Nat, methods: -//│ ), -//│ ClassInfo(11, O, [], parents: Nat, methods: -//│ )}, { -//│ Def(0, odd, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$1 of -- #19 -//│ O => -//│ let x$3 = False() in -- #7 -//│ jump j$0(x$3) -- #6 -//│ S => -//│ let x$4 = S.s(x$1) in -- #18 -//│ let* (x$5) = even(x$4) in -- #17 -//│ jump j$0(x$5) -- #16 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #4 -//│ ) -//│ Def(2, even, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$6 of -- #36 -//│ O => -//│ let x$8 = True() in -- #24 -//│ jump j$1(x$8) -- #23 -//│ S => -//│ let x$9 = S.s(x$6) in -- #35 -//│ let* (x$10) = odd(x$9) in -- #34 -//│ jump j$1(x$10) -- #33 -//│ ) -//│ Def(3, j$1, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #21 -//│ ) -//│ Def(4, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$11 = O() in -- #54 -//│ let x$12 = S(x$11) in -- #53 -//│ let x$13 = S(x$12) in -- #52 -//│ let x$14 = S(x$13) in -- #51 -//│ let* (x$15) = odd(x$14) in -- #50 -//│ x$15 -- #49 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #60 +//│ def apply1(x0$0) = +//│ 0 -- #56 +//│ def apply0() = +//│ 0 -- #55 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #59 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #58 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #57 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Nat() +//│ class S(s) extends Nat +//│ class O() extends Nat +//│ def odd(x$1) = +//│ case x$1 of -- #19 +//│ O => +//│ let x$3 = False() in -- #7 +//│ jump j$0(x$3) -- #6 +//│ S => +//│ let x$4 = S.s(x$1) in -- #18 +//│ let* (x$5) = even(x$4) in -- #17 +//│ jump j$0(x$5) -- #16 +//│ def j$0(x$2) = +//│ x$2 -- #4 +//│ def even(x$6) = +//│ case x$6 of -- #36 +//│ O => +//│ let x$8 = True() in -- #24 +//│ jump j$1(x$8) -- #23 +//│ S => +//│ let x$9 = S.s(x$6) in -- #35 +//│ let* (x$10) = odd(x$9) in -- #34 +//│ jump j$1(x$10) -- #33 +//│ def j$1(x$7) = +//│ x$7 -- #21 +//│ def foo() = +//│ let x$11 = O() in -- #54 +//│ let x$12 = S(x$11) in -- #53 +//│ let x$13 = S(x$12) in -- #52 +//│ let x$14 = S(x$13) in -- #51 +//│ let* (x$15) = odd(x$14) in -- #50 +//│ x$15 -- #49 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(10, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #60 -//│ ), -//│ apply1 -> Def(6, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #56 -//│ ), -//│ apply0 -> Def(5, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #55 -//│ ), -//│ apply4 -> Def(9, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #59 -//│ ), -//│ apply3 -> Def(8, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #58 -//│ ), -//│ apply2 -> Def(7, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #57 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Nat, [], parents: , methods: -//│ ), -//│ ClassInfo(10, S, [s], parents: Nat, methods: -//│ ), -//│ ClassInfo(11, O, [], parents: Nat, methods: -//│ )}, { -//│ Def(0, odd, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$1 of -- #19 -//│ O => -//│ let x$3 = False() in -- #7 -//│ jump j$0(x$3) -- #6 -//│ S => -//│ let x$4 = S.s(x$1) in -- #18 -//│ let* (x$5) = even(x$4) in -- #17 -//│ jump j$0(x$5) -- #16 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #4 -//│ ) -//│ Def(2, even, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$6 of -- #36 -//│ O => -//│ let x$8 = True() in -- #24 -//│ jump j$1(x$8) -- #23 -//│ S => -//│ let x$9 = S.s(x$6) in -- #35 -//│ let* (x$10) = odd(x$9) in -- #34 -//│ jump j$1(x$10) -- #33 -//│ ) -//│ Def(3, j$1, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #21 -//│ ) -//│ Def(4, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$11 = O() in -- #54 -//│ let x$12 = S(x$11) in -- #53 -//│ let x$13 = S(x$12) in -- #52 -//│ let x$14 = S(x$13) in -- #51 -//│ let* (x$15) = odd(x$14) in -- #50 -//│ x$15 -- #49 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #60 +//│ def apply1(x0$0) = +//│ 0 -- #56 +//│ def apply0() = +//│ 0 -- #55 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #59 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #58 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #57 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Nat() +//│ class S(s) extends Nat +//│ class O() extends Nat +//│ def odd(x$1) = +//│ case x$1 of -- #19 +//│ O => +//│ let x$3 = False() in -- #7 +//│ jump j$0(x$3) -- #6 +//│ S => +//│ let x$4 = S.s(x$1) in -- #18 +//│ let* (x$5) = even(x$4) in -- #17 +//│ jump j$0(x$5) -- #16 +//│ def j$0(x$2) = +//│ x$2 -- #4 +//│ def even(x$6) = +//│ case x$6 of -- #36 +//│ O => +//│ let x$8 = True() in -- #24 +//│ jump j$1(x$8) -- #23 +//│ S => +//│ let x$9 = S.s(x$6) in -- #35 +//│ let* (x$10) = odd(x$9) in -- #34 +//│ jump j$1(x$10) -- #33 +//│ def j$1(x$7) = +//│ x$7 -- #21 +//│ def foo() = +//│ let x$11 = O() in -- #54 +//│ let x$12 = S(x$11) in -- #53 +//│ let x$13 = S(x$12) in -- #52 +//│ let x$14 = S(x$13) in -- #51 +//│ let* (x$15) = odd(x$14) in -- #50 +//│ x$15 -- #49 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ True() @@ -1341,292 +703,142 @@ foo() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(12, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #79 -//│ ), -//│ apply1 -> Def(8, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #75 -//│ ), -//│ apply0 -> Def(7, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #74 -//│ ), -//│ apply4 -> Def(11, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #78 -//│ ), -//│ apply3 -> Def(10, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #77 -//│ ), -//│ apply2 -> Def(9, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #76 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Nat, [], parents: , methods: -//│ ), -//│ ClassInfo(10, S, [s], parents: Nat, methods: -//│ ), -//│ ClassInfo(11, O, [], parents: Nat, methods: -//│ )}, { -//│ Def(0, odd, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$1 of -- #19 -//│ O => -//│ let x$3 = False() in -- #7 -//│ jump j$0(x$3) -- #6 -//│ S => -//│ let x$4 = S.s(x$1) in -- #18 -//│ let* (x$5) = even(x$4) in -- #17 -//│ jump j$0(x$5) -- #16 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #4 -//│ ) -//│ Def(2, even, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$6 of -- #36 -//│ O => -//│ let x$8 = True() in -- #24 -//│ jump j$1(x$8) -- #23 -//│ S => -//│ let x$9 = S.s(x$6) in -- #35 -//│ let* (x$10) = odd(x$9) in -- #34 -//│ jump j$1(x$10) -- #33 -//│ ) -//│ Def(3, j$1, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #21 -//│ ) -//│ Def(4, mk, [n$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$11 = >(n$0,0) in -- #64 -//│ if x$11 -- #63 -//│ true => -//│ let x$13 = -(n$0,1) in -- #59 -//│ let* (x$14) = mk(x$13) in -- #58 -//│ let x$15 = S(x$14) in -- #57 -//│ jump j$2(x$15) -- #56 -//│ false => -//│ let x$16 = O() in -- #62 -//│ jump j$2(x$16) -- #61 -//│ ) -//│ Def(5, j$2, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$12 -- #43 -//│ ) -//│ Def(6, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$17) = mk(10) in -- #73 -//│ let* (x$18) = odd(x$17) in -- #72 -//│ x$18 -- #71 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #79 +//│ def apply1(x0$0) = +//│ 0 -- #75 +//│ def apply0() = +//│ 0 -- #74 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #78 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #77 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #76 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Nat() +//│ class S(s) extends Nat +//│ class O() extends Nat +//│ def odd(x$1) = +//│ case x$1 of -- #19 +//│ O => +//│ let x$3 = False() in -- #7 +//│ jump j$0(x$3) -- #6 +//│ S => +//│ let x$4 = S.s(x$1) in -- #18 +//│ let* (x$5) = even(x$4) in -- #17 +//│ jump j$0(x$5) -- #16 +//│ def j$0(x$2) = +//│ x$2 -- #4 +//│ def even(x$6) = +//│ case x$6 of -- #36 +//│ O => +//│ let x$8 = True() in -- #24 +//│ jump j$1(x$8) -- #23 +//│ S => +//│ let x$9 = S.s(x$6) in -- #35 +//│ let* (x$10) = odd(x$9) in -- #34 +//│ jump j$1(x$10) -- #33 +//│ def j$1(x$7) = +//│ x$7 -- #21 +//│ def mk(n$0) = +//│ let x$11 = >(n$0,0) in -- #64 +//│ if x$11 -- #63 +//│ true => +//│ let x$13 = -(n$0,1) in -- #59 +//│ let* (x$14) = mk(x$13) in -- #58 +//│ let x$15 = S(x$14) in -- #57 +//│ jump j$2(x$15) -- #56 +//│ false => +//│ let x$16 = O() in -- #62 +//│ jump j$2(x$16) -- #61 +//│ def j$2(x$12) = +//│ x$12 -- #43 +//│ def foo() = +//│ let* (x$17) = mk(10) in -- #73 +//│ let* (x$18) = odd(x$17) in -- #72 +//│ x$18 -- #71 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(12, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #79 -//│ ), -//│ apply1 -> Def(8, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #75 -//│ ), -//│ apply0 -> Def(7, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #74 -//│ ), -//│ apply4 -> Def(11, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #78 -//│ ), -//│ apply3 -> Def(10, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #77 -//│ ), -//│ apply2 -> Def(9, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #76 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Nat, [], parents: , methods: -//│ ), -//│ ClassInfo(10, S, [s], parents: Nat, methods: -//│ ), -//│ ClassInfo(11, O, [], parents: Nat, methods: -//│ )}, { -//│ Def(0, odd, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$1 of -- #19 -//│ O => -//│ let x$3 = False() in -- #7 -//│ jump j$0(x$3) -- #6 -//│ S => -//│ let x$4 = S.s(x$1) in -- #18 -//│ let* (x$5) = even(x$4) in -- #17 -//│ jump j$0(x$5) -- #16 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #4 -//│ ) -//│ Def(2, even, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$6 of -- #36 -//│ O => -//│ let x$8 = True() in -- #24 -//│ jump j$1(x$8) -- #23 -//│ S => -//│ let x$9 = S.s(x$6) in -- #35 -//│ let* (x$10) = odd(x$9) in -- #34 -//│ jump j$1(x$10) -- #33 -//│ ) -//│ Def(3, j$1, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #21 -//│ ) -//│ Def(4, mk, [n$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$11 = >(n$0,0) in -- #64 -//│ if x$11 -- #63 -//│ true => -//│ let x$13 = -(n$0,1) in -- #59 -//│ let* (x$14) = mk(x$13) in -- #58 -//│ let x$15 = S(x$14) in -- #57 -//│ jump j$2(x$15) -- #56 -//│ false => -//│ let x$16 = O() in -- #62 -//│ jump j$2(x$16) -- #61 -//│ ) -//│ Def(5, j$2, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$12 -- #43 -//│ ) -//│ Def(6, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$17) = mk(10) in -- #73 -//│ let* (x$18) = odd(x$17) in -- #72 -//│ x$18 -- #71 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #79 +//│ def apply1(x0$0) = +//│ 0 -- #75 +//│ def apply0() = +//│ 0 -- #74 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #78 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #77 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #76 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Nat() +//│ class S(s) extends Nat +//│ class O() extends Nat +//│ def odd(x$1) = +//│ case x$1 of -- #19 +//│ O => +//│ let x$3 = False() in -- #7 +//│ jump j$0(x$3) -- #6 +//│ S => +//│ let x$4 = S.s(x$1) in -- #18 +//│ let* (x$5) = even(x$4) in -- #17 +//│ jump j$0(x$5) -- #16 +//│ def j$0(x$2) = +//│ x$2 -- #4 +//│ def even(x$6) = +//│ case x$6 of -- #36 +//│ O => +//│ let x$8 = True() in -- #24 +//│ jump j$1(x$8) -- #23 +//│ S => +//│ let x$9 = S.s(x$6) in -- #35 +//│ let* (x$10) = odd(x$9) in -- #34 +//│ jump j$1(x$10) -- #33 +//│ def j$1(x$7) = +//│ x$7 -- #21 +//│ def mk(n$0) = +//│ let x$11 = >(n$0,0) in -- #64 +//│ if x$11 -- #63 +//│ true => +//│ let x$13 = -(n$0,1) in -- #59 +//│ let* (x$14) = mk(x$13) in -- #58 +//│ let x$15 = S(x$14) in -- #57 +//│ jump j$2(x$15) -- #56 +//│ false => +//│ let x$16 = O() in -- #62 +//│ jump j$2(x$16) -- #61 +//│ def j$2(x$12) = +//│ x$12 -- #43 +//│ def foo() = +//│ let* (x$17) = mk(10) in -- #73 +//│ let* (x$18) = odd(x$17) in -- #72 +//│ x$18 -- #71 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ False() @@ -1653,296 +865,146 @@ foo() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(12, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #87 -//│ ), -//│ apply1 -> Def(8, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #83 -//│ ), -//│ apply0 -> Def(7, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #82 -//│ ), -//│ apply4 -> Def(11, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #86 -//│ ), -//│ apply3 -> Def(10, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #85 -//│ ), -//│ apply2 -> Def(9, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #84 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Nat, [], parents: , methods: -//│ ), -//│ ClassInfo(10, S, [s], parents: Nat, methods: -//│ ), -//│ ClassInfo(11, O, [], parents: Nat, methods: -//│ )}, { -//│ Def(0, odd, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$1 of -- #19 -//│ O => -//│ let x$3 = False() in -- #7 -//│ jump j$0(x$3) -- #6 -//│ S => -//│ let x$4 = S.s(x$1) in -- #18 -//│ let* (x$5) = even(x$4) in -- #17 -//│ jump j$0(x$5) -- #16 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #4 -//│ ) -//│ Def(2, even, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$6 of -- #36 -//│ O => -//│ let x$8 = True() in -- #24 -//│ jump j$1(x$8) -- #23 -//│ S => -//│ let x$9 = S.s(x$6) in -- #35 -//│ let* (x$10) = odd(x$9) in -- #34 -//│ jump j$1(x$10) -- #33 -//│ ) -//│ Def(3, j$1, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #21 -//│ ) -//│ Def(4, mk, [n$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$11 = >(n$0,0) in -- #64 -//│ if x$11 -- #63 -//│ true => -//│ let x$13 = -(n$0,1) in -- #59 -//│ let* (x$14) = mk(x$13) in -- #58 -//│ let x$15 = S(x$14) in -- #57 -//│ jump j$2(x$15) -- #56 -//│ false => -//│ let x$16 = O() in -- #62 -//│ jump j$2(x$16) -- #61 -//│ ) -//│ Def(5, j$2, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$12 -- #43 -//│ ) -//│ Def(6, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$17) = mk(10) in -- #81 -//│ let x$18 = S(x$17) in -- #80 -//│ let x$19 = S(x$18) in -- #79 -//│ let* (x$20) = odd(x$19) in -- #78 -//│ x$20 -- #77 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #87 +//│ def apply1(x0$0) = +//│ 0 -- #83 +//│ def apply0() = +//│ 0 -- #82 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #86 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #85 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #84 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Nat() +//│ class S(s) extends Nat +//│ class O() extends Nat +//│ def odd(x$1) = +//│ case x$1 of -- #19 +//│ O => +//│ let x$3 = False() in -- #7 +//│ jump j$0(x$3) -- #6 +//│ S => +//│ let x$4 = S.s(x$1) in -- #18 +//│ let* (x$5) = even(x$4) in -- #17 +//│ jump j$0(x$5) -- #16 +//│ def j$0(x$2) = +//│ x$2 -- #4 +//│ def even(x$6) = +//│ case x$6 of -- #36 +//│ O => +//│ let x$8 = True() in -- #24 +//│ jump j$1(x$8) -- #23 +//│ S => +//│ let x$9 = S.s(x$6) in -- #35 +//│ let* (x$10) = odd(x$9) in -- #34 +//│ jump j$1(x$10) -- #33 +//│ def j$1(x$7) = +//│ x$7 -- #21 +//│ def mk(n$0) = +//│ let x$11 = >(n$0,0) in -- #64 +//│ if x$11 -- #63 +//│ true => +//│ let x$13 = -(n$0,1) in -- #59 +//│ let* (x$14) = mk(x$13) in -- #58 +//│ let x$15 = S(x$14) in -- #57 +//│ jump j$2(x$15) -- #56 +//│ false => +//│ let x$16 = O() in -- #62 +//│ jump j$2(x$16) -- #61 +//│ def j$2(x$12) = +//│ x$12 -- #43 +//│ def foo() = +//│ let* (x$17) = mk(10) in -- #81 +//│ let x$18 = S(x$17) in -- #80 +//│ let x$19 = S(x$18) in -- #79 +//│ let* (x$20) = odd(x$19) in -- #78 +//│ x$20 -- #77 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(12, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #87 -//│ ), -//│ apply1 -> Def(8, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #83 -//│ ), -//│ apply0 -> Def(7, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #82 -//│ ), -//│ apply4 -> Def(11, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #86 -//│ ), -//│ apply3 -> Def(10, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #85 -//│ ), -//│ apply2 -> Def(9, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #84 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Nat, [], parents: , methods: -//│ ), -//│ ClassInfo(10, S, [s], parents: Nat, methods: -//│ ), -//│ ClassInfo(11, O, [], parents: Nat, methods: -//│ )}, { -//│ Def(0, odd, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$1 of -- #19 -//│ O => -//│ let x$3 = False() in -- #7 -//│ jump j$0(x$3) -- #6 -//│ S => -//│ let x$4 = S.s(x$1) in -- #18 -//│ let* (x$5) = even(x$4) in -- #17 -//│ jump j$0(x$5) -- #16 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #4 -//│ ) -//│ Def(2, even, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$6 of -- #36 -//│ O => -//│ let x$8 = True() in -- #24 -//│ jump j$1(x$8) -- #23 -//│ S => -//│ let x$9 = S.s(x$6) in -- #35 -//│ let* (x$10) = odd(x$9) in -- #34 -//│ jump j$1(x$10) -- #33 -//│ ) -//│ Def(3, j$1, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #21 -//│ ) -//│ Def(4, mk, [n$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$11 = >(n$0,0) in -- #64 -//│ if x$11 -- #63 -//│ true => -//│ let x$13 = -(n$0,1) in -- #59 -//│ let* (x$14) = mk(x$13) in -- #58 -//│ let x$15 = S(x$14) in -- #57 -//│ jump j$2(x$15) -- #56 -//│ false => -//│ let x$16 = O() in -- #62 -//│ jump j$2(x$16) -- #61 -//│ ) -//│ Def(5, j$2, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$12 -- #43 -//│ ) -//│ Def(6, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$17) = mk(10) in -- #81 -//│ let x$18 = S(x$17) in -- #80 -//│ let x$19 = S(x$18) in -- #79 -//│ let* (x$20) = odd(x$19) in -- #78 -//│ x$20 -- #77 -//│ ) -//│ }, -//│ let* (x$0) = foo() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #87 +//│ def apply1(x0$0) = +//│ 0 -- #83 +//│ def apply0() = +//│ 0 -- #82 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #86 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #85 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #84 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Nat() +//│ class S(s) extends Nat +//│ class O() extends Nat +//│ def odd(x$1) = +//│ case x$1 of -- #19 +//│ O => +//│ let x$3 = False() in -- #7 +//│ jump j$0(x$3) -- #6 +//│ S => +//│ let x$4 = S.s(x$1) in -- #18 +//│ let* (x$5) = even(x$4) in -- #17 +//│ jump j$0(x$5) -- #16 +//│ def j$0(x$2) = +//│ x$2 -- #4 +//│ def even(x$6) = +//│ case x$6 of -- #36 +//│ O => +//│ let x$8 = True() in -- #24 +//│ jump j$1(x$8) -- #23 +//│ S => +//│ let x$9 = S.s(x$6) in -- #35 +//│ let* (x$10) = odd(x$9) in -- #34 +//│ jump j$1(x$10) -- #33 +//│ def j$1(x$7) = +//│ x$7 -- #21 +//│ def mk(n$0) = +//│ let x$11 = >(n$0,0) in -- #64 +//│ if x$11 -- #63 +//│ true => +//│ let x$13 = -(n$0,1) in -- #59 +//│ let* (x$14) = mk(x$13) in -- #58 +//│ let x$15 = S(x$14) in -- #57 +//│ jump j$2(x$15) -- #56 +//│ false => +//│ let x$16 = O() in -- #62 +//│ jump j$2(x$16) -- #61 +//│ def j$2(x$12) = +//│ x$12 -- #43 +//│ def foo() = +//│ let* (x$17) = mk(10) in -- #81 +//│ let x$18 = S(x$17) in -- #80 +//│ let x$19 = S(x$18) in -- #79 +//│ let* (x$20) = odd(x$19) in -- #78 +//│ x$20 -- #77 +//│ let* (x$0) = foo() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ False() @@ -1972,340 +1034,170 @@ main() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(14, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #98 -//│ ), -//│ apply1 -> Def(10, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #94 -//│ ), -//│ apply0 -> Def(9, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #93 -//│ ), -//│ apply4 -> Def(13, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #97 -//│ ), -//│ apply3 -> Def(12, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #96 -//│ ), -//│ apply2 -> Def(11, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #95 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Nat, [], parents: , methods: -//│ ), -//│ ClassInfo(10, S, [s], parents: Nat, methods: -//│ ), -//│ ClassInfo(11, O, [], parents: Nat, methods: -//│ )}, { -//│ Def(0, odd, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$1 of -- #19 -//│ O => -//│ let x$3 = False() in -- #7 -//│ jump j$0(x$3) -- #6 -//│ S => -//│ let x$4 = S.s(x$1) in -- #18 -//│ let* (x$5) = even(x$4) in -- #17 -//│ jump j$0(x$5) -- #16 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #4 -//│ ) -//│ Def(2, even, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$6 of -- #36 -//│ O => -//│ let x$8 = True() in -- #24 -//│ jump j$1(x$8) -- #23 -//│ S => -//│ let x$9 = S.s(x$6) in -- #35 -//│ let* (x$10) = odd(x$9) in -- #34 -//│ jump j$1(x$10) -- #33 -//│ ) -//│ Def(3, j$1, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #21 -//│ ) -//│ Def(4, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$11 = >(10,0) in -- #59 -//│ if x$11 -- #58 -//│ true => -//│ let x$14 = O() in -- #54 -//│ let x$15 = S(x$14) in -- #53 -//│ jump j$2(x$15) -- #52 -//│ false => -//│ let x$16 = O() in -- #57 -//│ jump j$2(x$16) -- #56 -//│ ) -//│ Def(5, j$2, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$13) = odd(x$12) in -- #47 -//│ x$13 -- #46 -//│ ) -//│ Def(6, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$17 = >(10,0) in -- #86 -//│ if x$17 -- #85 -//│ true => -//│ let x$19 = O() in -- #77 -//│ let x$20 = S(x$19) in -- #76 -//│ let* (x$21) = odd(x$20) in -- #75 -//│ jump j$3(x$21) -- #74 -//│ false => -//│ let x$22 = O() in -- #84 -//│ let* (x$23) = odd(x$22) in -- #83 -//│ jump j$3(x$23) -- #82 -//│ ) -//│ Def(7, j$3, [x$18], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$18 -- #66 -//│ ) -//│ Def(8, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$24) = foo() in -- #92 -//│ let* (x$25) = bar() in -- #91 -//│ x$25 -- #90 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #98 +//│ def apply1(x0$0) = +//│ 0 -- #94 +//│ def apply0() = +//│ 0 -- #93 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #97 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #96 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #95 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Nat() +//│ class S(s) extends Nat +//│ class O() extends Nat +//│ def odd(x$1) = +//│ case x$1 of -- #19 +//│ O => +//│ let x$3 = False() in -- #7 +//│ jump j$0(x$3) -- #6 +//│ S => +//│ let x$4 = S.s(x$1) in -- #18 +//│ let* (x$5) = even(x$4) in -- #17 +//│ jump j$0(x$5) -- #16 +//│ def j$0(x$2) = +//│ x$2 -- #4 +//│ def even(x$6) = +//│ case x$6 of -- #36 +//│ O => +//│ let x$8 = True() in -- #24 +//│ jump j$1(x$8) -- #23 +//│ S => +//│ let x$9 = S.s(x$6) in -- #35 +//│ let* (x$10) = odd(x$9) in -- #34 +//│ jump j$1(x$10) -- #33 +//│ def j$1(x$7) = +//│ x$7 -- #21 +//│ def foo() = +//│ let x$11 = >(10,0) in -- #59 +//│ if x$11 -- #58 +//│ true => +//│ let x$14 = O() in -- #54 +//│ let x$15 = S(x$14) in -- #53 +//│ jump j$2(x$15) -- #52 +//│ false => +//│ let x$16 = O() in -- #57 +//│ jump j$2(x$16) -- #56 +//│ def j$2(x$12) = +//│ let* (x$13) = odd(x$12) in -- #47 +//│ x$13 -- #46 +//│ def bar() = +//│ let x$17 = >(10,0) in -- #86 +//│ if x$17 -- #85 +//│ true => +//│ let x$19 = O() in -- #77 +//│ let x$20 = S(x$19) in -- #76 +//│ let* (x$21) = odd(x$20) in -- #75 +//│ jump j$3(x$21) -- #74 +//│ false => +//│ let x$22 = O() in -- #84 +//│ let* (x$23) = odd(x$22) in -- #83 +//│ jump j$3(x$23) -- #82 +//│ def j$3(x$18) = +//│ x$18 -- #66 +//│ def main() = +//│ let* (x$24) = foo() in -- #92 +//│ let* (x$25) = bar() in -- #91 +//│ x$25 -- #90 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(14, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #98 -//│ ), -//│ apply1 -> Def(10, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #94 -//│ ), -//│ apply0 -> Def(9, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #93 -//│ ), -//│ apply4 -> Def(13, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #97 -//│ ), -//│ apply3 -> Def(12, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #96 -//│ ), -//│ apply2 -> Def(11, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #95 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Nat, [], parents: , methods: -//│ ), -//│ ClassInfo(10, S, [s], parents: Nat, methods: -//│ ), -//│ ClassInfo(11, O, [], parents: Nat, methods: -//│ )}, { -//│ Def(0, odd, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$1 of -- #19 -//│ O => -//│ let x$3 = False() in -- #7 -//│ jump j$0(x$3) -- #6 -//│ S => -//│ let x$4 = S.s(x$1) in -- #18 -//│ let* (x$5) = even(x$4) in -- #17 -//│ jump j$0(x$5) -- #16 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #4 -//│ ) -//│ Def(2, even, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case x$6 of -- #36 -//│ O => -//│ let x$8 = True() in -- #24 -//│ jump j$1(x$8) -- #23 -//│ S => -//│ let x$9 = S.s(x$6) in -- #35 -//│ let* (x$10) = odd(x$9) in -- #34 -//│ jump j$1(x$10) -- #33 -//│ ) -//│ Def(3, j$1, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #21 -//│ ) -//│ Def(4, foo, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$11 = >(10,0) in -- #59 -//│ if x$11 -- #58 -//│ true => -//│ let x$14 = O() in -- #54 -//│ let x$15 = S(x$14) in -- #53 -//│ jump j$2(x$15) -- #52 -//│ false => -//│ let x$16 = O() in -- #57 -//│ jump j$2(x$16) -- #56 -//│ ) -//│ Def(5, j$2, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$13) = odd(x$12) in -- #47 -//│ x$13 -- #46 -//│ ) -//│ Def(6, bar, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$17 = >(10,0) in -- #86 -//│ if x$17 -- #85 -//│ true => -//│ let x$19 = O() in -- #77 -//│ let x$20 = S(x$19) in -- #76 -//│ let* (x$21) = odd(x$20) in -- #75 -//│ jump j$3(x$21) -- #74 -//│ false => -//│ let x$22 = O() in -- #84 -//│ let* (x$23) = odd(x$22) in -- #83 -//│ jump j$3(x$23) -- #82 -//│ ) -//│ Def(7, j$3, [x$18], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$18 -- #66 -//│ ) -//│ Def(8, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$24) = foo() in -- #92 -//│ let* (x$25) = bar() in -- #91 -//│ x$25 -- #90 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #98 +//│ def apply1(x0$0) = +//│ 0 -- #94 +//│ def apply0() = +//│ 0 -- #93 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #97 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #96 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #95 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Nat() +//│ class S(s) extends Nat +//│ class O() extends Nat +//│ def odd(x$1) = +//│ case x$1 of -- #19 +//│ O => +//│ let x$3 = False() in -- #7 +//│ jump j$0(x$3) -- #6 +//│ S => +//│ let x$4 = S.s(x$1) in -- #18 +//│ let* (x$5) = even(x$4) in -- #17 +//│ jump j$0(x$5) -- #16 +//│ def j$0(x$2) = +//│ x$2 -- #4 +//│ def even(x$6) = +//│ case x$6 of -- #36 +//│ O => +//│ let x$8 = True() in -- #24 +//│ jump j$1(x$8) -- #23 +//│ S => +//│ let x$9 = S.s(x$6) in -- #35 +//│ let* (x$10) = odd(x$9) in -- #34 +//│ jump j$1(x$10) -- #33 +//│ def j$1(x$7) = +//│ x$7 -- #21 +//│ def foo() = +//│ let x$11 = >(10,0) in -- #59 +//│ if x$11 -- #58 +//│ true => +//│ let x$14 = O() in -- #54 +//│ let x$15 = S(x$14) in -- #53 +//│ jump j$2(x$15) -- #52 +//│ false => +//│ let x$16 = O() in -- #57 +//│ jump j$2(x$16) -- #56 +//│ def j$2(x$12) = +//│ let* (x$13) = odd(x$12) in -- #47 +//│ x$13 -- #46 +//│ def bar() = +//│ let x$17 = >(10,0) in -- #86 +//│ if x$17 -- #85 +//│ true => +//│ let x$19 = O() in -- #77 +//│ let x$20 = S(x$19) in -- #76 +//│ let* (x$21) = odd(x$20) in -- #75 +//│ jump j$3(x$21) -- #74 +//│ false => +//│ let x$22 = O() in -- #84 +//│ let* (x$23) = odd(x$22) in -- #83 +//│ jump j$3(x$23) -- #82 +//│ def j$3(x$18) = +//│ x$18 -- #66 +//│ def main() = +//│ let* (x$24) = foo() in -- #92 +//│ let* (x$25) = bar() in -- #91 +//│ x$25 -- #90 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ True() @@ -2340,322 +1232,162 @@ main(False) //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(13, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #104 -//│ ), -//│ apply1 -> Def(9, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #100 -//│ ), -//│ apply0 -> Def(8, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #99 -//│ ), -//│ apply4 -> Def(12, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #103 -//│ ), -//│ apply3 -> Def(11, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #102 -//│ ), -//│ apply2 -> Def(10, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #101 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, AorB, [], parents: , methods: -//│ ), -//│ ClassInfo(10, A, [], parents: AorB, methods: -//│ ), -//│ ClassInfo(11, B, [b], parents: AorB, methods: -//│ )}, { -//│ Def(0, aaa, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = 1 in -- #32 -//│ let x$3 = 2 in -- #31 -//│ let x$4 = 3 in -- #30 -//│ let x$5 = 4 in -- #29 -//│ let x$6 = +(x$2,x$3) in -- #28 -//│ let x$7 = -(x$6,x$4) in -- #27 -//│ let x$8 = +(x$7,x$5) in -- #26 -//│ x$8 -- #25 -//│ ) -//│ Def(1, bbb, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$9) = aaa() in -- #48 -//│ let x$10 = *(x$9,100) in -- #47 -//│ let x$11 = +(x$10,4) in -- #46 -//│ x$11 -- #45 -//│ ) -//│ Def(2, not, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ if x$12 -- #57 -//│ true => -//│ let x$14 = False() in -- #53 -//│ jump j$0(x$14) -- #52 -//│ false => -//│ let x$15 = True() in -- #56 -//│ jump j$0(x$15) -- #55 -//│ ) -//│ Def(3, j$0, [x$13], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$13 -- #50 -//│ ) -//│ Def(4, foo, [x$16], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ if x$16 -- #77 -//│ true => -//│ let x$18 = A() in -- #62 -//│ jump j$1(x$18) -- #61 -//│ false => -//│ let* (x$19) = not(x$16) in -- #76 -//│ let* (x$20) = foo(x$19) in -- #75 -//│ let x$21 = B(x$20) in -- #74 -//│ jump j$1(x$21) -- #73 -//│ ) -//│ Def(5, j$1, [x$17], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$17 -- #59 -//│ ) -//│ Def(6, main, [flag$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$22) = foo(flag$0) in -- #98 -//│ case x$22 of -- #97 -//│ A => -//│ let* (x$24) = aaa() in -- #87 -//│ jump j$2(x$24) -- #86 -//│ B => -//│ let x$25 = B.b(x$22) in -- #96 -//│ let* (x$26) = bbb() in -- #95 -//│ jump j$2(x$26) -- #94 -//│ ) -//│ Def(7, j$2, [x$23], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$23 -- #83 -//│ ) -//│ }, -//│ let x$0 = False() in -- #5 -//│ let* (x$1) = main(x$0) in -- #4 -//│ x$1 -- #3) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #104 +//│ def apply1(x0$0) = +//│ 0 -- #100 +//│ def apply0() = +//│ 0 -- #99 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #103 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #102 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #101 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class AorB() +//│ class A() extends AorB +//│ class B(b) extends AorB +//│ def aaa() = +//│ let x$2 = 1 in -- #32 +//│ let x$3 = 2 in -- #31 +//│ let x$4 = 3 in -- #30 +//│ let x$5 = 4 in -- #29 +//│ let x$6 = +(x$2,x$3) in -- #28 +//│ let x$7 = -(x$6,x$4) in -- #27 +//│ let x$8 = +(x$7,x$5) in -- #26 +//│ x$8 -- #25 +//│ def bbb() = +//│ let* (x$9) = aaa() in -- #48 +//│ let x$10 = *(x$9,100) in -- #47 +//│ let x$11 = +(x$10,4) in -- #46 +//│ x$11 -- #45 +//│ def not(x$12) = +//│ if x$12 -- #57 +//│ true => +//│ let x$14 = False() in -- #53 +//│ jump j$0(x$14) -- #52 +//│ false => +//│ let x$15 = True() in -- #56 +//│ jump j$0(x$15) -- #55 +//│ def j$0(x$13) = +//│ x$13 -- #50 +//│ def foo(x$16) = +//│ if x$16 -- #77 +//│ true => +//│ let x$18 = A() in -- #62 +//│ jump j$1(x$18) -- #61 +//│ false => +//│ let* (x$19) = not(x$16) in -- #76 +//│ let* (x$20) = foo(x$19) in -- #75 +//│ let x$21 = B(x$20) in -- #74 +//│ jump j$1(x$21) -- #73 +//│ def j$1(x$17) = +//│ x$17 -- #59 +//│ def main(flag$0) = +//│ let* (x$22) = foo(flag$0) in -- #98 +//│ case x$22 of -- #97 +//│ A => +//│ let* (x$24) = aaa() in -- #87 +//│ jump j$2(x$24) -- #86 +//│ B => +//│ let x$25 = B.b(x$22) in -- #96 +//│ let* (x$26) = bbb() in -- #95 +//│ jump j$2(x$26) -- #94 +//│ def j$2(x$23) = +//│ x$23 -- #83 +//│ let x$0 = False() in -- #5 +//│ let* (x$1) = main(x$0) in -- #4 +//│ x$1 -- #3 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(13, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #104 -//│ ), -//│ apply1 -> Def(9, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #100 -//│ ), -//│ apply0 -> Def(8, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #99 -//│ ), -//│ apply4 -> Def(12, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #103 -//│ ), -//│ apply3 -> Def(11, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #102 -//│ ), -//│ apply2 -> Def(10, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #101 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, AorB, [], parents: , methods: -//│ ), -//│ ClassInfo(10, A, [], parents: AorB, methods: -//│ ), -//│ ClassInfo(11, B, [b], parents: AorB, methods: -//│ )}, { -//│ Def(0, aaa, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = 1 in -- #32 -//│ let x$3 = 2 in -- #31 -//│ let x$4 = 3 in -- #30 -//│ let x$5 = 4 in -- #29 -//│ let x$6 = +(x$2,x$3) in -- #28 -//│ let x$7 = -(x$6,x$4) in -- #27 -//│ let x$8 = +(x$7,x$5) in -- #26 -//│ x$8 -- #25 -//│ ) -//│ Def(1, bbb, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$9) = aaa() in -- #48 -//│ let x$10 = *(x$9,100) in -- #47 -//│ let x$11 = +(x$10,4) in -- #46 -//│ x$11 -- #45 -//│ ) -//│ Def(2, not, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ if x$12 -- #57 -//│ true => -//│ let x$14 = False() in -- #53 -//│ jump j$0(x$14) -- #52 -//│ false => -//│ let x$15 = True() in -- #56 -//│ jump j$0(x$15) -- #55 -//│ ) -//│ Def(3, j$0, [x$13], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$13 -- #50 -//│ ) -//│ Def(4, foo, [x$16], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ if x$16 -- #77 -//│ true => -//│ let x$18 = A() in -- #62 -//│ jump j$1(x$18) -- #61 -//│ false => -//│ let* (x$19) = not(x$16) in -- #76 -//│ let* (x$20) = foo(x$19) in -- #75 -//│ let x$21 = B(x$20) in -- #74 -//│ jump j$1(x$21) -- #73 -//│ ) -//│ Def(5, j$1, [x$17], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$17 -- #59 -//│ ) -//│ Def(6, main, [flag$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$22) = foo(flag$0) in -- #98 -//│ case x$22 of -- #97 -//│ A => -//│ let* (x$24) = aaa() in -- #87 -//│ jump j$2(x$24) -- #86 -//│ B => -//│ let x$25 = B.b(x$22) in -- #96 -//│ let* (x$26) = bbb() in -- #95 -//│ jump j$2(x$26) -- #94 -//│ ) -//│ Def(7, j$2, [x$23], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$23 -- #83 -//│ ) -//│ }, -//│ let x$0 = False() in -- #5 -//│ let* (x$1) = main(x$0) in -- #4 -//│ x$1 -- #3) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #104 +//│ def apply1(x0$0) = +//│ 0 -- #100 +//│ def apply0() = +//│ 0 -- #99 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #103 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #102 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #101 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class AorB() +//│ class A() extends AorB +//│ class B(b) extends AorB +//│ def aaa() = +//│ let x$2 = 1 in -- #32 +//│ let x$3 = 2 in -- #31 +//│ let x$4 = 3 in -- #30 +//│ let x$5 = 4 in -- #29 +//│ let x$6 = +(x$2,x$3) in -- #28 +//│ let x$7 = -(x$6,x$4) in -- #27 +//│ let x$8 = +(x$7,x$5) in -- #26 +//│ x$8 -- #25 +//│ def bbb() = +//│ let* (x$9) = aaa() in -- #48 +//│ let x$10 = *(x$9,100) in -- #47 +//│ let x$11 = +(x$10,4) in -- #46 +//│ x$11 -- #45 +//│ def not(x$12) = +//│ if x$12 -- #57 +//│ true => +//│ let x$14 = False() in -- #53 +//│ jump j$0(x$14) -- #52 +//│ false => +//│ let x$15 = True() in -- #56 +//│ jump j$0(x$15) -- #55 +//│ def j$0(x$13) = +//│ x$13 -- #50 +//│ def foo(x$16) = +//│ if x$16 -- #77 +//│ true => +//│ let x$18 = A() in -- #62 +//│ jump j$1(x$18) -- #61 +//│ false => +//│ let* (x$19) = not(x$16) in -- #76 +//│ let* (x$20) = foo(x$19) in -- #75 +//│ let x$21 = B(x$20) in -- #74 +//│ jump j$1(x$21) -- #73 +//│ def j$1(x$17) = +//│ x$17 -- #59 +//│ def main(flag$0) = +//│ let* (x$22) = foo(flag$0) in -- #98 +//│ case x$22 of -- #97 +//│ A => +//│ let* (x$24) = aaa() in -- #87 +//│ jump j$2(x$24) -- #86 +//│ B => +//│ let x$25 = B.b(x$22) in -- #96 +//│ let* (x$26) = bbb() in -- #95 +//│ jump j$2(x$26) -- #94 +//│ def j$2(x$23) = +//│ x$23 -- #83 +//│ let x$0 = False() in -- #5 +//│ let* (x$1) = main(x$0) in -- #4 +//│ x$1 -- #3 //│ //│ Interpreted: //│ 404 @@ -2688,282 +1420,136 @@ main() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(11, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #71 -//│ ), -//│ apply1 -> Def(7, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #67 -//│ ), -//│ apply0 -> Def(6, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #66 -//│ ), -//│ apply4 -> Def(10, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #70 -//│ ), -//│ apply3 -> Def(9, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #69 -//│ ), -//│ apply2 -> Def(8, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #68 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, List, [], parents: , methods: -//│ ), -//│ ClassInfo(10, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(11, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(12, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(13, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(14, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, head_opt, [l$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case l$0 of -- #24 -//│ Nil => -//│ let x$2 = None() in -- #7 -//│ jump j$0(x$2) -- #6 -//│ Cons => -//│ let x$3 = Cons.t(l$0) in -- #23 -//│ let x$4 = Cons.h(l$0) in -- #22 -//│ let x$5 = Some(x$4) in -- #21 -//│ jump j$0(x$5) -- #20 -//│ ) -//│ Def(1, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$1 -- #4 -//│ ) -//│ Def(2, is_none, [o$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case o$0 of -- #38 -//│ None => -//│ let x$7 = True() in -- #29 -//│ jump j$1(x$7) -- #28 -//│ Some => -//│ let x$8 = Some.x(o$0) in -- #37 -//│ let x$9 = False() in -- #36 -//│ jump j$1(x$9) -- #35 -//│ ) -//│ Def(3, j$1, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$6 -- #26 -//│ ) -//│ Def(4, is_empty, [l$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$10) = head_opt(l$1) in -- #47 -//│ let* (x$11) = is_none(x$10) in -- #46 -//│ x$11 -- #45 -//│ ) -//│ Def(5, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$12 = Nil() in -- #65 -//│ let x$13 = Cons(2,x$12) in -- #64 -//│ let x$14 = Cons(1,x$13) in -- #63 -//│ let* (x$15) = is_empty(x$14) in -- #62 -//│ x$15 -- #61 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #71 +//│ def apply1(x0$0) = +//│ 0 -- #67 +//│ def apply0() = +//│ 0 -- #66 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #70 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #69 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #68 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def head_opt(l$0) = +//│ case l$0 of -- #24 +//│ Nil => +//│ let x$2 = None() in -- #7 +//│ jump j$0(x$2) -- #6 +//│ Cons => +//│ let x$3 = Cons.t(l$0) in -- #23 +//│ let x$4 = Cons.h(l$0) in -- #22 +//│ let x$5 = Some(x$4) in -- #21 +//│ jump j$0(x$5) -- #20 +//│ def j$0(x$1) = +//│ x$1 -- #4 +//│ def is_none(o$0) = +//│ case o$0 of -- #38 +//│ None => +//│ let x$7 = True() in -- #29 +//│ jump j$1(x$7) -- #28 +//│ Some => +//│ let x$8 = Some.x(o$0) in -- #37 +//│ let x$9 = False() in -- #36 +//│ jump j$1(x$9) -- #35 +//│ def j$1(x$6) = +//│ x$6 -- #26 +//│ def is_empty(l$1) = +//│ let* (x$10) = head_opt(l$1) in -- #47 +//│ let* (x$11) = is_none(x$10) in -- #46 +//│ x$11 -- #45 +//│ def main() = +//│ let x$12 = Nil() in -- #65 +//│ let x$13 = Cons(2,x$12) in -- #64 +//│ let x$14 = Cons(1,x$13) in -- #63 +//│ let* (x$15) = is_empty(x$14) in -- #62 +//│ x$15 -- #61 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(11, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #71 -//│ ), -//│ apply1 -> Def(7, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #67 -//│ ), -//│ apply0 -> Def(6, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #66 -//│ ), -//│ apply4 -> Def(10, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #70 -//│ ), -//│ apply3 -> Def(9, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #69 -//│ ), -//│ apply2 -> Def(8, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #68 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, List, [], parents: , methods: -//│ ), -//│ ClassInfo(10, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(11, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(12, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(13, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(14, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, head_opt, [l$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case l$0 of -- #24 -//│ Nil => -//│ let x$2 = None() in -- #7 -//│ jump j$0(x$2) -- #6 -//│ Cons => -//│ let x$3 = Cons.t(l$0) in -- #23 -//│ let x$4 = Cons.h(l$0) in -- #22 -//│ let x$5 = Some(x$4) in -- #21 -//│ jump j$0(x$5) -- #20 -//│ ) -//│ Def(1, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$1 -- #4 -//│ ) -//│ Def(2, is_none, [o$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case o$0 of -- #38 -//│ None => -//│ let x$7 = True() in -- #29 -//│ jump j$1(x$7) -- #28 -//│ Some => -//│ let x$8 = Some.x(o$0) in -- #37 -//│ let x$9 = False() in -- #36 -//│ jump j$1(x$9) -- #35 -//│ ) -//│ Def(3, j$1, [x$6], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$6 -- #26 -//│ ) -//│ Def(4, is_empty, [l$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$10) = head_opt(l$1) in -- #47 -//│ let* (x$11) = is_none(x$10) in -- #46 -//│ x$11 -- #45 -//│ ) -//│ Def(5, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$12 = Nil() in -- #65 -//│ let x$13 = Cons(2,x$12) in -- #64 -//│ let x$14 = Cons(1,x$13) in -- #63 -//│ let* (x$15) = is_empty(x$14) in -- #62 -//│ x$15 -- #61 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #71 +//│ def apply1(x0$0) = +//│ 0 -- #67 +//│ def apply0() = +//│ 0 -- #66 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #70 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #69 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #68 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def head_opt(l$0) = +//│ case l$0 of -- #24 +//│ Nil => +//│ let x$2 = None() in -- #7 +//│ jump j$0(x$2) -- #6 +//│ Cons => +//│ let x$3 = Cons.t(l$0) in -- #23 +//│ let x$4 = Cons.h(l$0) in -- #22 +//│ let x$5 = Some(x$4) in -- #21 +//│ jump j$0(x$5) -- #20 +//│ def j$0(x$1) = +//│ x$1 -- #4 +//│ def is_none(o$0) = +//│ case o$0 of -- #38 +//│ None => +//│ let x$7 = True() in -- #29 +//│ jump j$1(x$7) -- #28 +//│ Some => +//│ let x$8 = Some.x(o$0) in -- #37 +//│ let x$9 = False() in -- #36 +//│ jump j$1(x$9) -- #35 +//│ def j$1(x$6) = +//│ x$6 -- #26 +//│ def is_empty(l$1) = +//│ let* (x$10) = head_opt(l$1) in -- #47 +//│ let* (x$11) = is_none(x$10) in -- #46 +//│ x$11 -- #45 +//│ def main() = +//│ let x$12 = Nil() in -- #65 +//│ let x$13 = Cons(2,x$12) in -- #64 +//│ let x$14 = Cons(1,x$13) in -- #63 +//│ let* (x$15) = is_empty(x$14) in -- #62 +//│ x$15 -- #61 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ False() @@ -2997,324 +1583,158 @@ main() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(13, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #92 -//│ ), -//│ apply1 -> Def(9, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #88 -//│ ), -//│ apply0 -> Def(8, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #87 -//│ ), -//│ apply4 -> Def(12, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #91 -//│ ), -//│ apply3 -> Def(11, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #90 -//│ ), -//│ apply2 -> Def(10, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #89 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, List, [], parents: , methods: -//│ ), -//│ ClassInfo(10, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(11, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(12, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(13, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(14, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, mk_list, [n$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = ==(n$0,0) in -- #32 -//│ if x$1 -- #31 -//│ true => -//│ let x$3 = Nil() in -- #12 -//│ jump j$0(x$3) -- #11 -//│ false => -//│ let x$4 = -(n$0,1) in -- #30 -//│ let* (x$5) = mk_list(x$4) in -- #29 -//│ let x$6 = Cons(n$0,x$5) in -- #28 -//│ jump j$0(x$6) -- #27 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #9 -//│ ) -//│ Def(2, head_opt, [l$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case l$0 of -- #54 -//│ Nil => -//│ let x$8 = None() in -- #37 -//│ jump j$1(x$8) -- #36 -//│ Cons => -//│ let x$9 = Cons.t(l$0) in -- #53 -//│ let x$10 = Cons.h(l$0) in -- #52 -//│ let x$11 = Some(x$10) in -- #51 -//│ jump j$1(x$11) -- #50 -//│ ) -//│ Def(3, j$1, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #34 -//│ ) -//│ Def(4, is_none, [o$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case o$0 of -- #68 -//│ None => -//│ let x$13 = True() in -- #59 -//│ jump j$2(x$13) -- #58 -//│ Some => -//│ let x$14 = Some.x(o$0) in -- #67 -//│ let x$15 = False() in -- #66 -//│ jump j$2(x$15) -- #65 -//│ ) -//│ Def(5, j$2, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$12 -- #56 -//│ ) -//│ Def(6, is_empty, [l$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$16) = head_opt(l$1) in -- #77 -//│ let* (x$17) = is_none(x$16) in -- #76 -//│ x$17 -- #75 -//│ ) -//│ Def(7, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$18) = mk_list(10) in -- #86 -//│ let* (x$19) = is_empty(x$18) in -- #85 -//│ x$19 -- #84 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #92 +//│ def apply1(x0$0) = +//│ 0 -- #88 +//│ def apply0() = +//│ 0 -- #87 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #91 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #90 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #89 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def mk_list(n$0) = +//│ let x$1 = ==(n$0,0) in -- #32 +//│ if x$1 -- #31 +//│ true => +//│ let x$3 = Nil() in -- #12 +//│ jump j$0(x$3) -- #11 +//│ false => +//│ let x$4 = -(n$0,1) in -- #30 +//│ let* (x$5) = mk_list(x$4) in -- #29 +//│ let x$6 = Cons(n$0,x$5) in -- #28 +//│ jump j$0(x$6) -- #27 +//│ def j$0(x$2) = +//│ x$2 -- #9 +//│ def head_opt(l$0) = +//│ case l$0 of -- #54 +//│ Nil => +//│ let x$8 = None() in -- #37 +//│ jump j$1(x$8) -- #36 +//│ Cons => +//│ let x$9 = Cons.t(l$0) in -- #53 +//│ let x$10 = Cons.h(l$0) in -- #52 +//│ let x$11 = Some(x$10) in -- #51 +//│ jump j$1(x$11) -- #50 +//│ def j$1(x$7) = +//│ x$7 -- #34 +//│ def is_none(o$0) = +//│ case o$0 of -- #68 +//│ None => +//│ let x$13 = True() in -- #59 +//│ jump j$2(x$13) -- #58 +//│ Some => +//│ let x$14 = Some.x(o$0) in -- #67 +//│ let x$15 = False() in -- #66 +//│ jump j$2(x$15) -- #65 +//│ def j$2(x$12) = +//│ x$12 -- #56 +//│ def is_empty(l$1) = +//│ let* (x$16) = head_opt(l$1) in -- #77 +//│ let* (x$17) = is_none(x$16) in -- #76 +//│ x$17 -- #75 +//│ def main() = +//│ let* (x$18) = mk_list(10) in -- #86 +//│ let* (x$19) = is_empty(x$18) in -- #85 +//│ x$19 -- #84 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(13, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #92 -//│ ), -//│ apply1 -> Def(9, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #88 -//│ ), -//│ apply0 -> Def(8, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #87 -//│ ), -//│ apply4 -> Def(12, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #91 -//│ ), -//│ apply3 -> Def(11, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #90 -//│ ), -//│ apply2 -> Def(10, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #89 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, List, [], parents: , methods: -//│ ), -//│ ClassInfo(10, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(11, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(12, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(13, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(14, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, mk_list, [n$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = ==(n$0,0) in -- #32 -//│ if x$1 -- #31 -//│ true => -//│ let x$3 = Nil() in -- #12 -//│ jump j$0(x$3) -- #11 -//│ false => -//│ let x$4 = -(n$0,1) in -- #30 -//│ let* (x$5) = mk_list(x$4) in -- #29 -//│ let x$6 = Cons(n$0,x$5) in -- #28 -//│ jump j$0(x$6) -- #27 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #9 -//│ ) -//│ Def(2, head_opt, [l$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case l$0 of -- #54 -//│ Nil => -//│ let x$8 = None() in -- #37 -//│ jump j$1(x$8) -- #36 -//│ Cons => -//│ let x$9 = Cons.t(l$0) in -- #53 -//│ let x$10 = Cons.h(l$0) in -- #52 -//│ let x$11 = Some(x$10) in -- #51 -//│ jump j$1(x$11) -- #50 -//│ ) -//│ Def(3, j$1, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #34 -//│ ) -//│ Def(4, is_none, [o$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case o$0 of -- #68 -//│ None => -//│ let x$13 = True() in -- #59 -//│ jump j$2(x$13) -- #58 -//│ Some => -//│ let x$14 = Some.x(o$0) in -- #67 -//│ let x$15 = False() in -- #66 -//│ jump j$2(x$15) -- #65 -//│ ) -//│ Def(5, j$2, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$12 -- #56 -//│ ) -//│ Def(6, is_empty, [l$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$16) = head_opt(l$1) in -- #77 -//│ let* (x$17) = is_none(x$16) in -- #76 -//│ x$17 -- #75 -//│ ) -//│ Def(7, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$18) = mk_list(10) in -- #86 -//│ let* (x$19) = is_empty(x$18) in -- #85 -//│ x$19 -- #84 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #92 +//│ def apply1(x0$0) = +//│ 0 -- #88 +//│ def apply0() = +//│ 0 -- #87 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #91 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #90 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #89 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def mk_list(n$0) = +//│ let x$1 = ==(n$0,0) in -- #32 +//│ if x$1 -- #31 +//│ true => +//│ let x$3 = Nil() in -- #12 +//│ jump j$0(x$3) -- #11 +//│ false => +//│ let x$4 = -(n$0,1) in -- #30 +//│ let* (x$5) = mk_list(x$4) in -- #29 +//│ let x$6 = Cons(n$0,x$5) in -- #28 +//│ jump j$0(x$6) -- #27 +//│ def j$0(x$2) = +//│ x$2 -- #9 +//│ def head_opt(l$0) = +//│ case l$0 of -- #54 +//│ Nil => +//│ let x$8 = None() in -- #37 +//│ jump j$1(x$8) -- #36 +//│ Cons => +//│ let x$9 = Cons.t(l$0) in -- #53 +//│ let x$10 = Cons.h(l$0) in -- #52 +//│ let x$11 = Some(x$10) in -- #51 +//│ jump j$1(x$11) -- #50 +//│ def j$1(x$7) = +//│ x$7 -- #34 +//│ def is_none(o$0) = +//│ case o$0 of -- #68 +//│ None => +//│ let x$13 = True() in -- #59 +//│ jump j$2(x$13) -- #58 +//│ Some => +//│ let x$14 = Some.x(o$0) in -- #67 +//│ let x$15 = False() in -- #66 +//│ jump j$2(x$15) -- #65 +//│ def j$2(x$12) = +//│ x$12 -- #56 +//│ def is_empty(l$1) = +//│ let* (x$16) = head_opt(l$1) in -- #77 +//│ let* (x$17) = is_none(x$16) in -- #76 +//│ x$17 -- #75 +//│ def main() = +//│ let* (x$18) = mk_list(10) in -- #86 +//│ let* (x$19) = is_empty(x$18) in -- #85 +//│ x$19 -- #84 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ False() @@ -3345,292 +1765,146 @@ main() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(11, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #89 -//│ ), -//│ apply1 -> Def(7, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #85 -//│ ), -//│ apply0 -> Def(6, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #84 -//│ ), -//│ apply4 -> Def(10, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #88 -//│ ), -//│ apply3 -> Def(9, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #87 -//│ ), -//│ apply2 -> Def(8, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #86 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, List, [], parents: , methods: -//│ ), -//│ ClassInfo(10, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(11, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(12, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(13, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(14, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, mk_list, [n$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = ==(n$0,0) in -- #32 -//│ if x$1 -- #31 -//│ true => -//│ let x$3 = Nil() in -- #12 -//│ jump j$0(x$3) -- #11 -//│ false => -//│ let x$4 = -(n$0,1) in -- #30 -//│ let* (x$5) = mk_list(x$4) in -- #29 -//│ let x$6 = Cons(n$0,x$5) in -- #28 -//│ jump j$0(x$6) -- #27 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #9 -//│ ) -//│ Def(2, last_opt, [l$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case l$0 of -- #74 -//│ Nil => -//│ let x$8 = None() in -- #37 -//│ jump j$1(x$8) -- #36 -//│ Cons => -//│ let x$9 = Cons.t(l$0) in -- #73 -//│ let x$10 = Cons.h(l$0) in -- #72 -//│ case x$9 of -- #71 +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #89 +//│ def apply1(x0$0) = +//│ 0 -- #85 +//│ def apply0() = +//│ 0 -- #84 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #88 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #87 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #86 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def mk_list(n$0) = +//│ let x$1 = ==(n$0,0) in -- #32 +//│ if x$1 -- #31 +//│ true => +//│ let x$3 = Nil() in -- #12 +//│ jump j$0(x$3) -- #11 +//│ false => +//│ let x$4 = -(n$0,1) in -- #30 +//│ let* (x$5) = mk_list(x$4) in -- #29 +//│ let x$6 = Cons(n$0,x$5) in -- #28 +//│ jump j$0(x$6) -- #27 +//│ def j$0(x$2) = +//│ x$2 -- #9 +//│ def last_opt(l$0) = +//│ case l$0 of -- #74 //│ Nil => -//│ let x$12 = Some(x$10) in -- #54 -//│ jump j$2(x$12) -- #53 +//│ let x$8 = None() in -- #37 +//│ jump j$1(x$8) -- #36 //│ Cons => -//│ let x$13 = Cons.t(x$9) in -- #70 -//│ let x$14 = Cons.h(x$9) in -- #69 -//│ let* (x$15) = last_opt(x$9) in -- #68 -//│ jump j$2(x$15) -- #67 -//│ ) -//│ Def(3, j$1, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #34 -//│ ) -//│ Def(4, j$2, [x$11], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$1(x$11) -- #48 -//│ ) -//│ Def(5, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$16) = mk_list(10) in -- #83 -//│ let* (x$17) = last_opt(x$16) in -- #82 -//│ x$17 -- #81 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ let x$9 = Cons.t(l$0) in -- #73 +//│ let x$10 = Cons.h(l$0) in -- #72 +//│ case x$9 of -- #71 +//│ Nil => +//│ let x$12 = Some(x$10) in -- #54 +//│ jump j$2(x$12) -- #53 +//│ Cons => +//│ let x$13 = Cons.t(x$9) in -- #70 +//│ let x$14 = Cons.h(x$9) in -- #69 +//│ let* (x$15) = last_opt(x$9) in -- #68 +//│ jump j$2(x$15) -- #67 +//│ def j$1(x$7) = +//│ x$7 -- #34 +//│ def j$2(x$11) = +//│ jump j$1(x$11) -- #48 +//│ def main() = +//│ let* (x$16) = mk_list(10) in -- #83 +//│ let* (x$17) = last_opt(x$16) in -- #82 +//│ x$17 -- #81 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(11, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #89 -//│ ), -//│ apply1 -> Def(7, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #85 -//│ ), -//│ apply0 -> Def(6, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #84 -//│ ), -//│ apply4 -> Def(10, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #88 -//│ ), -//│ apply3 -> Def(9, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #87 -//│ ), -//│ apply2 -> Def(8, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #86 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, List, [], parents: , methods: -//│ ), -//│ ClassInfo(10, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(11, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(12, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(13, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(14, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, mk_list, [n$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = ==(n$0,0) in -- #32 -//│ if x$1 -- #31 -//│ true => -//│ let x$3 = Nil() in -- #12 -//│ jump j$0(x$3) -- #11 -//│ false => -//│ let x$4 = -(n$0,1) in -- #30 -//│ let* (x$5) = mk_list(x$4) in -- #29 -//│ let x$6 = Cons(n$0,x$5) in -- #28 -//│ jump j$0(x$6) -- #27 -//│ ) -//│ Def(1, j$0, [x$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$2 -- #9 -//│ ) -//│ Def(2, last_opt, [l$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case l$0 of -- #74 -//│ Nil => -//│ let x$8 = None() in -- #37 -//│ jump j$1(x$8) -- #36 -//│ Cons => -//│ let x$9 = Cons.t(l$0) in -- #73 -//│ let x$10 = Cons.h(l$0) in -- #72 -//│ case x$9 of -- #71 +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #89 +//│ def apply1(x0$0) = +//│ 0 -- #85 +//│ def apply0() = +//│ 0 -- #84 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #88 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #87 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #86 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def mk_list(n$0) = +//│ let x$1 = ==(n$0,0) in -- #32 +//│ if x$1 -- #31 +//│ true => +//│ let x$3 = Nil() in -- #12 +//│ jump j$0(x$3) -- #11 +//│ false => +//│ let x$4 = -(n$0,1) in -- #30 +//│ let* (x$5) = mk_list(x$4) in -- #29 +//│ let x$6 = Cons(n$0,x$5) in -- #28 +//│ jump j$0(x$6) -- #27 +//│ def j$0(x$2) = +//│ x$2 -- #9 +//│ def last_opt(l$0) = +//│ case l$0 of -- #74 //│ Nil => -//│ let x$12 = Some(x$10) in -- #54 -//│ jump j$2(x$12) -- #53 +//│ let x$8 = None() in -- #37 +//│ jump j$1(x$8) -- #36 //│ Cons => -//│ let x$13 = Cons.t(x$9) in -- #70 -//│ let x$14 = Cons.h(x$9) in -- #69 -//│ let* (x$15) = last_opt(x$9) in -- #68 -//│ jump j$2(x$15) -- #67 -//│ ) -//│ Def(3, j$1, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #34 -//│ ) -//│ Def(4, j$2, [x$11], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$1(x$11) -- #48 -//│ ) -//│ Def(5, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$16) = mk_list(10) in -- #83 -//│ let* (x$17) = last_opt(x$16) in -- #82 -//│ x$17 -- #81 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ let x$9 = Cons.t(l$0) in -- #73 +//│ let x$10 = Cons.h(l$0) in -- #72 +//│ case x$9 of -- #71 +//│ Nil => +//│ let x$12 = Some(x$10) in -- #54 +//│ jump j$2(x$12) -- #53 +//│ Cons => +//│ let x$13 = Cons.t(x$9) in -- #70 +//│ let x$14 = Cons.h(x$9) in -- #69 +//│ let* (x$15) = last_opt(x$9) in -- #68 +//│ jump j$2(x$15) -- #67 +//│ def j$1(x$7) = +//│ x$7 -- #34 +//│ def j$2(x$11) = +//│ jump j$1(x$11) -- #48 +//│ def main() = +//│ let* (x$16) = mk_list(10) in -- #83 +//│ let* (x$17) = last_opt(x$16) in -- #82 +//│ x$17 -- #81 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ Some(1) @@ -3675,388 +1949,202 @@ main() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(15, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #193 -//│ ), -//│ apply1 -> Def(11, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #189 -//│ ), -//│ apply0 -> Def(10, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #188 -//│ ), -//│ apply4 -> Def(14, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #192 -//│ ), -//│ apply3 -> Def(13, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #191 -//│ ), -//│ apply2 -> Def(12, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #190 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, List, [], parents: , methods: -//│ ), -//│ ClassInfo(10, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(11, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(12, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(13, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(14, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, is_some, [o$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case o$0 of -- #16 -//│ Some => -//│ let x$2 = Some.x(o$0) in -- #12 -//│ let x$3 = True() in -- #11 -//│ jump j$0(x$3) -- #10 -//│ None => -//│ let x$4 = False() in -- #15 -//│ jump j$0(x$4) -- #14 -//│ ) -//│ Def(1, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$1 -- #4 -//│ ) -//│ Def(2, e0, [w$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$5 = +(w$0,8) in -- #35 -//│ let x$6 = +(x$5,9) in -- #34 -//│ let x$7 = +(x$6,10) in -- #33 -//│ x$7 -- #32 -//│ ) -//│ Def(3, e1, [a$0,c$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$8 = +(a$0,1) in -- #60 -//│ let x$9 = +(x$8,2) in -- #59 -//│ let x$10 = +(x$9,3) in -- #58 -//│ let x$11 = +(x$10,4) in -- #57 -//│ x$11 -- #56 -//│ ) -//│ Def(4, e3, [c$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$12 = 4 in -- #111 -//│ let x$13 = 5 in -- #110 -//│ let x$14 = 6 in -- #109 -//│ let x$15 = 7 in -- #108 -//│ if c$1 -- #107 -//│ true => -//│ let x$17 = +(x$12,x$13) in -- #86 -//│ let x$18 = +(x$17,x$14) in -- #85 -//│ let x$19 = +(x$18,x$15) in -- #84 -//│ jump j$1(x$19) -- #83 -//│ false => -//│ let x$20 = +(x$12,x$13) in -- #106 -//│ let x$21 = -(x$20,x$14) in -- #105 -//│ let x$22 = +(x$21,x$15) in -- #104 -//│ jump j$1(x$22) -- #103 -//│ ) -//│ Def(5, j$1, [x$16], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$16 -- #66 -//│ ) -//│ Def(6, e2, [x$23], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$24 = +(x$23,12) in -- #130 -//│ let x$25 = +(x$24,13) in -- #129 -//│ let x$26 = +(x$25,14) in -- #128 -//│ x$26 -- #127 -//│ ) -//│ Def(7, f, [x$27], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$28) = is_some(x$27) in -- #167 -//│ let* (x$29) = e3(x$28) in -- #166 -//│ case x$27 of -- #165 -//│ Some => -//│ let x$32 = Some.x(x$27) in -- #158 -//│ let* (x$33) = e1(x$32,x$29) in -- #157 -//│ jump j$2(x$33) -- #156 -//│ None => -//│ let* (x$34) = e2(x$29) in -- #164 -//│ jump j$2(x$34) -- #163 -//│ ) -//│ Def(8, j$2, [x$30], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$31) = e0(x$30) in -- #145 -//│ x$31 -- #144 -//│ ) -//│ Def(9, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$35 = Some(2) in -- #187 -//│ let* (x$36) = f(x$35) in -- #186 -//│ let x$37 = None() in -- #185 -//│ let* (x$38) = f(x$37) in -- #184 -//│ let x$39 = +(x$36,x$38) in -- #183 -//│ x$39 -- #182 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #193 +//│ def apply1(x0$0) = +//│ 0 -- #189 +//│ def apply0() = +//│ 0 -- #188 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #192 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #191 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #190 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def is_some(o$0) = +//│ case o$0 of -- #16 +//│ Some => +//│ let x$2 = Some.x(o$0) in -- #12 +//│ let x$3 = True() in -- #11 +//│ jump j$0(x$3) -- #10 +//│ None => +//│ let x$4 = False() in -- #15 +//│ jump j$0(x$4) -- #14 +//│ def j$0(x$1) = +//│ x$1 -- #4 +//│ def e0(w$0) = +//│ let x$5 = +(w$0,8) in -- #35 +//│ let x$6 = +(x$5,9) in -- #34 +//│ let x$7 = +(x$6,10) in -- #33 +//│ x$7 -- #32 +//│ def e1(a$0,c$0) = +//│ let x$8 = +(a$0,1) in -- #60 +//│ let x$9 = +(x$8,2) in -- #59 +//│ let x$10 = +(x$9,3) in -- #58 +//│ let x$11 = +(x$10,4) in -- #57 +//│ x$11 -- #56 +//│ def e3(c$1) = +//│ let x$12 = 4 in -- #111 +//│ let x$13 = 5 in -- #110 +//│ let x$14 = 6 in -- #109 +//│ let x$15 = 7 in -- #108 +//│ if c$1 -- #107 +//│ true => +//│ let x$17 = +(x$12,x$13) in -- #86 +//│ let x$18 = +(x$17,x$14) in -- #85 +//│ let x$19 = +(x$18,x$15) in -- #84 +//│ jump j$1(x$19) -- #83 +//│ false => +//│ let x$20 = +(x$12,x$13) in -- #106 +//│ let x$21 = -(x$20,x$14) in -- #105 +//│ let x$22 = +(x$21,x$15) in -- #104 +//│ jump j$1(x$22) -- #103 +//│ def j$1(x$16) = +//│ x$16 -- #66 +//│ def e2(x$23) = +//│ let x$24 = +(x$23,12) in -- #130 +//│ let x$25 = +(x$24,13) in -- #129 +//│ let x$26 = +(x$25,14) in -- #128 +//│ x$26 -- #127 +//│ def f(x$27) = +//│ let* (x$28) = is_some(x$27) in -- #167 +//│ let* (x$29) = e3(x$28) in -- #166 +//│ case x$27 of -- #165 +//│ Some => +//│ let x$32 = Some.x(x$27) in -- #158 +//│ let* (x$33) = e1(x$32,x$29) in -- #157 +//│ jump j$2(x$33) -- #156 +//│ None => +//│ let* (x$34) = e2(x$29) in -- #164 +//│ jump j$2(x$34) -- #163 +//│ def j$2(x$30) = +//│ let* (x$31) = e0(x$30) in -- #145 +//│ x$31 -- #144 +//│ def main() = +//│ let x$35 = Some(2) in -- #187 +//│ let* (x$36) = f(x$35) in -- #186 +//│ let x$37 = None() in -- #185 +//│ let* (x$38) = f(x$37) in -- #184 +//│ let x$39 = +(x$36,x$38) in -- #183 +//│ x$39 -- #182 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(15, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #193 -//│ ), -//│ apply1 -> Def(11, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #189 -//│ ), -//│ apply0 -> Def(10, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #188 -//│ ), -//│ apply4 -> Def(14, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #192 -//│ ), -//│ apply3 -> Def(13, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #191 -//│ ), -//│ apply2 -> Def(12, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #190 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, List, [], parents: , methods: -//│ ), -//│ ClassInfo(10, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(11, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(12, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(13, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(14, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, is_some, [o$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case o$0 of -- #16 -//│ Some => -//│ let x$2 = Some.x(o$0) in -- #12 -//│ let x$3 = True() in -- #11 -//│ jump j$0(x$3) -- #10 -//│ None => -//│ let x$4 = False() in -- #15 -//│ jump j$0(x$4) -- #14 -//│ ) -//│ Def(1, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$1 -- #4 -//│ ) -//│ Def(2, e0, [w$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$5 = +(w$0,8) in -- #35 -//│ let x$6 = +(x$5,9) in -- #34 -//│ let x$7 = +(x$6,10) in -- #33 -//│ x$7 -- #32 -//│ ) -//│ Def(3, e1, [a$0,c$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$8 = +(a$0,1) in -- #60 -//│ let x$9 = +(x$8,2) in -- #59 -//│ let x$10 = +(x$9,3) in -- #58 -//│ let x$11 = +(x$10,4) in -- #57 -//│ x$11 -- #56 -//│ ) -//│ Def(4, e3, [c$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$12 = 4 in -- #111 -//│ let x$13 = 5 in -- #110 -//│ let x$14 = 6 in -- #109 -//│ let x$15 = 7 in -- #108 -//│ if c$1 -- #107 -//│ true => -//│ let x$17 = +(x$12,x$13) in -- #86 -//│ let x$18 = +(x$17,x$14) in -- #85 -//│ let x$19 = +(x$18,x$15) in -- #84 -//│ jump j$1(x$19) -- #83 -//│ false => -//│ let x$20 = +(x$12,x$13) in -- #106 -//│ let x$21 = -(x$20,x$14) in -- #105 -//│ let x$22 = +(x$21,x$15) in -- #104 -//│ jump j$1(x$22) -- #103 -//│ ) -//│ Def(5, j$1, [x$16], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$16 -- #66 -//│ ) -//│ Def(6, e2, [x$23], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$24 = +(x$23,12) in -- #130 -//│ let x$25 = +(x$24,13) in -- #129 -//│ let x$26 = +(x$25,14) in -- #128 -//│ x$26 -- #127 -//│ ) -//│ Def(7, f, [x$27], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$28) = is_some(x$27) in -- #167 -//│ let* (x$29) = e3(x$28) in -- #166 -//│ case x$27 of -- #165 -//│ Some => -//│ let x$32 = Some.x(x$27) in -- #158 -//│ let* (x$33) = e1(x$32,x$29) in -- #157 -//│ jump j$2(x$33) -- #156 -//│ None => -//│ let* (x$34) = e2(x$29) in -- #164 -//│ jump j$2(x$34) -- #163 -//│ ) -//│ Def(8, j$2, [x$30], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$31) = e0(x$30) in -- #145 -//│ x$31 -- #144 -//│ ) -//│ Def(9, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$35 = Some(2) in -- #187 -//│ let* (x$36) = f(x$35) in -- #186 -//│ let x$37 = None() in -- #185 -//│ let* (x$38) = f(x$37) in -- #184 -//│ let x$39 = +(x$36,x$38) in -- #183 -//│ x$39 -- #182 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #193 +//│ def apply1(x0$0) = +//│ 0 -- #189 +//│ def apply0() = +//│ 0 -- #188 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #192 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #191 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #190 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def is_some(o$0) = +//│ case o$0 of -- #16 +//│ Some => +//│ let x$2 = Some.x(o$0) in -- #12 +//│ let x$3 = True() in -- #11 +//│ jump j$0(x$3) -- #10 +//│ None => +//│ let x$4 = False() in -- #15 +//│ jump j$0(x$4) -- #14 +//│ def j$0(x$1) = +//│ x$1 -- #4 +//│ def e0(w$0) = +//│ let x$5 = +(w$0,8) in -- #35 +//│ let x$6 = +(x$5,9) in -- #34 +//│ let x$7 = +(x$6,10) in -- #33 +//│ x$7 -- #32 +//│ def e1(a$0,c$0) = +//│ let x$8 = +(a$0,1) in -- #60 +//│ let x$9 = +(x$8,2) in -- #59 +//│ let x$10 = +(x$9,3) in -- #58 +//│ let x$11 = +(x$10,4) in -- #57 +//│ x$11 -- #56 +//│ def e3(c$1) = +//│ let x$12 = 4 in -- #111 +//│ let x$13 = 5 in -- #110 +//│ let x$14 = 6 in -- #109 +//│ let x$15 = 7 in -- #108 +//│ if c$1 -- #107 +//│ true => +//│ let x$17 = +(x$12,x$13) in -- #86 +//│ let x$18 = +(x$17,x$14) in -- #85 +//│ let x$19 = +(x$18,x$15) in -- #84 +//│ jump j$1(x$19) -- #83 +//│ false => +//│ let x$20 = +(x$12,x$13) in -- #106 +//│ let x$21 = -(x$20,x$14) in -- #105 +//│ let x$22 = +(x$21,x$15) in -- #104 +//│ jump j$1(x$22) -- #103 +//│ def j$1(x$16) = +//│ x$16 -- #66 +//│ def e2(x$23) = +//│ let x$24 = +(x$23,12) in -- #130 +//│ let x$25 = +(x$24,13) in -- #129 +//│ let x$26 = +(x$25,14) in -- #128 +//│ x$26 -- #127 +//│ def f(x$27) = +//│ let* (x$28) = is_some(x$27) in -- #167 +//│ let* (x$29) = e3(x$28) in -- #166 +//│ case x$27 of -- #165 +//│ Some => +//│ let x$32 = Some.x(x$27) in -- #158 +//│ let* (x$33) = e1(x$32,x$29) in -- #157 +//│ jump j$2(x$33) -- #156 +//│ None => +//│ let* (x$34) = e2(x$29) in -- #164 +//│ jump j$2(x$34) -- #163 +//│ def j$2(x$30) = +//│ let* (x$31) = e0(x$30) in -- #145 +//│ x$31 -- #144 +//│ def main() = +//│ let x$35 = Some(2) in -- #187 +//│ let* (x$36) = f(x$35) in -- #186 +//│ let x$37 = None() in -- #185 +//│ let* (x$38) = f(x$37) in -- #184 +//│ let x$39 = +(x$36,x$38) in -- #183 +//│ x$39 -- #182 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 115 @@ -4101,410 +2189,214 @@ main() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(16, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #195 -//│ ), -//│ apply1 -> Def(12, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #191 -//│ ), -//│ apply0 -> Def(11, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #190 -//│ ), -//│ apply4 -> Def(15, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #194 -//│ ), -//│ apply3 -> Def(14, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #193 -//│ ), -//│ apply2 -> Def(13, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #192 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, List, [], parents: , methods: -//│ ), -//│ ClassInfo(10, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(11, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(12, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(13, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(14, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, is_some, [o$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case o$0 of -- #16 -//│ Some => -//│ let x$2 = Some.x(o$0) in -- #12 -//│ let x$3 = True() in -- #11 -//│ jump j$0(x$3) -- #10 -//│ None => -//│ let x$4 = False() in -- #15 -//│ jump j$0(x$4) -- #14 -//│ ) -//│ Def(1, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$1 -- #4 -//│ ) -//│ Def(2, e0, [w$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$5 = +(w$0,8) in -- #35 -//│ let x$6 = +(x$5,9) in -- #34 -//│ let x$7 = +(x$6,10) in -- #33 -//│ x$7 -- #32 -//│ ) -//│ Def(3, e1, [a$0,z$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$8 = >(a$0,0) in -- #62 -//│ if x$8 -- #61 -//│ true => -//│ let x$10 = -(a$0,1) in -- #58 -//│ let x$11 = Some(x$10) in -- #57 -//│ let* (x$12) = f(x$11) in -- #56 -//│ jump j$1(x$12) -- #55 -//│ false => -//│ jump j$1(z$0) -- #60 -//│ ) -//│ Def(4, j$1, [x$9], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$9 -- #42 -//│ ) -//│ Def(5, e3, [c$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$13 = 4 in -- #113 -//│ let x$14 = 5 in -- #112 -//│ let x$15 = 6 in -- #111 -//│ let x$16 = 7 in -- #110 -//│ if c$0 -- #109 -//│ true => -//│ let x$18 = +(x$13,x$14) in -- #88 -//│ let x$19 = +(x$18,x$15) in -- #87 -//│ let x$20 = +(x$19,x$16) in -- #86 -//│ jump j$2(x$20) -- #85 -//│ false => -//│ let x$21 = +(x$13,x$14) in -- #108 -//│ let x$22 = -(x$21,x$15) in -- #107 -//│ let x$23 = +(x$22,x$16) in -- #106 -//│ jump j$2(x$23) -- #105 -//│ ) -//│ Def(6, j$2, [x$17], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$17 -- #68 -//│ ) -//│ Def(7, e2, [x$24], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$25 = +(x$24,12) in -- #132 -//│ let x$26 = +(x$25,13) in -- #131 -//│ let x$27 = +(x$26,14) in -- #130 -//│ x$27 -- #129 -//│ ) -//│ Def(8, f, [x$28], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$29) = is_some(x$28) in -- #169 -//│ let* (x$30) = e3(x$29) in -- #168 -//│ case x$28 of -- #167 -//│ Some => -//│ let x$33 = Some.x(x$28) in -- #160 -//│ let* (x$34) = e1(x$33,x$30) in -- #159 -//│ jump j$3(x$34) -- #158 -//│ None => -//│ let* (x$35) = e2(x$30) in -- #166 -//│ jump j$3(x$35) -- #165 -//│ ) -//│ Def(9, j$3, [x$31], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$32) = e0(x$31) in -- #147 -//│ x$32 -- #146 -//│ ) -//│ Def(10, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$36 = Some(2) in -- #189 -//│ let* (x$37) = f(x$36) in -- #188 -//│ let x$38 = None() in -- #187 -//│ let* (x$39) = f(x$38) in -- #186 -//│ let x$40 = +(x$37,x$39) in -- #185 -//│ x$40 -- #184 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #195 +//│ def apply1(x0$0) = +//│ 0 -- #191 +//│ def apply0() = +//│ 0 -- #190 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #194 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #193 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #192 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def is_some(o$0) = +//│ case o$0 of -- #16 +//│ Some => +//│ let x$2 = Some.x(o$0) in -- #12 +//│ let x$3 = True() in -- #11 +//│ jump j$0(x$3) -- #10 +//│ None => +//│ let x$4 = False() in -- #15 +//│ jump j$0(x$4) -- #14 +//│ def j$0(x$1) = +//│ x$1 -- #4 +//│ def e0(w$0) = +//│ let x$5 = +(w$0,8) in -- #35 +//│ let x$6 = +(x$5,9) in -- #34 +//│ let x$7 = +(x$6,10) in -- #33 +//│ x$7 -- #32 +//│ def e1(a$0,z$0) = +//│ let x$8 = >(a$0,0) in -- #62 +//│ if x$8 -- #61 +//│ true => +//│ let x$10 = -(a$0,1) in -- #58 +//│ let x$11 = Some(x$10) in -- #57 +//│ let* (x$12) = f(x$11) in -- #56 +//│ jump j$1(x$12) -- #55 +//│ false => +//│ jump j$1(z$0) -- #60 +//│ def j$1(x$9) = +//│ x$9 -- #42 +//│ def e3(c$0) = +//│ let x$13 = 4 in -- #113 +//│ let x$14 = 5 in -- #112 +//│ let x$15 = 6 in -- #111 +//│ let x$16 = 7 in -- #110 +//│ if c$0 -- #109 +//│ true => +//│ let x$18 = +(x$13,x$14) in -- #88 +//│ let x$19 = +(x$18,x$15) in -- #87 +//│ let x$20 = +(x$19,x$16) in -- #86 +//│ jump j$2(x$20) -- #85 +//│ false => +//│ let x$21 = +(x$13,x$14) in -- #108 +//│ let x$22 = -(x$21,x$15) in -- #107 +//│ let x$23 = +(x$22,x$16) in -- #106 +//│ jump j$2(x$23) -- #105 +//│ def j$2(x$17) = +//│ x$17 -- #68 +//│ def e2(x$24) = +//│ let x$25 = +(x$24,12) in -- #132 +//│ let x$26 = +(x$25,13) in -- #131 +//│ let x$27 = +(x$26,14) in -- #130 +//│ x$27 -- #129 +//│ def f(x$28) = +//│ let* (x$29) = is_some(x$28) in -- #169 +//│ let* (x$30) = e3(x$29) in -- #168 +//│ case x$28 of -- #167 +//│ Some => +//│ let x$33 = Some.x(x$28) in -- #160 +//│ let* (x$34) = e1(x$33,x$30) in -- #159 +//│ jump j$3(x$34) -- #158 +//│ None => +//│ let* (x$35) = e2(x$30) in -- #166 +//│ jump j$3(x$35) -- #165 +//│ def j$3(x$31) = +//│ let* (x$32) = e0(x$31) in -- #147 +//│ x$32 -- #146 +//│ def main() = +//│ let x$36 = Some(2) in -- #189 +//│ let* (x$37) = f(x$36) in -- #188 +//│ let x$38 = None() in -- #187 +//│ let* (x$39) = f(x$38) in -- #186 +//│ let x$40 = +(x$37,x$39) in -- #185 +//│ x$40 -- #184 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(16, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #195 -//│ ), -//│ apply1 -> Def(12, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #191 -//│ ), -//│ apply0 -> Def(11, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #190 -//│ ), -//│ apply4 -> Def(15, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #194 -//│ ), -//│ apply3 -> Def(14, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #193 -//│ ), -//│ apply2 -> Def(13, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #192 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, List, [], parents: , methods: -//│ ), -//│ ClassInfo(10, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(11, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(12, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(13, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(14, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, is_some, [o$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case o$0 of -- #16 -//│ Some => -//│ let x$2 = Some.x(o$0) in -- #12 -//│ let x$3 = True() in -- #11 -//│ jump j$0(x$3) -- #10 -//│ None => -//│ let x$4 = False() in -- #15 -//│ jump j$0(x$4) -- #14 -//│ ) -//│ Def(1, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$1 -- #4 -//│ ) -//│ Def(2, e0, [w$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$5 = +(w$0,8) in -- #35 -//│ let x$6 = +(x$5,9) in -- #34 -//│ let x$7 = +(x$6,10) in -- #33 -//│ x$7 -- #32 -//│ ) -//│ Def(3, e1, [a$0,z$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$8 = >(a$0,0) in -- #62 -//│ if x$8 -- #61 -//│ true => -//│ let x$10 = -(a$0,1) in -- #58 -//│ let x$11 = Some(x$10) in -- #57 -//│ let* (x$12) = f(x$11) in -- #56 -//│ jump j$1(x$12) -- #55 -//│ false => -//│ jump j$1(z$0) -- #60 -//│ ) -//│ Def(4, j$1, [x$9], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$9 -- #42 -//│ ) -//│ Def(5, e3, [c$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$13 = 4 in -- #113 -//│ let x$14 = 5 in -- #112 -//│ let x$15 = 6 in -- #111 -//│ let x$16 = 7 in -- #110 -//│ if c$0 -- #109 -//│ true => -//│ let x$18 = +(x$13,x$14) in -- #88 -//│ let x$19 = +(x$18,x$15) in -- #87 -//│ let x$20 = +(x$19,x$16) in -- #86 -//│ jump j$2(x$20) -- #85 -//│ false => -//│ let x$21 = +(x$13,x$14) in -- #108 -//│ let x$22 = -(x$21,x$15) in -- #107 -//│ let x$23 = +(x$22,x$16) in -- #106 -//│ jump j$2(x$23) -- #105 -//│ ) -//│ Def(6, j$2, [x$17], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$17 -- #68 -//│ ) -//│ Def(7, e2, [x$24], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$25 = +(x$24,12) in -- #132 -//│ let x$26 = +(x$25,13) in -- #131 -//│ let x$27 = +(x$26,14) in -- #130 -//│ x$27 -- #129 -//│ ) -//│ Def(8, f, [x$28], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$29) = is_some(x$28) in -- #169 -//│ let* (x$30) = e3(x$29) in -- #168 -//│ case x$28 of -- #167 -//│ Some => -//│ let x$33 = Some.x(x$28) in -- #160 -//│ let* (x$34) = e1(x$33,x$30) in -- #159 -//│ jump j$3(x$34) -- #158 -//│ None => -//│ let* (x$35) = e2(x$30) in -- #166 -//│ jump j$3(x$35) -- #165 -//│ ) -//│ Def(9, j$3, [x$31], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$32) = e0(x$31) in -- #147 -//│ x$32 -- #146 -//│ ) -//│ Def(10, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$36 = Some(2) in -- #189 -//│ let* (x$37) = f(x$36) in -- #188 -//│ let x$38 = None() in -- #187 -//│ let* (x$39) = f(x$38) in -- #186 -//│ let x$40 = +(x$37,x$39) in -- #185 -//│ x$40 -- #184 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #195 +//│ def apply1(x0$0) = +//│ 0 -- #191 +//│ def apply0() = +//│ 0 -- #190 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #194 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #193 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #192 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def is_some(o$0) = +//│ case o$0 of -- #16 +//│ Some => +//│ let x$2 = Some.x(o$0) in -- #12 +//│ let x$3 = True() in -- #11 +//│ jump j$0(x$3) -- #10 +//│ None => +//│ let x$4 = False() in -- #15 +//│ jump j$0(x$4) -- #14 +//│ def j$0(x$1) = +//│ x$1 -- #4 +//│ def e0(w$0) = +//│ let x$5 = +(w$0,8) in -- #35 +//│ let x$6 = +(x$5,9) in -- #34 +//│ let x$7 = +(x$6,10) in -- #33 +//│ x$7 -- #32 +//│ def e1(a$0,z$0) = +//│ let x$8 = >(a$0,0) in -- #62 +//│ if x$8 -- #61 +//│ true => +//│ let x$10 = -(a$0,1) in -- #58 +//│ let x$11 = Some(x$10) in -- #57 +//│ let* (x$12) = f(x$11) in -- #56 +//│ jump j$1(x$12) -- #55 +//│ false => +//│ jump j$1(z$0) -- #60 +//│ def j$1(x$9) = +//│ x$9 -- #42 +//│ def e3(c$0) = +//│ let x$13 = 4 in -- #113 +//│ let x$14 = 5 in -- #112 +//│ let x$15 = 6 in -- #111 +//│ let x$16 = 7 in -- #110 +//│ if c$0 -- #109 +//│ true => +//│ let x$18 = +(x$13,x$14) in -- #88 +//│ let x$19 = +(x$18,x$15) in -- #87 +//│ let x$20 = +(x$19,x$16) in -- #86 +//│ jump j$2(x$20) -- #85 +//│ false => +//│ let x$21 = +(x$13,x$14) in -- #108 +//│ let x$22 = -(x$21,x$15) in -- #107 +//│ let x$23 = +(x$22,x$16) in -- #106 +//│ jump j$2(x$23) -- #105 +//│ def j$2(x$17) = +//│ x$17 -- #68 +//│ def e2(x$24) = +//│ let x$25 = +(x$24,12) in -- #132 +//│ let x$26 = +(x$25,13) in -- #131 +//│ let x$27 = +(x$26,14) in -- #130 +//│ x$27 -- #129 +//│ def f(x$28) = +//│ let* (x$29) = is_some(x$28) in -- #169 +//│ let* (x$30) = e3(x$29) in -- #168 +//│ case x$28 of -- #167 +//│ Some => +//│ let x$33 = Some.x(x$28) in -- #160 +//│ let* (x$34) = e1(x$33,x$30) in -- #159 +//│ jump j$3(x$34) -- #158 +//│ None => +//│ let* (x$35) = e2(x$30) in -- #166 +//│ jump j$3(x$35) -- #165 +//│ def j$3(x$31) = +//│ let* (x$32) = e0(x$31) in -- #147 +//│ x$32 -- #146 +//│ def main() = +//│ let x$36 = Some(2) in -- #189 +//│ let* (x$37) = f(x$36) in -- #188 +//│ let x$38 = None() in -- #187 +//│ let* (x$39) = f(x$38) in -- #186 +//│ let x$40 = +(x$37,x$39) in -- #185 +//│ x$40 -- #184 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 179 @@ -4544,408 +2436,208 @@ main() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(17, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #153 -//│ ), -//│ apply1 -> Def(13, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #149 -//│ ), -//│ apply0 -> Def(12, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #148 -//│ ), -//│ apply4 -> Def(16, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #152 -//│ ), -//│ apply3 -> Def(15, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #151 -//│ ), -//│ apply2 -> Def(14, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #150 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Nat, [], parents: , methods: -//│ ), -//│ ClassInfo(10, S, [x], parents: Nat, methods: -//│ ), -//│ ClassInfo(11, Z, [], parents: Nat, methods: -//│ )}, { -//│ Def(0, pred, [n$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case n$0 of -- #15 -//│ S => -//│ let x$2 = S.x(n$0) in -- #11 -//│ jump j$0(x$2) -- #10 -//│ Z => -//│ let x$3 = Z() in -- #14 -//│ jump j$0(x$3) -- #13 -//│ ) -//│ Def(1, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$1 -- #4 -//│ ) -//│ Def(2, plus, [n1$0,n2$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case n1$0 of -- #37 -//│ Z => -//│ jump j$1(n2$0) -- #19 -//│ S => -//│ let x$5 = S.x(n1$0) in -- #36 -//│ let* (x$6) = plus(x$5,n2$0) in -- #35 -//│ let x$7 = S(x$6) in -- #34 -//│ jump j$1(x$7) -- #33 -//│ ) -//│ Def(3, j$1, [x$4], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$4 -- #17 -//│ ) -//│ Def(4, fib, [n$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case n$1 of -- #84 -//│ Z => -//│ let x$9 = Z() in -- #46 -//│ let x$10 = S(x$9) in -- #45 -//│ jump j$2(x$10) -- #44 -//│ S => -//│ let x$11 = S.x(n$1) in -- #83 -//│ case x$11 of -- #82 +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #153 +//│ def apply1(x0$0) = +//│ 0 -- #149 +//│ def apply0() = +//│ 0 -- #148 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #152 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #151 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #150 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Nat() +//│ class S(x) extends Nat +//│ class Z() extends Nat +//│ def pred(n$0) = +//│ case n$0 of -- #15 +//│ S => +//│ let x$2 = S.x(n$0) in -- #11 +//│ jump j$0(x$2) -- #10 +//│ Z => +//│ let x$3 = Z() in -- #14 +//│ jump j$0(x$3) -- #13 +//│ def j$0(x$1) = +//│ x$1 -- #4 +//│ def plus(n1$0,n2$0) = +//│ case n1$0 of -- #37 +//│ Z => +//│ jump j$1(n2$0) -- #19 +//│ S => +//│ let x$5 = S.x(n1$0) in -- #36 +//│ let* (x$6) = plus(x$5,n2$0) in -- #35 +//│ let x$7 = S(x$6) in -- #34 +//│ jump j$1(x$7) -- #33 +//│ def j$1(x$4) = +//│ x$4 -- #17 +//│ def fib(n$1) = +//│ case n$1 of -- #84 +//│ Z => +//│ let x$9 = Z() in -- #46 +//│ let x$10 = S(x$9) in -- #45 +//│ jump j$2(x$10) -- #44 +//│ S => +//│ let x$11 = S.x(n$1) in -- #83 +//│ case x$11 of -- #82 +//│ Z => +//│ let x$13 = Z() in -- #60 +//│ let x$14 = S(x$13) in -- #59 +//│ jump j$3(x$14) -- #58 +//│ S => +//│ let x$15 = S.x(x$11) in -- #81 +//│ let* (x$16) = fib(x$11) in -- #80 +//│ let* (x$17) = fib(x$15) in -- #79 +//│ let* (x$18) = plus(x$16,x$17) in -- #78 +//│ jump j$3(x$18) -- #77 +//│ def j$2(x$8) = +//│ x$8 -- #39 +//│ def j$3(x$12) = +//│ jump j$2(x$12) -- #53 +//│ def to_int(n$2) = +//│ case n$2 of -- #106 //│ Z => -//│ let x$13 = Z() in -- #60 -//│ let x$14 = S(x$13) in -- #59 -//│ jump j$3(x$14) -- #58 +//│ jump j$4(0) -- #88 //│ S => -//│ let x$15 = S.x(x$11) in -- #81 -//│ let* (x$16) = fib(x$11) in -- #80 -//│ let* (x$17) = fib(x$15) in -- #79 -//│ let* (x$18) = plus(x$16,x$17) in -- #78 -//│ jump j$3(x$18) -- #77 -//│ ) -//│ Def(5, j$2, [x$8], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$8 -- #39 -//│ ) -//│ Def(6, j$3, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$2(x$12) -- #53 -//│ ) -//│ Def(7, to_int, [n$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case n$2 of -- #106 -//│ Z => -//│ jump j$4(0) -- #88 -//│ S => -//│ let x$20 = S.x(n$2) in -- #105 -//│ let* (x$21) = to_int(x$20) in -- #104 -//│ let x$22 = +(1,x$21) in -- #103 -//│ jump j$4(x$22) -- #102 -//│ ) -//│ Def(8, j$4, [x$19], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$19 -- #86 -//│ ) -//│ Def(9, to_nat, [n$3], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$23 = ==(n$3,0) in -- #134 -//│ if x$23 -- #133 -//│ true => -//│ let x$25 = Z() in -- #116 -//│ jump j$5(x$25) -- #115 -//│ false => -//│ let x$26 = -(n$3,1) in -- #132 -//│ let* (x$27) = to_nat(x$26) in -- #131 -//│ let x$28 = S(x$27) in -- #130 -//│ jump j$5(x$28) -- #129 -//│ ) -//│ Def(10, j$5, [x$24], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$24 -- #113 -//│ ) -//│ Def(11, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$29) = to_nat(30) in -- #147 -//│ let* (x$30) = fib(x$29) in -- #146 -//│ let* (x$31) = to_int(x$30) in -- #145 -//│ x$31 -- #144 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ let x$20 = S.x(n$2) in -- #105 +//│ let* (x$21) = to_int(x$20) in -- #104 +//│ let x$22 = +(1,x$21) in -- #103 +//│ jump j$4(x$22) -- #102 +//│ def j$4(x$19) = +//│ x$19 -- #86 +//│ def to_nat(n$3) = +//│ let x$23 = ==(n$3,0) in -- #134 +//│ if x$23 -- #133 +//│ true => +//│ let x$25 = Z() in -- #116 +//│ jump j$5(x$25) -- #115 +//│ false => +//│ let x$26 = -(n$3,1) in -- #132 +//│ let* (x$27) = to_nat(x$26) in -- #131 +//│ let x$28 = S(x$27) in -- #130 +//│ jump j$5(x$28) -- #129 +//│ def j$5(x$24) = +//│ x$24 -- #113 +//│ def main() = +//│ let* (x$29) = to_nat(30) in -- #147 +//│ let* (x$30) = fib(x$29) in -- #146 +//│ let* (x$31) = to_int(x$30) in -- #145 +//│ x$31 -- #144 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(17, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #153 -//│ ), -//│ apply1 -> Def(13, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #149 -//│ ), -//│ apply0 -> Def(12, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #148 -//│ ), -//│ apply4 -> Def(16, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #152 -//│ ), -//│ apply3 -> Def(15, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #151 -//│ ), -//│ apply2 -> Def(14, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #150 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Nat, [], parents: , methods: -//│ ), -//│ ClassInfo(10, S, [x], parents: Nat, methods: -//│ ), -//│ ClassInfo(11, Z, [], parents: Nat, methods: -//│ )}, { -//│ Def(0, pred, [n$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case n$0 of -- #15 -//│ S => -//│ let x$2 = S.x(n$0) in -- #11 -//│ jump j$0(x$2) -- #10 -//│ Z => -//│ let x$3 = Z() in -- #14 -//│ jump j$0(x$3) -- #13 -//│ ) -//│ Def(1, j$0, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$1 -- #4 -//│ ) -//│ Def(2, plus, [n1$0,n2$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case n1$0 of -- #37 -//│ Z => -//│ jump j$1(n2$0) -- #19 -//│ S => -//│ let x$5 = S.x(n1$0) in -- #36 -//│ let* (x$6) = plus(x$5,n2$0) in -- #35 -//│ let x$7 = S(x$6) in -- #34 -//│ jump j$1(x$7) -- #33 -//│ ) -//│ Def(3, j$1, [x$4], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$4 -- #17 -//│ ) -//│ Def(4, fib, [n$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case n$1 of -- #84 -//│ Z => -//│ let x$9 = Z() in -- #46 -//│ let x$10 = S(x$9) in -- #45 -//│ jump j$2(x$10) -- #44 -//│ S => -//│ let x$11 = S.x(n$1) in -- #83 -//│ case x$11 of -- #82 +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #153 +//│ def apply1(x0$0) = +//│ 0 -- #149 +//│ def apply0() = +//│ 0 -- #148 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #152 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #151 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #150 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Nat() +//│ class S(x) extends Nat +//│ class Z() extends Nat +//│ def pred(n$0) = +//│ case n$0 of -- #15 +//│ S => +//│ let x$2 = S.x(n$0) in -- #11 +//│ jump j$0(x$2) -- #10 +//│ Z => +//│ let x$3 = Z() in -- #14 +//│ jump j$0(x$3) -- #13 +//│ def j$0(x$1) = +//│ x$1 -- #4 +//│ def plus(n1$0,n2$0) = +//│ case n1$0 of -- #37 +//│ Z => +//│ jump j$1(n2$0) -- #19 +//│ S => +//│ let x$5 = S.x(n1$0) in -- #36 +//│ let* (x$6) = plus(x$5,n2$0) in -- #35 +//│ let x$7 = S(x$6) in -- #34 +//│ jump j$1(x$7) -- #33 +//│ def j$1(x$4) = +//│ x$4 -- #17 +//│ def fib(n$1) = +//│ case n$1 of -- #84 +//│ Z => +//│ let x$9 = Z() in -- #46 +//│ let x$10 = S(x$9) in -- #45 +//│ jump j$2(x$10) -- #44 +//│ S => +//│ let x$11 = S.x(n$1) in -- #83 +//│ case x$11 of -- #82 +//│ Z => +//│ let x$13 = Z() in -- #60 +//│ let x$14 = S(x$13) in -- #59 +//│ jump j$3(x$14) -- #58 +//│ S => +//│ let x$15 = S.x(x$11) in -- #81 +//│ let* (x$16) = fib(x$11) in -- #80 +//│ let* (x$17) = fib(x$15) in -- #79 +//│ let* (x$18) = plus(x$16,x$17) in -- #78 +//│ jump j$3(x$18) -- #77 +//│ def j$2(x$8) = +//│ x$8 -- #39 +//│ def j$3(x$12) = +//│ jump j$2(x$12) -- #53 +//│ def to_int(n$2) = +//│ case n$2 of -- #106 //│ Z => -//│ let x$13 = Z() in -- #60 -//│ let x$14 = S(x$13) in -- #59 -//│ jump j$3(x$14) -- #58 +//│ jump j$4(0) -- #88 //│ S => -//│ let x$15 = S.x(x$11) in -- #81 -//│ let* (x$16) = fib(x$11) in -- #80 -//│ let* (x$17) = fib(x$15) in -- #79 -//│ let* (x$18) = plus(x$16,x$17) in -- #78 -//│ jump j$3(x$18) -- #77 -//│ ) -//│ Def(5, j$2, [x$8], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$8 -- #39 -//│ ) -//│ Def(6, j$3, [x$12], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$2(x$12) -- #53 -//│ ) -//│ Def(7, to_int, [n$2], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case n$2 of -- #106 -//│ Z => -//│ jump j$4(0) -- #88 -//│ S => -//│ let x$20 = S.x(n$2) in -- #105 -//│ let* (x$21) = to_int(x$20) in -- #104 -//│ let x$22 = +(1,x$21) in -- #103 -//│ jump j$4(x$22) -- #102 -//│ ) -//│ Def(8, j$4, [x$19], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$19 -- #86 -//│ ) -//│ Def(9, to_nat, [n$3], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$23 = ==(n$3,0) in -- #134 -//│ if x$23 -- #133 -//│ true => -//│ let x$25 = Z() in -- #116 -//│ jump j$5(x$25) -- #115 -//│ false => -//│ let x$26 = -(n$3,1) in -- #132 -//│ let* (x$27) = to_nat(x$26) in -- #131 -//│ let x$28 = S(x$27) in -- #130 -//│ jump j$5(x$28) -- #129 -//│ ) -//│ Def(10, j$5, [x$24], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$24 -- #113 -//│ ) -//│ Def(11, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$29) = to_nat(30) in -- #147 -//│ let* (x$30) = fib(x$29) in -- #146 -//│ let* (x$31) = to_int(x$30) in -- #145 -//│ x$31 -- #144 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ let x$20 = S.x(n$2) in -- #105 +//│ let* (x$21) = to_int(x$20) in -- #104 +//│ let x$22 = +(1,x$21) in -- #103 +//│ jump j$4(x$22) -- #102 +//│ def j$4(x$19) = +//│ x$19 -- #86 +//│ def to_nat(n$3) = +//│ let x$23 = ==(n$3,0) in -- #134 +//│ if x$23 -- #133 +//│ true => +//│ let x$25 = Z() in -- #116 +//│ jump j$5(x$25) -- #115 +//│ false => +//│ let x$26 = -(n$3,1) in -- #132 +//│ let* (x$27) = to_nat(x$26) in -- #131 +//│ let x$28 = S(x$27) in -- #130 +//│ jump j$5(x$28) -- #129 +//│ def j$5(x$24) = +//│ x$24 -- #113 +//│ def main() = +//│ let* (x$29) = to_nat(30) in -- #147 +//│ let* (x$30) = fib(x$29) in -- #146 +//│ let* (x$31) = to_int(x$30) in -- #145 +//│ x$31 -- #144 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ diff --git a/compiler/shared/test/diff-ir/LiftClass.mls b/compiler/shared/test/diff-ir/LiftClass.mls index 7d0bb4a62..189160e79 100644 --- a/compiler/shared/test/diff-ir/LiftClass.mls +++ b/compiler/shared/test/diff-ir/LiftClass.mls @@ -17,174 +17,82 @@ main(4) //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #32 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #28 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #27 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #31 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #30 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #29 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, InnerClass, [y,x], parents: Callable, methods: -//│ apply1 -> Def(7, apply1, [z$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$6 = +(x,y) in -- #45 -//│ let x$7 = +(x$6,z$0) in -- #44 -//│ x$7 -- #43 -//│ ))}, { -//│ Def(0, main, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = InnerClass(1,x$1) in -- #26 -//│ let x$3 = Callable.apply1(x$2,2) in -- #25 -//│ let x$4 = Callable.apply1(x$2,3) in -- #24 -//│ let x$5 = +(x$3,x$4) in -- #23 -//│ x$5 -- #22 -//│ ) -//│ }, -//│ let* (x$0) = main(4) in -- #4 -//│ x$0 -- #3) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #32 +//│ def apply1(x0$0) = +//│ 0 -- #28 +//│ def apply0() = +//│ 0 -- #27 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #31 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #30 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #29 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class InnerClass(y,x) extends Callable { +//│ def apply1(z$0) = +//│ let x$6 = +(x,y) in -- #45 +//│ let x$7 = +(x$6,z$0) in -- #44 +//│ x$7 -- #43 +//│ } +//│ def main(x$1) = +//│ let x$2 = InnerClass(1,x$1) in -- #26 +//│ let x$3 = Callable.apply1(x$2,2) in -- #25 +//│ let x$4 = Callable.apply1(x$2,3) in -- #24 +//│ let x$5 = +(x$3,x$4) in -- #23 +//│ x$5 -- #22 +//│ let* (x$0) = main(4) in -- #4 +//│ x$0 -- #3 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #32 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #28 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #27 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #31 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #30 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #29 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, InnerClass, [y,x], parents: Callable, methods: -//│ apply1 -> Def(7, apply1, [z$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$6 = +(x,y) in -- #45 -//│ let x$7 = +(x$6,z$0) in -- #44 -//│ x$7 -- #43 -//│ ))}, { -//│ Def(0, main, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = InnerClass(1,x$1) in -- #26 -//│ let x$3 = Callable.apply1(x$2,2) in -- #25 -//│ let x$4 = Callable.apply1(x$2,3) in -- #24 -//│ let x$5 = +(x$3,x$4) in -- #23 -//│ x$5 -- #22 -//│ ) -//│ }, -//│ let* (x$0) = main(4) in -- #4 -//│ x$0 -- #3) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #32 +//│ def apply1(x0$0) = +//│ 0 -- #28 +//│ def apply0() = +//│ 0 -- #27 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #31 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #30 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #29 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class InnerClass(y,x) extends Callable { +//│ def apply1(z$0) = +//│ let x$6 = +(x,y) in -- #45 +//│ let x$7 = +(x$6,z$0) in -- #44 +//│ x$7 -- #43 +//│ } +//│ def main(x$1) = +//│ let x$2 = InnerClass(1,x$1) in -- #26 +//│ let x$3 = Callable.apply1(x$2,2) in -- #25 +//│ let x$4 = Callable.apply1(x$2,3) in -- #24 +//│ let x$5 = +(x$3,x$4) in -- #23 +//│ x$5 -- #22 +//│ let* (x$0) = main(4) in -- #4 +//│ x$0 -- #3 //│ //│ Interpreted: //│ 15 @@ -213,194 +121,94 @@ main(4) //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #42 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #38 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #37 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #41 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #40 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #39 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, InnerClass, [y], parents: Callable, methods: -//│ apply1 -> Def(7, apply1, [z$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$8 = InnerClass2(z$0) in -- #44 -//│ x$8 -- #43 -//│ )), -//│ ClassInfo(10, InnerClass2, [z], parents: Callable, methods: -//│ apply1 -> Def(8, apply1, [w$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$9 = +(w$0,z) in -- #51 -//│ x$9 -- #50 -//│ ))}, { -//│ Def(0, main, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = InnerClass(1) in -- #36 -//│ let x$3 = Callable.apply1(x$2,2) in -- #35 -//│ let x$4 = Callable.apply1(x$3,2) in -- #34 -//│ let x$5 = Callable.apply1(x$2,3) in -- #33 -//│ let x$6 = Callable.apply1(x$5,1) in -- #32 -//│ let x$7 = +(x$4,x$6) in -- #31 -//│ x$7 -- #30 -//│ ) -//│ }, -//│ let* (x$0) = main(4) in -- #4 -//│ x$0 -- #3) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #42 +//│ def apply1(x0$0) = +//│ 0 -- #38 +//│ def apply0() = +//│ 0 -- #37 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #41 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #40 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #39 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class InnerClass(y) extends Callable { +//│ def apply1(z$0) = +//│ let x$8 = InnerClass2(z$0) in -- #44 +//│ x$8 -- #43 +//│ } +//│ class InnerClass2(z) extends Callable { +//│ def apply1(w$0) = +//│ let x$9 = +(w$0,z) in -- #51 +//│ x$9 -- #50 +//│ } +//│ def main(x$1) = +//│ let x$2 = InnerClass(1) in -- #36 +//│ let x$3 = Callable.apply1(x$2,2) in -- #35 +//│ let x$4 = Callable.apply1(x$3,2) in -- #34 +//│ let x$5 = Callable.apply1(x$2,3) in -- #33 +//│ let x$6 = Callable.apply1(x$5,1) in -- #32 +//│ let x$7 = +(x$4,x$6) in -- #31 +//│ x$7 -- #30 +//│ let* (x$0) = main(4) in -- #4 +//│ x$0 -- #3 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #42 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #38 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #37 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #41 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #40 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #39 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, InnerClass, [y], parents: Callable, methods: -//│ apply1 -> Def(7, apply1, [z$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$8 = InnerClass2(z$0) in -- #44 -//│ x$8 -- #43 -//│ )), -//│ ClassInfo(10, InnerClass2, [z], parents: Callable, methods: -//│ apply1 -> Def(8, apply1, [w$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$9 = +(w$0,z) in -- #51 -//│ x$9 -- #50 -//│ ))}, { -//│ Def(0, main, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = InnerClass(1) in -- #36 -//│ let x$3 = Callable.apply1(x$2,2) in -- #35 -//│ let x$4 = Callable.apply1(x$3,2) in -- #34 -//│ let x$5 = Callable.apply1(x$2,3) in -- #33 -//│ let x$6 = Callable.apply1(x$5,1) in -- #32 -//│ let x$7 = +(x$4,x$6) in -- #31 -//│ x$7 -- #30 -//│ ) -//│ }, -//│ let* (x$0) = main(4) in -- #4 -//│ x$0 -- #3) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #42 +//│ def apply1(x0$0) = +//│ 0 -- #38 +//│ def apply0() = +//│ 0 -- #37 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #41 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #40 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #39 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class InnerClass(y) extends Callable { +//│ def apply1(z$0) = +//│ let x$8 = InnerClass2(z$0) in -- #44 +//│ x$8 -- #43 +//│ } +//│ class InnerClass2(z) extends Callable { +//│ def apply1(w$0) = +//│ let x$9 = +(w$0,z) in -- #51 +//│ x$9 -- #50 +//│ } +//│ def main(x$1) = +//│ let x$2 = InnerClass(1) in -- #36 +//│ let x$3 = Callable.apply1(x$2,2) in -- #35 +//│ let x$4 = Callable.apply1(x$3,2) in -- #34 +//│ let x$5 = Callable.apply1(x$2,3) in -- #33 +//│ let x$6 = Callable.apply1(x$5,1) in -- #32 +//│ let x$7 = +(x$4,x$6) in -- #31 +//│ x$7 -- #30 +//│ let* (x$0) = main(4) in -- #4 +//│ x$0 -- #3 //│ //│ Interpreted: //│ 8 @@ -425,168 +233,76 @@ main(2) //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #23 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #19 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #18 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #22 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #21 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #20 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, InnerClass, [y], parents: Callable, methods: -//│ f -> Def(7, f, [x$5], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ y -- #24 -//│ ))}, { -//│ Def(0, main, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = InnerClass(1) in -- #17 -//│ let x$3 = Nil() in -- #16 -//│ let x$4 = InnerClass.f(x$2,x$3) in -- #15 -//│ x$4 -- #14 -//│ ) -//│ }, -//│ let* (x$0) = main(2) in -- #4 -//│ x$0 -- #3) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #23 +//│ def apply1(x0$0) = +//│ 0 -- #19 +//│ def apply0() = +//│ 0 -- #18 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #22 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #21 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #20 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class InnerClass(y) extends Callable { +//│ def f(x$5) = +//│ y -- #24 +//│ } +//│ def main(x$1) = +//│ let x$2 = InnerClass(1) in -- #17 +//│ let x$3 = Nil() in -- #16 +//│ let x$4 = InnerClass.f(x$2,x$3) in -- #15 +//│ x$4 -- #14 +//│ let* (x$0) = main(2) in -- #4 +//│ x$0 -- #3 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #23 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #19 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #18 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #22 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #21 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #20 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, InnerClass, [y], parents: Callable, methods: -//│ f -> Def(7, f, [x$5], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ y -- #24 -//│ ))}, { -//│ Def(0, main, [x$1], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = InnerClass(1) in -- #17 -//│ let x$3 = Nil() in -- #16 -//│ let x$4 = InnerClass.f(x$2,x$3) in -- #15 -//│ x$4 -- #14 -//│ ) -//│ }, -//│ let* (x$0) = main(2) in -- #4 -//│ x$0 -- #3) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #23 +//│ def apply1(x0$0) = +//│ 0 -- #19 +//│ def apply0() = +//│ 0 -- #18 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #22 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #21 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #20 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class InnerClass(y) extends Callable { +//│ def f(x$5) = +//│ y -- #24 +//│ } +//│ def main(x$1) = +//│ let x$2 = InnerClass(1) in -- #17 +//│ let x$3 = Nil() in -- #16 +//│ let x$4 = InnerClass.f(x$2,x$3) in -- #15 +//│ x$4 -- #14 +//│ let* (x$0) = main(2) in -- #4 +//│ x$0 -- #3 //│ //│ Interpreted: //│ 1 diff --git a/compiler/shared/test/diff-ir/LiftFun.mls b/compiler/shared/test/diff-ir/LiftFun.mls index f2b67003d..a23d77749 100644 --- a/compiler/shared/test/diff-ir/LiftFun.mls +++ b/compiler/shared/test/diff-ir/LiftFun.mls @@ -14,190 +14,86 @@ main(1, 42) //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #17 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #13 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #12 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #16 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #15 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #14 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, main, [init$0,key$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$1) = r(init$0,key$0) in -- #11 -//│ x$1 -- #10 -//│ ) -//│ Def(7, r, [x$2,key$1], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$3 = <=(x$2,0) in -- #40 -//│ if x$3 -- #39 -//│ true => -//│ jump j$0(key$1) -- #26 -//│ false => -//│ let x$5 = -(x$2,1) in -- #38 -//│ let* (x$6) = r(x$5,key$1) in -- #37 -//│ jump j$0(x$6) -- #36 -//│ ) -//│ Def(8, j$0, [x$4], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$4 -- #24 -//│ ) -//│ }, -//│ let* (x$0) = main(1,42) in -- #6 -//│ x$0 -- #5) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #17 +//│ def apply1(x0$0) = +//│ 0 -- #13 +//│ def apply0() = +//│ 0 -- #12 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #16 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #15 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #14 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def main(init$0,key$0) = +//│ let* (x$1) = r(init$0,key$0) in -- #11 +//│ x$1 -- #10 +//│ def r(x$2,key$1) = +//│ let x$3 = <=(x$2,0) in -- #40 +//│ if x$3 -- #39 +//│ true => +//│ jump j$0(key$1) -- #26 +//│ false => +//│ let x$5 = -(x$2,1) in -- #38 +//│ let* (x$6) = r(x$5,key$1) in -- #37 +//│ jump j$0(x$6) -- #36 +//│ def j$0(x$4) = +//│ x$4 -- #24 +//│ let* (x$0) = main(1,42) in -- #6 +//│ x$0 -- #5 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #17 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #13 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #12 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #16 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #15 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #14 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, main, [init$0,key$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$1) = r(init$0,key$0) in -- #11 -//│ x$1 -- #10 -//│ ) -//│ Def(7, r, [x$2,key$1], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$3 = <=(x$2,0) in -- #40 -//│ if x$3 -- #39 -//│ true => -//│ jump j$0(key$1) -- #26 -//│ false => -//│ let x$5 = -(x$2,1) in -- #38 -//│ let* (x$6) = r(x$5,key$1) in -- #37 -//│ jump j$0(x$6) -- #36 -//│ ) -//│ Def(8, j$0, [x$4], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$4 -- #24 -//│ ) -//│ }, -//│ let* (x$0) = main(1,42) in -- #6 -//│ x$0 -- #5) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #17 +//│ def apply1(x0$0) = +//│ 0 -- #13 +//│ def apply0() = +//│ 0 -- #12 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #16 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #15 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #14 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def main(init$0,key$0) = +//│ let* (x$1) = r(init$0,key$0) in -- #11 +//│ x$1 -- #10 +//│ def r(x$2,key$1) = +//│ let x$3 = <=(x$2,0) in -- #40 +//│ if x$3 -- #39 +//│ true => +//│ jump j$0(key$1) -- #26 +//│ false => +//│ let x$5 = -(x$2,1) in -- #38 +//│ let* (x$6) = r(x$5,key$1) in -- #37 +//│ jump j$0(x$6) -- #36 +//│ def j$0(x$4) = +//│ x$4 -- #24 +//│ let* (x$0) = main(1,42) in -- #6 +//│ x$0 -- #5 //│ //│ Interpreted: //│ 42 @@ -220,236 +116,112 @@ main(1, 42) //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #17 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #13 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #12 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #16 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #15 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #14 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, main, [init$0,key$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$1) = ping(init$0,key$0) in -- #11 -//│ x$1 -- #10 -//│ ) -//│ Def(7, ping, [x$2,key$1], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$3 = <=(x$2,0) in -- #46 -//│ if x$3 -- #45 -//│ true => -//│ let x$5 = +(key$1,1) in -- #32 -//│ jump j$0(x$5) -- #31 -//│ false => -//│ let x$6 = -(x$2,1) in -- #44 -//│ let* (x$7) = pong(x$6,key$1) in -- #43 -//│ jump j$0(x$7) -- #42 -//│ ) -//│ Def(8, j$0, [x$4], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$4 -- #24 -//│ ) -//│ Def(9, pong, [x$8,key$2], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$9 = <=(x$8,0) in -- #75 -//│ if x$9 -- #74 -//│ true => -//│ let x$11 = +(key$2,2) in -- #61 -//│ jump j$1(x$11) -- #60 -//│ false => -//│ let x$12 = -(x$8,1) in -- #73 -//│ let* (x$13) = ping(x$12,key$2) in -- #72 -//│ jump j$1(x$13) -- #71 -//│ ) -//│ Def(10, j$1, [x$10], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$10 -- #53 -//│ ) -//│ }, -//│ let* (x$0) = main(1,42) in -- #6 -//│ x$0 -- #5) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #17 +//│ def apply1(x0$0) = +//│ 0 -- #13 +//│ def apply0() = +//│ 0 -- #12 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #16 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #15 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #14 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def main(init$0,key$0) = +//│ let* (x$1) = ping(init$0,key$0) in -- #11 +//│ x$1 -- #10 +//│ def ping(x$2,key$1) = +//│ let x$3 = <=(x$2,0) in -- #46 +//│ if x$3 -- #45 +//│ true => +//│ let x$5 = +(key$1,1) in -- #32 +//│ jump j$0(x$5) -- #31 +//│ false => +//│ let x$6 = -(x$2,1) in -- #44 +//│ let* (x$7) = pong(x$6,key$1) in -- #43 +//│ jump j$0(x$7) -- #42 +//│ def j$0(x$4) = +//│ x$4 -- #24 +//│ def pong(x$8,key$2) = +//│ let x$9 = <=(x$8,0) in -- #75 +//│ if x$9 -- #74 +//│ true => +//│ let x$11 = +(key$2,2) in -- #61 +//│ jump j$1(x$11) -- #60 +//│ false => +//│ let x$12 = -(x$8,1) in -- #73 +//│ let* (x$13) = ping(x$12,key$2) in -- #72 +//│ jump j$1(x$13) -- #71 +//│ def j$1(x$10) = +//│ x$10 -- #53 +//│ let* (x$0) = main(1,42) in -- #6 +//│ x$0 -- #5 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #17 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #13 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #12 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #16 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #15 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #14 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ )}, { -//│ Def(0, main, [init$0,key$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$1) = ping(init$0,key$0) in -- #11 -//│ x$1 -- #10 -//│ ) -//│ Def(7, ping, [x$2,key$1], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$3 = <=(x$2,0) in -- #46 -//│ if x$3 -- #45 -//│ true => -//│ let x$5 = +(key$1,1) in -- #32 -//│ jump j$0(x$5) -- #31 -//│ false => -//│ let x$6 = -(x$2,1) in -- #44 -//│ let* (x$7) = pong(x$6,key$1) in -- #43 -//│ jump j$0(x$7) -- #42 -//│ ) -//│ Def(8, j$0, [x$4], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$4 -- #24 -//│ ) -//│ Def(9, pong, [x$8,key$2], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$9 = <=(x$8,0) in -- #75 -//│ if x$9 -- #74 -//│ true => -//│ let x$11 = +(key$2,2) in -- #61 -//│ jump j$1(x$11) -- #60 -//│ false => -//│ let x$12 = -(x$8,1) in -- #73 -//│ let* (x$13) = ping(x$12,key$2) in -- #72 -//│ jump j$1(x$13) -- #71 -//│ ) -//│ Def(10, j$1, [x$10], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$10 -- #53 -//│ ) -//│ }, -//│ let* (x$0) = main(1,42) in -- #6 -//│ x$0 -- #5) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #17 +//│ def apply1(x0$0) = +//│ 0 -- #13 +//│ def apply0() = +//│ 0 -- #12 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #16 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #15 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #14 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ def main(init$0,key$0) = +//│ let* (x$1) = ping(init$0,key$0) in -- #11 +//│ x$1 -- #10 +//│ def ping(x$2,key$1) = +//│ let x$3 = <=(x$2,0) in -- #46 +//│ if x$3 -- #45 +//│ true => +//│ let x$5 = +(key$1,1) in -- #32 +//│ jump j$0(x$5) -- #31 +//│ false => +//│ let x$6 = -(x$2,1) in -- #44 +//│ let* (x$7) = pong(x$6,key$1) in -- #43 +//│ jump j$0(x$7) -- #42 +//│ def j$0(x$4) = +//│ x$4 -- #24 +//│ def pong(x$8,key$2) = +//│ let x$9 = <=(x$8,0) in -- #75 +//│ if x$9 -- #74 +//│ true => +//│ let x$11 = +(key$2,2) in -- #61 +//│ jump j$1(x$11) -- #60 +//│ false => +//│ let x$12 = -(x$8,1) in -- #73 +//│ let* (x$13) = ping(x$12,key$2) in -- #72 +//│ jump j$1(x$13) -- #71 +//│ def j$1(x$10) = +//│ x$10 -- #53 +//│ let* (x$0) = main(1,42) in -- #6 +//│ x$0 -- #5 //│ //│ Interpreted: //│ 44 @@ -474,256 +246,124 @@ main(1, 42) //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #20 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #16 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #15 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #19 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #18 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #17 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Lambda$0, [key], parents: Callable, methods: -//│ apply1 -> Def(11, apply1, [x$17], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$18) = ping(x$17,key) in -- #85 -//│ x$18 -- #84 -//│ ))}, { -//│ Def(0, main, [init$0,key$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$3 = Lambda$0(key$0) in -- #14 -//│ let x$4 = Callable.apply1(x$3,init$0) in -- #13 -//│ x$4 -- #12 -//│ ) -//│ Def(7, ping, [x$5,key$1], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$6 = <=(x$5,0) in -- #49 -//│ if x$6 -- #48 -//│ true => -//│ let x$8 = +(key$1,1) in -- #35 -//│ jump j$0(x$8) -- #34 -//│ false => -//│ let x$9 = -(x$5,1) in -- #47 -//│ let* (x$10) = pong(x$9,key$1) in -- #46 -//│ jump j$0(x$10) -- #45 -//│ ) -//│ Def(8, j$0, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #27 -//│ ) -//│ Def(9, pong, [x$11,key$2], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$12 = <=(x$11,0) in -- #78 -//│ if x$12 -- #77 -//│ true => -//│ let x$14 = +(key$2,2) in -- #64 -//│ jump j$1(x$14) -- #63 -//│ false => -//│ let x$15 = -(x$11,1) in -- #76 -//│ let* (x$16) = ping(x$15,key$2) in -- #75 -//│ jump j$1(x$16) -- #74 -//│ ) -//│ Def(10, j$1, [x$13], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$13 -- #56 -//│ ) -//│ }, -//│ let* (x$0) = main(1,42) in -- #6 -//│ x$0 -- #5) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #20 +//│ def apply1(x0$0) = +//│ 0 -- #16 +//│ def apply0() = +//│ 0 -- #15 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #19 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #18 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #17 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Lambda$0(key) extends Callable { +//│ def apply1(x$17) = +//│ let* (x$18) = ping(x$17,key) in -- #85 +//│ x$18 -- #84 +//│ } +//│ def main(init$0,key$0) = +//│ let x$3 = Lambda$0(key$0) in -- #14 +//│ let x$4 = Callable.apply1(x$3,init$0) in -- #13 +//│ x$4 -- #12 +//│ def ping(x$5,key$1) = +//│ let x$6 = <=(x$5,0) in -- #49 +//│ if x$6 -- #48 +//│ true => +//│ let x$8 = +(key$1,1) in -- #35 +//│ jump j$0(x$8) -- #34 +//│ false => +//│ let x$9 = -(x$5,1) in -- #47 +//│ let* (x$10) = pong(x$9,key$1) in -- #46 +//│ jump j$0(x$10) -- #45 +//│ def j$0(x$7) = +//│ x$7 -- #27 +//│ def pong(x$11,key$2) = +//│ let x$12 = <=(x$11,0) in -- #78 +//│ if x$12 -- #77 +//│ true => +//│ let x$14 = +(key$2,2) in -- #64 +//│ jump j$1(x$14) -- #63 +//│ false => +//│ let x$15 = -(x$11,1) in -- #76 +//│ let* (x$16) = ping(x$15,key$2) in -- #75 +//│ jump j$1(x$16) -- #74 +//│ def j$1(x$13) = +//│ x$13 -- #56 +//│ let* (x$0) = main(1,42) in -- #6 +//│ x$0 -- #5 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #20 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #16 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #15 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #19 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #18 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #17 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Lambda$0, [key], parents: Callable, methods: -//│ apply1 -> Def(11, apply1, [x$17], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$18) = ping(x$17,key) in -- #85 -//│ x$18 -- #84 -//│ ))}, { -//│ Def(0, main, [init$0,key$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$3 = Lambda$0(key$0) in -- #14 -//│ let x$4 = Callable.apply1(x$3,init$0) in -- #13 -//│ x$4 -- #12 -//│ ) -//│ Def(7, ping, [x$5,key$1], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$6 = <=(x$5,0) in -- #49 -//│ if x$6 -- #48 -//│ true => -//│ let x$8 = +(key$1,1) in -- #35 -//│ jump j$0(x$8) -- #34 -//│ false => -//│ let x$9 = -(x$5,1) in -- #47 -//│ let* (x$10) = pong(x$9,key$1) in -- #46 -//│ jump j$0(x$10) -- #45 -//│ ) -//│ Def(8, j$0, [x$7], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$7 -- #27 -//│ ) -//│ Def(9, pong, [x$11,key$2], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$12 = <=(x$11,0) in -- #78 -//│ if x$12 -- #77 -//│ true => -//│ let x$14 = +(key$2,2) in -- #64 -//│ jump j$1(x$14) -- #63 -//│ false => -//│ let x$15 = -(x$11,1) in -- #76 -//│ let* (x$16) = ping(x$15,key$2) in -- #75 -//│ jump j$1(x$16) -- #74 -//│ ) -//│ Def(10, j$1, [x$13], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$13 -- #56 -//│ ) -//│ }, -//│ let* (x$0) = main(1,42) in -- #6 -//│ x$0 -- #5) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #20 +//│ def apply1(x0$0) = +//│ 0 -- #16 +//│ def apply0() = +//│ 0 -- #15 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #19 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #18 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #17 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Lambda$0(key) extends Callable { +//│ def apply1(x$17) = +//│ let* (x$18) = ping(x$17,key) in -- #85 +//│ x$18 -- #84 +//│ } +//│ def main(init$0,key$0) = +//│ let x$3 = Lambda$0(key$0) in -- #14 +//│ let x$4 = Callable.apply1(x$3,init$0) in -- #13 +//│ x$4 -- #12 +//│ def ping(x$5,key$1) = +//│ let x$6 = <=(x$5,0) in -- #49 +//│ if x$6 -- #48 +//│ true => +//│ let x$8 = +(key$1,1) in -- #35 +//│ jump j$0(x$8) -- #34 +//│ false => +//│ let x$9 = -(x$5,1) in -- #47 +//│ let* (x$10) = pong(x$9,key$1) in -- #46 +//│ jump j$0(x$10) -- #45 +//│ def j$0(x$7) = +//│ x$7 -- #27 +//│ def pong(x$11,key$2) = +//│ let x$12 = <=(x$11,0) in -- #78 +//│ if x$12 -- #77 +//│ true => +//│ let x$14 = +(key$2,2) in -- #64 +//│ jump j$1(x$14) -- #63 +//│ false => +//│ let x$15 = -(x$11,1) in -- #76 +//│ let* (x$16) = ping(x$15,key$2) in -- #75 +//│ jump j$1(x$16) -- #74 +//│ def j$1(x$13) = +//│ x$13 -- #56 +//│ let* (x$0) = main(1,42) in -- #6 +//│ x$0 -- #5 //│ //│ Interpreted: //│ 44 diff --git a/compiler/shared/test/diff-ir/LiftLambda.mls b/compiler/shared/test/diff-ir/LiftLambda.mls index d6a0561c7..6118b5890 100644 --- a/compiler/shared/test/diff-ir/LiftLambda.mls +++ b/compiler/shared/test/diff-ir/LiftLambda.mls @@ -16,230 +16,112 @@ main(3) //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(7, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #31 -//│ ), -//│ apply1 -> Def(3, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #27 -//│ ), -//│ apply0 -> Def(2, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #26 -//│ ), -//│ apply4 -> Def(6, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #30 -//│ ), -//│ apply3 -> Def(5, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #29 -//│ ), -//│ apply2 -> Def(4, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #28 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Lambda$0, [f], parents: Callable, methods: -//│ apply1 -> Def(8, apply1, [g$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$11 = Lambda$2(f,g$0) in -- #33 -//│ x$11 -- #32 -//│ )), -//│ ClassInfo(10, Lambda$1, [x,y], parents: Callable, methods: -//│ apply1 -> Def(9, apply1, [z$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$12 = +(x,y) in -- #46 -//│ let x$13 = +(x$12,z$0) in -- #45 -//│ x$13 -- #44 -//│ )), -//│ ClassInfo(11, Lambda$2, [f,g], parents: Callable, methods: -//│ apply1 -> Def(10, apply1, [x$14], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$15 = Callable.apply1(g,x$14) in -- #57 -//│ let x$16 = Callable.apply1(f,x$15) in -- #56 -//│ x$16 -- #55 -//│ ))}, { -//│ Def(0, compose, [f$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = Lambda$0(f$0) in -- #6 -//│ x$2 -- #5 -//│ ) -//│ Def(1, main, [x$3], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$4 = 1 in -- #25 -//│ let x$6 = Lambda$1(x$3,x$4) in -- #24 -//│ let* (x$7) = compose(x$6) in -- #23 -//│ let x$8 = Callable.apply1(x$7,x$6) in -- #22 -//│ let x$9 = Callable.apply1(x$8,2) in -- #21 -//│ x$9 -- #20 -//│ ) -//│ }, -//│ let* (x$0) = main(3) in -- #4 -//│ x$0 -- #3) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #31 +//│ def apply1(x0$0) = +//│ 0 -- #27 +//│ def apply0() = +//│ 0 -- #26 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #30 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #29 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #28 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Lambda$0(f) extends Callable { +//│ def apply1(g$0) = +//│ let x$11 = Lambda$2(f,g$0) in -- #33 +//│ x$11 -- #32 +//│ } +//│ class Lambda$1(x,y) extends Callable { +//│ def apply1(z$0) = +//│ let x$12 = +(x,y) in -- #46 +//│ let x$13 = +(x$12,z$0) in -- #45 +//│ x$13 -- #44 +//│ } +//│ class Lambda$2(f,g) extends Callable { +//│ def apply1(x$14) = +//│ let x$15 = Callable.apply1(g,x$14) in -- #57 +//│ let x$16 = Callable.apply1(f,x$15) in -- #56 +//│ x$16 -- #55 +//│ } +//│ def compose(f$0) = +//│ let x$2 = Lambda$0(f$0) in -- #6 +//│ x$2 -- #5 +//│ def main(x$3) = +//│ let x$4 = 1 in -- #25 +//│ let x$6 = Lambda$1(x$3,x$4) in -- #24 +//│ let* (x$7) = compose(x$6) in -- #23 +//│ let x$8 = Callable.apply1(x$7,x$6) in -- #22 +//│ let x$9 = Callable.apply1(x$8,2) in -- #21 +//│ x$9 -- #20 +//│ let* (x$0) = main(3) in -- #4 +//│ x$0 -- #3 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(7, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #31 -//│ ), -//│ apply1 -> Def(3, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #27 -//│ ), -//│ apply0 -> Def(2, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #26 -//│ ), -//│ apply4 -> Def(6, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #30 -//│ ), -//│ apply3 -> Def(5, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #29 -//│ ), -//│ apply2 -> Def(4, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #28 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Lambda$0, [f], parents: Callable, methods: -//│ apply1 -> Def(8, apply1, [g$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$11 = Lambda$2(f,g$0) in -- #33 -//│ x$11 -- #32 -//│ )), -//│ ClassInfo(10, Lambda$1, [x,y], parents: Callable, methods: -//│ apply1 -> Def(9, apply1, [z$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$12 = +(x,y) in -- #46 -//│ let x$13 = +(x$12,z$0) in -- #45 -//│ x$13 -- #44 -//│ )), -//│ ClassInfo(11, Lambda$2, [f,g], parents: Callable, methods: -//│ apply1 -> Def(10, apply1, [x$14], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$15 = Callable.apply1(g,x$14) in -- #57 -//│ let x$16 = Callable.apply1(f,x$15) in -- #56 -//│ x$16 -- #55 -//│ ))}, { -//│ Def(0, compose, [f$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = Lambda$0(f$0) in -- #6 -//│ x$2 -- #5 -//│ ) -//│ Def(1, main, [x$3], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$4 = 1 in -- #25 -//│ let x$6 = Lambda$1(x$3,x$4) in -- #24 -//│ let* (x$7) = compose(x$6) in -- #23 -//│ let x$8 = Callable.apply1(x$7,x$6) in -- #22 -//│ let x$9 = Callable.apply1(x$8,2) in -- #21 -//│ x$9 -- #20 -//│ ) -//│ }, -//│ let* (x$0) = main(3) in -- #4 -//│ x$0 -- #3) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #31 +//│ def apply1(x0$0) = +//│ 0 -- #27 +//│ def apply0() = +//│ 0 -- #26 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #30 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #29 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #28 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Lambda$0(f) extends Callable { +//│ def apply1(g$0) = +//│ let x$11 = Lambda$2(f,g$0) in -- #33 +//│ x$11 -- #32 +//│ } +//│ class Lambda$1(x,y) extends Callable { +//│ def apply1(z$0) = +//│ let x$12 = +(x,y) in -- #46 +//│ let x$13 = +(x$12,z$0) in -- #45 +//│ x$13 -- #44 +//│ } +//│ class Lambda$2(f,g) extends Callable { +//│ def apply1(x$14) = +//│ let x$15 = Callable.apply1(g,x$14) in -- #57 +//│ let x$16 = Callable.apply1(f,x$15) in -- #56 +//│ x$16 -- #55 +//│ } +//│ def compose(f$0) = +//│ let x$2 = Lambda$0(f$0) in -- #6 +//│ x$2 -- #5 +//│ def main(x$3) = +//│ let x$4 = 1 in -- #25 +//│ let x$6 = Lambda$1(x$3,x$4) in -- #24 +//│ let* (x$7) = compose(x$6) in -- #23 +//│ let x$8 = Callable.apply1(x$7,x$6) in -- #22 +//│ let x$9 = Callable.apply1(x$8,2) in -- #21 +//│ x$9 -- #20 +//│ let* (x$0) = main(3) in -- #4 +//│ x$0 -- #3 //│ //│ Interpreted: //│ 10 diff --git a/compiler/shared/test/diff-ir/Override.mls b/compiler/shared/test/diff-ir/Override.mls index 905177940..4a098fe97 100644 --- a/compiler/shared/test/diff-ir/Override.mls +++ b/compiler/shared/test/diff-ir/Override.mls @@ -21,184 +21,84 @@ main() //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #21 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #17 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #16 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #20 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #19 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #18 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Base, [], parents: , methods: -//│ f -> Def(7, f, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 1 -- #22 -//│ )), -//│ ClassInfo(10, Child, [], parents: Base, methods: -//│ f -> Def(8, f, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 2 -- #23 -//│ ))}, { -//│ Def(0, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = Child() in -- #15 -//│ let x$2 = Base.f(x$1) in -- #14 -//│ let x$3 = Child.f(x$1) in -- #13 -//│ x$3 -- #12 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #21 +//│ def apply1(x0$0) = +//│ 0 -- #17 +//│ def apply0() = +//│ 0 -- #16 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #20 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #19 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #18 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Base() { +//│ def f() = +//│ 1 -- #22 +//│ } +//│ class Child() extends Base { +//│ def f() = +//│ 2 -- #23 +//│ } +//│ def main() = +//│ let x$1 = Child() in -- #15 +//│ let x$2 = Base.f(x$1) in -- #14 +//│ let x$3 = Child.f(x$1) in -- #13 +//│ x$3 -- #12 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(6, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #21 -//│ ), -//│ apply1 -> Def(2, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #17 -//│ ), -//│ apply0 -> Def(1, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #16 -//│ ), -//│ apply4 -> Def(5, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #20 -//│ ), -//│ apply3 -> Def(4, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #19 -//│ ), -//│ apply2 -> Def(3, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #18 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Base, [], parents: , methods: -//│ f -> Def(7, f, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 1 -- #22 -//│ )), -//│ ClassInfo(10, Child, [], parents: Base, methods: -//│ f -> Def(8, f, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 2 -- #23 -//│ ))}, { -//│ Def(0, main, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$1 = Child() in -- #15 -//│ let x$2 = Base.f(x$1) in -- #14 -//│ let x$3 = Child.f(x$1) in -- #13 -//│ x$3 -- #12 -//│ ) -//│ }, -//│ let* (x$0) = main() in -- #2 -//│ x$0 -- #1) +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #21 +//│ def apply1(x0$0) = +//│ 0 -- #17 +//│ def apply0() = +//│ 0 -- #16 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #20 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #19 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #18 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Base() { +//│ def f() = +//│ 1 -- #22 +//│ } +//│ class Child() extends Base { +//│ def f() = +//│ 2 -- #23 +//│ } +//│ def main() = +//│ let x$1 = Child() in -- #15 +//│ let x$2 = Base.f(x$1) in -- #14 +//│ let x$3 = Child.f(x$1) in -- #13 +//│ x$3 -- #12 +//│ let* (x$0) = main() in -- #2 +//│ x$0 -- #1 //│ //│ Interpreted: //│ 2 diff --git a/compiler/shared/test/diff-ir/gcd.mls b/compiler/shared/test/diff-ir/gcd.mls index 6ee7b7769..1f59739c9 100644 --- a/compiler/shared/test/diff-ir/gcd.mls +++ b/compiler/shared/test/diff-ir/gcd.mls @@ -230,2186 +230,1170 @@ testGcd_nofib(z_of_int(400)) //│ //│ //│ IR: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(94, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #1315 -//│ ), -//│ apply1 -> Def(90, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #1311 -//│ ), -//│ apply0 -> Def(89, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #1310 -//│ ), -//│ apply4 -> Def(93, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #1314 -//│ ), -//│ apply3 -> Def(92, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #1313 -//│ ), -//│ apply2 -> Def(91, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #1312 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Tuple2, [x,y], parents: , methods: -//│ ), -//│ ClassInfo(10, Tuple3, [x,y,z], parents: , methods: -//│ ), -//│ ClassInfo(11, Lambda$0, [], parents: Callable, methods: -//│ apply0 -> Def(95, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$270) = error() in -- #1318 -//│ x$270 -- #1317 -//│ )), -//│ ClassInfo(12, Lambda$1, [], parents: Callable, methods: -//│ apply0 -> Def(96, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$271) = error() in -- #1321 -//│ x$271 -- #1320 -//│ )), -//│ ClassInfo(13, Lambda$2, [], parents: Callable, methods: -//│ apply0 -> Def(97, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$272) = error() in -- #1324 -//│ x$272 -- #1323 -//│ )), -//│ ClassInfo(14, Lambda$3, [], parents: Callable, methods: -//│ apply0 -> Def(98, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$273) = error() in -- #1327 -//│ x$273 -- #1326 -//│ )), -//│ ClassInfo(15, Lambda$4, [], parents: Callable, methods: -//│ apply1 -> Def(99, apply1, [x$274], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$275) = f1(x$274) in -- #1332 -//│ x$275 -- #1331 -//│ )), -//│ ClassInfo(16, Lambda$5, [], parents: Callable, methods: -//│ apply1 -> Def(100, apply1, [x$276], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$277) = f2(x$276) in -- #1337 -//│ x$277 -- #1336 -//│ ))}, { -//│ Def(0, error, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = Callable.apply1(builtin,error) in -- #14 -//│ x$2 -- #13 -//│ ) -//│ Def(1, z_of_int, [x$3], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$4 = Callable.apply2(builtin,z_of_int,x$3) in -- #22 -//│ x$4 -- #21 -//│ ) -//│ Def(2, z_to_int, [x$5], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$6 = Callable.apply2(builtin,z_to_int,x$5) in -- #30 -//│ x$6 -- #29 -//│ ) -//│ Def(3, z_add, [x$7,y$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$8 = Callable.apply3(builtin,z_add,x$7,y$0) in -- #40 -//│ x$8 -- #39 -//│ ) -//│ Def(4, z_sub, [x$9,y$1], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$10 = Callable.apply3(builtin,z_sub,x$9,y$1) in -- #50 -//│ x$10 -- #49 -//│ ) -//│ Def(5, z_div, [x$11,y$2], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$12 = Callable.apply3(builtin,z_div,x$11,y$2) in -- #60 -//│ x$12 -- #59 -//│ ) -//│ Def(6, z_mul, [x$13,y$3], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$14 = Callable.apply3(builtin,z_mul,x$13,y$3) in -- #70 -//│ x$14 -- #69 -//│ ) -//│ Def(7, z_mod, [x$15,y$4], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$16 = Callable.apply3(builtin,z_mod,x$15,y$4) in -- #80 -//│ x$16 -- #79 -//│ ) -//│ Def(8, z_lt, [x$17,y$5], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$18 = Callable.apply3(builtin,z_lt,x$17,y$5) in -- #90 -//│ x$18 -- #89 -//│ ) -//│ Def(9, z_leq, [x$19,y$6], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$20 = Callable.apply3(builtin,z_leq,x$19,y$6) in -- #100 -//│ x$20 -- #99 -//│ ) -//│ Def(10, z_equal, [x$21,y$7], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$22 = Callable.apply3(builtin,z_equal,x$21,y$7) in -- #110 -//│ x$22 -- #109 -//│ ) -//│ Def(11, z_gt, [x$23,y$8], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$24 = Callable.apply3(builtin,z_gt,x$23,y$8) in -- #120 -//│ x$24 -- #119 -//│ ) -//│ Def(12, z_geq, [x$25,y$9], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$26 = Callable.apply3(builtin,z_geq,x$25,y$9) in -- #130 -//│ x$26 -- #129 -//│ ) -//│ Def(13, println, [x$27], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$28 = Callable.apply2(builtin,println,x$27) in -- #138 -//│ x$28 -- #137 -//│ ) -//│ Def(14, print, [x$29], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$30 = Callable.apply2(builtin,print,x$29) in -- #146 -//│ x$30 -- #145 -//│ ) -//│ Def(15, debug, [x$31], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$32 = Callable.apply2(builtin,debug,x$31) in -- #154 -//│ x$32 -- #153 -//│ ) -//│ Def(16, map, [f$0,ls$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls$0 of -- #189 -//│ Cons => -//│ let x$34 = Cons.t(ls$0) in -- #185 -//│ let x$35 = Cons.h(ls$0) in -- #184 -//│ let x$36 = Callable.apply1(f$0,x$35) in -- #183 -//│ let* (x$37) = map(f$0,x$34) in -- #182 -//│ let x$38 = Cons(x$36,x$37) in -- #181 -//│ jump j$0(x$38) -- #180 -//│ Nil => -//│ let x$39 = Nil() in -- #188 -//│ jump j$0(x$39) -- #187 -//│ ) -//│ Def(17, j$0, [x$33], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$33 -- #156 -//│ ) -//│ Def(18, filter, [f_2$0,ls_2$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_2$0 of -- #236 -//│ Cons => -//│ let x$41 = Cons.t(ls_2$0) in -- #232 -//│ let x$42 = Cons.h(ls_2$0) in -- #231 -//│ let x$43 = Callable.apply1(f_2$0,x$42) in -- #230 -//│ if x$43 -- #229 +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #1315 +//│ def apply1(x0$0) = +//│ 0 -- #1311 +//│ def apply0() = +//│ 0 -- #1310 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #1314 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #1313 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #1312 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Tuple2(x,y) +//│ class Tuple3(x,y,z) +//│ class Lambda$0() extends Callable { +//│ def apply0() = +//│ let* (x$270) = error() in -- #1318 +//│ x$270 -- #1317 +//│ } +//│ class Lambda$1() extends Callable { +//│ def apply0() = +//│ let* (x$271) = error() in -- #1321 +//│ x$271 -- #1320 +//│ } +//│ class Lambda$2() extends Callable { +//│ def apply0() = +//│ let* (x$272) = error() in -- #1324 +//│ x$272 -- #1323 +//│ } +//│ class Lambda$3() extends Callable { +//│ def apply0() = +//│ let* (x$273) = error() in -- #1327 +//│ x$273 -- #1326 +//│ } +//│ class Lambda$4() extends Callable { +//│ def apply1(x$274) = +//│ let* (x$275) = f1(x$274) in -- #1332 +//│ x$275 -- #1331 +//│ } +//│ class Lambda$5() extends Callable { +//│ def apply1(x$276) = +//│ let* (x$277) = f2(x$276) in -- #1337 +//│ x$277 -- #1336 +//│ } +//│ def error() = +//│ let x$2 = Callable.apply1(builtin,error) in -- #14 +//│ x$2 -- #13 +//│ def z_of_int(x$3) = +//│ let x$4 = Callable.apply2(builtin,z_of_int,x$3) in -- #22 +//│ x$4 -- #21 +//│ def z_to_int(x$5) = +//│ let x$6 = Callable.apply2(builtin,z_to_int,x$5) in -- #30 +//│ x$6 -- #29 +//│ def z_add(x$7,y$0) = +//│ let x$8 = Callable.apply3(builtin,z_add,x$7,y$0) in -- #40 +//│ x$8 -- #39 +//│ def z_sub(x$9,y$1) = +//│ let x$10 = Callable.apply3(builtin,z_sub,x$9,y$1) in -- #50 +//│ x$10 -- #49 +//│ def z_div(x$11,y$2) = +//│ let x$12 = Callable.apply3(builtin,z_div,x$11,y$2) in -- #60 +//│ x$12 -- #59 +//│ def z_mul(x$13,y$3) = +//│ let x$14 = Callable.apply3(builtin,z_mul,x$13,y$3) in -- #70 +//│ x$14 -- #69 +//│ def z_mod(x$15,y$4) = +//│ let x$16 = Callable.apply3(builtin,z_mod,x$15,y$4) in -- #80 +//│ x$16 -- #79 +//│ def z_lt(x$17,y$5) = +//│ let x$18 = Callable.apply3(builtin,z_lt,x$17,y$5) in -- #90 +//│ x$18 -- #89 +//│ def z_leq(x$19,y$6) = +//│ let x$20 = Callable.apply3(builtin,z_leq,x$19,y$6) in -- #100 +//│ x$20 -- #99 +//│ def z_equal(x$21,y$7) = +//│ let x$22 = Callable.apply3(builtin,z_equal,x$21,y$7) in -- #110 +//│ x$22 -- #109 +//│ def z_gt(x$23,y$8) = +//│ let x$24 = Callable.apply3(builtin,z_gt,x$23,y$8) in -- #120 +//│ x$24 -- #119 +//│ def z_geq(x$25,y$9) = +//│ let x$26 = Callable.apply3(builtin,z_geq,x$25,y$9) in -- #130 +//│ x$26 -- #129 +//│ def println(x$27) = +//│ let x$28 = Callable.apply2(builtin,println,x$27) in -- #138 +//│ x$28 -- #137 +//│ def print(x$29) = +//│ let x$30 = Callable.apply2(builtin,print,x$29) in -- #146 +//│ x$30 -- #145 +//│ def debug(x$31) = +//│ let x$32 = Callable.apply2(builtin,debug,x$31) in -- #154 +//│ x$32 -- #153 +//│ def map(f$0,ls$0) = +//│ case ls$0 of -- #189 +//│ Cons => +//│ let x$34 = Cons.t(ls$0) in -- #185 +//│ let x$35 = Cons.h(ls$0) in -- #184 +//│ let x$36 = Callable.apply1(f$0,x$35) in -- #183 +//│ let* (x$37) = map(f$0,x$34) in -- #182 +//│ let x$38 = Cons(x$36,x$37) in -- #181 +//│ jump j$0(x$38) -- #180 +//│ Nil => +//│ let x$39 = Nil() in -- #188 +//│ jump j$0(x$39) -- #187 +//│ def j$0(x$33) = +//│ x$33 -- #156 +//│ def filter(f_2$0,ls_2$0) = +//│ case ls_2$0 of -- #236 +//│ Cons => +//│ let x$41 = Cons.t(ls_2$0) in -- #232 +//│ let x$42 = Cons.h(ls_2$0) in -- #231 +//│ let x$43 = Callable.apply1(f_2$0,x$42) in -- #230 +//│ if x$43 -- #229 +//│ true => +//│ let* (x$45) = filter(f_2$0,x$41) in -- #220 +//│ let x$46 = Cons(x$42,x$45) in -- #219 +//│ jump j$2(x$46) -- #218 +//│ false => +//│ let* (x$47) = filter(f_2$0,x$41) in -- #228 +//│ jump j$2(x$47) -- #227 +//│ Nil => +//│ let x$48 = Nil() in -- #235 +//│ jump j$1(x$48) -- #234 +//│ def j$1(x$40) = +//│ x$40 -- #191 +//│ def j$2(x$44) = +//│ jump j$1(x$44) -- #206 +//│ def foldl(f_4$0,i$0,ls_4$0) = +//│ case ls_4$0 of -- #268 +//│ Cons => +//│ let x$50 = Cons.t(ls_4$0) in -- #265 +//│ let x$51 = Cons.h(ls_4$0) in -- #264 +//│ let x$52 = Callable.apply2(f_4$0,i$0,x$51) in -- #263 +//│ let* (x$53) = foldl(f_4$0,x$52,x$50) in -- #262 +//│ jump j$3(x$53) -- #261 +//│ Nil => +//│ jump j$3(i$0) -- #267 +//│ def j$3(x$49) = +//│ x$49 -- #238 +//│ def foldr(f_5$0,i_1$0,ls_5$0) = +//│ case ls_5$0 of -- #300 +//│ Cons => +//│ let x$55 = Cons.t(ls_5$0) in -- #297 +//│ let x$56 = Cons.h(ls_5$0) in -- #296 +//│ let* (x$57) = foldr(f_5$0,i_1$0,x$55) in -- #295 +//│ let x$58 = Callable.apply2(f_5$0,x$56,x$57) in -- #294 +//│ jump j$4(x$58) -- #293 +//│ Nil => +//│ jump j$4(i_1$0) -- #299 +//│ def j$4(x$54) = +//│ x$54 -- #270 +//│ def zip(xs$0,ys$0) = +//│ case xs$0 of -- #353 +//│ Cons => +//│ let x$60 = Cons.t(xs$0) in -- #349 +//│ let x$61 = Cons.h(xs$0) in -- #348 +//│ case ys$0 of -- #347 +//│ Cons => +//│ let x$63 = Cons.t(ys$0) in -- #343 +//│ let x$64 = Cons.h(ys$0) in -- #342 +//│ let x$65 = Tuple2(x$61,x$64) in -- #341 +//│ let* (x$66) = zip(x$60,x$63) in -- #340 +//│ let x$67 = Cons(x$65,x$66) in -- #339 +//│ jump j$6(x$67) -- #338 +//│ Nil => +//│ let x$68 = Nil() in -- #346 +//│ jump j$6(x$68) -- #345 +//│ Nil => +//│ let x$69 = Nil() in -- #352 +//│ jump j$5(x$69) -- #351 +//│ def j$5(x$59) = +//│ x$59 -- #302 +//│ def j$6(x$62) = +//│ jump j$5(x$62) -- #313 +//│ def zipWith(f_7$0,xs_4$0,ys_4$0) = +//│ case xs_4$0 of -- #409 +//│ Cons => +//│ let x$71 = Cons.t(xs_4$0) in -- #405 +//│ let x$72 = Cons.h(xs_4$0) in -- #404 +//│ case ys_4$0 of -- #403 +//│ Cons => +//│ let x$74 = Cons.t(ys_4$0) in -- #399 +//│ let x$75 = Cons.h(ys_4$0) in -- #398 +//│ let x$76 = Callable.apply2(f_7$0,x$72,x$75) in -- #397 +//│ let* (x$77) = zipWith(f_7$0,x$71,x$74) in -- #396 +//│ let x$78 = Cons(x$76,x$77) in -- #395 +//│ jump j$8(x$78) -- #394 +//│ Nil => +//│ let x$79 = Nil() in -- #402 +//│ jump j$8(x$79) -- #401 +//│ Nil => +//│ let x$80 = Nil() in -- #408 +//│ jump j$7(x$80) -- #407 +//│ def j$7(x$70) = +//│ x$70 -- #355 +//│ def j$8(x$73) = +//│ jump j$7(x$73) -- #366 +//│ def head(ls_7$0) = +//│ case ls_7$0 of -- #427 +//│ Cons => +//│ let x$82 = Cons.t(ls_7$0) in -- #423 +//│ let x$83 = Cons.h(ls_7$0) in -- #422 +//│ jump j$9(x$83) -- #421 +//│ Nil => +//│ let x$85 = Lambda$0() in -- #426 +//│ jump j$9(x$85) -- #425 +//│ def j$9(x$81) = +//│ x$81 -- #411 +//│ def tail(ls_9$0) = +//│ case ls_9$0 of -- #445 +//│ Cons => +//│ let x$87 = Cons.t(ls_9$0) in -- #441 +//│ let x$88 = Cons.h(ls_9$0) in -- #440 +//│ jump j$10(x$87) -- #439 +//│ Nil => +//│ let x$90 = Lambda$1() in -- #444 +//│ jump j$10(x$90) -- #443 +//│ def j$10(x$86) = +//│ x$86 -- #429 +//│ def enumFromTo(a$0,b$0) = +//│ let x$91 = <=(a$0,b$0) in -- #471 +//│ if x$91 -- #470 //│ true => -//│ let* (x$45) = filter(f_2$0,x$41) in -- #220 -//│ let x$46 = Cons(x$42,x$45) in -- #219 -//│ jump j$2(x$46) -- #218 +//│ let x$93 = +(a$0,1) in -- #466 +//│ let* (x$94) = enumFromTo(x$93,b$0) in -- #465 +//│ let x$95 = Cons(a$0,x$94) in -- #464 +//│ jump j$11(x$95) -- #463 //│ false => -//│ let* (x$47) = filter(f_2$0,x$41) in -- #228 -//│ jump j$2(x$47) -- #227 -//│ Nil => -//│ let x$48 = Nil() in -- #235 -//│ jump j$1(x$48) -- #234 -//│ ) -//│ Def(19, j$1, [x$40], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$40 -- #191 -//│ ) -//│ Def(20, j$2, [x$44], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$1(x$44) -- #206 -//│ ) -//│ Def(21, foldl, [f_4$0,i$0,ls_4$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_4$0 of -- #268 -//│ Cons => -//│ let x$50 = Cons.t(ls_4$0) in -- #265 -//│ let x$51 = Cons.h(ls_4$0) in -- #264 -//│ let x$52 = Callable.apply2(f_4$0,i$0,x$51) in -- #263 -//│ let* (x$53) = foldl(f_4$0,x$52,x$50) in -- #262 -//│ jump j$3(x$53) -- #261 -//│ Nil => -//│ jump j$3(i$0) -- #267 -//│ ) -//│ Def(22, j$3, [x$49], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$49 -- #238 -//│ ) -//│ Def(23, foldr, [f_5$0,i_1$0,ls_5$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_5$0 of -- #300 -//│ Cons => -//│ let x$55 = Cons.t(ls_5$0) in -- #297 -//│ let x$56 = Cons.h(ls_5$0) in -- #296 -//│ let* (x$57) = foldr(f_5$0,i_1$0,x$55) in -- #295 -//│ let x$58 = Callable.apply2(f_5$0,x$56,x$57) in -- #294 -//│ jump j$4(x$58) -- #293 -//│ Nil => -//│ jump j$4(i_1$0) -- #299 -//│ ) -//│ Def(24, j$4, [x$54], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$54 -- #270 -//│ ) -//│ Def(25, zip, [xs$0,ys$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case xs$0 of -- #353 -//│ Cons => -//│ let x$60 = Cons.t(xs$0) in -- #349 -//│ let x$61 = Cons.h(xs$0) in -- #348 -//│ case ys$0 of -- #347 +//│ let x$96 = Nil() in -- #469 +//│ jump j$11(x$96) -- #468 +//│ def j$11(x$92) = +//│ x$92 -- #449 +//│ def enumFromThenTo(a_1$0,t_11$0,b_1$0) = +//│ let x$97 = <=(a_1$0,b_1$0) in -- #502 +//│ if x$97 -- #501 +//│ true => +//│ let x$99 = *(2,t_11$0) in -- #497 +//│ let x$100 = -(x$99,a_1$0) in -- #496 +//│ let* (x$101) = enumFromThenTo(t_11$0,x$100,b_1$0) in -- #495 +//│ let x$102 = Cons(a_1$0,x$101) in -- #494 +//│ jump j$12(x$102) -- #493 +//│ false => +//│ let x$103 = Nil() in -- #500 +//│ jump j$12(x$103) -- #499 +//│ def j$12(x$98) = +//│ x$98 -- #475 +//│ def take(n$0,ls_11$0) = +//│ let x$104 = >(n$0,0) in -- #545 +//│ if x$104 -- #544 +//│ true => +//│ case ls_11$0 of -- #540 +//│ Cons => +//│ let x$107 = Cons.t(ls_11$0) in -- #536 +//│ let x$108 = Cons.h(ls_11$0) in -- #535 +//│ let x$109 = -(n$0,1) in -- #534 +//│ let* (x$110) = take(x$109,x$107) in -- #533 +//│ let x$111 = Cons(x$108,x$110) in -- #532 +//│ jump j$14(x$111) -- #531 +//│ Nil => +//│ let x$112 = Nil() in -- #539 +//│ jump j$14(x$112) -- #538 +//│ false => +//│ let x$113 = Nil() in -- #543 +//│ jump j$13(x$113) -- #542 +//│ def j$13(x$105) = +//│ x$105 -- #506 +//│ def j$14(x$106) = +//│ jump j$13(x$106) -- #509 +//│ def length(ls_13$0) = +//│ case ls_13$0 of -- #569 //│ Cons => -//│ let x$63 = Cons.t(ys$0) in -- #343 -//│ let x$64 = Cons.h(ys$0) in -- #342 -//│ let x$65 = Tuple2(x$61,x$64) in -- #341 -//│ let* (x$66) = zip(x$60,x$63) in -- #340 -//│ let x$67 = Cons(x$65,x$66) in -- #339 -//│ jump j$6(x$67) -- #338 +//│ let x$115 = Cons.t(ls_13$0) in -- #566 +//│ let x$116 = Cons.h(ls_13$0) in -- #565 +//│ let* (x$117) = length(x$115) in -- #564 +//│ let x$118 = +(1,x$117) in -- #563 +//│ jump j$15(x$118) -- #562 //│ Nil => -//│ let x$68 = Nil() in -- #346 -//│ jump j$6(x$68) -- #345 -//│ Nil => -//│ let x$69 = Nil() in -- #352 -//│ jump j$5(x$69) -- #351 -//│ ) -//│ Def(26, j$5, [x$59], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$59 -- #302 -//│ ) -//│ Def(27, j$6, [x$62], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$5(x$62) -- #313 -//│ ) -//│ Def(28, zipWith, [f_7$0,xs_4$0,ys_4$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case xs_4$0 of -- #409 -//│ Cons => -//│ let x$71 = Cons.t(xs_4$0) in -- #405 -//│ let x$72 = Cons.h(xs_4$0) in -- #404 -//│ case ys_4$0 of -- #403 +//│ jump j$15(0) -- #568 +//│ def j$15(x$114) = +//│ x$114 -- #547 +//│ def mappend(xs_8$0,ys_8$0) = +//│ case xs_8$0 of -- #598 //│ Cons => -//│ let x$74 = Cons.t(ys_4$0) in -- #399 -//│ let x$75 = Cons.h(ys_4$0) in -- #398 -//│ let x$76 = Callable.apply2(f_7$0,x$72,x$75) in -- #397 -//│ let* (x$77) = zipWith(f_7$0,x$71,x$74) in -- #396 -//│ let x$78 = Cons(x$76,x$77) in -- #395 -//│ jump j$8(x$78) -- #394 +//│ let x$120 = Cons.t(xs_8$0) in -- #595 +//│ let x$121 = Cons.h(xs_8$0) in -- #594 +//│ let* (x$122) = mappend(x$120,ys_8$0) in -- #593 +//│ let x$123 = Cons(x$121,x$122) in -- #592 +//│ jump j$16(x$123) -- #591 +//│ Nil => +//│ jump j$16(ys_8$0) -- #597 +//│ def j$16(x$119) = +//│ x$119 -- #571 +//│ def sum(ls_14$0) = +//│ let* (x$124) = sumAux(ls_14$0,0) in -- #605 +//│ x$124 -- #604 +//│ def sumAux(ls_15$0,a_4$0) = +//│ case ls_15$0 of -- #631 //│ Nil => -//│ let x$79 = Nil() in -- #402 -//│ jump j$8(x$79) -- #401 -//│ Nil => -//│ let x$80 = Nil() in -- #408 -//│ jump j$7(x$80) -- #407 -//│ ) -//│ Def(29, j$7, [x$70], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$70 -- #355 -//│ ) -//│ Def(30, j$8, [x$73], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$7(x$73) -- #366 -//│ ) -//│ Def(31, head, [ls_7$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_7$0 of -- #427 -//│ Cons => -//│ let x$82 = Cons.t(ls_7$0) in -- #423 -//│ let x$83 = Cons.h(ls_7$0) in -- #422 -//│ jump j$9(x$83) -- #421 -//│ Nil => -//│ let x$85 = Lambda$0() in -- #426 -//│ jump j$9(x$85) -- #425 -//│ ) -//│ Def(32, j$9, [x$81], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$81 -- #411 -//│ ) -//│ Def(33, tail, [ls_9$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_9$0 of -- #445 -//│ Cons => -//│ let x$87 = Cons.t(ls_9$0) in -- #441 -//│ let x$88 = Cons.h(ls_9$0) in -- #440 -//│ jump j$10(x$87) -- #439 -//│ Nil => -//│ let x$90 = Lambda$1() in -- #444 -//│ jump j$10(x$90) -- #443 -//│ ) -//│ Def(34, j$10, [x$86], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$86 -- #429 -//│ ) -//│ Def(35, enumFromTo, [a$0,b$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$91 = <=(a$0,b$0) in -- #471 -//│ if x$91 -- #470 -//│ true => -//│ let x$93 = +(a$0,1) in -- #466 -//│ let* (x$94) = enumFromTo(x$93,b$0) in -- #465 -//│ let x$95 = Cons(a$0,x$94) in -- #464 -//│ jump j$11(x$95) -- #463 -//│ false => -//│ let x$96 = Nil() in -- #469 -//│ jump j$11(x$96) -- #468 -//│ ) -//│ Def(36, j$11, [x$92], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$92 -- #449 -//│ ) -//│ Def(37, enumFromThenTo, [a_1$0,t_11$0,b_1$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$97 = <=(a_1$0,b_1$0) in -- #502 -//│ if x$97 -- #501 -//│ true => -//│ let x$99 = *(2,t_11$0) in -- #497 -//│ let x$100 = -(x$99,a_1$0) in -- #496 -//│ let* (x$101) = enumFromThenTo(t_11$0,x$100,b_1$0) in -- #495 -//│ let x$102 = Cons(a_1$0,x$101) in -- #494 -//│ jump j$12(x$102) -- #493 -//│ false => -//│ let x$103 = Nil() in -- #500 -//│ jump j$12(x$103) -- #499 -//│ ) -//│ Def(38, j$12, [x$98], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$98 -- #475 -//│ ) -//│ Def(39, take, [n$0,ls_11$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$104 = >(n$0,0) in -- #545 -//│ if x$104 -- #544 -//│ true => -//│ case ls_11$0 of -- #540 +//│ jump j$17(a_4$0) -- #609 +//│ Cons => +//│ let x$126 = Cons.t(ls_15$0) in -- #630 +//│ let x$127 = Cons.h(ls_15$0) in -- #629 +//│ let x$128 = +(a_4$0,x$127) in -- #628 +//│ let* (x$129) = sumAux(x$126,x$128) in -- #627 +//│ jump j$17(x$129) -- #626 +//│ def j$17(x$125) = +//│ x$125 -- #607 +//│ def atIndex(n_2$0,ls_16$0) = +//│ let x$130 = <(n_2$0,0) in -- #677 +//│ if x$130 -- #676 +//│ true => +//│ let x$133 = Lambda$2() in -- #638 +//│ jump j$18(x$133) -- #637 +//│ false => +//│ case ls_16$0 of -- #675 +//│ Cons => +//│ let x$135 = Cons.t(ls_16$0) in -- #671 +//│ let x$136 = Cons.h(ls_16$0) in -- #670 +//│ let x$137 = ==(n_2$0,0) in -- #669 +//│ if x$137 -- #668 +//│ true => +//│ jump j$20(x$136) -- #656 +//│ false => +//│ let x$139 = -(n_2$0,1) in -- #667 +//│ let* (x$140) = atIndex(x$139,x$135) in -- #666 +//│ jump j$20(x$140) -- #665 +//│ Nil => +//│ let x$142 = Lambda$3() in -- #674 +//│ jump j$19(x$142) -- #673 +//│ def j$18(x$131) = +//│ x$131 -- #635 +//│ def j$19(x$134) = +//│ jump j$18(x$134) -- #641 +//│ def j$20(x$138) = +//│ jump j$19(x$138) -- #654 +//│ def concat(lss$0) = +//│ case lss$0 of -- #705 //│ Cons => -//│ let x$107 = Cons.t(ls_11$0) in -- #536 -//│ let x$108 = Cons.h(ls_11$0) in -- #535 -//│ let x$109 = -(n$0,1) in -- #534 -//│ let* (x$110) = take(x$109,x$107) in -- #533 -//│ let x$111 = Cons(x$108,x$110) in -- #532 -//│ jump j$14(x$111) -- #531 +//│ let x$144 = Cons.t(lss$0) in -- #701 +//│ let x$145 = Cons.h(lss$0) in -- #700 +//│ let* (x$146) = concat(x$144) in -- #699 +//│ let* (x$147) = mappend(x$145,x$146) in -- #698 +//│ jump j$21(x$147) -- #697 //│ Nil => -//│ let x$112 = Nil() in -- #539 -//│ jump j$14(x$112) -- #538 -//│ false => -//│ let x$113 = Nil() in -- #543 -//│ jump j$13(x$113) -- #542 -//│ ) -//│ Def(40, j$13, [x$105], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$105 -- #506 -//│ ) -//│ Def(41, j$14, [x$106], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$13(x$106) -- #509 -//│ ) -//│ Def(42, length, [ls_13$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_13$0 of -- #569 -//│ Cons => -//│ let x$115 = Cons.t(ls_13$0) in -- #566 -//│ let x$116 = Cons.h(ls_13$0) in -- #565 -//│ let* (x$117) = length(x$115) in -- #564 -//│ let x$118 = +(1,x$117) in -- #563 -//│ jump j$15(x$118) -- #562 -//│ Nil => -//│ jump j$15(0) -- #568 -//│ ) -//│ Def(43, j$15, [x$114], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$114 -- #547 -//│ ) -//│ Def(44, mappend, [xs_8$0,ys_8$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case xs_8$0 of -- #598 -//│ Cons => -//│ let x$120 = Cons.t(xs_8$0) in -- #595 -//│ let x$121 = Cons.h(xs_8$0) in -- #594 -//│ let* (x$122) = mappend(x$120,ys_8$0) in -- #593 -//│ let x$123 = Cons(x$121,x$122) in -- #592 -//│ jump j$16(x$123) -- #591 -//│ Nil => -//│ jump j$16(ys_8$0) -- #597 -//│ ) -//│ Def(45, j$16, [x$119], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$119 -- #571 -//│ ) -//│ Def(46, sum, [ls_14$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$124) = sumAux(ls_14$0,0) in -- #605 -//│ x$124 -- #604 -//│ ) -//│ Def(47, sumAux, [ls_15$0,a_4$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_15$0 of -- #631 -//│ Nil => -//│ jump j$17(a_4$0) -- #609 -//│ Cons => -//│ let x$126 = Cons.t(ls_15$0) in -- #630 -//│ let x$127 = Cons.h(ls_15$0) in -- #629 -//│ let x$128 = +(a_4$0,x$127) in -- #628 -//│ let* (x$129) = sumAux(x$126,x$128) in -- #627 -//│ jump j$17(x$129) -- #626 -//│ ) -//│ Def(48, j$17, [x$125], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$125 -- #607 -//│ ) -//│ Def(49, atIndex, [n_2$0,ls_16$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$130 = <(n_2$0,0) in -- #677 -//│ if x$130 -- #676 -//│ true => -//│ let x$133 = Lambda$2() in -- #638 -//│ jump j$18(x$133) -- #637 -//│ false => -//│ case ls_16$0 of -- #675 +//│ let x$148 = Nil() in -- #704 +//│ jump j$21(x$148) -- #703 +//│ def j$21(x$143) = +//│ x$143 -- #679 +//│ def reverse(ls_18$0) = +//│ let x$149 = Nil() in -- #713 +//│ let* (x$150) = reverse_helper(ls_18$0,x$149) in -- #712 +//│ x$150 -- #711 +//│ def reverse_helper(ls_19$0,a_5$0) = +//│ case ls_19$0 of -- #742 //│ Cons => -//│ let x$135 = Cons.t(ls_16$0) in -- #671 -//│ let x$136 = Cons.h(ls_16$0) in -- #670 -//│ let x$137 = ==(n_2$0,0) in -- #669 -//│ if x$137 -- #668 -//│ true => -//│ jump j$20(x$136) -- #656 -//│ false => -//│ let x$139 = -(n_2$0,1) in -- #667 -//│ let* (x$140) = atIndex(x$139,x$135) in -- #666 -//│ jump j$20(x$140) -- #665 +//│ let x$152 = Cons.t(ls_19$0) in -- #739 +//│ let x$153 = Cons.h(ls_19$0) in -- #738 +//│ let x$154 = Cons(x$153,a_5$0) in -- #737 +//│ let* (x$155) = reverse_helper(x$152,x$154) in -- #736 +//│ jump j$22(x$155) -- #735 //│ Nil => -//│ let x$142 = Lambda$3() in -- #674 -//│ jump j$19(x$142) -- #673 -//│ ) -//│ Def(50, j$18, [x$131], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$131 -- #635 -//│ ) -//│ Def(51, j$19, [x$134], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$18(x$134) -- #641 -//│ ) -//│ Def(52, j$20, [x$138], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$19(x$138) -- #654 -//│ ) -//│ Def(53, concat, [lss$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case lss$0 of -- #705 -//│ Cons => -//│ let x$144 = Cons.t(lss$0) in -- #701 -//│ let x$145 = Cons.h(lss$0) in -- #700 -//│ let* (x$146) = concat(x$144) in -- #699 -//│ let* (x$147) = mappend(x$145,x$146) in -- #698 -//│ jump j$21(x$147) -- #697 -//│ Nil => -//│ let x$148 = Nil() in -- #704 -//│ jump j$21(x$148) -- #703 -//│ ) -//│ Def(54, j$21, [x$143], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$143 -- #679 -//│ ) -//│ Def(55, reverse, [ls_18$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$149 = Nil() in -- #713 -//│ let* (x$150) = reverse_helper(ls_18$0,x$149) in -- #712 -//│ x$150 -- #711 -//│ ) -//│ Def(56, reverse_helper, [ls_19$0,a_5$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_19$0 of -- #742 -//│ Cons => -//│ let x$152 = Cons.t(ls_19$0) in -- #739 -//│ let x$153 = Cons.h(ls_19$0) in -- #738 -//│ let x$154 = Cons(x$153,a_5$0) in -- #737 -//│ let* (x$155) = reverse_helper(x$152,x$154) in -- #736 -//│ jump j$22(x$155) -- #735 -//│ Nil => -//│ jump j$22(a_5$0) -- #741 -//│ ) -//│ Def(57, j$22, [x$151], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$151 -- #715 -//│ ) -//│ Def(58, listcomp_fun1, [ms$0,listcomp_fun_para$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case listcomp_fun_para$0 of -- #770 -//│ Cons => -//│ let x$157 = Cons.t(listcomp_fun_para$0) in -- #766 -//│ let x$158 = Cons.h(listcomp_fun_para$0) in -- #765 -//│ let* (x$159) = listcomp_fun2(ms$0,x$158,x$157,ms$0) in -- #764 -//│ jump j$23(x$159) -- #763 -//│ Nil => -//│ let x$160 = Nil() in -- #769 -//│ jump j$23(x$160) -- #768 -//│ ) -//│ Def(59, j$23, [x$156], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$156 -- #744 -//│ ) -//│ Def(60, listcomp_fun2, [ms$1,listcomp_fun_ls_h_out$0,listcomp_fun_ls_t_out$0,listcomp_fun_para$1], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case listcomp_fun_para$1 of -- #815 -//│ Cons => -//│ let x$162 = Cons.t(listcomp_fun_para$1) in -- #806 -//│ let x$163 = Cons.h(listcomp_fun_para$1) in -- #805 -//│ let x$164 = Tuple2(listcomp_fun_ls_h_out$0,x$163) in -- #804 -//│ let* (x$165) = listcomp_fun2(ms$1,listcomp_fun_ls_h_out$0,listcomp_fun_ls_t_out$0,x$162) in -- #803 -//│ let x$166 = Cons(x$164,x$165) in -- #802 -//│ jump j$24(x$166) -- #801 -//│ Nil => -//│ let* (x$167) = listcomp_fun1(ms$1,listcomp_fun_ls_t_out$0) in -- #814 -//│ jump j$24(x$167) -- #813 -//│ ) -//│ Def(61, j$24, [x$161], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$161 -- #772 -//│ ) -//│ Def(62, test, [test_arg1$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$168) = const5000() in -- #876 -//│ let* (x$169) = const5000() in -- #875 -//│ let* (x$170) = z_add(x$169,test_arg1$0) in -- #874 -//│ let* (x$171) = z_enumFromTo(x$168,x$170) in -- #873 -//│ let* (x$172) = const10000() in -- #872 -//│ let* (x$173) = const10000() in -- #871 -//│ let* (x$174) = z_add(x$173,test_arg1$0) in -- #870 -//│ let* (x$175) = z_enumFromTo(x$172,x$174) in -- #869 -//│ let x$178 = Lambda$4() in -- #868 -//│ let* (x$179) = listcomp_fun1(x$175,x$171) in -- #867 -//│ let* (x$180) = map(x$178,x$179) in -- #866 -//│ let x$183 = Lambda$5() in -- #865 -//│ let* (x$184) = map(x$183,x$180) in -- #864 -//│ let* (x$185) = max'(x$184) in -- #863 -//│ x$185 -- #862 -//│ ) -//│ Def(63, const10000, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$186) = z_of_int(10000) in -- #881 -//│ x$186 -- #880 -//│ ) -//│ Def(64, f1, [f1_arg1$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case f1_arg1$0 of -- #910 -//│ Tuple2 => -//│ let x$188 = Tuple2.y(f1_arg1$0) in -- #909 -//│ let x$189 = Tuple2.x(f1_arg1$0) in -- #908 -//│ let* (x$190) = gcdE(x$189,x$188) in -- #907 -//│ let x$191 = Tuple3(x$189,x$188,x$190) in -- #906 -//│ jump j$25(x$191) -- #905 -//│ ) -//│ Def(65, j$25, [x$187], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$187 -- #883 -//│ ) -//│ Def(66, quotRem, [quotRem_arg1$0,quotRem_arg2$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$192) = z_div(quotRem_arg1$0,quotRem_arg2$0) in -- #929 -//│ let* (x$193) = z_mod(quotRem_arg1$0,quotRem_arg2$0) in -- #928 -//│ let x$194 = Tuple2(x$192,x$193) in -- #927 -//│ x$194 -- #926 -//│ ) -//│ Def(67, max', [max'_arg1$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case max'_arg1$0 of -- #992 -//│ Cons => -//│ let x$196 = Cons.t(max'_arg1$0) in -- #991 -//│ let x$197 = Cons.h(max'_arg1$0) in -- #990 -//│ case x$196 of -- #989 +//│ jump j$22(a_5$0) -- #741 +//│ def j$22(x$151) = +//│ x$151 -- #715 +//│ def listcomp_fun1(ms$0,listcomp_fun_para$0) = +//│ case listcomp_fun_para$0 of -- #770 +//│ Cons => +//│ let x$157 = Cons.t(listcomp_fun_para$0) in -- #766 +//│ let x$158 = Cons.h(listcomp_fun_para$0) in -- #765 +//│ let* (x$159) = listcomp_fun2(ms$0,x$158,x$157,ms$0) in -- #764 +//│ jump j$23(x$159) -- #763 //│ Nil => -//│ jump j$27(x$197) -- #944 +//│ let x$160 = Nil() in -- #769 +//│ jump j$23(x$160) -- #768 +//│ def j$23(x$156) = +//│ x$156 -- #744 +//│ def listcomp_fun2(ms$1,listcomp_fun_ls_h_out$0,listcomp_fun_ls_t_out$0,listcomp_fun_para$1) = +//│ case listcomp_fun_para$1 of -- #815 //│ Cons => -//│ let x$199 = Cons.t(x$196) in -- #988 -//│ let x$200 = Cons.h(x$196) in -- #987 -//│ let* (x$201) = z_lt(x$197,x$200) in -- #986 -//│ if x$201 -- #985 -//│ true => -//│ let x$203 = Cons(x$200,x$199) in -- #972 -//│ let* (x$204) = max'(x$203) in -- #971 -//│ jump j$28(x$204) -- #970 -//│ false => -//│ let x$205 = Cons(x$197,x$199) in -- #984 -//│ let* (x$206) = max'(x$205) in -- #983 -//│ jump j$28(x$206) -- #982 -//│ ) -//│ Def(68, j$26, [x$195], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$195 -- #931 -//│ ) -//│ Def(69, j$27, [x$198], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$26(x$198) -- #942 -//│ ) -//│ Def(70, j$28, [x$202], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$27(x$202) -- #960 -//│ ) -//│ Def(71, g, [g_arg1$0,g_arg2$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case g_arg1$0 of -- #1120 -//│ Tuple3 => -//│ let x$208 = Tuple3.z(g_arg1$0) in -- #1119 -//│ let x$209 = Tuple3.y(g_arg1$0) in -- #1118 -//│ let x$210 = Tuple3.x(g_arg1$0) in -- #1117 -//│ case g_arg2$0 of -- #1116 +//│ let x$162 = Cons.t(listcomp_fun_para$1) in -- #806 +//│ let x$163 = Cons.h(listcomp_fun_para$1) in -- #805 +//│ let x$164 = Tuple2(listcomp_fun_ls_h_out$0,x$163) in -- #804 +//│ let* (x$165) = listcomp_fun2(ms$1,listcomp_fun_ls_h_out$0,listcomp_fun_ls_t_out$0,x$162) in -- #803 +//│ let x$166 = Cons(x$164,x$165) in -- #802 +//│ jump j$24(x$166) -- #801 +//│ Nil => +//│ let* (x$167) = listcomp_fun1(ms$1,listcomp_fun_ls_t_out$0) in -- #814 +//│ jump j$24(x$167) -- #813 +//│ def j$24(x$161) = +//│ x$161 -- #772 +//│ def test(test_arg1$0) = +//│ let* (x$168) = const5000() in -- #876 +//│ let* (x$169) = const5000() in -- #875 +//│ let* (x$170) = z_add(x$169,test_arg1$0) in -- #874 +//│ let* (x$171) = z_enumFromTo(x$168,x$170) in -- #873 +//│ let* (x$172) = const10000() in -- #872 +//│ let* (x$173) = const10000() in -- #871 +//│ let* (x$174) = z_add(x$173,test_arg1$0) in -- #870 +//│ let* (x$175) = z_enumFromTo(x$172,x$174) in -- #869 +//│ let x$178 = Lambda$4() in -- #868 +//│ let* (x$179) = listcomp_fun1(x$175,x$171) in -- #867 +//│ let* (x$180) = map(x$178,x$179) in -- #866 +//│ let x$183 = Lambda$5() in -- #865 +//│ let* (x$184) = map(x$183,x$180) in -- #864 +//│ let* (x$185) = max'(x$184) in -- #863 +//│ x$185 -- #862 +//│ def const10000() = +//│ let* (x$186) = z_of_int(10000) in -- #881 +//│ x$186 -- #880 +//│ def f1(f1_arg1$0) = +//│ case f1_arg1$0 of -- #910 +//│ Tuple2 => +//│ let x$188 = Tuple2.y(f1_arg1$0) in -- #909 +//│ let x$189 = Tuple2.x(f1_arg1$0) in -- #908 +//│ let* (x$190) = gcdE(x$189,x$188) in -- #907 +//│ let x$191 = Tuple3(x$189,x$188,x$190) in -- #906 +//│ jump j$25(x$191) -- #905 +//│ def j$25(x$187) = +//│ x$187 -- #883 +//│ def quotRem(quotRem_arg1$0,quotRem_arg2$0) = +//│ let* (x$192) = z_div(quotRem_arg1$0,quotRem_arg2$0) in -- #929 +//│ let* (x$193) = z_mod(quotRem_arg1$0,quotRem_arg2$0) in -- #928 +//│ let x$194 = Tuple2(x$192,x$193) in -- #927 +//│ x$194 -- #926 +//│ def max'(max'_arg1$0) = +//│ case max'_arg1$0 of -- #992 +//│ Cons => +//│ let x$196 = Cons.t(max'_arg1$0) in -- #991 +//│ let x$197 = Cons.h(max'_arg1$0) in -- #990 +//│ case x$196 of -- #989 +//│ Nil => +//│ jump j$27(x$197) -- #944 +//│ Cons => +//│ let x$199 = Cons.t(x$196) in -- #988 +//│ let x$200 = Cons.h(x$196) in -- #987 +//│ let* (x$201) = z_lt(x$197,x$200) in -- #986 +//│ if x$201 -- #985 +//│ true => +//│ let x$203 = Cons(x$200,x$199) in -- #972 +//│ let* (x$204) = max'(x$203) in -- #971 +//│ jump j$28(x$204) -- #970 +//│ false => +//│ let x$205 = Cons(x$197,x$199) in -- #984 +//│ let* (x$206) = max'(x$205) in -- #983 +//│ jump j$28(x$206) -- #982 +//│ def j$26(x$195) = +//│ x$195 -- #931 +//│ def j$27(x$198) = +//│ jump j$26(x$198) -- #942 +//│ def j$28(x$202) = +//│ jump j$27(x$202) -- #960 +//│ def g(g_arg1$0,g_arg2$0) = +//│ case g_arg1$0 of -- #1120 //│ Tuple3 => -//│ let x$212 = Tuple3.z(g_arg2$0) in -- #1115 -//│ let x$213 = Tuple3.y(g_arg2$0) in -- #1114 -//│ let x$214 = Tuple3.x(g_arg2$0) in -- #1113 -//│ let* (x$215) = const0() in -- #1112 -//│ let* (x$216) = z_equal(x$212,x$215) in -- #1111 -//│ if x$216 -- #1110 -//│ true => -//│ let x$218 = Tuple3(x$208,x$210,x$209) in -- #1040 -//│ jump j$31(x$218) -- #1039 -//│ false => -//│ let* (x$219) = quotRem(x$208,x$212) in -- #1109 -//│ case x$219 of -- #1108 -//│ Tuple2 => -//│ let x$221 = Tuple2.y(x$219) in -- #1107 -//│ let x$222 = Tuple2.x(x$219) in -- #1106 -//│ let x$223 = Tuple3(x$214,x$213,x$212) in -- #1105 -//│ let* (x$224) = z_mul(x$222,x$214) in -- #1104 -//│ let* (x$225) = z_sub(x$210,x$224) in -- #1103 -//│ let* (x$226) = z_mul(x$222,x$213) in -- #1102 -//│ let* (x$227) = z_sub(x$209,x$226) in -- #1101 -//│ let x$228 = Tuple3(x$225,x$227,x$221) in -- #1100 -//│ let* (x$229) = g(x$223,x$228) in -- #1099 -//│ jump j$32(x$229) -- #1098 -//│ ) -//│ Def(72, j$29, [x$207], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$207 -- #994 -//│ ) -//│ Def(73, j$30, [x$211], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$29(x$211) -- #1009 -//│ ) -//│ Def(74, j$31, [x$217], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$30(x$217) -- #1030 -//│ ) -//│ Def(75, j$32, [x$220], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$31(x$220) -- #1049 -//│ ) -//│ Def(76, abs, [abs_arg1$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$230) = const0() in -- #1143 -//│ let* (x$231) = z_lt(abs_arg1$0,x$230) in -- #1142 -//│ if x$231 -- #1141 -//│ true => -//│ let* (x$233) = const0() in -- #1138 -//│ let* (x$234) = z_sub(x$233,abs_arg1$0) in -- #1137 -//│ jump j$33(x$234) -- #1136 -//│ false => -//│ jump j$33(abs_arg1$0) -- #1140 -//│ ) -//│ Def(77, j$33, [x$232], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$232 -- #1128 -//│ ) -//│ Def(78, f2, [f2_arg1$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case f2_arg1$0 of -- #1198 -//│ Tuple3 => -//│ let x$236 = Tuple3.z(f2_arg1$0) in -- #1197 -//│ let x$237 = Tuple3.y(f2_arg1$0) in -- #1196 -//│ let x$238 = Tuple3.x(f2_arg1$0) in -- #1195 -//│ case x$236 of -- #1194 +//│ let x$208 = Tuple3.z(g_arg1$0) in -- #1119 +//│ let x$209 = Tuple3.y(g_arg1$0) in -- #1118 +//│ let x$210 = Tuple3.x(g_arg1$0) in -- #1117 +//│ case g_arg2$0 of -- #1116 +//│ Tuple3 => +//│ let x$212 = Tuple3.z(g_arg2$0) in -- #1115 +//│ let x$213 = Tuple3.y(g_arg2$0) in -- #1114 +//│ let x$214 = Tuple3.x(g_arg2$0) in -- #1113 +//│ let* (x$215) = const0() in -- #1112 +//│ let* (x$216) = z_equal(x$212,x$215) in -- #1111 +//│ if x$216 -- #1110 +//│ true => +//│ let x$218 = Tuple3(x$208,x$210,x$209) in -- #1040 +//│ jump j$31(x$218) -- #1039 +//│ false => +//│ let* (x$219) = quotRem(x$208,x$212) in -- #1109 +//│ case x$219 of -- #1108 +//│ Tuple2 => +//│ let x$221 = Tuple2.y(x$219) in -- #1107 +//│ let x$222 = Tuple2.x(x$219) in -- #1106 +//│ let x$223 = Tuple3(x$214,x$213,x$212) in -- #1105 +//│ let* (x$224) = z_mul(x$222,x$214) in -- #1104 +//│ let* (x$225) = z_sub(x$210,x$224) in -- #1103 +//│ let* (x$226) = z_mul(x$222,x$213) in -- #1102 +//│ let* (x$227) = z_sub(x$209,x$226) in -- #1101 +//│ let x$228 = Tuple3(x$225,x$227,x$221) in -- #1100 +//│ let* (x$229) = g(x$223,x$228) in -- #1099 +//│ jump j$32(x$229) -- #1098 +//│ def j$29(x$207) = +//│ x$207 -- #994 +//│ def j$30(x$211) = +//│ jump j$29(x$211) -- #1009 +//│ def j$31(x$217) = +//│ jump j$30(x$217) -- #1030 +//│ def j$32(x$220) = +//│ jump j$31(x$220) -- #1049 +//│ def abs(abs_arg1$0) = +//│ let* (x$230) = const0() in -- #1143 +//│ let* (x$231) = z_lt(abs_arg1$0,x$230) in -- #1142 +//│ if x$231 -- #1141 +//│ true => +//│ let* (x$233) = const0() in -- #1138 +//│ let* (x$234) = z_sub(x$233,abs_arg1$0) in -- #1137 +//│ jump j$33(x$234) -- #1136 +//│ false => +//│ jump j$33(abs_arg1$0) -- #1140 +//│ def j$33(x$232) = +//│ x$232 -- #1128 +//│ def f2(f2_arg1$0) = +//│ case f2_arg1$0 of -- #1198 //│ Tuple3 => -//│ let x$240 = Tuple3.z(x$236) in -- #1193 -//│ let x$241 = Tuple3.y(x$236) in -- #1192 -//│ let x$242 = Tuple3.x(x$236) in -- #1191 -//│ let* (x$243) = z_add(x$242,x$241) in -- #1190 -//│ let* (x$244) = z_add(x$243,x$240) in -- #1189 -//│ let* (x$245) = abs(x$244) in -- #1188 -//│ jump j$35(x$245) -- #1187 -//│ ) -//│ Def(79, j$34, [x$235], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$235 -- #1145 -//│ ) -//│ Def(80, j$35, [x$239], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$34(x$239) -- #1160 -//│ ) -//│ Def(81, const0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$246) = z_of_int(0) in -- #1203 -//│ x$246 -- #1202 -//│ ) -//│ Def(82, gcdE, [gcdE_arg1$0,gcdE_arg2$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$247) = const0() in -- #1260 -//│ let* (x$248) = z_equal(gcdE_arg1$0,x$247) in -- #1259 -//│ if x$248 -- #1258 -//│ true => -//│ let* (x$250) = const0() in -- #1225 -//│ let* (x$251) = const1() in -- #1224 -//│ let x$252 = Tuple3(gcdE_arg2$0,x$250,x$251) in -- #1223 -//│ jump j$36(x$252) -- #1222 -//│ false => -//│ let* (x$253) = const1() in -- #1257 -//│ let* (x$254) = const0() in -- #1256 -//│ let x$255 = Tuple3(x$253,x$254,gcdE_arg1$0) in -- #1255 -//│ let* (x$256) = const0() in -- #1254 -//│ let* (x$257) = const1() in -- #1253 -//│ let x$258 = Tuple3(x$256,x$257,gcdE_arg2$0) in -- #1252 -//│ let* (x$259) = g(x$255,x$258) in -- #1251 -//│ jump j$36(x$259) -- #1250 -//│ ) -//│ Def(83, j$36, [x$249], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$249 -- #1211 -//│ ) -//│ Def(84, const1, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$260) = z_of_int(1) in -- #1265 -//│ x$260 -- #1264 -//│ ) -//│ Def(85, const5000, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$261) = z_of_int(5000) in -- #1270 -//│ x$261 -- #1269 -//│ ) -//│ Def(86, testGcd_nofib, [testGcd_nofib_arg1$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$262) = test(testGcd_nofib_arg1$0) in -- #1275 -//│ x$262 -- #1274 -//│ ) -//│ Def(87, z_enumFromTo, [z_enumFromTo_arg1$0,z_enumFromTo_arg2$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$263) = z_leq(z_enumFromTo_arg1$0,z_enumFromTo_arg2$0) in -- #1309 -//│ if x$263 -- #1308 -//│ true => -//│ let* (x$265) = const1() in -- #1304 -//│ let* (x$266) = z_add(z_enumFromTo_arg1$0,x$265) in -- #1303 -//│ let* (x$267) = z_enumFromTo(x$266,z_enumFromTo_arg2$0) in -- #1302 -//│ let x$268 = Cons(z_enumFromTo_arg1$0,x$267) in -- #1301 -//│ jump j$37(x$268) -- #1300 -//│ false => -//│ let x$269 = Nil() in -- #1307 -//│ jump j$37(x$269) -- #1306 -//│ ) -//│ Def(88, j$37, [x$264], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$264 -- #1282 -//│ ) -//│ }, -//│ let* (x$0) = z_of_int(400) in -- #8 -//│ let* (x$1) = testGcd_nofib(x$0) in -- #7 -//│ x$1 -- #6) +//│ let x$236 = Tuple3.z(f2_arg1$0) in -- #1197 +//│ let x$237 = Tuple3.y(f2_arg1$0) in -- #1196 +//│ let x$238 = Tuple3.x(f2_arg1$0) in -- #1195 +//│ case x$236 of -- #1194 +//│ Tuple3 => +//│ let x$240 = Tuple3.z(x$236) in -- #1193 +//│ let x$241 = Tuple3.y(x$236) in -- #1192 +//│ let x$242 = Tuple3.x(x$236) in -- #1191 +//│ let* (x$243) = z_add(x$242,x$241) in -- #1190 +//│ let* (x$244) = z_add(x$243,x$240) in -- #1189 +//│ let* (x$245) = abs(x$244) in -- #1188 +//│ jump j$35(x$245) -- #1187 +//│ def j$34(x$235) = +//│ x$235 -- #1145 +//│ def j$35(x$239) = +//│ jump j$34(x$239) -- #1160 +//│ def const0() = +//│ let* (x$246) = z_of_int(0) in -- #1203 +//│ x$246 -- #1202 +//│ def gcdE(gcdE_arg1$0,gcdE_arg2$0) = +//│ let* (x$247) = const0() in -- #1260 +//│ let* (x$248) = z_equal(gcdE_arg1$0,x$247) in -- #1259 +//│ if x$248 -- #1258 +//│ true => +//│ let* (x$250) = const0() in -- #1225 +//│ let* (x$251) = const1() in -- #1224 +//│ let x$252 = Tuple3(gcdE_arg2$0,x$250,x$251) in -- #1223 +//│ jump j$36(x$252) -- #1222 +//│ false => +//│ let* (x$253) = const1() in -- #1257 +//│ let* (x$254) = const0() in -- #1256 +//│ let x$255 = Tuple3(x$253,x$254,gcdE_arg1$0) in -- #1255 +//│ let* (x$256) = const0() in -- #1254 +//│ let* (x$257) = const1() in -- #1253 +//│ let x$258 = Tuple3(x$256,x$257,gcdE_arg2$0) in -- #1252 +//│ let* (x$259) = g(x$255,x$258) in -- #1251 +//│ jump j$36(x$259) -- #1250 +//│ def j$36(x$249) = +//│ x$249 -- #1211 +//│ def const1() = +//│ let* (x$260) = z_of_int(1) in -- #1265 +//│ x$260 -- #1264 +//│ def const5000() = +//│ let* (x$261) = z_of_int(5000) in -- #1270 +//│ x$261 -- #1269 +//│ def testGcd_nofib(testGcd_nofib_arg1$0) = +//│ let* (x$262) = test(testGcd_nofib_arg1$0) in -- #1275 +//│ x$262 -- #1274 +//│ def z_enumFromTo(z_enumFromTo_arg1$0,z_enumFromTo_arg2$0) = +//│ let* (x$263) = z_leq(z_enumFromTo_arg1$0,z_enumFromTo_arg2$0) in -- #1309 +//│ if x$263 -- #1308 +//│ true => +//│ let* (x$265) = const1() in -- #1304 +//│ let* (x$266) = z_add(z_enumFromTo_arg1$0,x$265) in -- #1303 +//│ let* (x$267) = z_enumFromTo(x$266,z_enumFromTo_arg2$0) in -- #1302 +//│ let x$268 = Cons(z_enumFromTo_arg1$0,x$267) in -- #1301 +//│ jump j$37(x$268) -- #1300 +//│ false => +//│ let x$269 = Nil() in -- #1307 +//│ jump j$37(x$269) -- #1306 +//│ def j$37(x$264) = +//│ x$264 -- #1282 +//│ let* (x$0) = z_of_int(400) in -- #8 +//│ let* (x$1) = testGcd_nofib(x$0) in -- #7 +//│ x$1 -- #6 //│ //│ Promoted: -//│ Program({ClassInfo(0, True, [], parents: , methods: -//│ ), -//│ ClassInfo(1, False, [], parents: , methods: -//│ ), -//│ ClassInfo(2, Callable, [], parents: , methods: -//│ apply5 -> Def(94, apply5, [x0$4,x1$3,x2$2,x3$1,x4$0], [{},{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #1315 -//│ ), -//│ apply1 -> Def(90, apply1, [x0$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #1311 -//│ ), -//│ apply0 -> Def(89, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #1310 -//│ ), -//│ apply4 -> Def(93, apply4, [x0$3,x1$2,x2$1,x3$0], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #1314 -//│ ), -//│ apply3 -> Def(92, apply3, [x0$2,x1$1,x2$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #1313 -//│ ), -//│ apply2 -> Def(91, apply2, [x0$1,x1$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ 0 -- #1312 -//│ )), -//│ ClassInfo(3, List, [], parents: , methods: -//│ ), -//│ ClassInfo(4, Cons, [h,t], parents: List, methods: -//│ ), -//│ ClassInfo(5, Nil, [], parents: List, methods: -//│ ), -//│ ClassInfo(6, Option, [], parents: , methods: -//│ ), -//│ ClassInfo(7, Some, [x], parents: Option, methods: -//│ ), -//│ ClassInfo(8, None, [], parents: Option, methods: -//│ ), -//│ ClassInfo(9, Tuple2, [x,y], parents: , methods: -//│ ), -//│ ClassInfo(10, Tuple3, [x,y,z], parents: , methods: -//│ ), -//│ ClassInfo(11, Lambda$0, [], parents: Callable, methods: -//│ apply0 -> Def(95, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$270) = error() in -- #1318 -//│ x$270 -- #1317 -//│ )), -//│ ClassInfo(12, Lambda$1, [], parents: Callable, methods: -//│ apply0 -> Def(96, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$271) = error() in -- #1321 -//│ x$271 -- #1320 -//│ )), -//│ ClassInfo(13, Lambda$2, [], parents: Callable, methods: -//│ apply0 -> Def(97, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$272) = error() in -- #1324 -//│ x$272 -- #1323 -//│ )), -//│ ClassInfo(14, Lambda$3, [], parents: Callable, methods: -//│ apply0 -> Def(98, apply0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$273) = error() in -- #1327 -//│ x$273 -- #1326 -//│ )), -//│ ClassInfo(15, Lambda$4, [], parents: Callable, methods: -//│ apply1 -> Def(99, apply1, [x$274], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$275) = f1(x$274) in -- #1332 -//│ x$275 -- #1331 -//│ )), -//│ ClassInfo(16, Lambda$5, [], parents: Callable, methods: -//│ apply1 -> Def(100, apply1, [x$276], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$277) = f2(x$276) in -- #1337 -//│ x$277 -- #1336 -//│ ))}, { -//│ Def(0, error, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$2 = Callable.apply1(builtin,error) in -- #14 -//│ x$2 -- #13 -//│ ) -//│ Def(1, z_of_int, [x$3], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$4 = Callable.apply2(builtin,z_of_int,x$3) in -- #22 -//│ x$4 -- #21 -//│ ) -//│ Def(2, z_to_int, [x$5], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$6 = Callable.apply2(builtin,z_to_int,x$5) in -- #30 -//│ x$6 -- #29 -//│ ) -//│ Def(3, z_add, [x$7,y$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$8 = Callable.apply3(builtin,z_add,x$7,y$0) in -- #40 -//│ x$8 -- #39 -//│ ) -//│ Def(4, z_sub, [x$9,y$1], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$10 = Callable.apply3(builtin,z_sub,x$9,y$1) in -- #50 -//│ x$10 -- #49 -//│ ) -//│ Def(5, z_div, [x$11,y$2], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$12 = Callable.apply3(builtin,z_div,x$11,y$2) in -- #60 -//│ x$12 -- #59 -//│ ) -//│ Def(6, z_mul, [x$13,y$3], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$14 = Callable.apply3(builtin,z_mul,x$13,y$3) in -- #70 -//│ x$14 -- #69 -//│ ) -//│ Def(7, z_mod, [x$15,y$4], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$16 = Callable.apply3(builtin,z_mod,x$15,y$4) in -- #80 -//│ x$16 -- #79 -//│ ) -//│ Def(8, z_lt, [x$17,y$5], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$18 = Callable.apply3(builtin,z_lt,x$17,y$5) in -- #90 -//│ x$18 -- #89 -//│ ) -//│ Def(9, z_leq, [x$19,y$6], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$20 = Callable.apply3(builtin,z_leq,x$19,y$6) in -- #100 -//│ x$20 -- #99 -//│ ) -//│ Def(10, z_equal, [x$21,y$7], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$22 = Callable.apply3(builtin,z_equal,x$21,y$7) in -- #110 -//│ x$22 -- #109 -//│ ) -//│ Def(11, z_gt, [x$23,y$8], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$24 = Callable.apply3(builtin,z_gt,x$23,y$8) in -- #120 -//│ x$24 -- #119 -//│ ) -//│ Def(12, z_geq, [x$25,y$9], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$26 = Callable.apply3(builtin,z_geq,x$25,y$9) in -- #130 -//│ x$26 -- #129 -//│ ) -//│ Def(13, println, [x$27], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$28 = Callable.apply2(builtin,println,x$27) in -- #138 -//│ x$28 -- #137 -//│ ) -//│ Def(14, print, [x$29], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$30 = Callable.apply2(builtin,print,x$29) in -- #146 -//│ x$30 -- #145 -//│ ) -//│ Def(15, debug, [x$31], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$32 = Callable.apply2(builtin,debug,x$31) in -- #154 -//│ x$32 -- #153 -//│ ) -//│ Def(16, map, [f$0,ls$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls$0 of -- #189 -//│ Cons => -//│ let x$34 = Cons.t(ls$0) in -- #185 -//│ let x$35 = Cons.h(ls$0) in -- #184 -//│ let x$36 = Callable.apply1(f$0,x$35) in -- #183 -//│ let* (x$37) = map(f$0,x$34) in -- #182 -//│ let x$38 = Cons(x$36,x$37) in -- #181 -//│ jump j$0(x$38) -- #180 -//│ Nil => -//│ let x$39 = Nil() in -- #188 -//│ jump j$0(x$39) -- #187 -//│ ) -//│ Def(17, j$0, [x$33], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$33 -- #156 -//│ ) -//│ Def(18, filter, [f_2$0,ls_2$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_2$0 of -- #236 -//│ Cons => -//│ let x$41 = Cons.t(ls_2$0) in -- #232 -//│ let x$42 = Cons.h(ls_2$0) in -- #231 -//│ let x$43 = Callable.apply1(f_2$0,x$42) in -- #230 -//│ if x$43 -- #229 +//│ Program: +//│ class True() +//│ class False() +//│ class Callable() { +//│ def apply5(x0$4,x1$3,x2$2,x3$1,x4$0) = +//│ 0 -- #1315 +//│ def apply1(x0$0) = +//│ 0 -- #1311 +//│ def apply0() = +//│ 0 -- #1310 +//│ def apply4(x0$3,x1$2,x2$1,x3$0) = +//│ 0 -- #1314 +//│ def apply3(x0$2,x1$1,x2$0) = +//│ 0 -- #1313 +//│ def apply2(x0$1,x1$0) = +//│ 0 -- #1312 +//│ } +//│ class List() +//│ class Cons(h,t) extends List +//│ class Nil() extends List +//│ class Option() +//│ class Some(x) extends Option +//│ class None() extends Option +//│ class Tuple2(x,y) +//│ class Tuple3(x,y,z) +//│ class Lambda$0() extends Callable { +//│ def apply0() = +//│ let* (x$270) = error() in -- #1318 +//│ x$270 -- #1317 +//│ } +//│ class Lambda$1() extends Callable { +//│ def apply0() = +//│ let* (x$271) = error() in -- #1321 +//│ x$271 -- #1320 +//│ } +//│ class Lambda$2() extends Callable { +//│ def apply0() = +//│ let* (x$272) = error() in -- #1324 +//│ x$272 -- #1323 +//│ } +//│ class Lambda$3() extends Callable { +//│ def apply0() = +//│ let* (x$273) = error() in -- #1327 +//│ x$273 -- #1326 +//│ } +//│ class Lambda$4() extends Callable { +//│ def apply1(x$274) = +//│ let* (x$275) = f1(x$274) in -- #1332 +//│ x$275 -- #1331 +//│ } +//│ class Lambda$5() extends Callable { +//│ def apply1(x$276) = +//│ let* (x$277) = f2(x$276) in -- #1337 +//│ x$277 -- #1336 +//│ } +//│ def error() = +//│ let x$2 = Callable.apply1(builtin,error) in -- #14 +//│ x$2 -- #13 +//│ def z_of_int(x$3) = +//│ let x$4 = Callable.apply2(builtin,z_of_int,x$3) in -- #22 +//│ x$4 -- #21 +//│ def z_to_int(x$5) = +//│ let x$6 = Callable.apply2(builtin,z_to_int,x$5) in -- #30 +//│ x$6 -- #29 +//│ def z_add(x$7,y$0) = +//│ let x$8 = Callable.apply3(builtin,z_add,x$7,y$0) in -- #40 +//│ x$8 -- #39 +//│ def z_sub(x$9,y$1) = +//│ let x$10 = Callable.apply3(builtin,z_sub,x$9,y$1) in -- #50 +//│ x$10 -- #49 +//│ def z_div(x$11,y$2) = +//│ let x$12 = Callable.apply3(builtin,z_div,x$11,y$2) in -- #60 +//│ x$12 -- #59 +//│ def z_mul(x$13,y$3) = +//│ let x$14 = Callable.apply3(builtin,z_mul,x$13,y$3) in -- #70 +//│ x$14 -- #69 +//│ def z_mod(x$15,y$4) = +//│ let x$16 = Callable.apply3(builtin,z_mod,x$15,y$4) in -- #80 +//│ x$16 -- #79 +//│ def z_lt(x$17,y$5) = +//│ let x$18 = Callable.apply3(builtin,z_lt,x$17,y$5) in -- #90 +//│ x$18 -- #89 +//│ def z_leq(x$19,y$6) = +//│ let x$20 = Callable.apply3(builtin,z_leq,x$19,y$6) in -- #100 +//│ x$20 -- #99 +//│ def z_equal(x$21,y$7) = +//│ let x$22 = Callable.apply3(builtin,z_equal,x$21,y$7) in -- #110 +//│ x$22 -- #109 +//│ def z_gt(x$23,y$8) = +//│ let x$24 = Callable.apply3(builtin,z_gt,x$23,y$8) in -- #120 +//│ x$24 -- #119 +//│ def z_geq(x$25,y$9) = +//│ let x$26 = Callable.apply3(builtin,z_geq,x$25,y$9) in -- #130 +//│ x$26 -- #129 +//│ def println(x$27) = +//│ let x$28 = Callable.apply2(builtin,println,x$27) in -- #138 +//│ x$28 -- #137 +//│ def print(x$29) = +//│ let x$30 = Callable.apply2(builtin,print,x$29) in -- #146 +//│ x$30 -- #145 +//│ def debug(x$31) = +//│ let x$32 = Callable.apply2(builtin,debug,x$31) in -- #154 +//│ x$32 -- #153 +//│ def map(f$0,ls$0) = +//│ case ls$0 of -- #189 +//│ Cons => +//│ let x$34 = Cons.t(ls$0) in -- #185 +//│ let x$35 = Cons.h(ls$0) in -- #184 +//│ let x$36 = Callable.apply1(f$0,x$35) in -- #183 +//│ let* (x$37) = map(f$0,x$34) in -- #182 +//│ let x$38 = Cons(x$36,x$37) in -- #181 +//│ jump j$0(x$38) -- #180 +//│ Nil => +//│ let x$39 = Nil() in -- #188 +//│ jump j$0(x$39) -- #187 +//│ def j$0(x$33) = +//│ x$33 -- #156 +//│ def filter(f_2$0,ls_2$0) = +//│ case ls_2$0 of -- #236 +//│ Cons => +//│ let x$41 = Cons.t(ls_2$0) in -- #232 +//│ let x$42 = Cons.h(ls_2$0) in -- #231 +//│ let x$43 = Callable.apply1(f_2$0,x$42) in -- #230 +//│ if x$43 -- #229 +//│ true => +//│ let* (x$45) = filter(f_2$0,x$41) in -- #220 +//│ let x$46 = Cons(x$42,x$45) in -- #219 +//│ jump j$2(x$46) -- #218 +//│ false => +//│ let* (x$47) = filter(f_2$0,x$41) in -- #228 +//│ jump j$2(x$47) -- #227 +//│ Nil => +//│ let x$48 = Nil() in -- #235 +//│ jump j$1(x$48) -- #234 +//│ def j$1(x$40) = +//│ x$40 -- #191 +//│ def j$2(x$44) = +//│ jump j$1(x$44) -- #206 +//│ def foldl(f_4$0,i$0,ls_4$0) = +//│ case ls_4$0 of -- #268 +//│ Cons => +//│ let x$50 = Cons.t(ls_4$0) in -- #265 +//│ let x$51 = Cons.h(ls_4$0) in -- #264 +//│ let x$52 = Callable.apply2(f_4$0,i$0,x$51) in -- #263 +//│ let* (x$53) = foldl(f_4$0,x$52,x$50) in -- #262 +//│ jump j$3(x$53) -- #261 +//│ Nil => +//│ jump j$3(i$0) -- #267 +//│ def j$3(x$49) = +//│ x$49 -- #238 +//│ def foldr(f_5$0,i_1$0,ls_5$0) = +//│ case ls_5$0 of -- #300 +//│ Cons => +//│ let x$55 = Cons.t(ls_5$0) in -- #297 +//│ let x$56 = Cons.h(ls_5$0) in -- #296 +//│ let* (x$57) = foldr(f_5$0,i_1$0,x$55) in -- #295 +//│ let x$58 = Callable.apply2(f_5$0,x$56,x$57) in -- #294 +//│ jump j$4(x$58) -- #293 +//│ Nil => +//│ jump j$4(i_1$0) -- #299 +//│ def j$4(x$54) = +//│ x$54 -- #270 +//│ def zip(xs$0,ys$0) = +//│ case xs$0 of -- #353 +//│ Cons => +//│ let x$60 = Cons.t(xs$0) in -- #349 +//│ let x$61 = Cons.h(xs$0) in -- #348 +//│ case ys$0 of -- #347 +//│ Cons => +//│ let x$63 = Cons.t(ys$0) in -- #343 +//│ let x$64 = Cons.h(ys$0) in -- #342 +//│ let x$65 = Tuple2(x$61,x$64) in -- #341 +//│ let* (x$66) = zip(x$60,x$63) in -- #340 +//│ let x$67 = Cons(x$65,x$66) in -- #339 +//│ jump j$6(x$67) -- #338 +//│ Nil => +//│ let x$68 = Nil() in -- #346 +//│ jump j$6(x$68) -- #345 +//│ Nil => +//│ let x$69 = Nil() in -- #352 +//│ jump j$5(x$69) -- #351 +//│ def j$5(x$59) = +//│ x$59 -- #302 +//│ def j$6(x$62) = +//│ jump j$5(x$62) -- #313 +//│ def zipWith(f_7$0,xs_4$0,ys_4$0) = +//│ case xs_4$0 of -- #409 +//│ Cons => +//│ let x$71 = Cons.t(xs_4$0) in -- #405 +//│ let x$72 = Cons.h(xs_4$0) in -- #404 +//│ case ys_4$0 of -- #403 +//│ Cons => +//│ let x$74 = Cons.t(ys_4$0) in -- #399 +//│ let x$75 = Cons.h(ys_4$0) in -- #398 +//│ let x$76 = Callable.apply2(f_7$0,x$72,x$75) in -- #397 +//│ let* (x$77) = zipWith(f_7$0,x$71,x$74) in -- #396 +//│ let x$78 = Cons(x$76,x$77) in -- #395 +//│ jump j$8(x$78) -- #394 +//│ Nil => +//│ let x$79 = Nil() in -- #402 +//│ jump j$8(x$79) -- #401 +//│ Nil => +//│ let x$80 = Nil() in -- #408 +//│ jump j$7(x$80) -- #407 +//│ def j$7(x$70) = +//│ x$70 -- #355 +//│ def j$8(x$73) = +//│ jump j$7(x$73) -- #366 +//│ def head(ls_7$0) = +//│ case ls_7$0 of -- #427 +//│ Cons => +//│ let x$82 = Cons.t(ls_7$0) in -- #423 +//│ let x$83 = Cons.h(ls_7$0) in -- #422 +//│ jump j$9(x$83) -- #421 +//│ Nil => +//│ let x$85 = Lambda$0() in -- #426 +//│ jump j$9(x$85) -- #425 +//│ def j$9(x$81) = +//│ x$81 -- #411 +//│ def tail(ls_9$0) = +//│ case ls_9$0 of -- #445 +//│ Cons => +//│ let x$87 = Cons.t(ls_9$0) in -- #441 +//│ let x$88 = Cons.h(ls_9$0) in -- #440 +//│ jump j$10(x$87) -- #439 +//│ Nil => +//│ let x$90 = Lambda$1() in -- #444 +//│ jump j$10(x$90) -- #443 +//│ def j$10(x$86) = +//│ x$86 -- #429 +//│ def enumFromTo(a$0,b$0) = +//│ let x$91 = <=(a$0,b$0) in -- #471 +//│ if x$91 -- #470 //│ true => -//│ let* (x$45) = filter(f_2$0,x$41) in -- #220 -//│ let x$46 = Cons(x$42,x$45) in -- #219 -//│ jump j$2(x$46) -- #218 +//│ let x$93 = +(a$0,1) in -- #466 +//│ let* (x$94) = enumFromTo(x$93,b$0) in -- #465 +//│ let x$95 = Cons(a$0,x$94) in -- #464 +//│ jump j$11(x$95) -- #463 //│ false => -//│ let* (x$47) = filter(f_2$0,x$41) in -- #228 -//│ jump j$2(x$47) -- #227 -//│ Nil => -//│ let x$48 = Nil() in -- #235 -//│ jump j$1(x$48) -- #234 -//│ ) -//│ Def(19, j$1, [x$40], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$40 -- #191 -//│ ) -//│ Def(20, j$2, [x$44], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$1(x$44) -- #206 -//│ ) -//│ Def(21, foldl, [f_4$0,i$0,ls_4$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_4$0 of -- #268 -//│ Cons => -//│ let x$50 = Cons.t(ls_4$0) in -- #265 -//│ let x$51 = Cons.h(ls_4$0) in -- #264 -//│ let x$52 = Callable.apply2(f_4$0,i$0,x$51) in -- #263 -//│ let* (x$53) = foldl(f_4$0,x$52,x$50) in -- #262 -//│ jump j$3(x$53) -- #261 -//│ Nil => -//│ jump j$3(i$0) -- #267 -//│ ) -//│ Def(22, j$3, [x$49], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$49 -- #238 -//│ ) -//│ Def(23, foldr, [f_5$0,i_1$0,ls_5$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_5$0 of -- #300 -//│ Cons => -//│ let x$55 = Cons.t(ls_5$0) in -- #297 -//│ let x$56 = Cons.h(ls_5$0) in -- #296 -//│ let* (x$57) = foldr(f_5$0,i_1$0,x$55) in -- #295 -//│ let x$58 = Callable.apply2(f_5$0,x$56,x$57) in -- #294 -//│ jump j$4(x$58) -- #293 -//│ Nil => -//│ jump j$4(i_1$0) -- #299 -//│ ) -//│ Def(24, j$4, [x$54], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$54 -- #270 -//│ ) -//│ Def(25, zip, [xs$0,ys$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case xs$0 of -- #353 -//│ Cons => -//│ let x$60 = Cons.t(xs$0) in -- #349 -//│ let x$61 = Cons.h(xs$0) in -- #348 -//│ case ys$0 of -- #347 +//│ let x$96 = Nil() in -- #469 +//│ jump j$11(x$96) -- #468 +//│ def j$11(x$92) = +//│ x$92 -- #449 +//│ def enumFromThenTo(a_1$0,t_11$0,b_1$0) = +//│ let x$97 = <=(a_1$0,b_1$0) in -- #502 +//│ if x$97 -- #501 +//│ true => +//│ let x$99 = *(2,t_11$0) in -- #497 +//│ let x$100 = -(x$99,a_1$0) in -- #496 +//│ let* (x$101) = enumFromThenTo(t_11$0,x$100,b_1$0) in -- #495 +//│ let x$102 = Cons(a_1$0,x$101) in -- #494 +//│ jump j$12(x$102) -- #493 +//│ false => +//│ let x$103 = Nil() in -- #500 +//│ jump j$12(x$103) -- #499 +//│ def j$12(x$98) = +//│ x$98 -- #475 +//│ def take(n$0,ls_11$0) = +//│ let x$104 = >(n$0,0) in -- #545 +//│ if x$104 -- #544 +//│ true => +//│ case ls_11$0 of -- #540 +//│ Cons => +//│ let x$107 = Cons.t(ls_11$0) in -- #536 +//│ let x$108 = Cons.h(ls_11$0) in -- #535 +//│ let x$109 = -(n$0,1) in -- #534 +//│ let* (x$110) = take(x$109,x$107) in -- #533 +//│ let x$111 = Cons(x$108,x$110) in -- #532 +//│ jump j$14(x$111) -- #531 +//│ Nil => +//│ let x$112 = Nil() in -- #539 +//│ jump j$14(x$112) -- #538 +//│ false => +//│ let x$113 = Nil() in -- #543 +//│ jump j$13(x$113) -- #542 +//│ def j$13(x$105) = +//│ x$105 -- #506 +//│ def j$14(x$106) = +//│ jump j$13(x$106) -- #509 +//│ def length(ls_13$0) = +//│ case ls_13$0 of -- #569 //│ Cons => -//│ let x$63 = Cons.t(ys$0) in -- #343 -//│ let x$64 = Cons.h(ys$0) in -- #342 -//│ let x$65 = Tuple2(x$61,x$64) in -- #341 -//│ let* (x$66) = zip(x$60,x$63) in -- #340 -//│ let x$67 = Cons(x$65,x$66) in -- #339 -//│ jump j$6(x$67) -- #338 +//│ let x$115 = Cons.t(ls_13$0) in -- #566 +//│ let x$116 = Cons.h(ls_13$0) in -- #565 +//│ let* (x$117) = length(x$115) in -- #564 +//│ let x$118 = +(1,x$117) in -- #563 +//│ jump j$15(x$118) -- #562 //│ Nil => -//│ let x$68 = Nil() in -- #346 -//│ jump j$6(x$68) -- #345 -//│ Nil => -//│ let x$69 = Nil() in -- #352 -//│ jump j$5(x$69) -- #351 -//│ ) -//│ Def(26, j$5, [x$59], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$59 -- #302 -//│ ) -//│ Def(27, j$6, [x$62], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$5(x$62) -- #313 -//│ ) -//│ Def(28, zipWith, [f_7$0,xs_4$0,ys_4$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case xs_4$0 of -- #409 -//│ Cons => -//│ let x$71 = Cons.t(xs_4$0) in -- #405 -//│ let x$72 = Cons.h(xs_4$0) in -- #404 -//│ case ys_4$0 of -- #403 +//│ jump j$15(0) -- #568 +//│ def j$15(x$114) = +//│ x$114 -- #547 +//│ def mappend(xs_8$0,ys_8$0) = +//│ case xs_8$0 of -- #598 //│ Cons => -//│ let x$74 = Cons.t(ys_4$0) in -- #399 -//│ let x$75 = Cons.h(ys_4$0) in -- #398 -//│ let x$76 = Callable.apply2(f_7$0,x$72,x$75) in -- #397 -//│ let* (x$77) = zipWith(f_7$0,x$71,x$74) in -- #396 -//│ let x$78 = Cons(x$76,x$77) in -- #395 -//│ jump j$8(x$78) -- #394 +//│ let x$120 = Cons.t(xs_8$0) in -- #595 +//│ let x$121 = Cons.h(xs_8$0) in -- #594 +//│ let* (x$122) = mappend(x$120,ys_8$0) in -- #593 +//│ let x$123 = Cons(x$121,x$122) in -- #592 +//│ jump j$16(x$123) -- #591 +//│ Nil => +//│ jump j$16(ys_8$0) -- #597 +//│ def j$16(x$119) = +//│ x$119 -- #571 +//│ def sum(ls_14$0) = +//│ let* (x$124) = sumAux(ls_14$0,0) in -- #605 +//│ x$124 -- #604 +//│ def sumAux(ls_15$0,a_4$0) = +//│ case ls_15$0 of -- #631 //│ Nil => -//│ let x$79 = Nil() in -- #402 -//│ jump j$8(x$79) -- #401 -//│ Nil => -//│ let x$80 = Nil() in -- #408 -//│ jump j$7(x$80) -- #407 -//│ ) -//│ Def(29, j$7, [x$70], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$70 -- #355 -//│ ) -//│ Def(30, j$8, [x$73], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$7(x$73) -- #366 -//│ ) -//│ Def(31, head, [ls_7$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_7$0 of -- #427 -//│ Cons => -//│ let x$82 = Cons.t(ls_7$0) in -- #423 -//│ let x$83 = Cons.h(ls_7$0) in -- #422 -//│ jump j$9(x$83) -- #421 -//│ Nil => -//│ let x$85 = Lambda$0() in -- #426 -//│ jump j$9(x$85) -- #425 -//│ ) -//│ Def(32, j$9, [x$81], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$81 -- #411 -//│ ) -//│ Def(33, tail, [ls_9$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_9$0 of -- #445 -//│ Cons => -//│ let x$87 = Cons.t(ls_9$0) in -- #441 -//│ let x$88 = Cons.h(ls_9$0) in -- #440 -//│ jump j$10(x$87) -- #439 -//│ Nil => -//│ let x$90 = Lambda$1() in -- #444 -//│ jump j$10(x$90) -- #443 -//│ ) -//│ Def(34, j$10, [x$86], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$86 -- #429 -//│ ) -//│ Def(35, enumFromTo, [a$0,b$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$91 = <=(a$0,b$0) in -- #471 -//│ if x$91 -- #470 -//│ true => -//│ let x$93 = +(a$0,1) in -- #466 -//│ let* (x$94) = enumFromTo(x$93,b$0) in -- #465 -//│ let x$95 = Cons(a$0,x$94) in -- #464 -//│ jump j$11(x$95) -- #463 -//│ false => -//│ let x$96 = Nil() in -- #469 -//│ jump j$11(x$96) -- #468 -//│ ) -//│ Def(36, j$11, [x$92], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$92 -- #449 -//│ ) -//│ Def(37, enumFromThenTo, [a_1$0,t_11$0,b_1$0], [{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$97 = <=(a_1$0,b_1$0) in -- #502 -//│ if x$97 -- #501 -//│ true => -//│ let x$99 = *(2,t_11$0) in -- #497 -//│ let x$100 = -(x$99,a_1$0) in -- #496 -//│ let* (x$101) = enumFromThenTo(t_11$0,x$100,b_1$0) in -- #495 -//│ let x$102 = Cons(a_1$0,x$101) in -- #494 -//│ jump j$12(x$102) -- #493 -//│ false => -//│ let x$103 = Nil() in -- #500 -//│ jump j$12(x$103) -- #499 -//│ ) -//│ Def(38, j$12, [x$98], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$98 -- #475 -//│ ) -//│ Def(39, take, [n$0,ls_11$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$104 = >(n$0,0) in -- #545 -//│ if x$104 -- #544 -//│ true => -//│ case ls_11$0 of -- #540 +//│ jump j$17(a_4$0) -- #609 +//│ Cons => +//│ let x$126 = Cons.t(ls_15$0) in -- #630 +//│ let x$127 = Cons.h(ls_15$0) in -- #629 +//│ let x$128 = +(a_4$0,x$127) in -- #628 +//│ let* (x$129) = sumAux(x$126,x$128) in -- #627 +//│ jump j$17(x$129) -- #626 +//│ def j$17(x$125) = +//│ x$125 -- #607 +//│ def atIndex(n_2$0,ls_16$0) = +//│ let x$130 = <(n_2$0,0) in -- #677 +//│ if x$130 -- #676 +//│ true => +//│ let x$133 = Lambda$2() in -- #638 +//│ jump j$18(x$133) -- #637 +//│ false => +//│ case ls_16$0 of -- #675 +//│ Cons => +//│ let x$135 = Cons.t(ls_16$0) in -- #671 +//│ let x$136 = Cons.h(ls_16$0) in -- #670 +//│ let x$137 = ==(n_2$0,0) in -- #669 +//│ if x$137 -- #668 +//│ true => +//│ jump j$20(x$136) -- #656 +//│ false => +//│ let x$139 = -(n_2$0,1) in -- #667 +//│ let* (x$140) = atIndex(x$139,x$135) in -- #666 +//│ jump j$20(x$140) -- #665 +//│ Nil => +//│ let x$142 = Lambda$3() in -- #674 +//│ jump j$19(x$142) -- #673 +//│ def j$18(x$131) = +//│ x$131 -- #635 +//│ def j$19(x$134) = +//│ jump j$18(x$134) -- #641 +//│ def j$20(x$138) = +//│ jump j$19(x$138) -- #654 +//│ def concat(lss$0) = +//│ case lss$0 of -- #705 //│ Cons => -//│ let x$107 = Cons.t(ls_11$0) in -- #536 -//│ let x$108 = Cons.h(ls_11$0) in -- #535 -//│ let x$109 = -(n$0,1) in -- #534 -//│ let* (x$110) = take(x$109,x$107) in -- #533 -//│ let x$111 = Cons(x$108,x$110) in -- #532 -//│ jump j$14(x$111) -- #531 +//│ let x$144 = Cons.t(lss$0) in -- #701 +//│ let x$145 = Cons.h(lss$0) in -- #700 +//│ let* (x$146) = concat(x$144) in -- #699 +//│ let* (x$147) = mappend(x$145,x$146) in -- #698 +//│ jump j$21(x$147) -- #697 //│ Nil => -//│ let x$112 = Nil() in -- #539 -//│ jump j$14(x$112) -- #538 -//│ false => -//│ let x$113 = Nil() in -- #543 -//│ jump j$13(x$113) -- #542 -//│ ) -//│ Def(40, j$13, [x$105], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$105 -- #506 -//│ ) -//│ Def(41, j$14, [x$106], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$13(x$106) -- #509 -//│ ) -//│ Def(42, length, [ls_13$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_13$0 of -- #569 -//│ Cons => -//│ let x$115 = Cons.t(ls_13$0) in -- #566 -//│ let x$116 = Cons.h(ls_13$0) in -- #565 -//│ let* (x$117) = length(x$115) in -- #564 -//│ let x$118 = +(1,x$117) in -- #563 -//│ jump j$15(x$118) -- #562 -//│ Nil => -//│ jump j$15(0) -- #568 -//│ ) -//│ Def(43, j$15, [x$114], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$114 -- #547 -//│ ) -//│ Def(44, mappend, [xs_8$0,ys_8$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case xs_8$0 of -- #598 -//│ Cons => -//│ let x$120 = Cons.t(xs_8$0) in -- #595 -//│ let x$121 = Cons.h(xs_8$0) in -- #594 -//│ let* (x$122) = mappend(x$120,ys_8$0) in -- #593 -//│ let x$123 = Cons(x$121,x$122) in -- #592 -//│ jump j$16(x$123) -- #591 -//│ Nil => -//│ jump j$16(ys_8$0) -- #597 -//│ ) -//│ Def(45, j$16, [x$119], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$119 -- #571 -//│ ) -//│ Def(46, sum, [ls_14$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$124) = sumAux(ls_14$0,0) in -- #605 -//│ x$124 -- #604 -//│ ) -//│ Def(47, sumAux, [ls_15$0,a_4$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_15$0 of -- #631 -//│ Nil => -//│ jump j$17(a_4$0) -- #609 -//│ Cons => -//│ let x$126 = Cons.t(ls_15$0) in -- #630 -//│ let x$127 = Cons.h(ls_15$0) in -- #629 -//│ let x$128 = +(a_4$0,x$127) in -- #628 -//│ let* (x$129) = sumAux(x$126,x$128) in -- #627 -//│ jump j$17(x$129) -- #626 -//│ ) -//│ Def(48, j$17, [x$125], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$125 -- #607 -//│ ) -//│ Def(49, atIndex, [n_2$0,ls_16$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$130 = <(n_2$0,0) in -- #677 -//│ if x$130 -- #676 -//│ true => -//│ let x$133 = Lambda$2() in -- #638 -//│ jump j$18(x$133) -- #637 -//│ false => -//│ case ls_16$0 of -- #675 +//│ let x$148 = Nil() in -- #704 +//│ jump j$21(x$148) -- #703 +//│ def j$21(x$143) = +//│ x$143 -- #679 +//│ def reverse(ls_18$0) = +//│ let x$149 = Nil() in -- #713 +//│ let* (x$150) = reverse_helper(ls_18$0,x$149) in -- #712 +//│ x$150 -- #711 +//│ def reverse_helper(ls_19$0,a_5$0) = +//│ case ls_19$0 of -- #742 //│ Cons => -//│ let x$135 = Cons.t(ls_16$0) in -- #671 -//│ let x$136 = Cons.h(ls_16$0) in -- #670 -//│ let x$137 = ==(n_2$0,0) in -- #669 -//│ if x$137 -- #668 -//│ true => -//│ jump j$20(x$136) -- #656 -//│ false => -//│ let x$139 = -(n_2$0,1) in -- #667 -//│ let* (x$140) = atIndex(x$139,x$135) in -- #666 -//│ jump j$20(x$140) -- #665 +//│ let x$152 = Cons.t(ls_19$0) in -- #739 +//│ let x$153 = Cons.h(ls_19$0) in -- #738 +//│ let x$154 = Cons(x$153,a_5$0) in -- #737 +//│ let* (x$155) = reverse_helper(x$152,x$154) in -- #736 +//│ jump j$22(x$155) -- #735 //│ Nil => -//│ let x$142 = Lambda$3() in -- #674 -//│ jump j$19(x$142) -- #673 -//│ ) -//│ Def(50, j$18, [x$131], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$131 -- #635 -//│ ) -//│ Def(51, j$19, [x$134], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$18(x$134) -- #641 -//│ ) -//│ Def(52, j$20, [x$138], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$19(x$138) -- #654 -//│ ) -//│ Def(53, concat, [lss$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case lss$0 of -- #705 -//│ Cons => -//│ let x$144 = Cons.t(lss$0) in -- #701 -//│ let x$145 = Cons.h(lss$0) in -- #700 -//│ let* (x$146) = concat(x$144) in -- #699 -//│ let* (x$147) = mappend(x$145,x$146) in -- #698 -//│ jump j$21(x$147) -- #697 -//│ Nil => -//│ let x$148 = Nil() in -- #704 -//│ jump j$21(x$148) -- #703 -//│ ) -//│ Def(54, j$21, [x$143], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$143 -- #679 -//│ ) -//│ Def(55, reverse, [ls_18$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let x$149 = Nil() in -- #713 -//│ let* (x$150) = reverse_helper(ls_18$0,x$149) in -- #712 -//│ x$150 -- #711 -//│ ) -//│ Def(56, reverse_helper, [ls_19$0,a_5$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case ls_19$0 of -- #742 -//│ Cons => -//│ let x$152 = Cons.t(ls_19$0) in -- #739 -//│ let x$153 = Cons.h(ls_19$0) in -- #738 -//│ let x$154 = Cons(x$153,a_5$0) in -- #737 -//│ let* (x$155) = reverse_helper(x$152,x$154) in -- #736 -//│ jump j$22(x$155) -- #735 -//│ Nil => -//│ jump j$22(a_5$0) -- #741 -//│ ) -//│ Def(57, j$22, [x$151], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$151 -- #715 -//│ ) -//│ Def(58, listcomp_fun1, [ms$0,listcomp_fun_para$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case listcomp_fun_para$0 of -- #770 -//│ Cons => -//│ let x$157 = Cons.t(listcomp_fun_para$0) in -- #766 -//│ let x$158 = Cons.h(listcomp_fun_para$0) in -- #765 -//│ let* (x$159) = listcomp_fun2(ms$0,x$158,x$157,ms$0) in -- #764 -//│ jump j$23(x$159) -- #763 -//│ Nil => -//│ let x$160 = Nil() in -- #769 -//│ jump j$23(x$160) -- #768 -//│ ) -//│ Def(59, j$23, [x$156], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$156 -- #744 -//│ ) -//│ Def(60, listcomp_fun2, [ms$1,listcomp_fun_ls_h_out$0,listcomp_fun_ls_t_out$0,listcomp_fun_para$1], [{},{},{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case listcomp_fun_para$1 of -- #815 -//│ Cons => -//│ let x$162 = Cons.t(listcomp_fun_para$1) in -- #806 -//│ let x$163 = Cons.h(listcomp_fun_para$1) in -- #805 -//│ let x$164 = Tuple2(listcomp_fun_ls_h_out$0,x$163) in -- #804 -//│ let* (x$165) = listcomp_fun2(ms$1,listcomp_fun_ls_h_out$0,listcomp_fun_ls_t_out$0,x$162) in -- #803 -//│ let x$166 = Cons(x$164,x$165) in -- #802 -//│ jump j$24(x$166) -- #801 -//│ Nil => -//│ let* (x$167) = listcomp_fun1(ms$1,listcomp_fun_ls_t_out$0) in -- #814 -//│ jump j$24(x$167) -- #813 -//│ ) -//│ Def(61, j$24, [x$161], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$161 -- #772 -//│ ) -//│ Def(62, test, [test_arg1$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$168) = const5000() in -- #876 -//│ let* (x$169) = const5000() in -- #875 -//│ let* (x$170) = z_add(x$169,test_arg1$0) in -- #874 -//│ let* (x$171) = z_enumFromTo(x$168,x$170) in -- #873 -//│ let* (x$172) = const10000() in -- #872 -//│ let* (x$173) = const10000() in -- #871 -//│ let* (x$174) = z_add(x$173,test_arg1$0) in -- #870 -//│ let* (x$175) = z_enumFromTo(x$172,x$174) in -- #869 -//│ let x$178 = Lambda$4() in -- #868 -//│ let* (x$179) = listcomp_fun1(x$175,x$171) in -- #867 -//│ let* (x$180) = map(x$178,x$179) in -- #866 -//│ let x$183 = Lambda$5() in -- #865 -//│ let* (x$184) = map(x$183,x$180) in -- #864 -//│ let* (x$185) = max'(x$184) in -- #863 -//│ x$185 -- #862 -//│ ) -//│ Def(63, const10000, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$186) = z_of_int(10000) in -- #881 -//│ x$186 -- #880 -//│ ) -//│ Def(64, f1, [f1_arg1$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case f1_arg1$0 of -- #910 -//│ Tuple2 => -//│ let x$188 = Tuple2.y(f1_arg1$0) in -- #909 -//│ let x$189 = Tuple2.x(f1_arg1$0) in -- #908 -//│ let* (x$190) = gcdE(x$189,x$188) in -- #907 -//│ let x$191 = Tuple3(x$189,x$188,x$190) in -- #906 -//│ jump j$25(x$191) -- #905 -//│ ) -//│ Def(65, j$25, [x$187], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$187 -- #883 -//│ ) -//│ Def(66, quotRem, [quotRem_arg1$0,quotRem_arg2$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$192) = z_div(quotRem_arg1$0,quotRem_arg2$0) in -- #929 -//│ let* (x$193) = z_mod(quotRem_arg1$0,quotRem_arg2$0) in -- #928 -//│ let x$194 = Tuple2(x$192,x$193) in -- #927 -//│ x$194 -- #926 -//│ ) -//│ Def(67, max', [max'_arg1$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case max'_arg1$0 of -- #992 -//│ Cons => -//│ let x$196 = Cons.t(max'_arg1$0) in -- #991 -//│ let x$197 = Cons.h(max'_arg1$0) in -- #990 -//│ case x$196 of -- #989 +//│ jump j$22(a_5$0) -- #741 +//│ def j$22(x$151) = +//│ x$151 -- #715 +//│ def listcomp_fun1(ms$0,listcomp_fun_para$0) = +//│ case listcomp_fun_para$0 of -- #770 +//│ Cons => +//│ let x$157 = Cons.t(listcomp_fun_para$0) in -- #766 +//│ let x$158 = Cons.h(listcomp_fun_para$0) in -- #765 +//│ let* (x$159) = listcomp_fun2(ms$0,x$158,x$157,ms$0) in -- #764 +//│ jump j$23(x$159) -- #763 //│ Nil => -//│ jump j$27(x$197) -- #944 +//│ let x$160 = Nil() in -- #769 +//│ jump j$23(x$160) -- #768 +//│ def j$23(x$156) = +//│ x$156 -- #744 +//│ def listcomp_fun2(ms$1,listcomp_fun_ls_h_out$0,listcomp_fun_ls_t_out$0,listcomp_fun_para$1) = +//│ case listcomp_fun_para$1 of -- #815 //│ Cons => -//│ let x$199 = Cons.t(x$196) in -- #988 -//│ let x$200 = Cons.h(x$196) in -- #987 -//│ let* (x$201) = z_lt(x$197,x$200) in -- #986 -//│ if x$201 -- #985 -//│ true => -//│ let x$203 = Cons(x$200,x$199) in -- #972 -//│ let* (x$204) = max'(x$203) in -- #971 -//│ jump j$28(x$204) -- #970 -//│ false => -//│ let x$205 = Cons(x$197,x$199) in -- #984 -//│ let* (x$206) = max'(x$205) in -- #983 -//│ jump j$28(x$206) -- #982 -//│ ) -//│ Def(68, j$26, [x$195], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$195 -- #931 -//│ ) -//│ Def(69, j$27, [x$198], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$26(x$198) -- #942 -//│ ) -//│ Def(70, j$28, [x$202], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$27(x$202) -- #960 -//│ ) -//│ Def(71, g, [g_arg1$0,g_arg2$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case g_arg1$0 of -- #1120 -//│ Tuple3 => -//│ let x$208 = Tuple3.z(g_arg1$0) in -- #1119 -//│ let x$209 = Tuple3.y(g_arg1$0) in -- #1118 -//│ let x$210 = Tuple3.x(g_arg1$0) in -- #1117 -//│ case g_arg2$0 of -- #1116 +//│ let x$162 = Cons.t(listcomp_fun_para$1) in -- #806 +//│ let x$163 = Cons.h(listcomp_fun_para$1) in -- #805 +//│ let x$164 = Tuple2(listcomp_fun_ls_h_out$0,x$163) in -- #804 +//│ let* (x$165) = listcomp_fun2(ms$1,listcomp_fun_ls_h_out$0,listcomp_fun_ls_t_out$0,x$162) in -- #803 +//│ let x$166 = Cons(x$164,x$165) in -- #802 +//│ jump j$24(x$166) -- #801 +//│ Nil => +//│ let* (x$167) = listcomp_fun1(ms$1,listcomp_fun_ls_t_out$0) in -- #814 +//│ jump j$24(x$167) -- #813 +//│ def j$24(x$161) = +//│ x$161 -- #772 +//│ def test(test_arg1$0) = +//│ let* (x$168) = const5000() in -- #876 +//│ let* (x$169) = const5000() in -- #875 +//│ let* (x$170) = z_add(x$169,test_arg1$0) in -- #874 +//│ let* (x$171) = z_enumFromTo(x$168,x$170) in -- #873 +//│ let* (x$172) = const10000() in -- #872 +//│ let* (x$173) = const10000() in -- #871 +//│ let* (x$174) = z_add(x$173,test_arg1$0) in -- #870 +//│ let* (x$175) = z_enumFromTo(x$172,x$174) in -- #869 +//│ let x$178 = Lambda$4() in -- #868 +//│ let* (x$179) = listcomp_fun1(x$175,x$171) in -- #867 +//│ let* (x$180) = map(x$178,x$179) in -- #866 +//│ let x$183 = Lambda$5() in -- #865 +//│ let* (x$184) = map(x$183,x$180) in -- #864 +//│ let* (x$185) = max'(x$184) in -- #863 +//│ x$185 -- #862 +//│ def const10000() = +//│ let* (x$186) = z_of_int(10000) in -- #881 +//│ x$186 -- #880 +//│ def f1(f1_arg1$0) = +//│ case f1_arg1$0 of -- #910 +//│ Tuple2 => +//│ let x$188 = Tuple2.y(f1_arg1$0) in -- #909 +//│ let x$189 = Tuple2.x(f1_arg1$0) in -- #908 +//│ let* (x$190) = gcdE(x$189,x$188) in -- #907 +//│ let x$191 = Tuple3(x$189,x$188,x$190) in -- #906 +//│ jump j$25(x$191) -- #905 +//│ def j$25(x$187) = +//│ x$187 -- #883 +//│ def quotRem(quotRem_arg1$0,quotRem_arg2$0) = +//│ let* (x$192) = z_div(quotRem_arg1$0,quotRem_arg2$0) in -- #929 +//│ let* (x$193) = z_mod(quotRem_arg1$0,quotRem_arg2$0) in -- #928 +//│ let x$194 = Tuple2(x$192,x$193) in -- #927 +//│ x$194 -- #926 +//│ def max'(max'_arg1$0) = +//│ case max'_arg1$0 of -- #992 +//│ Cons => +//│ let x$196 = Cons.t(max'_arg1$0) in -- #991 +//│ let x$197 = Cons.h(max'_arg1$0) in -- #990 +//│ case x$196 of -- #989 +//│ Nil => +//│ jump j$27(x$197) -- #944 +//│ Cons => +//│ let x$199 = Cons.t(x$196) in -- #988 +//│ let x$200 = Cons.h(x$196) in -- #987 +//│ let* (x$201) = z_lt(x$197,x$200) in -- #986 +//│ if x$201 -- #985 +//│ true => +//│ let x$203 = Cons(x$200,x$199) in -- #972 +//│ let* (x$204) = max'(x$203) in -- #971 +//│ jump j$28(x$204) -- #970 +//│ false => +//│ let x$205 = Cons(x$197,x$199) in -- #984 +//│ let* (x$206) = max'(x$205) in -- #983 +//│ jump j$28(x$206) -- #982 +//│ def j$26(x$195) = +//│ x$195 -- #931 +//│ def j$27(x$198) = +//│ jump j$26(x$198) -- #942 +//│ def j$28(x$202) = +//│ jump j$27(x$202) -- #960 +//│ def g(g_arg1$0,g_arg2$0) = +//│ case g_arg1$0 of -- #1120 //│ Tuple3 => -//│ let x$212 = Tuple3.z(g_arg2$0) in -- #1115 -//│ let x$213 = Tuple3.y(g_arg2$0) in -- #1114 -//│ let x$214 = Tuple3.x(g_arg2$0) in -- #1113 -//│ let* (x$215) = const0() in -- #1112 -//│ let* (x$216) = z_equal(x$212,x$215) in -- #1111 -//│ if x$216 -- #1110 -//│ true => -//│ let x$218 = Tuple3(x$208,x$210,x$209) in -- #1040 -//│ jump j$31(x$218) -- #1039 -//│ false => -//│ let* (x$219) = quotRem(x$208,x$212) in -- #1109 -//│ case x$219 of -- #1108 -//│ Tuple2 => -//│ let x$221 = Tuple2.y(x$219) in -- #1107 -//│ let x$222 = Tuple2.x(x$219) in -- #1106 -//│ let x$223 = Tuple3(x$214,x$213,x$212) in -- #1105 -//│ let* (x$224) = z_mul(x$222,x$214) in -- #1104 -//│ let* (x$225) = z_sub(x$210,x$224) in -- #1103 -//│ let* (x$226) = z_mul(x$222,x$213) in -- #1102 -//│ let* (x$227) = z_sub(x$209,x$226) in -- #1101 -//│ let x$228 = Tuple3(x$225,x$227,x$221) in -- #1100 -//│ let* (x$229) = g(x$223,x$228) in -- #1099 -//│ jump j$32(x$229) -- #1098 -//│ ) -//│ Def(72, j$29, [x$207], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$207 -- #994 -//│ ) -//│ Def(73, j$30, [x$211], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$29(x$211) -- #1009 -//│ ) -//│ Def(74, j$31, [x$217], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$30(x$217) -- #1030 -//│ ) -//│ Def(75, j$32, [x$220], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$31(x$220) -- #1049 -//│ ) -//│ Def(76, abs, [abs_arg1$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$230) = const0() in -- #1143 -//│ let* (x$231) = z_lt(abs_arg1$0,x$230) in -- #1142 -//│ if x$231 -- #1141 -//│ true => -//│ let* (x$233) = const0() in -- #1138 -//│ let* (x$234) = z_sub(x$233,abs_arg1$0) in -- #1137 -//│ jump j$33(x$234) -- #1136 -//│ false => -//│ jump j$33(abs_arg1$0) -- #1140 -//│ ) -//│ Def(77, j$33, [x$232], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$232 -- #1128 -//│ ) -//│ Def(78, f2, [f2_arg1$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ case f2_arg1$0 of -- #1198 -//│ Tuple3 => -//│ let x$236 = Tuple3.z(f2_arg1$0) in -- #1197 -//│ let x$237 = Tuple3.y(f2_arg1$0) in -- #1196 -//│ let x$238 = Tuple3.x(f2_arg1$0) in -- #1195 -//│ case x$236 of -- #1194 +//│ let x$208 = Tuple3.z(g_arg1$0) in -- #1119 +//│ let x$209 = Tuple3.y(g_arg1$0) in -- #1118 +//│ let x$210 = Tuple3.x(g_arg1$0) in -- #1117 +//│ case g_arg2$0 of -- #1116 +//│ Tuple3 => +//│ let x$212 = Tuple3.z(g_arg2$0) in -- #1115 +//│ let x$213 = Tuple3.y(g_arg2$0) in -- #1114 +//│ let x$214 = Tuple3.x(g_arg2$0) in -- #1113 +//│ let* (x$215) = const0() in -- #1112 +//│ let* (x$216) = z_equal(x$212,x$215) in -- #1111 +//│ if x$216 -- #1110 +//│ true => +//│ let x$218 = Tuple3(x$208,x$210,x$209) in -- #1040 +//│ jump j$31(x$218) -- #1039 +//│ false => +//│ let* (x$219) = quotRem(x$208,x$212) in -- #1109 +//│ case x$219 of -- #1108 +//│ Tuple2 => +//│ let x$221 = Tuple2.y(x$219) in -- #1107 +//│ let x$222 = Tuple2.x(x$219) in -- #1106 +//│ let x$223 = Tuple3(x$214,x$213,x$212) in -- #1105 +//│ let* (x$224) = z_mul(x$222,x$214) in -- #1104 +//│ let* (x$225) = z_sub(x$210,x$224) in -- #1103 +//│ let* (x$226) = z_mul(x$222,x$213) in -- #1102 +//│ let* (x$227) = z_sub(x$209,x$226) in -- #1101 +//│ let x$228 = Tuple3(x$225,x$227,x$221) in -- #1100 +//│ let* (x$229) = g(x$223,x$228) in -- #1099 +//│ jump j$32(x$229) -- #1098 +//│ def j$29(x$207) = +//│ x$207 -- #994 +//│ def j$30(x$211) = +//│ jump j$29(x$211) -- #1009 +//│ def j$31(x$217) = +//│ jump j$30(x$217) -- #1030 +//│ def j$32(x$220) = +//│ jump j$31(x$220) -- #1049 +//│ def abs(abs_arg1$0) = +//│ let* (x$230) = const0() in -- #1143 +//│ let* (x$231) = z_lt(abs_arg1$0,x$230) in -- #1142 +//│ if x$231 -- #1141 +//│ true => +//│ let* (x$233) = const0() in -- #1138 +//│ let* (x$234) = z_sub(x$233,abs_arg1$0) in -- #1137 +//│ jump j$33(x$234) -- #1136 +//│ false => +//│ jump j$33(abs_arg1$0) -- #1140 +//│ def j$33(x$232) = +//│ x$232 -- #1128 +//│ def f2(f2_arg1$0) = +//│ case f2_arg1$0 of -- #1198 //│ Tuple3 => -//│ let x$240 = Tuple3.z(x$236) in -- #1193 -//│ let x$241 = Tuple3.y(x$236) in -- #1192 -//│ let x$242 = Tuple3.x(x$236) in -- #1191 -//│ let* (x$243) = z_add(x$242,x$241) in -- #1190 -//│ let* (x$244) = z_add(x$243,x$240) in -- #1189 -//│ let* (x$245) = abs(x$244) in -- #1188 -//│ jump j$35(x$245) -- #1187 -//│ ) -//│ Def(79, j$34, [x$235], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$235 -- #1145 -//│ ) -//│ Def(80, j$35, [x$239], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ jump j$34(x$239) -- #1160 -//│ ) -//│ Def(81, const0, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$246) = z_of_int(0) in -- #1203 -//│ x$246 -- #1202 -//│ ) -//│ Def(82, gcdE, [gcdE_arg1$0,gcdE_arg2$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$247) = const0() in -- #1260 -//│ let* (x$248) = z_equal(gcdE_arg1$0,x$247) in -- #1259 -//│ if x$248 -- #1258 -//│ true => -//│ let* (x$250) = const0() in -- #1225 -//│ let* (x$251) = const1() in -- #1224 -//│ let x$252 = Tuple3(gcdE_arg2$0,x$250,x$251) in -- #1223 -//│ jump j$36(x$252) -- #1222 -//│ false => -//│ let* (x$253) = const1() in -- #1257 -//│ let* (x$254) = const0() in -- #1256 -//│ let x$255 = Tuple3(x$253,x$254,gcdE_arg1$0) in -- #1255 -//│ let* (x$256) = const0() in -- #1254 -//│ let* (x$257) = const1() in -- #1253 -//│ let x$258 = Tuple3(x$256,x$257,gcdE_arg2$0) in -- #1252 -//│ let* (x$259) = g(x$255,x$258) in -- #1251 -//│ jump j$36(x$259) -- #1250 -//│ ) -//│ Def(83, j$36, [x$249], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$249 -- #1211 -//│ ) -//│ Def(84, const1, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$260) = z_of_int(1) in -- #1265 -//│ x$260 -- #1264 -//│ ) -//│ Def(85, const5000, [], [], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$261) = z_of_int(5000) in -- #1270 -//│ x$261 -- #1269 -//│ ) -//│ Def(86, testGcd_nofib, [testGcd_nofib_arg1$0], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$262) = test(testGcd_nofib_arg1$0) in -- #1275 -//│ x$262 -- #1274 -//│ ) -//│ Def(87, z_enumFromTo, [z_enumFromTo_arg1$0,z_enumFromTo_arg2$0], [{},{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ let* (x$263) = z_leq(z_enumFromTo_arg1$0,z_enumFromTo_arg2$0) in -- #1309 -//│ if x$263 -- #1308 -//│ true => -//│ let* (x$265) = const1() in -- #1304 -//│ let* (x$266) = z_add(z_enumFromTo_arg1$0,x$265) in -- #1303 -//│ let* (x$267) = z_enumFromTo(x$266,z_enumFromTo_arg2$0) in -- #1302 -//│ let x$268 = Cons(z_enumFromTo_arg1$0,x$267) in -- #1301 -//│ jump j$37(x$268) -- #1300 -//│ false => -//│ let x$269 = Nil() in -- #1307 -//│ jump j$37(x$269) -- #1306 -//│ ) -//│ Def(88, j$37, [x$264], [{}], -//│ I: [], -//│ R: [None], -//│ Rec: None, -//│ 1, -//│ x$264 -- #1282 -//│ ) -//│ }, -//│ let* (x$0) = z_of_int(400) in -- #8 -//│ let* (x$1) = testGcd_nofib(x$0) in -- #7 -//│ x$1 -- #6) +//│ let x$236 = Tuple3.z(f2_arg1$0) in -- #1197 +//│ let x$237 = Tuple3.y(f2_arg1$0) in -- #1196 +//│ let x$238 = Tuple3.x(f2_arg1$0) in -- #1195 +//│ case x$236 of -- #1194 +//│ Tuple3 => +//│ let x$240 = Tuple3.z(x$236) in -- #1193 +//│ let x$241 = Tuple3.y(x$236) in -- #1192 +//│ let x$242 = Tuple3.x(x$236) in -- #1191 +//│ let* (x$243) = z_add(x$242,x$241) in -- #1190 +//│ let* (x$244) = z_add(x$243,x$240) in -- #1189 +//│ let* (x$245) = abs(x$244) in -- #1188 +//│ jump j$35(x$245) -- #1187 +//│ def j$34(x$235) = +//│ x$235 -- #1145 +//│ def j$35(x$239) = +//│ jump j$34(x$239) -- #1160 +//│ def const0() = +//│ let* (x$246) = z_of_int(0) in -- #1203 +//│ x$246 -- #1202 +//│ def gcdE(gcdE_arg1$0,gcdE_arg2$0) = +//│ let* (x$247) = const0() in -- #1260 +//│ let* (x$248) = z_equal(gcdE_arg1$0,x$247) in -- #1259 +//│ if x$248 -- #1258 +//│ true => +//│ let* (x$250) = const0() in -- #1225 +//│ let* (x$251) = const1() in -- #1224 +//│ let x$252 = Tuple3(gcdE_arg2$0,x$250,x$251) in -- #1223 +//│ jump j$36(x$252) -- #1222 +//│ false => +//│ let* (x$253) = const1() in -- #1257 +//│ let* (x$254) = const0() in -- #1256 +//│ let x$255 = Tuple3(x$253,x$254,gcdE_arg1$0) in -- #1255 +//│ let* (x$256) = const0() in -- #1254 +//│ let* (x$257) = const1() in -- #1253 +//│ let x$258 = Tuple3(x$256,x$257,gcdE_arg2$0) in -- #1252 +//│ let* (x$259) = g(x$255,x$258) in -- #1251 +//│ jump j$36(x$259) -- #1250 +//│ def j$36(x$249) = +//│ x$249 -- #1211 +//│ def const1() = +//│ let* (x$260) = z_of_int(1) in -- #1265 +//│ x$260 -- #1264 +//│ def const5000() = +//│ let* (x$261) = z_of_int(5000) in -- #1270 +//│ x$261 -- #1269 +//│ def testGcd_nofib(testGcd_nofib_arg1$0) = +//│ let* (x$262) = test(testGcd_nofib_arg1$0) in -- #1275 +//│ x$262 -- #1274 +//│ def z_enumFromTo(z_enumFromTo_arg1$0,z_enumFromTo_arg2$0) = +//│ let* (x$263) = z_leq(z_enumFromTo_arg1$0,z_enumFromTo_arg2$0) in -- #1309 +//│ if x$263 -- #1308 +//│ true => +//│ let* (x$265) = const1() in -- #1304 +//│ let* (x$266) = z_add(z_enumFromTo_arg1$0,x$265) in -- #1303 +//│ let* (x$267) = z_enumFromTo(x$266,z_enumFromTo_arg2$0) in -- #1302 +//│ let x$268 = Cons(z_enumFromTo_arg1$0,x$267) in -- #1301 +//│ jump j$37(x$268) -- #1300 +//│ false => +//│ let x$269 = Nil() in -- #1307 +//│ jump j$37(x$269) -- #1306 +//│ def j$37(x$264) = +//│ x$264 -- #1282 +//│ let* (x$0) = z_of_int(400) in -- #8 +//│ let* (x$1) = testGcd_nofib(x$0) in -- #7 +//│ x$1 -- #6 //│ //│ //│ Execution succeeded: diff --git a/compiler/shared/test/scala/mlscript/compiler/TestIR.scala b/compiler/shared/test/scala/mlscript/compiler/TestIR.scala index 2c9904a19..439e128a1 100644 --- a/compiler/shared/test/scala/mlscript/compiler/TestIR.scala +++ b/compiler/shared/test/scala/mlscript/compiler/TestIR.scala @@ -24,9 +24,9 @@ class IRDiffTestCompiler extends DiffTests { val (fresh, freshFnId, freshClassId, freshTag) = (Fresh(), FreshInt(), FreshInt(), FreshInt()) val gb = Builder(fresh, freshFnId, freshClassId, freshTag, mode.irVerbose) val graph = gb.buildGraph(unit) - output(graph.toString) + output(graph.show) output("\nPromoted:") - output(graph.toString) + output(graph.show) var interp_result: Opt[Str] = None if (mode.interpIR) output("\nInterpreted:")