Return-Path: 
Return-Path: <john.harrison-request@uk.ac.cam.cl>
Received: from nsf.ac.uk by swan.cl.cam.ac.uk via JANET 
          with NIFTP to fgate (PP) id <569-0@swan.cl.cam.ac.uk>;
          Fri, 1 Mar 1991 01:42:06 +0000
Received: from vax.nsfnet-relay.ac.uk by sun2.nsfnet-relay.ac.uk 
          with SMTP inbound id <26755-51@sun2.nsfnet-relay.ac.uk>;
          Fri, 1 Mar 1991 01:35:57 +0000
Received: from iris.ucdavis.edu by vax.NSFnet-Relay.AC.UK via NSFnet with SMTP 
          id aa08236; 28 Feb 91 23:25 GMT
Received: by iris.eecs.ucdavis.edu (5.57/UCD.EECS.4.0) id AA04523;
          Thu, 28 Feb 91 11:26:50 -0800
Received: from sun2.nsfnet-relay.ac.uk 
          by clover.eecs.ucdavis.edu (5.59/UCD.EECS.1.11) id AA15970;
          Thu, 28 Feb 91 11:28:16 PST
Received: from computer-lab.cambridge.ac.uk by sun2.nsfnet-relay.ac.uk 
          via JANET with NIFTP id <16987-0@sun2.nsfnet-relay.ac.uk>;
          Thu, 28 Feb 1991 17:02:13 +0000
Received: from cl.cam.ac.uk by swan.cl.cam.ac.uk with SMTP (PP) 
          id <23197-0@swan.cl.cam.ac.uk>; Thu, 28 Feb 1991 17:01:21 +0000
Received: by uk.ac.cam.cl.dipper (4.0/SMI-3.0DEV3) id AA05850;
          Thu, 28 Feb 91 17:01:15 GMT
Date: Thu, 28 Feb 91 17:01:15 GMT
From: John.Van-Tassel@uk.ac.cam.cl
Message-Id: <9102281701.AA05850@uk.ac.cam.cl.dipper>
To: cant@au.oz.dsto.itd, info-hol@edu.ucdavis.clover
Subject: Re: String to term conversion

Tony,

Sorry to have been a bit late in getting this answer to your query about a
string -> term converter out the door.  I'm following up to info-hol because
the answer might be of interest to the wider HOL community.

In the new release of the system (version 1.12 -- an announcement of
which should eminate from Sara Kalvala soon), there's a new library
called "parser".  It allows one to create recursive descent parsers
for use from within ML.  Included as one of the examples in the library
is a HOL term parser.  There is no antiquotation, but it seems to work 
on other stuff in the same fashion as the internal HOL term parser.

Here are some examples of it in action (Sun3 w/ Franz Lisp):

   #<< x /\ y >>;;
   "x /\ y" : term
   Run time: 0.1s
   
   #"x/\y";;
   "x /\ y" : term
   Run time: 0.0s
   
   #<< let a = \x,y.x+y and b = \w,z.w-z in (a,b) >>;;
   "let a (x,y) = x + y and b (w,z) = w - z in a,b" : term
   Run time: 0.6s
   
   #"let a = \x,y.x+y and b = \w,z.w-z in (a,b)";;
   "let a (x,y) = x + y and b (w,z) = w - z in a,b" : term
   Run time: 0.1s

The "<< >>" notation is also a new feature of the system.  In essence,
one may define special syntax blocks, and special delimiters for them.  
The ML parser then treats the text between these delimiters as a string to
be passed to a user-specified function.  So, in the above case, the
statement "new_syntax_block(`<<`,`>>`,`parse`);;" causes anything
between a << and a >> to be sent to the function "parse".  "parse" itself
is the hook into the generated parser for HOL terms.

This and other new tools (e.g. a pretty-printer generator) come with
Version 1.12.  Coming soon to an anonymous repository near you!


JVT

------------------------------------------------------------------------------
John Van Tassel			|  Tel: +44-223-334729
Univ. of Cambridge		|  Fax: +44-223-334678
Computer Laboratory		|  
Pembroke Street			|  Email: jvt@cl.cam.ac.uk
Cambridge CB2 3QG		|
England				|

