@@ -96,18 +96,17 @@ def tests() = suite("└ ruler tests") {
9696 ])
9797 }
9898
99- // TODO: this works, but only without optimizations ("b_k_0 is not defined")
100- // test("normalization: erasing church") {
101- // val program: Program = collect {
102- // with assertNoThrow[WrongFormat]
103- // with source[Char] { "(x=>y=>y s=>z=>(s (s (s z))))".each }
104- // compile!()
105- // }
106- // val redexes = box { program.redexes() }
107- // val (normalized, steps) = normalize(program, redexes, 20)
108- // assertEqual(steps, 11)
109- // assertEqual(list::collect[Constructor] { normalized() }, [
110- // Abstractor(Pos("ySym1"), Neg("ySym1"), Pos("kAbs2"))
111- // ])
112- // }
113- }
99+ test("normalization: erasing church") {
100+ val program: Program = collect {
101+ with assertNoThrow[WrongFormat]
102+ with source[Char] { "(x=>y=>y s=>z=>(s (s (s z))))".each }
103+ compile!()
104+ }
105+ val redexes = box { program.redexes() }
106+ val (normalized, steps) = normalize(program, redexes, 20)
107+ assertEqual(steps, 11)
108+ assertEqual(list::collect[Constructor] { normalized() }, [
109+ Abstractor(Pos("ySym1"), Neg("ySym1"), Pos("kAbs2"))
110+ ])
111+ }
112+ }
0 commit comments