-
Notifications
You must be signed in to change notification settings - Fork 85
/
CertificateGeneratorScript.sml
55 lines (48 loc) · 1.73 KB
/
CertificateGeneratorScript.sml
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
(**
A simple, unverified generator for certificates.
To be used in conjunction with the certificate checker to first analyze
a kernel and then validate the analysis result
**)
open RealIntervalInferenceTheory ErrorIntervalInferenceTheory ExpressionsTheory
FloverMapTheory TypeValidatorTheory CommandsTheory AbbrevsTheory
ExpressionAbbrevsTheory;
open preambleFloVer;
val _ = new_theory "CertificateGenerator";
Definition CertificateGeneratorExp_def:
CertificateGeneratorExp (f:real expr) (P:precond) (Gamma:typeMap)
:(real expr # precond # typeMap # analysisResult) option =
let
ivMap = inferIntervalbounds f P FloverMapTree_empty;
fullTMap = getValidMap Gamma f FloverMapTree_empty;
in
case ivMap, fullTMap of
| SOME ivMap, Succes tMap =>
(case inferErrorbound f tMap ivMap FloverMapTree_empty of
| SOME errMap => SOME (f,P,Gamma,errMap)
| NONE => NONE)
| _, _ => NONE
End
Definition getExp_def:
getExp (f, P, Gamma, errMap) = f
End
Definition getError_def:
getError (f, P, Gamma, errMap) = FloverMapTree_find f errMap
End
Definition CertificateGeneratorCmd_def:
CertificateGeneratorCmd (f:real cmd) (P:precond) (Gamma:typeMap)
:(real cmd # precond # typeMap # analysisResult) option =
let
ivMap = inferIntervalboundsCmd f P FloverMapTree_empty;
fullTMap = getValidMapCmd Gamma f FloverMapTree_empty;
in
case ivMap, fullTMap of
| SOME ivMap, Succes tMap =>
(case inferErrorboundCmd f tMap ivMap FloverMapTree_empty of
| SOME errMap => SOME (f,P,Gamma,errMap)
| NONE => NONE)
| _, _ => NONE
End
Definition getCmd_def:
getCmd (f, P, Gamma, errMap) = f
End
val _ = export_theory ();