Section: User Commands (1)
Updated: local
Index Return to Main Contents


hat-detect - find a bug by algorithmic debugging  


hat-detect prog[.hat]  


hat-detect is an interactive tool for finding bugs in the trace of a Haskell program prog supplied as its argument. The user must answer a sequence of yes/no questions. Each question asked by hat-detect concerns the reduction of a function application to a value. You answer yes if the reduction is correct with respect to your intentions, and <em>no</em> otherwise. After a number of questions hat-detect reports an example equation which is the cause of the observed faulty behaviour - that is, which function definition is incorrect.



The hat-detect browser asks you questions, so the basic mode of interaction is to type answers:

Yes, the equation looks correct by my understanding of the meaning of the function.
No, the equation looks incorrect. Given the displayed arguments, the function is returning the wrong result.
I am not sure whether this equation is correct. Continue, but ask me about this question again if it turns out to be relevant.

The following other commands are available. They each begin with a colon. A command can be abbreviated to its shortest non-ambiguous prefix.

Exit the interactive tool.
:help [cmd]
Shows help text giving an overview of the commands available, or if a command name cmd is given, shows more detailed help about that command. Also :help query shows the detailed syntax of observation queries. :set [flag] With no argument, shows all current mode settings. Given an argument, it changes that mode and reports the new setting. The flag argument is one of:
uneval [on|off]
show unevaluated expressions in full (default off)
strSugar [on|off]
sugar character strings (default on)
listSugar [on|off]
sugar lists (default on)
recursive [on|off]
ask about recursive calls (default on)
qualified [on|off]
show all identifiers qualified (default off)
equations [on|off]
show rhs of equations (default on)
ask about all relevant equations (even duplicates) or only unique (default all)
group n
number of equations listed per page (default 10)
cutoff n
cut-off depth for deeply nested exprs (default 10)
Short-cut to increase the cutoff depth by <n> (default 1)
Short-cut to decrease the cutoff depth by <n> (default 1)

:source n
Shows (in a separate window) the source code for the application usage of the numbered equation.
:Source n
Shows (in a separate window) the source code for the function definition of the numbered equation.
:detect n
Start a fresh copy of hat-detect in a new window, beginning with the numbered equation.
:trail n
Start the hat-trail browser in a new window, beginning with the numbered equation.
:observe [query]
With no argument, an interactive hat-observe window is started for the same traced program. Given a query argument, the new window starts with an immediate search for the expression pattern before giving an interactive prompt.
After resizing a window, use this command to inform the tool to detect the change in size, so that pretty-printing can fit the screen.
Trust all applications of the current function. This causes the system to assume the answer to any question involving this function is yes.
Cease all in-browser trusting of function identifiers. Reverts to nothing trusted.






hmake(1), hat-trans(1), hat-stack(1), hat-observe(1), hat-trail(1)




This document was created by man2html, using the manual pages.
Time: 15:48:36 GMT, July 03, 2003