File: VALUEOPSSIG.sml

package info (click to toggle)
polyml 5.7.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 40,616 kB
  • sloc: cpp: 44,142; ansic: 26,963; sh: 22,002; asm: 13,486; makefile: 602; exp: 525; python: 253; awk: 91
file content (126 lines) | stat: -rw-r--r-- 5,379 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
(*
    Copyright (c) 2000
        Cambridge University Technical Services Limited
        
    Modified David C. J. Matthews 2009-2015.

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License version 2.1 as published by the Free Software Foundation.
    
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.
    
    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*)

signature VALUEOPSSIG =
sig
    type lexan
    type codetree
    type types
    type values
    type structVals
    type functors
    type valAccess
    type typeConstrs
    type typeConstrSet
    type signatures
    type fixStatus
    type univTable
    type pretty
    type location =
        { file: string, startLine: FixedInt.int, startPosition: FixedInt.int,
          endLine: FixedInt.int, endPosition: FixedInt.int }
    type locationProp
    type typeId
    type typeVarForm
    type typeVarMap
    type level
    type machineWord

    (* Construction functions. *)
    val mkGvar:        string * types * codetree * locationProp list -> values
    val mkValVar:      string * types * locationProp list -> values
    val mkPattVar:     string * types * locationProp list -> values
    val mkSelectedVar: values * structVals * locationProp list -> values
    val mkGconstr:     string * types * codetree * bool * int * locationProp list -> values
    val mkGex:         string * types * codetree * locationProp list -> values
    val mkEx:          string * types * locationProp list -> values


    type printTypeEnv =
        { lookupType: string -> (typeConstrSet * (int->typeId) option) option,
          lookupStruct: string -> (structVals * (int->typeId) option) option}

    (* Print values. *)
    val displayFixStatus:  fixStatus -> pretty
    val displaySignatures: signatures * FixedInt.int * printTypeEnv -> pretty
    val displayStructures: structVals * FixedInt.int * printTypeEnv -> pretty
    val displayFunctors:   functors   * FixedInt.int * printTypeEnv -> pretty
    val displayValues: values * FixedInt.int * printTypeEnv -> pretty
    val printValues: values * FixedInt.int -> pretty

    val codeStruct:     structVals * level -> codetree
    val codeAccess:     valAccess  * level -> codetree
    val codeVal:
        values * level * typeVarMap * {value: types, equality: bool, printity: bool} list * lexan * location -> codetree
    val codeExFunction: values * level * typeVarMap * types list * lexan * location -> codetree
    val applyFunction:
        values * codetree * level * typeVarMap * {value: types, equality: bool, printity: bool} list *
            lexan * location -> codetree
    val getOverloadInstance: string * types * bool -> codetree*string
    val makeGuard:      values * types list * codetree * level * typeVarMap -> codetree 
    val makeInverse:    values * types list * codetree * level * typeVarMap -> codetree
                    
    val lookupStructure:  string * {lookupStruct: string -> structVals option} * 
                            string * (string -> unit) -> structVals option
                                           
    val lookupStructureAsSignature:
        (string -> structVals option) *  string * (string -> unit) -> structVals option
                                           
    val lookupValue:   string * {lookupVal: string -> values option, lookupStruct: string -> structVals option} * 
                          string * (string -> unit) -> values
                                
    val lookupTyp:   {lookupType: string -> typeConstrSet option,
                      lookupStruct: string -> structVals option} * 
                        string * (string -> unit) -> typeConstrSet

    val makeSelectedValue: values * structVals -> values
    and makeSelectedStructure: structVals * structVals -> structVals
    and makeSelectedType: typeConstrSet * structVals -> typeConstrSet

    val codeLocation: location -> codetree

    val getPolymorphism: values * types * typeVarMap -> {value: types, equality: bool, printity: bool} list
    
    val getLiteralValue: values * string * types * (string->unit) -> machineWord option

    (* Types that can be shared. *)
    structure Sharing:
    sig
        type lexan          = lexan
        type codetree       = codetree
        type types          = types
        type values         = values
        type structVals     = structVals
        type functors       = functors
        type valAccess      = valAccess
        type typeConstrs    = typeConstrs
        type typeConstrSet  = typeConstrSet
        type signatures     = signatures
        type fixStatus      = fixStatus
        type univTable      = univTable
        type pretty         = pretty
        type locationProp   = locationProp
        type typeId         = typeId
        type typeVarForm    = typeVarForm
        type typeVarMap     = typeVarMap
        type level          = level
        type machineWord    = machineWord
    end
end;