author | Christian Urban <urbanc@in.tum.de> |
Sat, 02 Jul 2011 00:27:47 +0100 | |
changeset 2931 | aaef9dec5e1d |
parent 2822 | 23befefc6e73 |
child 2973 | d1038e67923a |
permissions | -rw-r--r-- |
2819
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1 |
(* Nominal Function Common |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
2 |
Author: Christian Urban |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
3 |
|
2821
c7d4bd9e89e0
fixed problem with earlier commit about nominal_function_common; added facility for specifying an invariant - added a definition of frees_set which need a finiteness invariant
Christian Urban <urbanc@in.tum.de>
parents:
2819
diff
changeset
|
4 |
heavily based on the code of Alexander Krauss |
c7d4bd9e89e0
fixed problem with earlier commit about nominal_function_common; added facility for specifying an invariant - added a definition of frees_set which need a finiteness invariant
Christian Urban <urbanc@in.tum.de>
parents:
2819
diff
changeset
|
5 |
(code forked on 5 June 2011) |
c7d4bd9e89e0
fixed problem with earlier commit about nominal_function_common; added facility for specifying an invariant - added a definition of frees_set which need a finiteness invariant
Christian Urban <urbanc@in.tum.de>
parents:
2819
diff
changeset
|
6 |
|
2822
23befefc6e73
cleaned ups a bit the examples with the invariant framework; exported nominal_function_config datatype into separate structure and file
Christian Urban <urbanc@in.tum.de>
parents:
2821
diff
changeset
|
7 |
Redefinition of config datatype |
2819
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
8 |
*) |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
9 |
|
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
10 |
|
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
11 |
|
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
12 |
structure Nominal_Function_Common = |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
13 |
struct |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
14 |
|
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
15 |
|
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
16 |
(* Configuration management *) |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
17 |
datatype nominal_function_opt |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
18 |
= Sequential |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
19 |
| Default of string |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
20 |
| DomIntros |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
21 |
| No_Partials |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
22 |
| Invariant of string |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
23 |
|
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
24 |
datatype nominal_function_config = NominalFunctionConfig of |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
25 |
{sequential: bool, |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
26 |
default: string option, |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
27 |
domintros: bool, |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
28 |
partials: bool, |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
29 |
inv: string option} |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
30 |
|
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
31 |
fun apply_opt Sequential (NominalFunctionConfig {sequential, default, domintros, partials, inv}) = |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
32 |
NominalFunctionConfig |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
33 |
{sequential=true, default=default, domintros=domintros, partials=partials, inv=inv} |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
34 |
| apply_opt (Default d) (NominalFunctionConfig {sequential, default, domintros, partials, inv}) = |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
35 |
NominalFunctionConfig |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
36 |
{sequential=sequential, default=SOME d, domintros=domintros, partials=partials, inv=inv} |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
37 |
| apply_opt DomIntros (NominalFunctionConfig {sequential, default, domintros, partials, inv}) = |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
38 |
NominalFunctionConfig |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
39 |
{sequential=sequential, default=default, domintros=true, partials=partials, inv=inv} |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
40 |
| apply_opt No_Partials (NominalFunctionConfig {sequential, default, domintros, partials, inv}) = |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
41 |
NominalFunctionConfig |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
42 |
{sequential=sequential, default=default, domintros=domintros, partials=false, inv=inv} |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
43 |
| apply_opt (Invariant s) (NominalFunctionConfig {sequential, default, domintros, partials, inv}) = |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
44 |
NominalFunctionConfig |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
45 |
{sequential=sequential, default=default, domintros=domintros, partials=partials, inv = SOME s} |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
46 |
|
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
47 |
val nominal_default_config = |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
48 |
NominalFunctionConfig { sequential=false, default=NONE, |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
49 |
domintros=false, partials=true, inv=NONE} |
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
50 |
|
4bd584ff4fab
added an option for an invariant (at the moment only a stub)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
51 |
end |