Using checklists as domains

Author: Jeff Dalton

Updated: Wed Mar 22 17:57:34 2006 by Jeff Dalton

This note described the initial version of a checklist importer.

There are obviously a number of changes that could be made,
and the "sentence" parsing is pretty unsophisticated at present,
but it can act as a basis for future versions.

Some rules:

* Define a "checklist" as lines with indentation to indicate
  grouping.  Indentation can be nested; blank lines are allowed
  only at the top level.

* Any top-level line will produce a refinement.

  Lines at the next level of indentation will become nodes
  in that refinement.

  If any line has more deeply indented lines under it,
  it also produces a refinement with lines at the next
  level (relative to it) as its nodes; and so on.

* Lines should NOT be numbered.  (If necessary, we can introduce
  handling for numbered lines later.)

How to use this new feature:

  Name your file whatever.checklist

  Treat it as a domain.

If you look at "Help" -> "About I-X Process Panel", the
list of "File syntaxes" will include:

   Checklist files as domains ("checklist")
      Input only
      Input must be a domain

An example:

Go to London
  Prepare for trip.
    Buy train tickets
    Book hotel
    Arrange meetings
    Pack clothes
    Buy food to eat on train.
       Buy sandwiches
       Buy wine
       Buy snacks
    Get enough money for taxi food etc
  To do the night before
    Book taxi
    Check train times
    Set alarm clock
  Go to Waverley.
  Take train

Return trip
  Check tickets

In LTF syntax, that becomes:

(refinement Go-0 (Go to London)
  (nodes
    (1 (Prepare for trip.))
    (2 (To do the night before))
    (3 (Go to Waverley.))
    (4 (Take train))))

(refinement Prepare-0 (Prepare for trip.)
  (nodes
    (1 (Buy train tickets))
    (2 (Book hotel))
    (3 (Arrange meetings))
    (4 (Pack clothes))
    (5 (Buy food to eat on train.))
    (6 (Get enough money for taxi food etc))))

(refinement Buy-0 (Buy food to eat on train.)
  (nodes
    (1 (Buy sandwiches))
    (2 (Buy wine))
    (3 (Buy snacks))))

(refinement To-0 (To do the night before)
  (nodes
    (1 (Book taxi))
    (2 (Check train times))
    (3 (Set alarm clock))))

(refinement Return-0 (Return trip)
  (nodes
    (1 (Check tickets))))

It could obviously be better about generating refinement names
and at handling punctiation and capitalisation in the source.

There is a case for restricting the refinement that can be used in
"nested" cases to the one that was produced from the nested lines
(rather than just linking them through the expands-pattern); but
there's also a pretty good case for NOT doing that.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
