Return-Path: <john.harrison-request@uk.ac.cam.cl>
Delivery-Date: 
Received: from ted.cs.uidaho.edu (no rfc931) by swan.cl.cam.ac.uk 
          with SMTP (PP-6.4); Fri, 15 Jan 1993 11:05:59 +0000
Received: by ted.cs.uidaho.edu (16.6/1.34) id AA01188;
          Fri, 15 Jan 93 02:02:28 -0800
Sender: info-hol-request@edu.uidaho.cs.ted
Errors-To: info-hol-request@edu.uidaho.cs.ted
Precedence: bulk
Received: from ganymede.inmos.co.uk by ted.cs.uidaho.edu (16.6/1.34) id AA01183;
          Fri, 15 Jan 93 02:02:16 -0800
Received: from frogland.inmos.co.uk by ganymede.inmos.co.uk;
          Fri, 15 Jan 93 10:01:39 GMT
From: David Shepherd <des@uk.co.inmos>
Message-Id: <6361.9301151002@frogland.inmos.co.uk>
Subject: Re: new_recursive_definition limitation?
To: info-hol@edu.uidaho.cs.ted (info-hol mailing list)
Date: Fri, 15 Jan 1993 10:02:02 +0000 (GMT)
In-Reply-To: <9301142251.AA07795@sparta.oracorp.com> from "shb@oracorp.com" at Jan 14, 93 05:51:04 pm
X-Mailer: ELM [version 2.4 PL20]
Content-Type: text
Content-Length: 1345

shb@oracorp.com has said:
>   new_constant(`f`,":num->num");;

>   new_recursive_definition false foo `test2`
>   "(test2 f bar0 = 1) /\
>    (test2 f (bar1 f1 f2) = (test2 f f1) + (test2 f f2))";;

the problem is that you've declared f to be a constant. It gets parsed
as a constant in the definition term above, but the recursive
definition functions assume that an paramaters to "test2" other than
the constructed element of the recursive type are variables  (or pehaps
pairs of variables). I think what is happening is that something in the
internals depends on this and the presence of the constant causes the
error - the error message is perhaps a bit of a sweeping statement and
doesn't really tell you what the problem is.

In any case the presence of "f" in the parameters to "test2" is  wrong
- try using another variable name instead.

Also, why are you declaring "f" as a constant. If you are only doing
this so that the type checker knows its type then what you want is
set_sticky_type which sets a `default` type for a variable.


--------------------------------------------------------------------------
david shepherd: des@inmos.co.uk                     tel: 0454-616616 x 625
                inmos ltd, 1000 aztec west, almondsbury, bristol, bs12 4sq
                New Year Resolution for 1993: Start using capital letters.
