Skip to content

Commit 14b04f9

Browse files
authored
Merge pull request #379 from LPCIC/fix-pp
Fix pp
2 parents 0feb97a + 41ab187 commit 14b04f9

File tree

7 files changed

+87
-103
lines changed

7 files changed

+87
-103
lines changed

src/runtime/runtime.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ let xppterm ~nice ?(pp_ctx = { Data.uv_names; table = ! C.table }) ?(min_prec=mi
302302
Fmt.fprintf f "@ %a" (aux inf_prec depth) (mkConst depth);
303303
match t with
304304
| Lam (Builtin (Pi, [body])) -> pp_pis (depth + 1) body
305-
| Lam t -> Fmt.fprintf f "@ \\@ %a@]" (aux min_prec depth) t
305+
| Lam t -> Fmt.fprintf f "@ \\@ %a@]" (aux min_prec (depth+1)) t
306306
| _ -> assert false in
307307
pp_pis depth body)
308308
| Builtin(b,[]) -> Fmt.fprintf f "%a" ppbuiltin b

tests/sources/dt_empty_list.log

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
1-
rid:0 step:2 gid:0 dev:disc-tree:depth-path = Goal: MaxDepths
2-
1
3-
4-
rid:0 step:2 gid:0 dev:disc-tree:path = [|Output; Variable; PathEnd; PathEnd;
5-
PathEnd|]
6-
1
7-
8-
rid:0 step:2 gid:0 dev:disc-tree:candidates = 2
9-
10-
rid:0 step:3 gid:0 dev:disc-tree:depth-path = Goal: MaxDepths
11-
1
12-
13-
rid:0 step:3 gid:0 dev:disc-tree:path = [|Output; ListNil; PathEnd; PathEnd;
14-
PathEnd|]
15-
1
16-
17-
rid:0 step:3 gid:0 dev:disc-tree:candidates = 1
18-
19-
rid:0 step:4 gid:0 dev:disc-tree:depth-path = Goal: MaxDepths
20-
1
21-
22-
rid:0 step:4 gid:0 dev:disc-tree:path = [|Output; ListHead; Variable;
23-
ListTailVariable; PathEnd|]
24-
1
25-
26-
rid:0 step:4 gid:0 dev:disc-tree:candidates = 1
27-
1+
rid:0 step:2 gid:0 dev:disc-tree:depth-path = Goal: MaxDepths 1
2+
3+
rid:0 step:2 gid:0 dev:disc-tree:path =
4+
[|Output; Variable; PathEnd; PathEnd; PathEnd|]1
5+
6+
rid:0 step:2 gid:0 dev:disc-tree:candidates = 2
7+
rid:0 step:3 gid:0 dev:disc-tree:depth-path = Goal: MaxDepths 1
8+
9+
rid:0 step:3 gid:0 dev:disc-tree:path =
10+
[|Output; ListNil; PathEnd; PathEnd; PathEnd|]1
11+
12+
rid:0 step:3 gid:0 dev:disc-tree:candidates = 1
13+
rid:0 step:4 gid:0 dev:disc-tree:depth-path = Goal: MaxDepths 1
14+
15+
rid:0 step:4 gid:0 dev:disc-tree:path =
16+
[|Output; ListHead; Variable; ListTailVariable; PathEnd|]1
17+
18+
rid:0 step:4 gid:0 dev:disc-tree:candidates = 1

tests/sources/dt_max_depths.log

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1-
rid:0 step:2 gid:0 dev:disc-tree:depth-path = Inst: MaxDepths
2-
2
3-
1
4-
5-
rid:0 step:3 gid:0 dev:disc-tree:depth-path = Inst: MaxDepths
6-
2
7-
3
8-
9-
rid:0 step:4 gid:0 dev:disc-tree:depth-path = Goal: MaxDepths
10-
2;
11-
3
12-
13-
rid:0 step:5 gid:0 dev:disc-tree:depth-path = Inst: MaxDepths
14-
3
15-
16-
rid:0 step:6 gid:0 dev:disc-tree:depth-path = Goal: MaxDepths
17-
3
18-
19-
rid:0 step:7 gid:0 dev:disc-tree:depth-path = Inst: MaxDepths
20-
2
21-
22-
rid:0 step:8 gid:0 dev:disc-tree:depth-path = Goal: MaxDepths
23-
2
24-
1+
rid:0 step:2 gid:0 dev:disc-tree:depth-path = Inst: MaxDepths 2
2+
1
3+
4+
rid:0 step:3 gid:0 dev:disc-tree:depth-path = Inst: MaxDepths 2
5+
3
6+
7+
rid:0 step:4 gid:0 dev:disc-tree:depth-path = Goal: MaxDepths 2;
8+
3
9+
10+
rid:0 step:5 gid:0 dev:disc-tree:depth-path = Inst: MaxDepths 3
11+
12+
rid:0 step:6 gid:0 dev:disc-tree:depth-path = Goal: MaxDepths 3
13+
14+
rid:0 step:7 gid:0 dev:disc-tree:depth-path = Inst: MaxDepths 2
15+
16+
rid:0 step:8 gid:0 dev:disc-tree:depth-path = Goal: MaxDepths 2
17+

