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; Sun, 21 Aug 1994 06:20:57 +0100
Received: by leopard.cs.byu.edu (1.37.109.8/16.2) id AA29153;
          Sat, 20 Aug 1994 23:05:42 -0600
Sender: info-hol-request@lal.cs.byu.edu
Errors-To: info-hol-request@lal.cs.byu.edu
Precedence: bulk
Received: from dworshak.cs.uidaho.edu by leopard.cs.byu.edu 
          with SMTP (1.37.109.8/16.2) id AA29149;
          Sat, 20 Aug 1994 23:05:41 -0600
Received: from toadflax.cs.ucdavis.edu (toadflax.cs.ucdavis.edu [128.120.56.188]) 
          by dworshak.cs.uidaho.edu (8.6.9/1.0) with SMTP id WAA03119 
          for <info-hol@cs.uidaho.edu>; Sat, 20 Aug 1994 22:01:10 -0700
Received: from ice.cs.ucdavis.edu by toadflax.cs.ucdavis.edu (4.1/UCD.CS.2.5) 
          id AA12568; Sat, 20 Aug 94 22:01:08 PDT
Received: by ice.cs.ucdavis.edu (5.65/UCD.CS.2.5) id AA09642;
          Sat, 20 Aug 1994 22:01:07 -0700
Date: Sat, 20 Aug 1994 22:01:07 -0700
From: shaw@cs.ucdavis.edu (Rob Shaw)
Message-Id: <9408210501.AA09642@ice.cs.ucdavis.edu>
To: info-hol@cs.uidaho.edu
Subject: Useful(?) set thm available


I don't know if this is useful to anyone or not, but it seems like
it might be. I'm working alot with specs that I want to "execute"
via rewriting, and I use finite_sets for several objects in the system.

In order to define an "executable" (i.e. a constructive, recursive)
lookup function for finite sets, one needs a theorem like:

SEARCH_BY_KEY =
|- ?searchByKey.
    (!kf err k. searchByKey{}kf err k = err) /\
    (!s kf err k e.
      searchByKey(e INSERT s)kf err k =
      ((~validKeyFun(e INSERT s)kf) =>
       err |
       ((kf e = k) => e | searchByKey s kf err k)))

I have this theorem for (*)set's and key functions (*->**) (e.g. a
key function might be ProcState -> Pid). I used the same method
as the finite_sets authors' construction of the CARD function.

The validKeyFun predicate just says that it gives a unique value for
each element:

let validKeyFun = new_definition
  (`validKeyFun`,
   "validKeyFun (s:(*)set) (f:*->**) = (INJ f s (IMAGE f s))");;

Let me know if anyone would like this proof. 

Rob
