Files
mercury/tests/debugger/declarative/pd.exp
Zoltan Somogyi 2bada9761f Eliminate some code duplication by unifying the two goal_path types have had
Estimated hours taken: 2
Branches: main

Eliminate some code duplication by unifying the two goal_path types have had
until now: one in mdbcomp/program_representation.m and compiler/hlds_goal.m,
which differed in only one detail (whether we record the total number of arms
in a switch). The new type is in program_representation.m, but with the
definition from goal_path.m.

Add a "step_" prefix to the function symbols of the goal_path_step type,
to avoid ambiguity with the hlds goals the steps describe.

Turn the predicates operating on goal_paths into functions for greater
convenience of use.

mdbcomp/program_representation.m:
compiler/hlds_goal.m:
	Make the change described above.

browser/*.m:
compiler/*.m:
mdbcomp/*.m:
slice/*.m:
	Conform to the change above.

tests/debugger/*.exp:
	Expect the extra information now available for goal path steps
	describing switches.
2007-01-06 10:56:27 +00:00

41 lines
1.1 KiB
Plaintext

1: 1 1 CALL pred pd.main/2-0 (det) pd.m:8
mdb> echo on
Command echo enabled.
mdb> register --quiet
mdb> break rev
0: + stop interface func pd.rev/1-0 (det)
mdb> continue
2: 2 2 CALL func pd.rev/1-0 (det) pd.m:14 (pd.m:9)
mdb> finish
15: 2 2 EXIT func pd.rev/1-0 (det) pd.m:14 (pd.m:9)
mdb> dd -d 3 -n 7
rev([1, 2, 3]) = []
Valid? no
rev_2([1, 2, 3], []) = []
Valid? pd
14: 3 3 EXIT func pd.rev_2/2-0 (det) pd.m:18 (pd.m:14)
mdb> retry
3: 3 3 CALL func pd.rev_2/2-0 (det) pd.m:18 (pd.m:14)
mdb> step
4: 3 3 SWTC func pd.rev_2/2-0 (det) s2-2; pd.m:19
mdb> step
5: 4 4 CALL func pd.rev_2/2-0 (det) pd.m:18 (pd.m:19)
mdb> finish
13: 4 4 EXIT func pd.rev_2/2-0 (det) pd.m:18 (pd.m:19)
mdb> dd -d 3 -n 7
rev_2([2, 3], [1]) = []
Valid? no
rev_2([3], [2, 1]) = []
Valid? pd
12: 5 5 EXIT func pd.rev_2/2-0 (det) pd.m:18 (pd.m:19)
mdb> dd -d 3 -n 7
rev_2([3], [2, 1]) = []
Valid? no
rev_2([], [3, 2, 1]) = []
Valid? no
Found incorrect contour:
rev_2([], [3, 2, 1]) = []
Is this a bug? yes
11: 6 6 EXIT func pd.rev_2/2-0 (det) pd.m:18 (pd.m:19)
mdb> quit -y