[Update Hat webpage. malcolm**20020315123331] { hunk ./docs/index.html 13 +

Table of Contents

+What is Hat?
+How can I view a trace?
+Tutorials and Documentation
+Current Release
+Development
+Mailing Lists
+Publications
+ + + + +

What is Hat?

+ hunk ./docs/index.html 54 -

How can I view a trace?

+ +

How can I view a trace?

hunk ./docs/index.html 71 -
  • Hat-stack
    hunk ./docs/index.html 72 -For aborted computations, that is computations that terminated -with an error message or were interrupted, hat-stack shows in which -function call the computation was aborted. It does so by showing a -virtual stack of function calls (redexes). So every function -call on the stack caused the function call above it. The evaluation -of the top stack element caused the error or during its evaluation -the computation was interrupted. The shown stack is virtual, -because it does not correspond to the actual runtime stack. The actual -runtime stack enables lazy evaluation whereas the virtual -stack corresponds to a stack that would be used for eager (strict) -evaluation. +
  • Hat-observe (inspired by Hood)
    + +Hat-observe is an interactive tool that shows how top-level functions +are used. That is, for a given top-level function name it shows +all the arguments with which it is called during the computation, +together with the respective results. hunk ./docs/index.html 89 -hat-stack shows + +gives the result hunk ./docs/index.html 92 -Program terminated with error: - "No match in pattern." -Virtual stack trace: - (last' []) (Example.hs: line-6/col-16) - (last' (5+6:[])) (Example.hs: line-6/col-16) - (last' ((div 5 0):5+6:[])) (Example.hs: line-6/col-16) - (last' (8:(div 5 0):5+6:[])) (Example.hs: line-4/col-27) - main (Example.hs: line-2/col-1) +(8, No match in pattern. hunk ./docs/index.html 94 +and the hat-observe tool can be used to explore its behaviour as follows: hunk ./docs/index.html 96 +
    +$ hat-observe Example
    +
    +		hat-observe 1.12    (:h for help, :q to quit)
    +
    +hat-observe> main
    +1  main = IO (print (8,_|_))
    +hat-observe> print
    +1  print (8,_|_) = IO (print (8,_|_))
    +hat-observe> last'
    +1  last' [8,_,_] = _|_
    +2  last' [_,_] = _|_
    +3  last' [_] = _|_
    +4  last' [] = _|_
    +hat-observe> :quit
    +$
    +
    hunk ./docs/index.html 114 -
  • Hat-observe (inspired by Hood)
    hunk ./docs/index.html 115 -Hat-observe shows a top-level function. That is, for a given top-level -function name it shows all the arguments with which is was called -during the computation together with the respective results. +
  • Hat-trail
    + +Hat-trail is an interactive tool that enables exploring a computation +backwards, starting at the program output or an error message +(with which the computation aborted). This is particularly useful +for locating an error. You start at the observed faulty behaviour +and work backwards towards the source of the error. hunk ./docs/index.html 124 -For example, -
    -hat-observe "last'" Example
    -
    -shows +Every reduction replaces an instance of the left-hand side of a program +equation by an instance of its right-hand side. The instance of the +left-hand side ``creates'' the instance of the right-hand side and is +therefore called its parent. With hat-trail you can obtain +the parent of any expression. + +

    +(Note: if you cannot see any highlighting in the following diagram, +try changing the fixed-width font in your browser to something like +Courier text.) Each line of the trail is the parent of the highlighted +subexpression directly above it. + hunk ./docs/index.html 137 -last' (8:_:_:[]) = _|_ -last' (_:_:[]) = _|_ -last' (_:[]) = _|_ -last' [] = _|_ +Error: ------------------------------------------------------- +No match in pattern. +Output: ------------------------------------------------------ +(8, +Trail: ---------------------- Example.hs line: 2 col: 12 ----- +<- last' [] +<- last' [_] +<- last' [_,_] +<- last' [8,_,_] +<- 4 * 2 +<- xs hunk ./docs/index.html 151 +Here, the error message is chosen as the starting point, rather +than any of the output. The first trail is therefore +last' [], because its evaluation caused the error message. +The parent of last' [] is +last' [_]. The parent of last' [_] +is last' [_,_]), etc. The parent of the +subexpression 8 is 4*2 whose parent is +xs. +

    + hunk ./docs/index.html 162 -Hat-detect is an interactive tool that enables locating -semi-automatically an error in a program by answering a sequence -of yes/no questions. Each question asked by hat-detect concerns -the reduction of a redex - that is, a function application - to a -value. You have to answer yes, if the reduction is correct -with respect to your intentions, and no otherwise. After a -number of questions hat-detect states which reduction is the cause -of the observed faulty behaviour - that is, which function definition -is incorrect. +Hat-detect is an interactive tool that enables the semi-automatic +location of an error in a program by answering a sequence of yes/no +questions. Each question asked by hat-detect concerns the reduction +of a redex - that is, a function application - to a value. You have to +answer yes, if the reduction is correct with respect to your +intentions, and no otherwise. After a number of questions +hat-detect states which reduction is the cause of the observed faulty +behaviour - that is, which function definition is incorrect. hunk ./docs/index.html 174 -1> main = IO (print (3:3:3:[])) (Y/?/N): n - -2> sort (3:2:1:[]) = 3:3:3:[] (Y/?/N): n +$ hat-detect Example hunk ./docs/index.html 176 -3> insert 1 [] = 1:[] (Y/?/N): y + hat-detect 1.12 (:h for help, :q to quit) hunk ./docs/index.html 178 -4> insert 2 (1:[]) = 2:2:[] (Y/?/N): n - -5> insert 2 [] = 2:[] (Y/?/N): y +1 main = IO (print [3,3,3]) ? n +2 sort [3,2,1] = [3,3,3] ? n +3 insert 1 [] = [1] ? y +4 insert 2 [1] = [2,2] ? n +5 insert 2 [] = [2] ? y hunk ./docs/index.html 185 -Bug found: "insert 2 (1:[]) = 2:2:[]" +Bug found in reduction: insert 2 [1] = [2,2] hunk ./docs/index.html 188 -

  • Hat-trail
    hunk ./docs/index.html 189 -Hat-trail is an interactive tool that enables exploring a computation -backwards, starting at the program output or an error message -(with which the computation aborted). This is particularly useful -for locating an error. You start at the observed faulty behaviour -and work backwards towards the source of the error. +
  • Hat-stack
    hunk ./docs/index.html 191 -

    -Every reduction replaces an instance of the left-hand side of a program -equation by an instance of its right-hand side. The instance of the -left-hand side ``creates'' the instance of the right-hand side and is -therefore called its parent. With hat-trail you can obtain -the parent of an expression. +For aborted computations, that is computations that terminated +with an error message or were interrupted, hat-stack shows in which +function call the computation was aborted. It does so by showing a +virtual stack of function calls (redexes). Thus, every function +call shown on the stack caused the function call above it. The evaluation +of the top stack element caused the error (or during its evaluation +the computation was interrupted). The stack shown is virtual, +because it does not correspond to the actual runtime stack. The actual +runtime stack enables lazy evaluation whereas the virtual +stack corresponds to a stack that would be used for eager (strict) +evaluation. hunk ./docs/index.html 204 -

    -example -
    +Using the same example program as above, hat-stack shows +
    +$ hat-stack Example
    +Program terminated with error:
    +    "No match in pattern."
    +Virtual stack trace:                     source file/line/col
    +    (last' [])                            Example.hs   6  16
    +    (last' (5+6:[]))                      Example.hs   6  16
    +    (last' ((div 5 0):5+6:[]))            Example.hs   6  16
    +    (last' (8:(div 5 0):5+6:[]))          Example.hs   4  27
    +    main                                  Example.hs   2   1
    +$
    +
    hunk ./docs/index.html 218 -last' [] is the starting point, because its evaluation -caused an error message. The parent of last' [] is -last' (5+6:[]). The parent of last' (5+6:[]) -is last' (5 `div` 0:5+6:[]), etc. The parent of the -subexpression 8 is 4*2 whose parent is -xs. hunk ./docs/index.html 221 -

    Documentation

    + +

    Tutorials and Documentation

    hunk ./docs/index.html 225 -
  • - Frequently asked questions -
  • the Hat user manual (part of the distribution) +
  • Frequently asked questions +
  • A simple tutorial introduction to Hat: + (TeX) + (PostScript) + (PDF) +
  • A second tutorial introducing more sophisticated features of Hat: + (Not yet available) +
  • the Hat user manual: hunk ./docs/index.html 239 -

    Current Release

    + +

    Current Release

    hunk ./docs/index.html 242 -Hat 1.10 is part of the Haskell system nhc98. So you get Hat by +Hat 1.12 is part of the Haskell system nhc98. So you get Hat by hunk ./docs/index.html 252 - + hunk ./docs/index.html 257 -

    Development

    + +

    Development

    hunk ./docs/index.html 305 -

    Mailing lists

    + +

    Mailing lists

    hunk ./docs/index.html 320 -

    Publications

    + +

    Publications

    hunk ./docs/index.html 377 -This page last modified: 14 December 2001
    +This page last modified: 13 March 2002
    }