mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
Update tests with whitespace changes
This commit is contained in:
parent
11730ce271
commit
fcadd9808e
@ -101,7 +101,8 @@ let pp_marker target ppf () =
|
||||
|
||||
(**{2 Printers}*)
|
||||
|
||||
(** Prints the argument after the correct marker and to the correct channel *)
|
||||
(** Prints the argument after the correct marker and to the correct channel
|
||||
(inside a vbox) *)
|
||||
let format target format =
|
||||
let ppf = get_ppf target in
|
||||
Format.pp_open_vbox ppf 0;
|
||||
@ -137,7 +138,7 @@ let to_internal_error (content : Content.t) : Content.t =
|
||||
content with
|
||||
message =
|
||||
(fun ppf ->
|
||||
Format.fprintf ppf "%s@\n%t" internal_error_prefix content.message);
|
||||
Format.fprintf ppf "%s@,%t" internal_error_prefix content.message);
|
||||
}
|
||||
|
||||
let emit_content (content : Content.t) (target : content_type) : unit =
|
||||
|
@ -29,8 +29,8 @@ scope Test1:
|
||||
```catala-test-inline
|
||||
$ catala Interpret -s Test1
|
||||
[ERROR] Syntax error at token "scope"
|
||||
Message: expected either 'condition', or 'content' followed by the expected variable type
|
||||
Autosuggestion: did you mean "content", or maybe "condition"?
|
||||
Message: expected either 'condition', or 'content' followed by the expected variable type
|
||||
Autosuggestion: did you mean "content", or maybe "condition"?
|
||||
|
||||
Error token:
|
||||
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.21-11.26:
|
||||
@ -73,8 +73,8 @@ scope Test2:
|
||||
```catala-test-inline
|
||||
$ catala Interpret -s Test2
|
||||
[ERROR] Syntax error at token "scope"
|
||||
Message: expected either 'condition', or 'content' followed by the expected variable type
|
||||
Autosuggestion: did you mean "content", or maybe "condition"?
|
||||
Message: expected either 'condition', or 'content' followed by the expected variable type
|
||||
Autosuggestion: did you mean "content", or maybe "condition"?
|
||||
|
||||
Error token:
|
||||
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.21-11.26:
|
||||
@ -117,8 +117,8 @@ scope Test3:
|
||||
```catala-test-inline
|
||||
$ catala Interpret -s Test3
|
||||
[ERROR] Syntax error at token "scope"
|
||||
Message: expected either 'condition', or 'content' followed by the expected variable type
|
||||
Autosuggestion: did you mean "content", or maybe "condition"?
|
||||
Message: expected either 'condition', or 'content' followed by the expected variable type
|
||||
Autosuggestion: did you mean "content", or maybe "condition"?
|
||||
|
||||
Error token:
|
||||
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.21-11.26:
|
||||
@ -163,8 +163,8 @@ scope Test4:
|
||||
```catala-test-inline
|
||||
$ catala Interpret -s Test4
|
||||
[ERROR] Syntax error at token "scope"
|
||||
Message: expected either 'condition', or 'content' followed by the expected variable type
|
||||
Autosuggestion: did you mean "content", or maybe "condition"?
|
||||
Message: expected either 'condition', or 'content' followed by the expected variable type
|
||||
Autosuggestion: did you mean "content", or maybe "condition"?
|
||||
|
||||
Error token:
|
||||
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.21-11.26:
|
||||
|
@ -12,8 +12,7 @@ scope A:
|
||||
|
||||
```catala-test-inline
|
||||
$ catala Interpret -s A
|
||||
[ERROR] I don't know how to apply operator >= on types integer and
|
||||
money
|
||||
[ERROR] I don't know how to apply operator >= on types integer and money
|
||||
|
||||
┌─⯈ tests/test_array/bad/fold_error.catala_en:10.50-10.52:
|
||||
└──┐
|
||||
|
@ -33,9 +33,9 @@ scope B:
|
||||
$ catala Interpret -s A
|
||||
[RESULT] Computation successful! Results:
|
||||
[RESULT] x =
|
||||
[ { S id = 0; income = $0.00; };
|
||||
{ S id = 1; income = $9.00; };
|
||||
{ S id = 2; income = $5.20; } ]
|
||||
[ { S id = 0; income = $0.00; };
|
||||
{ S id = 1; income = $9.00; };
|
||||
{ S id = 2; income = $5.20; } ]
|
||||
```
|
||||
|
||||
```catala-test-inline
|
||||
@ -48,10 +48,10 @@ $ catala Interpret -s B
|
||||
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
|
||||
[RESULT] Computation successful! Results:
|
||||
[RESULT] x =
|
||||
ESome
|
||||
[ ESome { S id = ESome 0; income = ESome $0.00; };
|
||||
ESome { S id = ESome 1; income = ESome $9.00; };
|
||||
ESome { S id = ESome 2; income = ESome $5.20; } ]
|
||||
ESome
|
||||
[ ESome { S id = ESome 0; income = ESome $0.00; };
|
||||
ESome { S id = ESome 1; income = ESome $9.00; };
|
||||
ESome { S id = ESome 2; income = ESome $5.20; } ]
|
||||
```
|
||||
```catala-test-inline
|
||||
$ catala Interpret_Lcalc -s B --avoid_exceptions --optimize
|
||||
|
@ -19,18 +19,20 @@ $ catala Interpret -s A
|
||||
```catala-test-inline
|
||||
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
|
||||
[RESULT] Computation successful! Results:
|
||||
[RESULT] x = ESome [ ESome 0; ESome 1; ESome 2; ESome 3; ESome 4; ESome 5; ESome 6 ]
|
||||
[RESULT] x =
|
||||
ESome
|
||||
[ ESome 0; ESome 1; ESome 2; ESome 3; ESome 4; ESome 5; ESome 6 ]
|
||||
[RESULT] y =
|
||||
ESome
|
||||
[ ESome 0;
|
||||
ESome 1;
|
||||
ESome 2;
|
||||
ESome 3;
|
||||
ESome 4;
|
||||
ESome 5;
|
||||
ESome 6;
|
||||
ESome 7;
|
||||
ESome 8;
|
||||
ESome 9;
|
||||
ESome 10 ]
|
||||
ESome
|
||||
[ ESome 0;
|
||||
ESome 1;
|
||||
ESome 2;
|
||||
ESome 3;
|
||||
ESome 4;
|
||||
ESome 5;
|
||||
ESome 6;
|
||||
ESome 7;
|
||||
ESome 8;
|
||||
ESome 9;
|
||||
ESome 10 ]
|
||||
```
|
||||
|
@ -33,9 +33,9 @@ scope B:
|
||||
$ catala Interpret -s A
|
||||
[RESULT] Computation successful! Results:
|
||||
[RESULT] x =
|
||||
[ { S id = 0; income = $0.00; };
|
||||
{ S id = 1; income = $9.00; };
|
||||
{ S id = 2; income = $5.20; } ]
|
||||
[ { S id = 0; income = $0.00; };
|
||||
{ S id = 1; income = $9.00; };
|
||||
{ S id = 2; income = $5.20; } ]
|
||||
```
|
||||
|
||||
```catala-test-inline
|
||||
@ -48,10 +48,10 @@ $ catala Interpret -s B
|
||||
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
|
||||
[RESULT] Computation successful! Results:
|
||||
[RESULT] x =
|
||||
ESome
|
||||
[ ESome { S id = ESome 0; income = ESome $0.00; };
|
||||
ESome { S id = ESome 1; income = ESome $9.00; };
|
||||
ESome { S id = ESome 2; income = ESome $5.20; } ]
|
||||
ESome
|
||||
[ ESome { S id = ESome 0; income = ESome $0.00; };
|
||||
ESome { S id = ESome 1; income = ESome $9.00; };
|
||||
ESome { S id = ESome 2; income = ESome $5.20; } ]
|
||||
```
|
||||
```catala-test-inline
|
||||
$ catala Interpret_Lcalc -s B --avoid_exceptions --optimize
|
||||
|
@ -13,8 +13,8 @@ scope Foo:
|
||||
```catala-test-inline
|
||||
$ catala Interpret -s Foo
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
--> integer
|
||||
--> bool
|
||||
--> integer
|
||||
--> bool
|
||||
|
||||
Error coming from typechecking the following expression:
|
||||
┌─⯈ tests/test_bool/bad/bad_assert.catala_en:9.13-9.14:
|
||||
|
@ -11,8 +11,8 @@ scope TestXorWithInt:
|
||||
```catala-test-inline
|
||||
$ catala Typecheck
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
--> integer
|
||||
--> bool
|
||||
--> integer
|
||||
--> bool
|
||||
|
||||
Error coming from typechecking the following expression:
|
||||
┌─⯈ tests/test_bool/bad/test_xor_with_int.catala_en:8.30-8.32:
|
||||
|
@ -18,7 +18,7 @@ scope A:
|
||||
$ catala Interpret -s A
|
||||
[RESULT] Computation successful! Results:
|
||||
[RESULT] a =
|
||||
-0.000000000000000000000000000000000000000000000000000000000078695580959228473468…
|
||||
-0.000000000000000000000000000000000000000000000000000000000078695580959228473468…
|
||||
[RESULT] x = 84.64866565265689623
|
||||
[RESULT] y = -4.3682977870532065498
|
||||
[RESULT] z = 654265429805103220650980650.570540510654
|
||||
@ -27,8 +27,8 @@ $ catala Interpret -s A
|
||||
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
|
||||
[RESULT] Computation successful! Results:
|
||||
[RESULT] a =
|
||||
ESome
|
||||
-0.000000000000000000000000000000000000000000000000000000000078695580959228473468…
|
||||
ESome
|
||||
-0.000000000000000000000000000000000000000000000000000000000078695580959228473468…
|
||||
[RESULT] x = ESome 84.64866565265689623
|
||||
[RESULT] y = ESome -4.3682977870532065498
|
||||
[RESULT] z = ESome 654265429805103220650980650.570540510654
|
||||
|
@ -31,8 +31,8 @@ scope B:
|
||||
```catala-test-inline
|
||||
$ catala Interpret -s A
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
--> E
|
||||
--> F
|
||||
--> E
|
||||
--> F
|
||||
|
||||
Error coming from typechecking the following expression:
|
||||
┌─⯈ tests/test_enum/bad/quick_pattern_2.catala_en:28.23-28.24:
|
||||
|
@ -21,8 +21,8 @@ definition y equals x with pattern Case3
|
||||
```catala-test-inline
|
||||
$ catala Interpret -s A
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
--> E
|
||||
--> F
|
||||
--> E
|
||||
--> F
|
||||
|
||||
Error coming from typechecking the following expression:
|
||||
┌─⯈ tests/test_enum/bad/quick_pattern_3.catala_en:18.21-18.22:
|
||||
|
@ -20,8 +20,8 @@ definition y equals x with pattern Case3
|
||||
```catala-test-inline
|
||||
$ catala Interpret -s A
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
--> E
|
||||
--> F
|
||||
--> E
|
||||
--> F
|
||||
|
||||
Error coming from typechecking the following expression:
|
||||
┌─⯈ tests/test_enum/bad/quick_pattern_4.catala_en:17.21-17.22:
|
||||
|
@ -48,38 +48,38 @@ let scope Foo (y: integer|input) (x: integer|internal|output) =
|
||||
$ catala Exceptions -s Foo -v x
|
||||
[RESULT] Printing the tree of exceptions for the definitions of variable "x" of scope "Foo".
|
||||
[RESULT] Definitions with label "base":
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:9.3-9.26:
|
||||
└─┐
|
||||
9 │ label base definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:13.3-13.26:
|
||||
└──┐
|
||||
13 │ label base definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:9.3-9.26:
|
||||
└─┐
|
||||
9 │ label base definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:13.3-13.26:
|
||||
└──┐
|
||||
13 │ label base definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
[RESULT] Definitions with label "intermediate":
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:17.3-17.49:
|
||||
└──┐
|
||||
17 │ label intermediate exception base definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:21.3-21.49:
|
||||
└──┐
|
||||
21 │ label intermediate exception base definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:17.3-17.49:
|
||||
└──┐
|
||||
17 │ label intermediate exception base definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:21.3-21.49:
|
||||
└──┐
|
||||
21 │ label intermediate exception base definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
[RESULT] Definitions with label "exception_to_intermediate":
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:25.3-25.38:
|
||||
└──┐
|
||||
25 │ exception intermediate definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:29.3-29.38:
|
||||
└──┐
|
||||
29 │ exception intermediate definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:25.3-25.38:
|
||||
└──┐
|
||||
25 │ exception intermediate definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:29.3-29.38:
|
||||
└──┐
|
||||
29 │ exception intermediate definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
[RESULT] The exception tree structure is as follows:
|
||||
|
||||
"base"───"intermediate"───"exception_to_intermediate"
|
||||
|
@ -14,8 +14,7 @@ scope A:
|
||||
|
||||
```catala-test-inline
|
||||
$ catala Interpret -s A
|
||||
[ERROR] I don't know how to apply operator * on types money and
|
||||
money
|
||||
[ERROR] I don't know how to apply operator * on types money and money
|
||||
|
||||
┌─⯈ tests/test_money/bad/no_mingle.catala_en:12.26-12.27:
|
||||
└──┐
|
||||
|
@ -54,7 +54,11 @@ $ catala Interpret -s S2
|
||||
$ catala Interpret_Lcalc -s S --avoid_exceptions --optimize
|
||||
[RESULT] Computation successful! Results:
|
||||
[RESULT] a =
|
||||
ESome { A x = ESome -2.; y = ESome { B y = ESome false; z = ESome -1.; }; }
|
||||
ESome
|
||||
{ A
|
||||
x = ESome -2.;
|
||||
y = ESome { B y = ESome false; z = ESome -1.; };
|
||||
}
|
||||
[RESULT] b = ESome { B y = ESome true; z = ESome 42.; }
|
||||
```
|
||||
```catala-test-inline
|
||||
|
@ -27,6 +27,11 @@ $ catala Interpret -s S
|
||||
```catala-test-inline
|
||||
$ catala Interpret_Lcalc -s S --avoid_exceptions --optimize
|
||||
[RESULT] Computation successful! Results:
|
||||
[RESULT] a = ESome { A x = ESome 0; y = ESome { B y = ESome true; z = ESome 0.; }; }
|
||||
[RESULT] a =
|
||||
ESome
|
||||
{ A
|
||||
x = ESome 0;
|
||||
y = ESome { B y = ESome true; z = ESome 0.; };
|
||||
}
|
||||
[RESULT] b = ESome { B y = ESome true; z = ESome 0.; }
|
||||
```
|
||||
|
@ -17,7 +17,7 @@ scope A:
|
||||
```catala-test-inline
|
||||
$ catala Interpret -s A
|
||||
[ERROR] Cyclic dependency detected between the following variables of scope A:
|
||||
z → x → y → z
|
||||
z → x → y → z
|
||||
|
||||
z is used here in the definition of x:
|
||||
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:14.23-14.24:
|
||||
|
@ -29,7 +29,7 @@ scope S4:
|
||||
```catala-test-inline
|
||||
$ catala typecheck
|
||||
[ERROR] Cyclic dependency detected between the following scopes:
|
||||
S4 → S3 → S2 → S4
|
||||
S4 → S3 → S2 → S4
|
||||
|
||||
S4 is used here in the definition of S3:
|
||||
┌─⯈ tests/test_scope/bad/cyclic_scope_calls.catala_en:21.24-21.36:
|
||||
|
@ -18,7 +18,8 @@ scope B:
|
||||
|
||||
```catala-test-inline
|
||||
$ catala Interpret -s A
|
||||
[ERROR] Cyclic dependency detected between the following scopes: B → A → B
|
||||
[ERROR] Cyclic dependency detected between the following scopes:
|
||||
B → A → B
|
||||
|
||||
B is used here in the definition of A:
|
||||
┌─⯈ tests/test_scope/bad/cyclic_scopes.catala_en:5.3-5.4:
|
||||
|
@ -20,47 +20,47 @@ scope RentComputation:
|
||||
$ catala Interpret -t -s HousingComputation
|
||||
[LOG] ≔ HousingComputation.f: <function>
|
||||
[LOG] ☛ Definition applied:
|
||||
┌─⯈ tests/test_scope/good/scope_call3.catala_en:8.14-8.20:
|
||||
└─┐
|
||||
8 │ definition result equals f of 1
|
||||
│ ‾‾‾‾‾‾
|
||||
|
||||
┌─⯈ tests/test_scope/good/scope_call3.catala_en:8.14-8.20:
|
||||
└─┐
|
||||
8 │ definition result equals f of 1
|
||||
│ ‾‾‾‾‾‾
|
||||
|
||||
[LOG] → HousingComputation.f
|
||||
[LOG] ≔ HousingComputation.f.input0: 1
|
||||
[LOG] ☛ Definition applied:
|
||||
┌─⯈ tests/test_scope/good/scope_call3.catala_en:7.14-7.15:
|
||||
└─┐
|
||||
7 │ definition f of x equals (output of RentComputation).f of x
|
||||
│ ‾
|
||||
|
||||
┌─⯈ tests/test_scope/good/scope_call3.catala_en:7.14-7.15:
|
||||
└─┐
|
||||
7 │ definition f of x equals (output of RentComputation).f of x
|
||||
│ ‾
|
||||
|
||||
[LOG] → RentComputation.direct
|
||||
[LOG] ≔ RentComputation.direct.input: {RentComputation_in}
|
||||
[LOG] ≔ RentComputation.g: <function>
|
||||
[LOG] ≔ RentComputation.f: <function>
|
||||
[LOG] ☛ Definition applied:
|
||||
┌─⯈ tests/test_scope/good/scope_call3.catala_en:7.29-7.54:
|
||||
└─┐
|
||||
7 │ definition f of x equals (output of RentComputation).f of x
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
|
||||
┌─⯈ tests/test_scope/good/scope_call3.catala_en:7.29-7.54:
|
||||
└─┐
|
||||
7 │ definition f of x equals (output of RentComputation).f of x
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
|
||||
[LOG] ≔ RentComputation.direct.output: { RentComputation f = <function>; }
|
||||
[LOG] ← RentComputation.direct
|
||||
[LOG] → RentComputation.f
|
||||
[LOG] ≔ RentComputation.f.input0: 1
|
||||
[LOG] ☛ Definition applied:
|
||||
┌─⯈ tests/test_scope/good/scope_call3.catala_en:16.14-16.15:
|
||||
└──┐
|
||||
16 │ definition f of x equals g of (x + 1)
|
||||
│ ‾
|
||||
|
||||
┌─⯈ tests/test_scope/good/scope_call3.catala_en:16.14-16.15:
|
||||
└──┐
|
||||
16 │ definition f of x equals g of (x + 1)
|
||||
│ ‾
|
||||
|
||||
[LOG] → RentComputation.g
|
||||
[LOG] ≔ RentComputation.g.input0: 2
|
||||
[LOG] ☛ Definition applied:
|
||||
┌─⯈ tests/test_scope/good/scope_call3.catala_en:15.14-15.15:
|
||||
└──┐
|
||||
15 │ definition g of x equals x + 1
|
||||
│ ‾
|
||||
|
||||
┌─⯈ tests/test_scope/good/scope_call3.catala_en:15.14-15.15:
|
||||
└──┐
|
||||
15 │ definition g of x equals x + 1
|
||||
│ ‾
|
||||
|
||||
[LOG] ≔ RentComputation.g.output: 3
|
||||
[LOG] ← RentComputation.g
|
||||
[LOG] ≔ RentComputation.f.output: 3
|
||||
@ -70,26 +70,28 @@ $ catala Interpret -t -s HousingComputation
|
||||
[LOG] ≔ HousingComputation.result: 3
|
||||
[RESULT] Computation successful! Results:
|
||||
[RESULT] f = λ (x: integer) →
|
||||
error_empty
|
||||
⟨true
|
||||
⊢ (let result : RentComputation =
|
||||
(λ (RentComputation_in: RentComputation_in) →
|
||||
let g : integer → integer =
|
||||
λ (x1: integer) →
|
||||
error_empty ⟨true ⊢ x1 + 1⟩
|
||||
in
|
||||
let f : integer → integer =
|
||||
λ (x1: integer) →
|
||||
error_empty ⟨true ⊢ g (x1 + 1)⟩
|
||||
in
|
||||
{ RentComputation f = f; })
|
||||
{RentComputation_in}
|
||||
in
|
||||
let result1 : RentComputation =
|
||||
{ RentComputation f = λ (param0: integer) → result.f param0; }
|
||||
in
|
||||
if true then result1 else result1).
|
||||
f
|
||||
x⟩
|
||||
error_empty
|
||||
⟨true
|
||||
⊢ (let result : RentComputation =
|
||||
(λ (RentComputation_in: RentComputation_in) →
|
||||
let g : integer → integer =
|
||||
λ (x1: integer) →
|
||||
error_empty ⟨true ⊢ x1 + 1⟩
|
||||
in
|
||||
let f : integer → integer =
|
||||
λ (x1: integer) →
|
||||
error_empty ⟨true ⊢ g (x1 + 1)⟩
|
||||
in
|
||||
{ RentComputation f = f; })
|
||||
{RentComputation_in}
|
||||
in
|
||||
let result1 : RentComputation =
|
||||
{ RentComputation
|
||||
f = λ (param0: integer) → result.f param0;
|
||||
}
|
||||
in
|
||||
if true then result1 else result1).
|
||||
f
|
||||
x⟩
|
||||
[RESULT] result = 3
|
||||
```
|
||||
|
@ -26,36 +26,38 @@ scope RentComputation:
|
||||
$ catala Interpret -s RentComputation
|
||||
[RESULT] Computation successful! Results:
|
||||
[RESULT] f1 = λ (x: integer) →
|
||||
error_empty ⟨true ⊢ let x1 : integer = x + 1 in
|
||||
error_empty ⟨true ⊢ x1 + 1⟩⟩
|
||||
error_empty
|
||||
⟨true ⊢ let x1 : integer = x + 1 in
|
||||
error_empty ⟨true ⊢ x1 + 1⟩⟩
|
||||
[RESULT] f2 = λ (x: integer) →
|
||||
error_empty ⟨true ⊢ let x1 : integer = x + 1 in
|
||||
error_empty ⟨true ⊢ x1 + 1⟩⟩
|
||||
error_empty
|
||||
⟨true ⊢ let x1 : integer = x + 1 in
|
||||
error_empty ⟨true ⊢ x1 + 1⟩⟩
|
||||
```
|
||||
|
||||
```catala-test-inline
|
||||
$ catala Interpret_Lcalc -s RentComputation --avoid_exceptions --optimize
|
||||
[RESULT] Computation successful! Results:
|
||||
[RESULT] f1 =
|
||||
ESome
|
||||
(λ (x: integer) →
|
||||
ESome
|
||||
match
|
||||
(match (ESome (λ (x1: integer) → ESome (x1 + 1))) with
|
||||
| ENone _ → ENone _
|
||||
| ESome f1 → f1 (x + 1))
|
||||
with
|
||||
| ENone f1 → raise NoValueProvided
|
||||
| ESome x1 → x1)
|
||||
ESome
|
||||
(λ (x: integer) →
|
||||
ESome
|
||||
match
|
||||
(match (ESome (λ (x1: integer) → ESome (x1 + 1))) with
|
||||
| ENone _ → ENone _
|
||||
| ESome f1 → f1 (x + 1))
|
||||
with
|
||||
| ENone f1 → raise NoValueProvided
|
||||
| ESome x1 → x1)
|
||||
[RESULT] f2 =
|
||||
ESome
|
||||
(λ (x: integer) →
|
||||
ESome
|
||||
match
|
||||
(match (ESome (λ (x1: integer) → ESome (x1 + 1))) with
|
||||
| ENone _ → ENone _
|
||||
| ESome f2 → f2 (x + 1))
|
||||
with
|
||||
| ENone f2 → raise NoValueProvided
|
||||
| ESome x1 → x1)
|
||||
ESome
|
||||
(λ (x: integer) →
|
||||
ESome
|
||||
match
|
||||
(match (ESome (λ (x1: integer) → ESome (x1 + 1))) with
|
||||
| ENone _ → ENone _
|
||||
| ESome f2 → f2 (x + 1))
|
||||
with
|
||||
| ENone f2 → raise NoValueProvided
|
||||
| ESome x1 → x1)
|
||||
```
|
||||
|
@ -50,20 +50,20 @@ $ catala Interpret -s B
|
||||
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
|
||||
[RESULT] Computation successful! Results:
|
||||
[RESULT] t =
|
||||
ESome
|
||||
{ T
|
||||
a = ESome { S x = ESome 0; y = ESome false; };
|
||||
b = ESome { S x = ESome 1; y = ESome true; };
|
||||
}
|
||||
ESome
|
||||
{ T
|
||||
a = ESome { S x = ESome 0; y = ESome false; };
|
||||
b = ESome { S x = ESome 1; y = ESome true; };
|
||||
}
|
||||
```
|
||||
```catala-test-inline
|
||||
$ catala Interpret_Lcalc -s B --avoid_exceptions --optimize
|
||||
[RESULT] Computation successful! Results:
|
||||
[RESULT] out = ESome 1
|
||||
[RESULT] t =
|
||||
ESome
|
||||
{ T
|
||||
a = ESome { S x = ESome 0; y = ESome false; };
|
||||
b = ESome { S x = ESome 1; y = ESome true; };
|
||||
}
|
||||
ESome
|
||||
{ T
|
||||
a = ESome { S x = ESome 0; y = ESome false; };
|
||||
b = ESome { S x = ESome 1; y = ESome true; };
|
||||
}
|
||||
```
|
||||
|
@ -13,8 +13,8 @@ scope S:
|
||||
```catala-test-inline
|
||||
$ catala Typecheck
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
--> decimal
|
||||
--> integer
|
||||
--> decimal
|
||||
--> integer
|
||||
|
||||
Error coming from typechecking the following expression:
|
||||
┌─⯈ tests/test_typing/bad/err1.catala_en:7.23-7.26:
|
||||
|
@ -13,8 +13,8 @@ scope S:
|
||||
```catala-test-inline
|
||||
$ catala Typecheck
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
--> decimal
|
||||
--> collection
|
||||
--> decimal
|
||||
--> collection
|
||||
|
||||
Error coming from typechecking the following expression:
|
||||
┌─⯈ tests/test_typing/bad/err2.catala_en:10.39-10.42:
|
||||
|
@ -20,8 +20,8 @@ $ catala Typecheck
|
||||
│ ‾‾‾
|
||||
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
--> integer
|
||||
--> decimal
|
||||
--> integer
|
||||
--> decimal
|
||||
|
||||
Error coming from typechecking the following expression:
|
||||
┌─⯈ tests/test_typing/bad/err3.catala_en:10.42-10.43:
|
||||
@ -58,8 +58,8 @@ $ catala ocaml
|
||||
│ ‾‾‾
|
||||
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
--> integer
|
||||
--> decimal
|
||||
--> integer
|
||||
--> decimal
|
||||
|
||||
Error coming from typechecking the following expression:
|
||||
┌─⯈ tests/test_typing/bad/err3.catala_en:10.42-10.43:
|
||||
|
@ -32,8 +32,8 @@ $ catala ocaml
|
||||
│ ‾‾‾
|
||||
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
--> Enum
|
||||
--> Structure
|
||||
--> Enum
|
||||
--> Structure
|
||||
|
||||
Error coming from typechecking the following expression:
|
||||
┌─⯈ tests/test_typing/bad/err4.catala_en:5.25-5.38:
|
||||
|
@ -13,8 +13,8 @@ scope S:
|
||||
```catala-test-inline
|
||||
$ catala Typecheck
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
--> integer
|
||||
--> Structure
|
||||
--> integer
|
||||
--> Structure
|
||||
|
||||
Error coming from typechecking the following expression:
|
||||
┌─⯈ tests/test_typing/bad/err5.catala_en:8.5-8.9:
|
||||
|
@ -29,8 +29,8 @@ Should be "catala Typecheck", see test err3
|
||||
```catala-test-inline
|
||||
$ catala ocaml
|
||||
[ERROR] Error during typechecking, incompatible types:
|
||||
--> decimal
|
||||
--> integer
|
||||
--> decimal
|
||||
--> integer
|
||||
|
||||
Error coming from typechecking the following expression:
|
||||
┌─⯈ tests/test_typing/bad/err6.catala_en:20.27-20.30:
|
||||
|
@ -22,7 +22,7 @@ scope A:
|
||||
```catala-test-inline
|
||||
$ catala Typecheck
|
||||
[ERROR] Cyclic dependency detected between the following variables of scope A:
|
||||
foofoo@bar → foofoo@baz → foo@bar → foo@baz → foofoo@bar
|
||||
foofoo@bar → foofoo@baz → foo@bar → foo@baz → foofoo@bar
|
||||
|
||||
foofoo@bar is used here in the definition of foofoo@baz:
|
||||
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:19.38-19.44:
|
||||
|
Loading…
Reference in New Issue
Block a user