Files
mercury/tests/debugger/declarative/binary_search.exp2
Ian MacLarty cfa50105ba Allow the search mode to be changed from within the declarative debugger.
Estimated hours taken: 15
Branches: main

Allow the search mode to be changed from within the declarative debugger.

Make binary search independent of subterm dependency tracking.  The
user can now perform a binary search along the path between the current
question and the root of the search space using the command `mode binary'
(or `m b').

browser/declarative_analyser.m:
	Make reask_last_question fail instead of throwing an exception
	if there is no last question.  If it fails we
	recompute the question.  This happens when the user
	resumes with a new search mode.

	Do not return an analyser response when showing info, since we can
	just call reask_last_question.

	Make set_fallback_search_mode set the last_search_question field to
	no.  This will force the question to be recomputed with the new
	search strategy when analysis continues.

	Add change_search_mode which handles the users request to change the
	current search mode from within a declarative debugging session.

	Do not perform a binary search after tracking a subterm unless
	instructed to do so by the user.

browser/declarative_debugger.m:
	Allow search mode changes to be undone.
	Handle the new change_search oracle response.
	Handle the fact that reask_last_question is now semidet.

browser/declarative_oracle.m:
	Add a change_search oracle response.
	Add a predicate to indicate which oracle responses are undoable.

browser/declarative_user.m:
	Add a change_search user response.

doc/user_guide.texi:
	Rephrase the description of the undo command to take into account that
	search mode changes can be undone.
	Add a section about the binary search mode.
	Rearrange some text and reword some sentences slightly.

tests/debugger/mdb_command_test.inp:
tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/binary_search.exp:
tests/debugger/declarative/binary_search.exp2:
tests/debugger/declarative/binary_search.inp:
tests/debugger/declarative/binary_search.inp2:
tests/debugger/declarative/change_search.exp:
tests/debugger/declarative/change_search.inp:
tests/debugger/declarative/change_search.m:
tests/debugger/declarative/info.exp:
tests/debugger/declarative/info.inp:
	Test the `mode' command and do not expect the declarative debugger to
	automatically go into binary search mode once it has tracked a subterm.
2005-08-19 16:08:31 +00:00

101 lines
2.3 KiB
Plaintext

E1: C1 CALL pred binary_search.main/2-0 (det) binary_search.m:15
mdb> mdb> Contexts will not be printed.
mdb> echo on
Command echo enabled.
mdb> break a
0: + stop interface pred binary_search.a/1-0 (det)
mdb> c
E2: C2 CALL pred binary_search.a/1-0 (det)
mdb> f
E3: C2 EXIT pred binary_search.a/1-0 (det)
mdb> dd -d 3 -n 7
a(yes)
Valid? b 1
browser> mark
silly_even(0, yes)
Valid? mode binary
sillier_even(502, yes)
Valid? y
silly_even(771, yes)
Valid? n
sillier_even(655, yes)
Valid? n
sillier_even(600, yes)
Valid? y
sillier_even(627, yes)
Valid? n
silly_even(614, yes)
Valid? y
sillier_even(619, yes)
Valid? n
sillier_even(618, yes)
Valid? y
silly_even(619, yes)
Valid? n
silly_even(618, yes)
Valid? y
Found incorrect contour:
>(619, 0)
-(619, 1) = 618
silly_even(618, yes)
silly_even(619, yes)
Is this a bug? y
E4: C3 EXIT pred binary_search.silly_even/2-0 (det)
mdb> trust binary_search_1
Trusting module binary_search_1
mdb> break b
1: + stop interface pred binary_search.b/1-0 (det)
mdb> delete 0
0: E stop interface pred binary_search.a/1-0 (det)
mdb> c
E5: C4 CALL pred binary_search.b/1-0 (det)
mdb> f
E6: C4 EXIT pred binary_search.b/1-0 (det)
mdb> dd -d 3 -n 7
b(yes)
Valid? b 1
browser> mark
Found incorrect contour:
>(619, 0)
-(619, 1) = 618
silly_even(618, yes)
silly_even(619, yes)
Is this a bug? y
E7: C5 EXIT pred binary_search.silly_even/2-0 (det)
mdb> delete 1
1: E stop interface pred binary_search.b/1-0 (det)
mdb> break add1s
0: + stop interface pred binary_search.add1s/2-0 (det)
mdb> c
E8: C6 CALL pred binary_search.add1s/2-0 (det)
mdb> delete 0
0: E stop interface pred binary_search.add1s/2-0 (det)
mdb> f
E9: C6 EXIT pred binary_search.add1s/2-0 (det)
mdb> dd -d 3 -n 7
add1s([1, 2, 3, 4, 5, 6, 7, 8, ...], [|]/2)
Valid? b 2
browser> ls
[2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
browser> cdr 9 2
browser> ls
[11]
browser> cd 1
browser> mark
add1s([10], [11])
Valid? mode binary
add1s([5, 6, 7, 8, 9, 10], [6, ...])
Valid? y
add1s([2, 3, 4, 5, 6, 7, 8, 9, ...], [|]/2)
Valid? n
add1s([3, 4, 5, 6, 7, 8, 9, 10], [|]/2)
Valid? y
Found incorrect contour:
+(2, 1) = 3
add1s([3, 4, 5, 6, 7, 8, 9, 10], [|]/2)
add1s([2, 3, 4, 5, 6, 7, 8, 9, ...], [|]/2)
Is this a bug? y
E10: C7 EXIT pred binary_search.add1s/2-0 (det)
mdb> c
yesyes[2, 3, 4, 5, 6, 7, 8, 9, 10, 11]