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