@@ -32,13 +32,13 @@ def List.toLinearExp (l : List (String × Int)) : LinearExp := l.toHashMap
3232instance : Coe (List (String × Int)) LinearExp := ⟨List.toLinearExp⟩
3333
3434instance : ToString LinearExp := ⟨fun linexp =>
35- String.intercalate " + " $ linexp.toList.map (fun (s, i) => (ToString.toString i ++ "*" ++ s))⟩
35+ String.intercalate " + " <| linexp.toList.map (fun (s, i) => (ToString.toString i ++ "*" ++ s))⟩
3636
3737def ex1 : LinearExp := [("x" , 3 ), ("y" , -2 ), ("z" , 4 )]
3838def ex2 : LinearExp := [("x" , 4 ), ("y" , 2 ), ("w" , -1 ), ("v" , 3 )]
3939
40- #eval toString $ ex1
41- #eval toString $ ex2
40+ #eval toString ex1
41+ #eval toString ex2
4242
4343
4444/--
@@ -59,13 +59,13 @@ def linearCombination (a : Int) (u : LinearExp) (b : Int) (v : LinearExp) : Line
5959 result := result.insert t (b * j)
6060 result
6161
62- #eval toString $ linearCombination 1 ex1 1 ex2
63- #eval toString $ linearCombination 1 ex1 (-1 ) ex1
64- #eval toString $ linearCombination 2 ex1 (-3 ) ex2
62+ #eval toString <| linearCombination 1 ex1 1 ex2
63+ #eval toString <| linearCombination 1 ex1 (-1 ) ex1
64+ #eval toString <| linearCombination 2 ex1 (-3 ) ex2
6565
6666-- checks whether an expression is empty
6767#eval ex1.isEmpty
68- #eval HashMap.isEmpty $ linearCombination 1 ex1 (-1 ) ex1
68+ #eval HashMap.isEmpty <| linearCombination 1 ex1 (-1 ) ex1
6969
7070-- you can erase a term from an expression
7171#eval let ex' : LinearExp := ex1.erase "x"
@@ -191,8 +191,8 @@ def wikipedia_constraints : List LinearExp :=
191191 [("one" , -7 ), ("x" , 1 ), ("y" , -5 ), ("z" , 2 )],
192192 [("one" , 12 ), ("x" , 3 ), ("y" , -2 ), ("z" , -6 )] ]
193193
194- #eval toString $ sortGtConstraints "x" wikipedia_constraints
195- #eval toString $ elimVarGtConstraints "x" wikipedia_constraints
194+ #eval toString <| sortGtConstraints "x" wikipedia_constraints
195+ #eval toString <| elimVarGtConstraints "x" wikipedia_constraints
196196
197197/-
198198Given a pair `eq, gts`, we want to eliminate all the variables to determine whether it is
0 commit comments