tests/sources/trace2.elab.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"rule": [
2222
"UserRule",
2323
{
24-
"rule_text": "main :- (print 1), (pi (c0 \\ (sigma (c1 \\ (fail => (true , fail)))))).",
24+
"rule_text": "main :- (print 1), (pi c0 \\ (sigma (c1 \\ (fail => (true , fail))))).",
2525
"rule_loc": [
2626
"File",
2727
{
@@ -51,7 +51,7 @@
5151
"rule": [
5252
"UserRule",
5353
{
54-
"rule_text": "main :- (print 1), (pi (c0 \\ (sigma (c1 \\ (fail => (true , fail)))))).",
54+
"rule_text": "main :- (print 1), (pi c0 \\ (sigma (c1 \\ (fail => (true , fail))))).",
5555
"rule_loc": [
5656
"File",
5757
{
@@ -102,7 +102,7 @@
102102
"rule": [
103103
"UserRule",
104104
{
105-
"rule_text": "main :- (print 1), (pi (c0 \\ (sigma (c1 \\ (fail => (true , fail)))))).",
105+
"rule_text": "main :- (print 1), (pi c0 \\ (sigma (c1 \\ (fail => (true , fail))))).",
106106
"rule_loc": [
107107
"File",
108108
{
@@ -158,7 +158,7 @@
158158
"rule": [
159159
"UserRule",
160160
{
161-
"rule_text": "main :- (print 1), (pi (c0 \\ (sigma (c1 \\ (fail => (true , fail)))))).",
161+
"rule_text": "main :- (print 1), (pi c0 \\ (sigma (c1 \\ (fail => (true , fail))))).",
162162
"rule_loc": [
163163
"File",
164164
{
@@ -216,7 +216,7 @@
216216
"rule": [
217217
"UserRule",
218218
{
219-
"rule_text": "main :- (print 1), (pi (c0 \\ (sigma (c1 \\ (fail => (true , fail)))))).",
219+
"rule_text": "main :- (print 1), (pi c0 \\ (sigma (c1 \\ (fail => (true , fail))))).",
220220
"rule_loc": [
221221
"File",
222222
{
@@ -277,7 +277,7 @@
277277
"rule": [
278278
"UserRule",
279279
{
280-
"rule_text": "main :- (print 1), (pi (c0 \\ (sigma (c1 \\ (fail => (true , fail)))))).",
280+
"rule_text": "main :- (print 1), (pi c0 \\ (sigma (c1 \\ (fail => (true , fail))))).",
281281
"rule_loc": [
282282
"File",
283283
{
@@ -346,7 +346,7 @@
346346
"rule": [
347347
"UserRule",
348348
{
349-
"rule_text": "main :- (print 1), (pi (c0 \\ (sigma (c1 \\ (fail => (true , fail)))))).",
349+
"rule_text": "main :- (print 1), (pi c0 \\ (sigma (c1 \\ (fail => (true , fail))))).",
350350
"rule_loc": [
351351
"File",
352352
{
@@ -445,7 +445,7 @@
445445
"rule": [
446446
"UserRule",
447447
{
448-
"rule_text": "main :- (print 1), (pi (c0 \\ (sigma (c1 \\ (fail => (true , fail)))))).",
448+
"rule_text": "main :- (print 1), (pi c0 \\ (sigma (c1 \\ (fail => (true , fail))))).",
449449
"rule_loc": [
450450
"File",
451451
{
@@ -522,7 +522,7 @@
522522
"rule": [
523523
"UserRule",
524524
{
525-
"rule_text": "main :- (print 1), (pi (c0 \\ (sigma (c1 \\ (fail => (true , fail)))))).",
525+
"rule_text": "main :- (print 1), (pi c0 \\ (sigma (c1 \\ (fail => (true , fail))))).",
526526
"rule_loc": [
527527
"File",
528528
{

tests/sources/trace2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{"step" : 1,"kind" : ["Info"],"goal_id" : 4,"runtime_id" : 0,"name" : "user:curgoal","payload" : ["main","main"]}
33
{"step" : 1,"kind" : ["Info"],"goal_id" : 4,"runtime_id" : 0,"name" : "user:rule","payload" : ["backchain"]}
44
{"step" : 1,"kind" : ["Info"],"goal_id" : 4,"runtime_id" : 0,"name" : "user:rule:backchain:candidates","payload" : ["File \"tests/sources/trace2.elpi\", line 1, column 0, characters 0-56:"]}
5-
{"step" : 1,"kind" : ["Info"],"goal_id" : 4,"runtime_id" : 0,"name" : "user:rule:backchain:try","payload" : ["File \"tests/sources/trace2.elpi\", line 1, column 0, characters 0-56:","main :- (print 1), (pi (c0 \\ (sigma (c1 \\ (fail => (true , fail))))))."]}
5+
{"step" : 1,"kind" : ["Info"],"goal_id" : 4,"runtime_id" : 0,"name" : "user:rule:backchain:try","payload" : ["File \"tests/sources/trace2.elpi\", line 1, column 0, characters 0-56:","main :- (print 1), (pi c0 \\ (sigma (c1 \\ (fail => (true , fail)))))."]}
66
{"step" : 1,"kind" : ["Info"],"goal_id" : 4,"runtime_id" : 0,"name" : "user:subgoal","payload" : ["5"]}
77
{"step" : 1,"kind" : ["Info"],"goal_id" : 5,"runtime_id" : 0,"name" : "user:newgoal","payload" : ["print 1"]}
88
{"step" : 1,"kind" : ["Info"],"goal_id" : 5,"runtime_id" : 0,"name" : "user:subgoal","payload" : ["6"]}

0 commit comments

Comments
 (0)