1
- Icing: CAV'19...
1
+ Main implementation directory for PrincessCake(ML): Verified Compilation and
2
+ Optimization of Floating-Point Programs
3
+ ===========================================================================
4
+
5
+ The development is known to compile with HOL4 commit:
6
+ 52ffdc8f01c5cf044427bf6f3a12e8300e91765a
7
+
8
+ Running the files in this directory requires a working version of
9
+ [ FloVer] ( https://gitlab.mpi-sws.org/AVA/FloVer ) .
10
+ You need to download FloVer, compile its HOL4 development and store its
11
+ directory as a shell variable:
12
+
13
+ ```
14
+ git clone https://gitlab.mpi-sws.org/AVA/FloVer FloVer
15
+ export FLOVERDIR=<current directory>/FloVer/
16
+ cd FloVer/hol4/ && $HOLDIR/bin/Holmake
17
+ ```
18
+
19
+ Afterwards the content in the directory can be build with ` Holmake ` .
20
+
21
+ Files contained in this directory:
2
22
3
23
[ CakeMLtoFloVerLemsScript.sml] ( CakeMLtoFloVerLemsScript.sml ) :
4
- Lemmas for connection to FloVer
24
+ Lemmas for connection to FloVer,
25
+ the translation function is defined in CakeMLtoFloVerScript.sml, and the main
26
+ connection theorem in CakeMLtoFloVerProofsScript.sml
5
27
6
28
[ CakeMLtoFloVerProofsScript.sml] ( CakeMLtoFloVerProofsScript.sml ) :
7
- Central theorem about connection to FloVer
29
+ Main connection theorem relating FloVer's roundoff error bound
30
+ to CakeML floating-point kernel executions
8
31
9
32
[ CakeMLtoFloVerScript.sml] ( CakeMLtoFloVerScript.sml ) :
10
- Definition of translation to FloVer
33
+ Translation from CakeML floating-point kernels to FloVer input
11
34
12
35
[ cfSupportScript.sml] ( cfSupportScript.sml ) :
13
- Support lemmas for CF reasoning
36
+ Support lemmas for CF proofs in the end-to-end correctness theorems
14
37
15
38
[ examples] ( examples ) :
16
- Case studies for the Marzipan optimizer
39
+ FPBench benchmarks used in the evaluation of PrincessCake.
17
40
18
41
[ floatToRealProofsScript.sml] ( floatToRealProofsScript.sml ) :
19
- Proofs about translation from float computations to real number computations
42
+ Proofs about translation from floating-point computations to real-number
43
+ computations. Needed to prove simulations in the end-to-end correctness
44
+ theorems.
20
45
21
46
[ floatToRealScript.sml] ( floatToRealScript.sml ) :
22
- Define a translation from float computations to real number computations
47
+ Translation from CakeML floating-point computations to
48
+ CakeML real-number computations.
23
49
24
50
[ icingTacticsLib.sml] ( icingTacticsLib.sml ) :
25
- Tactic library specific to Icing
51
+ Tactic library for PrincessCake development
26
52
27
53
[ icing_optimisationProofsScript.sml] ( icing_optimisationProofsScript.sml ) :
28
- Correctness proofs for Icing optimisations supported by CakeML
29
- Each optimisation is defined in icing_optimisationsScript.
54
+ Correctness proofs for peephole optimisations supported by PrincessCake
55
+ Each optimisation is defined in icing_optimisationsScript.sml.
30
56
This file proves the low-level correctness theorems for a single
31
- application of the optimisation, as well as that optimisations
32
- are real -valued identities .
57
+ application of the optimisation.
58
+ Real -valued identity proofs are in icing_realIdProofsScript.sml .
33
59
The overall correctness proof for a particular run of the optimiser
34
60
from source_to_sourceScript is build using the automation in
35
61
icing_optimisationsLib and the general theorems from
36
62
source_to_sourceProofsScript.
37
63
38
64
[ icing_optimisationsLib.sml] ( icing_optimisationsLib.sml ) :
39
- Library defining function mk_opt_correct_thms that builds an optimiser
40
- correctness theorem for a list of rewriteFPexp_correct theorems
65
+ Library defining HOL4 automation that builds an optimiser
66
+ correctness theorem for an optimisation plan.
41
67
42
68
[ icing_optimisationsScript.sml] ( icing_optimisationsScript.sml ) :
43
- Icing optimisations supported by CakeML
44
- This file defines all the optimisations that can be used by the Icing
45
- optimizer , defined in source_to_sourceScript.
46
- Correctness proofs for each optimisation are in the file
69
+ Peephole optimisations used by PrincessCake
70
+ This file defines all the optimisations that are can be used by the
71
+ PrincessCake optimiser , defined in source_to_sourceScript.sml .
72
+ The local correctness proofs for each optimisation are in the file
47
73
icing_optimisationProofsScript.
48
74
49
75
[ icing_realIdProofsScript.sml] ( icing_realIdProofsScript.sml ) :
50
76
Real-number identity proofs for Icing optimisations supported by CakeML
51
77
Each optimisation is defined in icing_optimisationsScript.
52
- This file proves the low-level correctness theorems for a single
53
- application of the optimisation, as well as that optimisations
54
- are real-valued identities.
55
- The overall correctness proof for a particular run of the optimiser
78
+ This file proves that optimisations are real-valued identities.
79
+ The overall real-number simluation proof for a particular run of the optimiser
56
80
from source_to_sourceScript is build using the automation in
57
81
icing_optimisationsLib and the general theorems from
58
82
source_to_sourceProofsScript.
@@ -66,20 +90,30 @@ Implementation of the source to source floating-point rewriter
66
90
This file defines the basic rewriter, used by the optimisation pass later.
67
91
Correctness proofs are in icing_rewriterProofsScript.
68
92
93
+ [ optPlannerProofsScript.sml] ( optPlannerProofsScript.sml ) :
94
+ Correctness proof for optimization planner
95
+
69
96
[ optPlannerScript.sml] ( optPlannerScript.sml ) :
70
- Unverified optimisation planners
97
+ Unverified optimisation planner.
98
+ Definitions in this file correspond to the function ‘planOpts’
99
+ from Section 5 of the PrincessCake paper.
71
100
72
101
[ pureExpsScript.sml] ( pureExpsScript.sml ) :
73
102
predicate to check whether an expression is pure, i.e. does not use memory
74
103
or the FFI
75
104
76
105
[ source_to_sourceProofsScript.sml] ( source_to_sourceProofsScript.sml ) :
77
- Correctness proofs for floating-point optimizations
106
+ Overall correctness proofs for optimisation functions
107
+ defined in source_to_sourceScript.sml.
108
+ To prove a particular run correct, they are combined
109
+ using the automation in icing_optimisationsLib.sml with
110
+ the local correctness theorems from icing_optimisationProofsScript.sml.
78
111
79
112
[ source_to_sourceScript.sml] ( source_to_sourceScript.sml ) :
80
- Source to source optimiser, applying Icing optimizations
81
- This file defines the high-level Icing optimisers.
82
- Their general correctness theorems are proven in source_to_sourceProofsScript.
113
+ This file defines the PrincessCake optimiser as a source to source pass.
114
+ Function ‵stos_pass_with_plans‵ corresponds to ‵applyOpts‵
115
+ from the paper.
116
+ General correctness theorems are proven in source_to_sourceProofsScript.
83
117
The optimiser definitions rely on the low-level functions from
84
118
icing_rewriterScript implementing pattern matching and pattern instantiation.
85
119
0 commit comments