Return-Path: <John.Harrison-request@cl.cam.ac.uk>
Delivery-Date: 
Received: from leopard.cs.byu.edu (no rfc931) by swan.cl.cam.ac.uk 
          with SMTP (PP-6.5) outside ac.uk; Wed, 20 Jul 1994 16:22:22 +0100
Received: by leopard.cs.byu.edu (1.37.109.8/16.2) id AA07134;
          Wed, 20 Jul 1994 08:47:18 -0600
Sender: info-hol-request@lal.cs.byu.edu
Errors-To: info-hol-request@lal.cs.byu.edu
Precedence: bulk
Received: from [128.232.0.56] by leopard.cs.byu.edu with SMTP (1.37.109.8/16.2) 
          id AA07115; Wed, 20 Jul 1994 08:44:59 -0600
Received: from auk.cl.cam.ac.uk (user jrh (rfc931)) by swan.cl.cam.ac.uk 
          with SMTP (PP-6.5) to cl; Wed, 20 Jul 1994 15:38:56 +0100
To: info-hol@leopard.cs.byu.edu
Cc: terra@diku.dk
Subject: Re: "Meta" rewriting
In-Reply-To: Your message of "Tue, 19 Jul 94 15:43:45 BST." <9407191443.AA17059@switha.dcs.gla.ac.uk>
Date: Wed, 20 Jul 94 15:38:42 +0100
From: John Harrison <John.Harrison@cl.cam.ac.uk>
Message-Id: <"swan.cl.cam.:005190:940720143915"@cl.cam.ac.uk>


Tom Melham writes:

| It's not really the matching part whose efficiency I'm worried about -
| mere computation of the match is of little consequence.  What concerns me
| is the subsequent (1) search for places to do beta-reduction, and (2)
| depth conversion needed to effect reduction at these places.

Well, there need be no "subsequent search" for beta-redexes; one can generate
the appropriate depth conversion as part of the matching procedure. A selection
of possible reductions can be precomputed from the rewrite rule before the
target term is seen, and whittled down quite efficiently later during matching.
(There are a few tricky issues about exactly which beta-conversions the user
*wants*, but let's leave that aside.)

Certainly the matter of actually doing the depth conversions is unavoidable.
However I believe that it is almost as efficient as a handcoded alternative
which works in the same way (perhaps with partial evaluation it would be
identical?) Of course it may be that an alternative inference pattern is
quicker than higher order instantiation of a proforma (this is the case for
some of the existing quantifier conversions which are mostly very efficient),
but in my opinion the margin is small, and outweighed by the gain in elegance
and regularity.

John.
