|
28 | 28 | )).
|
29 | 29 |
|
30 | 30 | test("doesnt modify free variables", (reif:goal_expanded(A,B), A == B, var(A))).
|
31 |
| -test("doesnt expand call/1", reif:goal_expanded(call(a), call(a))). |
32 |
| -test("expands call(if_/3)", reif:goal_expanded(call(if_(A,B,C)), if_(A,B,C))). |
| 31 | +test("expands call/1", reif:goal_expanded(call(a), a)). |
33 | 32 | test("expands call/1 for modules", reif:goal_expanded(call(a:b(1)), a:b(1))).
|
34 | 33 | test("expands call/2 for modules", reif:goal_expanded(call(a:b,c), a:b(c))).
|
35 | 34 | test("doesn't expand call/2", reif:goal_expanded(call(b,c), call(b,c))).
|
|
55 | 54 | */
|
56 | 55 | test("goal_expansion (=)", (
|
57 | 56 | subsumes_full_expansion(if_(1=2,a,b), (
|
58 |
| - 1 \= 2 -> call(b) |
59 |
| - ; 1 == 2 -> call(a) |
60 |
| - ; 1 = 2, call(a) |
61 |
| - ; dif(1,2), call(b))))). |
| 57 | + 1 \= 2 -> b |
| 58 | + ; 1 == 2 -> a |
| 59 | + ; 1 = 2, a |
| 60 | + ; dif(1,2), b)))). |
62 | 61 |
|
63 | 62 | test("goal_expansion (;)", (
|
64 | 63 | subsumes_full_expansion(if_((1=2;3=3),a,b), (
|
65 | 64 | 1 \= 2 -> if_(3=3,a,b)
|
66 |
| - ; 1 == 2 -> call(a) |
67 |
| - ; 1 = 2, call(a) |
| 65 | + ; 1 == 2 -> a |
| 66 | + ; 1 = 2, a |
68 | 67 | ; dif(1,2), if_(3=3,a,b))))).
|
69 | 68 |
|
70 | 69 | test("goal_expansion (,)", (
|
71 | 70 | subsumes_full_expansion(if_((1=2,3=3),a,b), (
|
72 |
| - 1 \= 2 -> call(b) |
| 71 | + 1 \= 2 -> b |
73 | 72 | ; 1 == 2 -> if_(3=3,a,b)
|
74 | 73 | ; 1 = 2, if_(3=3,a,b)
|
75 |
| - ; dif(1,2), call(b))))). |
| 74 | + ; dif(1,2), b)))). |
76 | 75 |
|
77 | 76 | test("goal_expansion memberd_t", (
|
78 | 77 | subsumes_full_expansion(if_(memberd_t(f,"abcdefgh"),t,f), (
|
79 | 78 | call(memberd_t(f,"abcdefgh"),A),
|
80 |
| - ( A == true -> call(t) |
81 |
| - ; A == false -> call(f) |
| 79 | + ( A == true -> t |
| 80 | + ; A == false -> f |
82 | 81 | ; nonvar(A) -> throw(error(type_error(boolean,A),_))
|
83 | 82 | ; throw(error(instantiation_error,_))))))).
|
84 | 83 |
|
85 | 84 | test("goal_expansion cond_t", (
|
86 | 85 | subsumes_full_expansion(if_(cond_t(a,b),t,f), (
|
87 | 86 | call(cond_t(a,b),A),
|
88 |
| - ( A == true -> call(t) |
89 |
| - ; A == false -> call(f) |
| 87 | + ( A == true -> t |
| 88 | + ; A == false -> f |
90 | 89 | ; nonvar(A) -> throw(error(type_error(boolean,A),_))
|
91 | 90 | ; throw(error(instantiation_error,_))))))).
|
92 | 91 |
|
|
0 commit comments