Files
mercury/tests/debugger/declarative/partial.exp
Ian MacLarty fef2d804cc Allow subterms to be tracked through partial unifications in the
Estimated hours taken: 4
Branches: main

Allow subterms to be tracked through partial unifications in the
declarative debugger.
This involves adding new types of atomic goals to the program representation
stored with the executable of programs compiled with `--trace rep'.

Remove the ``unsafe'' from the cast goal representation to bring the program
representation up to date with Mark's recent change.

browser/declarative_execution.m:
	Read partial unification atomic goals from bytecode.

browser/declarative_tree.m:
	Handle partial unifications when tracking a subterm.

compiler/prog_rep.m:
	If a construction or deconstruction unification is a partial
	unification then generate a partial construction or deconstruction
	goal type.

	Make atomic_goal_info_to_byte_list return the list of variables bound
	by the atomic goal so we can check if a deconstruction is a
	partial unification (the LHS will be in the list of bound variables).

	Wrap the arguments of the RHS of the partial unification in a maybe
	type, so that we can tell which were input.

mdbcomp/program_representation.m:
	Add a new atomic goal `unify_partial_rep' to represent partial
	unifications.

tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/partial.exp:
tests/debugger/declarative/partial.inp:
tests/debugger/declarative/partial.m:
	Test tracking of subterms through partial unifications.
2005-09-13 04:04:07 +00:00

37 lines
1.1 KiB
Plaintext

E1: C1 CALL pred partial.main/2-0 (det) partial.m:11
mdb> mdb> Contexts will not be printed.
mdb> echo on
Command echo enabled.
mdb> step
E2: C2 CALL pred partial.p/1-0 (det)
mdb> finish
E3: C2 EXIT pred partial.p/1-0 (det)
mdb> dd
p(t(1, 2))
Valid? browse 1
browser> cd 1
browser> mark
a(1)
Valid? info
Context of current question : partial.m:32 (partial.m:25)
Search mode : top down
The current question was chosen because the marked subterm was bound by
the unification inside the predicate partial.a/1 (partial.m:32). The
path to the subterm in the atom is 1.
dd> undo
p(t(1, 2))
Valid? browse 1
browser> cd 2
browser> mark
b(2)
Valid? info
Context of current question : partial.m:36 (partial.m:26)
Search mode : top down
The current question was chosen because the marked subterm was bound by
the unification inside the predicate partial.b/1 (partial.m:36). The
path to the subterm in the atom is 1.
dd> quit
Diagnosis aborted.
E3: C2 EXIT pred partial.p/1-0 (det)
mdb> quit -y