Removing lines with more than 80 characters in tests

This commit is contained in:
elvis
2025-01-26 22:07:53 +01:00
parent ca39024ee3
commit f175a6089d
4 changed files with 243 additions and 94 deletions

View File

@ -35,7 +35,8 @@ let program =
LetIn
("f",
(Function ("x",
FunctionType (IntegerType, FunctionType (IntegerType, IntegerType)),
FunctionType
(IntegerType, FunctionType (IntegerType, IntegerType)),
(Function ("y", FunctionType (IntegerType, IntegerType),
Plus (Variable "x", Variable "y"))
)
@ -73,10 +74,13 @@ let program =
("f",
(Function (
"z",
FunctionType (FunctionType (IntegerType, IntegerType), IntegerType),
FunctionType (FunctionType (IntegerType, IntegerType),
FunctionType (FunctionType (IntegerType, IntegerType),
FunctionType (IntegerType, IntegerType))),
(Function (
"y",
FunctionType (FunctionType (IntegerType, IntegerType), IntegerType),
FunctionType (FunctionType (IntegerType, IntegerType),
FunctionType (IntegerType, IntegerType)),
Function (
"x",
FunctionType (IntegerType, IntegerType),
@ -91,10 +95,12 @@ let program =
(
(Application
(Variable "f",
Function ("x", FunctionType (IntegerType, IntegerType), Plus (Variable "x", Integer 1))
Function ("x", FunctionType (IntegerType, IntegerType),
Plus (Variable "x", Integer 1))
)
),
Function ("x", FunctionType (IntegerType, IntegerType), Minus (Variable "x", Integer 1))
Function ("x", FunctionType (IntegerType, IntegerType),
Minus (Variable "x", Integer 1))
)
)
)
@ -115,7 +121,13 @@ let program =
("f",
"x",
FunctionType (IntegerType, IntegerType),
(IfThenElse (CmpLess (Variable "x", Integer 2),Integer 1, Plus (Variable "x", Application (Variable "f", Minus (Variable "x", Integer 1))))),
(IfThenElse (CmpLess (Variable "x", Integer 2),
Integer 1,
Plus (
Variable "x",
Application (
Variable "f",
Minus (Variable "x", Integer 1))))),
(Variable "f")
)
;;
@ -129,7 +141,9 @@ match reduce program 10 with
let program =
LetIn
("f",
(LetIn ("a", Integer 1, (Function ("y", FunctionType (IntegerType, IntegerType), Plus (Variable "y", Variable "a"))))),
(LetIn ("a", Integer 1, (Function ("y",
FunctionType (IntegerType, IntegerType),
Plus (Variable "y", Variable "a"))))),
(LetIn ("a", Integer 2, Variable "f"))
)
;;
@ -145,7 +159,11 @@ let program =
"f",
"x",
FunctionType (IntegerType, IntegerType),
(IfThenElse (CmpLessEq (Variable "x", Integer 0), Integer 1, Times (Variable "x", Application (Variable "f", Minus (Variable "x", Integer 1))))),
(IfThenElse (CmpLessEq (Variable "x", Integer 0),
Integer 1,
Times (Variable "x",
Application (Variable "f",
Minus (Variable "x", Integer 1))))),
(Variable "f")
)
;;
@ -158,27 +176,38 @@ match reduce program 10 with
(* Hailstone sequence's lenght program *)
let program =
LetFun (
"collatz",
"input",
FunctionType (TupleType (IntegerType, IntegerType), IntegerType),
(
IfThenElse (BNot (Cmp (First (Variable "input"), Integer 1)),
(IfThenElse (Cmp (Modulo (First (Variable "input"), Integer 2), Integer 0),
(IfThenElse (Cmp (Modulo (First (Variable "input"),
Integer 2),
Integer 0),
Application (Variable "collatz",
Tuple (
Division (First (Variable "input"), Integer 2),
Plus (Integer 1, Second (Variable "input")))),
Division (First
(Variable "input"),
Integer 2),
Plus (Integer 1, Second
(Variable "input")))),
Application (Variable "collatz",
Tuple (
Plus (Integer 1, Times (Integer 3, First (Variable "input"))),
Plus (Integer 1, Second (Variable "input")))))),
Plus
(Integer 1,
Times
(Integer 3,
First (Variable "input"))),
Plus (
Integer 1,
Second (Variable "input")))))),
(Second (Variable "input")))
),
(Function ("x",
FunctionType (IntegerType, IntegerType),
Application (Variable "collatz", Tuple (Variable "x", Integer 1))))
Application (Variable "collatz",
Tuple (Variable "x", Integer 1))))
)
;;
@ -194,11 +223,15 @@ let program =
"sum",
"n",
FunctionType (IntegerType, IntegerType),
(IfThenElse ((BOr (Cmp (Modulo (Variable "n", Integer 3), Integer 0), Cmp (Modulo (Variable "n", Integer 5), Integer 0))),
Plus (Variable "n", Application (Variable "sum", Minus (Variable "n", Integer 1))),
(IfThenElse ((BOr (Cmp (Modulo (Variable "n", Integer 3), Integer 0),
Cmp (Modulo (Variable "n", Integer 5), Integer 0))),
Plus (Variable "n",
Application (Variable "sum",
Minus (Variable "n", Integer 1))),
(IfThenElse ((CmpLessEq (Variable "n", Integer 1)),
(Integer 0),
(Application (Variable "sum", Minus (Variable "n", Integer 1))))
(Application (Variable "sum",
Minus (Variable "n", Integer 1))))
))
),
(Variable "sum")
@ -231,7 +264,8 @@ let program =
LetFun (
"fib",
"i",
FunctionType (IntegerType, FunctionType (IntegerType, FunctionType (IntegerType, IntegerType))),
FunctionType (IntegerType, FunctionType
(IntegerType, FunctionType (IntegerType, IntegerType))),
Function (
"a",
FunctionType (IntegerType, FunctionType (IntegerType, IntegerType)),