comparison src/core_util.sig @ 16:bc7b76ca57e0

Conversion to Core
author Adam Chlipala <adamc@hcoop.net>
date Sun, 08 Jun 2008 13:59:29 -0400
parents
children 1ab48e37d0ef
comparison
equal deleted inserted replaced
15:1e645beb3f3b 16:bc7b76ca57e0
1 (* Copyright (c) 2008, Adam Chlipala
2 * All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * - Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 * - Redistributions in binary form must reproduce the above copyright notice,
10 * this list of conditions and the following disclaimer in the documentation
11 * and/or other materials provided with the distribution.
12 * - The names of contributors may not be used to endorse or promote products
13 * derived from this software without specific prior written permission.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
26 *)
27
28 signature CORE_UTIL = sig
29
30 structure Kind : sig
31 val mapfold : (Core.kind', 'state, 'abort) Search.mapfolder
32 -> (Core.kind, 'state, 'abort) Search.mapfolder
33 val map : (Core.kind' -> Core.kind') -> Core.kind -> Core.kind
34 val exists : (Core.kind' -> bool) -> Core.kind -> bool
35 end
36
37 structure Con : sig
38 datatype binder =
39 Rel of string * Core.kind
40 | Named of string * Core.kind
41
42 val mapfoldB : {kind : (Core.kind', 'state, 'abort) Search.mapfolder,
43 con : ('context, Core.con', 'state, 'abort) Search.mapfolderB,
44 bind : 'context * binder -> 'context}
45 -> ('context, Core.con, 'state, 'abort) Search.mapfolderB
46 val mapfold : {kind : (Core.kind', 'state, 'abort) Search.mapfolder,
47 con : (Core.con', 'state, 'abort) Search.mapfolder}
48 -> (Core.con, 'state, 'abort) Search.mapfolder
49
50 val map : {kind : Core.kind' -> Core.kind',
51 con : Core.con' -> Core.con'}
52 -> Core.con -> Core.con
53
54 val mapB : {kind : Core.kind' -> Core.kind',
55 con : 'context -> Core.con' -> Core.con',
56 bind : 'context * binder -> 'context}
57 -> 'context -> (Core.con -> Core.con)
58 val exists : {kind : Core.kind' -> bool,
59 con : Core.con' -> bool} -> Core.con -> bool
60 end
61
62 structure Exp : sig
63 datatype binder =
64 RelC of string * Core.kind
65 | NamedC of string * Core.kind
66 | RelE of string * Core.con
67 | NamedE of string * Core.con
68
69 val mapfoldB : {kind : (Core.kind', 'state, 'abort) Search.mapfolder,
70 con : ('context, Core.con', 'state, 'abort) Search.mapfolderB,
71 exp : ('context, Core.exp', 'state, 'abort) Search.mapfolderB,
72 bind : 'context * binder -> 'context}
73 -> ('context, Core.exp, 'state, 'abort) Search.mapfolderB
74 val mapfold : {kind : (Core.kind', 'state, 'abort) Search.mapfolder,
75 con : (Core.con', 'state, 'abort) Search.mapfolder,
76 exp : (Core.exp', 'state, 'abort) Search.mapfolder}
77 -> (Core.exp, 'state, 'abort) Search.mapfolder
78
79 val map : {kind : Core.kind' -> Core.kind',
80 con : Core.con' -> Core.con',
81 exp : Core.exp' -> Core.exp'}
82 -> Core.exp -> Core.exp
83 val exists : {kind : Core.kind' -> bool,
84 con : Core.con' -> bool,
85 exp : Core.exp' -> bool} -> Core.exp -> bool
86 end
87
88 end