From tfm%computer-lab.cambridge.ac.uk@NSFnet-Relay.AC.UK  Thu Oct 26 10:32:43 1989
Received: by iris (5.57/3.14)
        id AA19510; Thu, 26 Oct 89 10:32:43 PDT
Received: from ucdavis.ucdavis.edu by clover.ucdavis.edu (5.59/UCD.EECS.1.11)
        id AA19197; Thu, 26 Oct 89 10:35:28 PDT
Received: by ucdavis.ucdavis.edu (5.51/UCD1.41)
        id AA01829; Thu, 26 Oct 89 10:25:34 PDT
Received: from computer-lab.cambridge.ac.uk by NSFnet-Relay.AC.UK
           via Janet with NIFTP  id aa12149; 26 Oct 89 18:01 BST
Received: from steve.cl.cam.ac.uk by scaup.Cl.Cam.AC.UK id aa15261;
          26 Oct 89 16:26 GMT
Date: Thu, 26 Oct 89 17:24:37 BST
From: Tom Melham <tfm%computer-lab.cambridge.ac.uk@NSFnet-Relay.AC.UK>
To: info-hol%clover.ucdavis.edu@NSFnet-Relay.AC.UK
Subject: sticky types in HOL88
Message-Id:  <8910261626.aa15261@scaup.Cl.Cam.AC.UK>

RE: the problem that Ramayya Kumar had in getting an example to run in HOL.

The problem is not due to errors in rebuilding HOL88, but
to a difference between the HOL88 parser and the old HOL parser.

The following session:

***********************************************************************
#let th1 = ASSUME "t1 ==> t2";;
th1 = . |- t1 ==> t2

#let th2 = UNDISCH th1;;
th2 = .. |- t2

#DISCH "t1 ==>t2" (DISCH "t1" th2);;
Indeterminate types:  "t1:?"

evaluation failed     types indeterminate in quotation
***********************************************************************

which occurs in the paper "HOL: a proof generating system for higher
order logic" used to run in pre-HOL88 versions because of a feature
called "sticky types".  This feature has been disabled in HOL88, though
it can be re-enabled (as discussed below).

Sticky types were a heuristic used by the old HOL parser to "guess"
the types of variables when there is not enough information to deduce
them.  The idea is that a variable is likely to be intended by the user
to have the same type as it had in its most recent use in the current
session.  Consider, for example, the session above.  In the third input
line:

     #DISCH "t1 ==>t2" (DISCH "t1" th2);;

the second mention of the variable t1 in the quotation "t1" does
not (without stick types) have enough information to determine an
unambiguous type for the variable.  The scope of variable-typing
is always single quotation, and in the quotation "t1", the variable
t1 could have any type.  With the sticky type feature turned on (as
in old HOL) the parser will assume that the variable t1 in "t1"
has type :bool, since it had type :bool in another quotation earlier
in the same line (and indeed in other quotations earlier in the session).
With sticky types disabled (as in HOL88), the parser does not make
this assumption, and can't assign an unambiguous type to "t1".  Hence
the error message shown above.

To enable stick types in HOL88, execute:

   set_flag(`sticky`, true);;

This will re-enable the sticky type feature.  Otherwise, use
enough type-annotation to ensure that types can be deduced by
the parser.  E.g., enter:

     #DISCH "t1 ==>t2" (DISCH "t1:bool" th2);;

in the example given above.

I hope this helps.

Tom

