-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoc.html
More file actions
733 lines (668 loc) · 32 KB
/
doc.html
File metadata and controls
733 lines (668 loc) · 32 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<title>Q*cert: Commented Coq Development</title>
<!-- Bootstrap core CSS -->
<link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap theme -->
<link href="./bootstrap/css/bootstrap-theme.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="qcertsite.css" rel="stylesheet">
</head>
<body>
<div class="container theme-showcase" role="main">
<!-- Static navbar -->
<nav class="navbar navbar-default">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Q*cert</a>
</div>
<div class="container-fluid">
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="index.html">Home</a></li>
<li class="active"><a href="doc.html">Commented Code</a></li>
<li><a href="demo.html">Demo</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="http://github.com/querycert/qcert">github</a></li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container-fluid -->
</nav>
<!-- ============ Body ============ -->
<!-- Main jumbotron for a primary marketing message or call to action -->
<h2 align="center">Commented Coq Development</h2>
<h3 align="center">The Q*cert development team</h3>
<h4 align="center">(Joshua Auerbach, Stefan Fehrenbach, Martin Hirzel, Louis Mandel, Avraham Shinnar and Jérôme Siméon)</h4>
<h3>Overview</h3>
<p>This is the commented source code for Q*cert, a framework for the
development and verification of query compilers built using the Coq
proof assistant <a href="#coq">[Coq]</a>.</p>
<p>From a traditional database view point, it mostly covers the
so-called logical layer of a query compiler. At the present time,
the physical layer consists of a simple code-generation step
targeting either an imperative language (JavaScript or Java), or a
distributed data-processing platform (Spark or Cloudant).</p>
<p>While a significant subset of the initial compilation pipeline has
been mechanically checked for correctness, Q*cert is still a work in
progress. This page documents the state of the development, and
serves as an entry point to navigate the code. It describes the
architecture of the compiler, lists the languages in the compilation
pipeline, the existing translation and optimization passes, and
links to the corresponding code, including proofs, when
available.</p>
<h3>Compilation Pipeline</h3>
<object id="compilation" data="figure/figure.svg" type="image/svg+xml"
width="700"><img src="figure/figure.png" alt="Compilation Paths" width="700"/></object>
<p>This figure represents the general architecture of the compiler
with its
<a href="html/Qcert.Compiler.Driver.CompLang.html">all supported
languages</a> and the
different <a href="html/Qcert.Compiler.Driver.CompDriver.html#driver">compilation
paths</a>.</p>
<p>The colors on the figure indicate the level of Coq development. The
part in blue has not been fully mechanized. The part in red has been
mechanized in Coq and comes with a proof of correctness. The dotted
red arrows indicate correctness proofs that have not yet been fully
integrated in
a <a href="html/Qcert.Compiler.Driver.CompCorrectness.html#compile_with_correct_driver_preserves_eval">proof
of correctness for the compiler as a whole</a>.</p>
<h3>Code Organization</h3>
<p>The general organization of the source code available in Q*cert is
the following:</p>
<ul>
<li><code>bin</code>: directory where binaries are installed </li>
<li><code>coq</code>: the Coq source code of the compiler </li>
<li><code>doc</code>: documentation and Web demo </li>
<li><code>javaRunners</code>: simple runners for the compiled queries</li>
<li><code>javaService</code>: code to integrate the Java parsers (for SQL, SQL++, and ODM rules)</li>
<li><code>jrulesParser</code>: ODM rules parser </li>
<li><code>ocaml</code>: OCaml code of the command line compiler </li>
<li><code>runtimes</code>: runtime libraries for the different backends </li>
<li><code>samples</code>: examples of queries in various source languages </li>
<li><code>scripts</code>: utility scripts </li>
<li><code>sqlParser</code>: SQL parser </li>
<li><code>sqlppParser</code>: SQL++ parser </li>
</ul>
<h3>General-purpose libraries</h3>
<p>
The <code>coq/Utils</code> directory contains general purpose
libraries, tactics and lemmas used throughout the system.
</p>
<ul>
<li><a href="html/Qcert.Utils.CoqLibAdd.html">CoqLibAdd</a>:
Additional definitions and lemmas complementing those found in the
Coq Library.</li>
<li><a href="html/Qcert.Utils.ListAdd.html">ListAdd</a>: Additional
definitions and lemmas on lists.
</li>
<li><a href="html/Qcert.Utils.StringAdd.html">StringAdd</a>:
Additional definitions and lemmas on strings, including a total order
relation.
</li>
<li><a href="html/Qcert.Utils.SortingAdd.html">SortingAdd</a>:
simple insertion sort
</li>
<li><a href="html/Qcert.Utils.Lattice.html">Lattice</a>: definition of
a lattice (loosely based on ideas
from <a href="http://www.cs.ox.ac.uk/people/daniel.james/lattice.html">A
reflection-based proof tactic for lattices in Coq</a>
and <a href="http://www.pps.univ-paris-diderot.fr/~sozeau/repos/coq/order">http://www.pps.univ-paris-diderot.fr/~sozeau/repos/coq/order</a>).
</li>
<li><a href="html/Qcert.Utils.Lift.html">Lift</a>
and <a href="html/Qcert.Utils.LiftIterators.html">LiftIterators</a>:
definitions and properties of lifting operations over option types.
</li>
<li><a href="html/Qcert.Utils.Assoc.html">Assoc</a>: definitions and
properties of association lists.
</li>
<li><a href="html/Qcert.Utils.Sublist.html">Sublist</a>: definitions
and properties of sub-lists.
</li>
<li><a href="html/Qcert.Utils.Compat.html">Compat</a>: notion of
compatibility between two association lists.
</li>
<li><a href="html/Qcert.Utils.Bindings.html">Bindings</a>
and <a href="html/Qcert.Utils.BindingsNat.html">BindingsNat</a>:
support for association lists for which the keys are ordered and with
no duplicates.
</li>
<li><a href="html/Qcert.Utils.Digits.html">Digits</a>
and <a href="html/Qcert.Utils.Fresh.html">Fresh</a>: support for
creating and reasoning about fresh names (represented as strings).
</li>
<li><a href="html/Qcert.Utils.Bag.html">Bag</a>: support for bags (or
multisets).
</li>
<li><a href="html/Qcert.Utils.Var.html">Var</a>: Variables.</li>
<li><a href="html/Qcert.Utils.JSON.html">JSON</a>: A simple
JSON AST.</li>
<li><a href="html/Qcert.Utils.OptimizerStep.html">OptimizerStep</a>
and <a href="html/Qcert.Utils.OptimizerLogger.html">OptimizerLogger</a>:
Support for log traces, used to monitor optimizations.</li>
</ul>
<h3>Common components</h3>
<p>The <code>coq/Common</code> directory contains components shared
across languages.</p>
<h4>Brands</h4>
<p>The <code>Common/Brands</code> directory contains definitions for a
notion of <emph>brands</emph> (i.e., names with a relation that forms
a lattice) which is used to capture inheritance in both the type
system and the data model.</p>
<h4>Type System</h4>
<p>The type system includes support for atomic types, bags, records,
and <emph>branded types</emph> which are used to encode classes with
inheritance.</p>
<ul>
<li><code>Common/TypeSystem</code>: definition and properties of the type system</li>
</ul>
<h4>Data Model</h4>
<p>The data model includes atomic values, bags, records,
and <emph>branded values</emph> which are used to encode objects with
inheritance.</p>
<ul>
<li><code>Common/Data</code>: definition and properties of the data model</li>
<li><code>Common/DataTyping</code>: typing for the data model </li>
</ul>
<p>Note that the type system modules
(in <code>Common/TypeSystem</code>) and the data modules
(in <code>Common/Data</code>) are independent from each other, only
relying on the notion of brands. How data relates to type is made
explicit in the data typing modules
(in <code>Common/DataTyping</code>).</p>
<h4>Built-in Operators</h4>
<p>A number of operations are assumed to be available in all
languages, and defined as built-in operators.</p>
<ul>
<li><code>Common/Operators</code>: syntax and semantics for built-in
operators</li>
<li><code>Common/OperatorsTyping</code>: typing for the built-in operators </li>
</ul>
<h3>Languages</h3>
<p>In the <code>coq</code> directory, each language has its own
directory with a subdirectory <code>Lang</code> containing the
syntax (Abstract Syntax Tree) and the definition of the semantics of
the language.</p>
<p>For most language, the semantics is given through an evaluation
function. In a few cases, a denotational semantics is also provided
(e.g., for cNNRC and NRA).</p>
<p>When that language comes with a type checker, the type checker can
be found in a separate <code>Typing</code> subdirectory.</p>
<h4>Source Languages</h4>
<p>The following languages can be passed in source (text/file) form
to the compiler and are provided with a parser. The parsers for OQL
and λ-NRA are written in OCaml and part of the Q*cert
distribution. The parsers for TechRule, DesignerRule, SQL and SQL++
are written in Java and require third-party libraries which must be
downloaded separately during installation.</p>
<table class="table">
<tr><th>Name</th>
<th>Language</th>
<th>On Command Line</th>
<th>Directory</th>
<th>Code</th>
<th>Reference</th></tr>
<tr><th>TechRule</th>
<td>ODM technical rules</td>
<td><code>tech_rule</code></td>
<td><code>coq/TechRule<code></td>
<td><a href="html/Qcert.TechRule.Lang.TechRule.html#tech_rule">Source</a></td>
<td></td></tr>
<tr><th>DesignerRule</th>
<td>ODM designer rules</td>
<td><code>designer_rule</code></td>
<td><code>coq/DesignerRule<code></td>
<td><a href="html/Qcert.DesignerRule.Lang.DesignerRule.html#designer_rule">Source</a></td>
<td></td></tr>
<tr><th>λ-NRA</th>
<td>Lambda NRA</td>
<td><code>lambda_nra</code></td>
<td><code>coq/LambdaNRA<code></td>
<td><a href="html/Qcert.LambdaNRA.Lang.LambdaNRA.html#lambda_nra">Ast</a>,
<a href="html/Qcert.LambdaNRA.Lang.LambdaNRA.html#lambda_nra_eval_top">Eval</a>,
<a href="html/Qcert.LambdaNRA.Typing.LambdaNRA.html#lambda_nra_type">Typing</a></td>
<td><a href="#nraenv">[AHMSS2017]</a></td></tr>
<tr><th>SQL</th>
<td>Structured Query Language</td>
<td><code>sql</code></td>
<td><code>coq/SQL<code></td>
<td><a href="html/Qcert.SQL.Lang.SQL.html#sql">Ast</a></td>
<td></td></tr>
<tr><th>SQL++</th>
<td>SQL extended for JSON</td>
<td><code>sqlpp</code></td>
<td><code>coq/SQLPP<code></td>
<td><a href="html/Qcert.SQLPP.Lang.SQLPP.html#sqlpp">Ast</a></td>
<td></td></tr>
<tr><th>OQL</th>
<td>Object Query Language</td>
<td><code>oql</code></td>
<td><code>coq/OQL<code></td>
<td><a href="html/Qcert.OQL.Lang.OQL.html#oql">Ast</a>,
<a href="html/Qcert.OQL.Lang.OQL.html#oql_eval_top">Eval</a></td>
<td><a href="#oql">[ODMG]</a></td>
<td></td></tr>
</table>
<h4>Local Intermediate Languages</h4>
<p>The following languages are intermediate representations used for
compilation and optimization. They all assume the data is accessed
locally (i.e., do not take distribution into consideration). Most of
that part of the code comes with type checkers and mechanized proofs
of correctness (when translating between those languages or applying
optimizations).</p>
<table class="table">
<tr><th>Name</th>
<th>Language</th>
<th>On Command Line</th>
<th>Directory</th>
<th>Code</th>
<th>Reference</th></tr>
<tr><th>CAMPRule</th>
<td>CAMP rules</td>
<td><code>camp_rule</code></td>
<td><code>coq/CAMPRule<code></td>
<td><a href="html/Qcert.CAMPRule.Lang.CAMPRule.html#camp_rule">Syntax</a>,
<a href="html/Qcert.CAMPRule.Lang.CAMPRule.html#camp_rule_eval_top">Eval</a></td>
<td><a href="#camp">[SSH2015]</a></td></tr>
<tr><th>CAMP</th>
<td>Calculus of Aggregating Matching Patterns</td>
<td><code>camp</code></td>
<td><code>coq/CAMP<code></td>
<td><a href="html/Qcert.CAMP.Lang.CAMP.html#camp">Syntax</a>,
<a href="html/Qcert.CAMP.Lang.CAMP.html#camp_eval_top">Eval</a>,
<a href="html/Qcert.CAMP.Typing.TCAMP.html#camp_type">Typing</a></td>
<td><a href="#camp">[SSH2015]</a></td></tr>
<tr><th>NRA</th>
<td>Nested Relational Algebra</td>
<td><code>nra</code></td>
<td><code>coq/NRA<code></td>
<td><a href="html/Qcert.NRA.Lang.NRA.html#nra">Syntax</a>,
<a href="html/Qcert.NRA.Lang.NRA.html#nra_sem">Semantics</a>,
<a href="html/Qcert.NRA.Lang.NRA.html#nra_eval_top">Eval</a>,
<a href="html/Qcert.NRA.Typing.TNRA.html#nra_type">Typing</a></td>
<td><a href="#nra">[Moer2014]</a></td></tr>
<tr><th>NRA<sup>e</sup></th>
<td>NRA with Environments</td>
<td><code>nraenv</code></td>
<td><code>coq/NRAEnv<code></td>
<td><a href="html/Qcert.NRAEnv.Lang.NRAEnv.html#nraenv">Syntax</a>,
<a href="html/Qcert.NRAEnv.Lang.NRAEnv.html#nraenv_eval_top">Eval</a>,
<a href="html/Qcert.NRAEnv.Typing.TNRAEnv.html#nraenv_type">Typing</a></td>
<td></td></tr>
<tr><th>cNRA<sup>e</sup></th>
<td>Core NRA with Environments</td>
<td><code>nraenv_core</code></td>
<td><code>coq/cNRAEnv<code></td>
<td><a href="html/Qcert.cNRAEnv.Lang.cNRAEnv.html#nraenv_core">Syntax</a>,
<a href="html/Qcert.cNRAEnv.Lang.cNRAEnv.html#nraenv_core_sem">Semantics</a>,
<a href="html/Qcert.cNRAEnv.Lang.cNRAEnv.html#nraenv_core_eval_top">Eval</a>,
<a href="html/Qcert.cNRAEnv.Typing.TcNRAEnv.html#nraenv_core_type">Typing</a></td>
<td><a href="#nraenv">[AHMSS2017]</a></td></tr>
<tr><th>NNRC</th>
<td>Named Nested Relational Calculus</td>
<td><code>nnrc</code></td>
<td><code>coq/NNRC<code></td>
<td><a href="html/Qcert.NNRC.Lang.NNRC.html#nnrc">Syntax</a>,
<a href="html/Qcert.NNRC.Lang.NNRC.html#nnrc_eval_top">Eval</a>,
<a href="html/Qcert.NNRC.Typing.TNNRC.html#nnrc_type">Typing</a></td>
<td></td></tr>
<tr><th>cNNRC</th>
<td>Core NNRC</td>
<td><code>nnrc_core</code></td>
<td><code>coq/cNNRC<code></td>
<td><a href="html/Qcert.cNNRC.Lang.cNNRC.html#nnrc_core">Syntax</a>,
<a href="html/Qcert.cNNRC.Lang.cNNRC.html#nnrc_core_sem_top">Semantics</a>,
<a href="html/Qcert.cNNRC.Lang.cNNRC.html#nnrc_core_eval_top">Eval</a>,
<a href="html/Qcert.cNNRC.Typing.TcNNRC.html#nnrc_core_type">Typing</a></td>
<td><a href="#nnrc">[BV2007]</a></td></tr>
<tr><th>NNRS</th>
<td>Lightly Imperative NNRC</td>
<td><code>nnrs</code></td>
<td><code>coq/NNRS<code></td>
<td><a href="html/Qcert.NNRS.Lang.NNRS.html#nnrs">Syntax</a>,
<a href="html/Qcert.NNRS.Lang.NNRSSem.html#nnrs_sem_top">Semantics</a>,
<a href="html/Qcert.NNRS.Lang.NNRSEval.html#nnrs_eval_top">Eval</a>,
<a href="html/Qcert.NNRS.Typing.TNNRS.html#nnrs_type">Typing</a></td>
<td></td></tr>
</table>
<h4>Distributed Intermediate Languages</h4>
<p>The following languages are intermediate representations used for
compilation and optimization. They take distribution into
consideration. Most of that part of the code comes with no
mechanized proofs (when translating to/from those languages or when
applying optimizations).</p>
<table class="table">
<tr><th>Name</th>
<th>Language</th>
<th>On Command Line</th>
<th>Directory</th>
<th>Code</th>
<th>Reference</th></tr>
<tr><th>DNNRC</th>
<td>Distributed Named Nested Relational Calculus</td>
<td><code>dnnrc</code></td>
<td><code>coq/DNNRC<code></td>
<td><a href="html/Qcert.DNNRC.Lang.DNNRC.html#dnnrc">Syntax</a>,
<a href="html/Qcert.DNNRC.Lang.DNNRC.html#dnnrc_eval_top">Eval</a>,
<a href="html/Qcert.DNNRC.Typing.TDNNRCBase.html#dnnrc_base_type">Typing</a></td>
<td></td></tr>
<tr><th>tDNNRC</th>
<td>Typed DNNRC</td>
<td><code>dnnrc_typed</code></td>
<td><code>coq/tDNNRC<code></td>
<td><a href="html/Qcert.tDNNRC.Lang.tDNNRC.html#dnnrc_typed">Syntax</a>,
<a href="html/Qcert.tDNNRC.Lang.tDNNRC.html#dnnrc_typed_eval_top">Eval</a></td>
<td></td></tr>
<tr><th>NNRCMR</th>
<td>NNRC extended with Map/Reduce</td>
<td><code>nnrcmr</code></td>
<td><code>coq/NNRCMR<code></td>
<td><a href="html/Qcert.NNRCMR.Lang.NNRCMR.html#nnrcmr">Syntax</a>,
<a href="html/Qcert.NNRCMR.Lang.NNRCMR.html#nnrcmr_eval_top">Eval</a></td>
<td></td></tr>
<tr><th>CldMR</th>
<td>NNRC extended with Map/Reduce for Cloudant</td>
<td><code>cldmr</code></td>
<td><code>coq/CldMR<code></td>
<td><a href="html/Qcert.CldMR.Lang.CldMR.html#cldmr">Syntax</a>,
<a href="html/Qcert.CldMR.Lang.CldMR.html#cldmr_eval_top">Eval</a></td>
<td></td></tr>
</table>
<h4>Target Languages</h4>
<p>The following languages are usually represented as character
strings containing code corresponding to the target. The
corresponding code needs to be linked to a small runtime for
execution. The runtimes are located in the <code>runtimes</code>
directory in the Q*cert source code.</p>
<table class="table">
<tr><th>Name</th>
<th>Language</th>
<th>On Command Line</th>
<th>Directory</th>
<th>Code</th>
<th>Runtime</th>
<th>Reference</th></tr>
<tr><th>JavaScript</th>
<td>JavaScript</td>
<td><code>javascript</code></td>
<td><code>coq/JavaScript<code></td>
<td><a href="html/Qcert.JavaScript.Lang.JavaScriptAst.html#ajavascript">Ast</a>,
<a href="html/Qcert.JavaScript.Lang.JavaScript.html#javascript">Target</a></td>
<td><code>runtimes/javascript</code></td>
<td></td></tr>
<tr><th>Java</th>
<td>Java</td>
<td><code>java</code></td>
<td><code>coq/Java<code></td>
<td><a href="html/Qcert.Java.Lang.Java.html#java">Target</a></td>
<td><code>runtimes/java</code></td>
<td></td></tr>
<tr><th>Cloudant</th>
<td>Cloudant Map/Reduce Views</td>
<td><code>cloudant</code></td>
<td><code>coq/Cloudant<code></td>
<td><a href="html/Qcert.Cloudant.Lang.Cloudant.html#cloudant">Target</a></td>
<td><code>runtimes/javascript</code></td>
<td><a href="#cloudant">[Cloudant]</a></td></tr>
<tr><th>Spark RDDs</th>
<td>Spark (Resilient Distributed Datasets)</td>
<td><code>spark_rdd</code></td>
<td><code>coq/SparkRDD<code></td>
<td><a href="html/Qcert.SparkRDD.Lang.SparkRDD.html#spark_rdd">Target</a></td>
<td><code>runtimes/javascript</code></td>
<td><a href="#spark_rdd">[SparkRDD]</a></td></tr>
<tr><th>Spark DataFrames</th>
<td>Spark (DataFrames)</td>
<td><code>spark_df</code></td>
<td><code>coq/SparkDF<code></td>
<td><a href="html/Qcert.SparkDF.Lang.SparkDF.html#spark_df">Target</a></td>
<td><code>runtimes/spark2</code></td>
<td><a href="#spark_df">[SparkDF]</a></td></tr>
</table>
<h3>Translation Passes</h3>
<p>
The <code>coq/Translation</code> directory contains all the
functions translating between languages.
</p>
<p>
When possible, a corresponding proof of correctness (semantics
preservation) and a proof of type preservation for the translation
are also included.
</p>
<table class="table">
<tr><th>From</th>
<th>To</th>
<th>Code</th>
<th>Notes</th>
<th>Reference</th></tr>
<tr><td>TechRule</td>
<td>CAMPRule</td>
<td><a href="html/Qcert.Translation.TechRuletoCAMPRule.html">Translation</a></td>
<td>In Java</td>
<td></td></tr>
<tr><td>DesignerRule</td>
<td>CAMPRule</td>
<td><a href="html/Qcert.Translation.DesignRuletoCAMPRule.html">Translation</a></td>
<td>In Java</td>
<td></td></tr>
<tr><td>λ-NRA</td>
<td>NRA<sup>e</sup></td>
<td><a href="html/Qcert.Translation.LambdaNRAtoNRAEnv.html#lambda_nra_to_nraenv_top">Translation</a>,
<a href="html/Qcert.Translation.LambdaNRAtoNRAEnv.html#lambda_nra_to_nraenv_top_correct">Correctness</a>,
<a href="html/Qcert.Translation.TLambdaNRAtoNRAEnv.html#tlambda_nra_sem_correct">Type Preservation</a></td>
<td></td>
<td></td></tr>
<tr><td>SQL</td>
<td>NRA<sup>e</sup></td>
<td><a href="html/Qcert.Translation.SQLtoNRAEnv.html#sql_to_nraenv_top">Translation</a></td>
<td></td>
<td></td></tr>
<tr><td>SQL++</td>
<td>NRA<sup>e</sup></td>
<td><a href="html/Qcert.Translation.SQLPPtoNRAEnv.html#sqlpp_to_nraenv_top">Translation</a></td>
<td></td>
<td></td></tr>
<tr><td>OQL</td>
<td>NRA<sup>e</sup></td>
<td><a href="html/Qcert.Translation.OQLtoNRAEnv.html#oql_to_nraenv_top">Translation</a>,
<a href="html/Qcert.Translation.OQLtoNRAEnv.html#oql_to_nraenv_top_correct">Correctness</a></td>
<td></td>
<td></td></tr>
<tr><td>CAMPRule</td>
<td>CAMP</td>
<td><a href="html/Qcert.Translation.CAMPRuletoCAMP.html#camp_rule_to_camp_top">Translation</a>,
<a href="html/Qcert.Translation.CAMPRuletoCAMP.html#camp_rule_to_camp_top_correct">Correctness</a></td>
<td>By macro-expansion</td>
<td><a href="#camp">[SSH2015]</a></td></tr>
<tr><td>CAMP</td>
<td>NRA<sup>e</sup><br/>cNRA<sup>e</sup><br/>NRA</td>
<td><a href="html/Qcert.Translation.CAMPtoNRAEnv.html#camp_to_nraenv_top">Translation</a>,
<a href="html/Qcert.Translation.CAMPtoNRAEnv.html#camp_to_nraenv_top_correct">Correctness</a>,
<a href="html/Qcert.Translation.TCAMPtoNRAEnv.html#alg_of_camp_top_type_preserve">Type Preservation</a><br/>
<a href="html/Qcert.Translation.CAMPtocNRAEnv.html#camp_to_nraenv_core_top">Translation</a>,
<a href="html/Qcert.Translation.CAMPtocNRAEnv.html#camp_to_nraenv_core_top_correct">Correctness</a>,
<a href="html/Qcert.Translation.TCAMPtocNRAEnv.html#alg_of_camp_top_type_preserve">Type Preservation</a></br>
<a href="html/Qcert.Translation.CAMPtoNRA.html#camp_to_nra_top">Translation</a>,
<a href="html/Qcert.Translation.CAMPtoNRA.html#camp_to_nra_top_correct">Correctness</a>,
<a href="html/Qcert.Translation.TCAMPtoNRA.html#nra_of_camp_top_type_preserve">Type Preservation</a>
</td>
<td></td>
<td><br/><a href="#nraenv">[AHMSS2017]</a><br/><a href="#camp">[SSH2015]</a></td></tr>
<tr><td>NRA</td>
<td>cNNRC<br/>cNRA<sup>e</sup></td>
<td><a href="html/Qcert.Translation.NRAtocNNRC.html#nra_to_nnrc_core_top">Translation</a>,
<a href="html/Qcert.Translation.NRAtocNNRC.html#nra_to_nnrc_core_correct">Correctness</a>,
<a href="html/Qcert.Translation.TNRAtocNNRC.html#tnra_sem_correct">Type Preservation</a><br/>
<a href="html/Qcert.Translation.NRAtocNRAEnv.html#nra_to_nraenv_core_top">Translation</a>,
<a href="html/Qcert.Translation.NRAtocNRAEnv.html#nra_to_nraenv_core_top_correct">Correctness</a>
</td>
<td></td>
<td><a href="#camp">[SSH2015]</a><br/><a href="#nraenv">[AHMSS2017]</a></td></tr>
<tr><td>NRA<sup>e</sup></td>
<td>NNRC<br/>cNRA<sup>e</sup></td>
<td><a href="html/Qcert.Translation.NRAEnvtoNNRC.html#nraenv_to_nnrc_top">Translation</a>,
<a href="html/Qcert.Translation.NRAEnvtoNNRC.html#nraenv_to_nnrc_top_correct">Correctness</a><br/>
<a href="html/Qcert.Translation.NRAEnvtocNRAEnv.html#nraenv_to_nraenv_core_top">Translation</a>,
<a href="html/Qcert.Translation.NRAEnvtocNRAEnv.html#nraenv_to_nraenv_core_top_correct">Correctness</a>
</td>
<td><br/>By macro-expansion</td>
<td></td></tr>
<tr><td>cNRA<sup>e</sup></td>
<td>cNNRC<br/>NRA<sup>e</sup></td>
<td><a href="html/Qcert.Translation.cNRAEnvtocNNRC.html#nraenv_core_to_nnrc_core_top">Translation</a>,
<a href="html/Qcert.Translation.cNRAEnvtocNNRC.html#nraenv_core_to_nnrc_core_top_correct">Correctness</a>,
<a href="html/Qcert.Translation.TcNRAEnvtocNNRC.html#tnraenv_sem_correct">Type Preservation</a><br/>
<a href="html/Qcert.Translation.cNRAEnvtoNRAEnv.html#nraenv_core_to_nraenv_top">Translation</a>,
<a href="html/Qcert.Translation.cNRAEnvtoNRAEnv.html#nraenv_core_to_nraenv_top_correct">Correctness</a>
</td>
<td><br/>By inclusion</td>
<td></td></tr>
<tr><td>NNRC</td>
<td>cNNRC<br/>NNRS<br/>DNNRC<br/>NNRCMR<br/>Java</td>
<td><a href="html/Qcert.Translation.NNRCtocNNRC.html#nnrc_to_nnrc_core_top">Translation</a>,
<a href="html/Qcert.Translation.NNRCtocNNRC.html#nnrc_to_nnrc_core_top_correct">Correctness</a><br/>
<a href="html/Qcert.Translation.NNRCtoNNRS.html#nnrc_to_nnrs_top">Translation</a>,
<a href="html/Qcert.Translation.NNRCtoNNRS.html#nnrc_to_nnrs_top_correct">Correctness</a><br/>
<a href="html/Qcert.Translation.NNRCtoDNNRC.html#nnrc_to_dnnrc_top">Translation</a>,
<a href="html/Qcert.Translation.NNRCtoDNNRC.html#nnrc_to_dnnrc_top_correct">Correctness</a><br/>
<a href="html/Qcert.Translation.NNRCtoNNRCMR.html#nnrc_to_nnrcmr_top">Translation</a><br/>
<a href="html/Qcert.Translation.NNRCtoJava.html#nnrc_to_java_top">Translation</a>
</td>
<td>By macro-expansion<br/><br/></br>Code-generation</td>
<td></td></tr>
<tr><td>cNNRC</td>
<td>NNRC<br/>CAMP</td>
<td><a href="html/Qcert.Translation.cNNRCtoNNRC.html#nnrc_core_to_nnrc_top">Translation</a>,
<a href="html/Qcert.Translation.cNNRCtoNNRC.html#nnrc_core_to_nnrc_top_correct">Correctness</a><br/>
<a href="html/Qcert.Translation.cNNRCtoCAMP.html#nnrc_core_to_camp_top">Translation</a>,
<a href="html/Qcert.Translation.cNNRCtoCAMP.html#nnrcToCamp_let_sem_correct_top">Correctness</a>,
<a href="html/Qcert.Translation.TcNNRCtoCAMP.html#nnrc_to_camp_let_type_preserve">Type Preservation</a>
</td>
<td>By inclusion</td>
<td></td></tr>
<tr><td>NNRS</td>
<td>Javascript</td>
<td><a href="html/Qcert.Translation.NNRStoJavaScriptAst.html#nnrs_to_js_ast_top">Translation</a>
</td>
<td>Through Ast</td>
<td></td></tr>
<tr><td>DNNRC</td>
<td>tDNNRC</td>
<td><a href="html/Qcert.Translation.DNNRCtotDNNRC.html#dnnrc_to_dnnrc_typed_top">Translation</a>
</td>
<td>Type inference</td>
<td></td></tr>
<tr><td>tDNNRC</td>
<td>SparkDF</td>
<td><a href="html/Qcert.Translation.tDNNRCtoSparkDF.html#dnnrc_typed_to_spark_df_top">Translation</a>
</td>
<td>Code-generation</td>
<td></td></tr>
<tr><td>NNRCMR</td>
<td>NNRC<br/>CldMR</br>SparkRDD</td>
<td><a href="html/Qcert.Translation.NNRCMRtoNNRC.html#nnrc_of_nnrcmr_top">Translation</a><br/>
<a href="html/Qcert.Translation.NNRCMRtoCldMR.html#nnrcmr_to_cldmr_top">Translation</a><br/>
<a href="html/Qcert.Translation.NNRCMRtoSparkRDD.html#nnrcmr_to_spark_rdd_top">Translation</a>
</td>
<td><br/><br/>Code-generation</td>
<td></td></tr>
<tr><td>CldMR</td>
<td>Cloudant</td>
<td><a href="html/Qcert.Translation.CldMRtoCloudant.html#cldmr_to_cloudant_top">Translation</a>
</td>
<td>Code-generation</td>
<td></td></tr>
</table>
<h3>Optimization Passes</h3>
<p>
Optimizers, when present, are located within the
<code>Optim</code> directory of the corresponding language. The
following four languages support optimization passes:</p>
<table class="table">
<tr><th>Name</th>
<th>Language</th>
<th>Code</th>
<th>Reference</th></tr>
<tr><td>NRA<sup>e</sup></td>
<td>NRA with Environments</td>
<td><a href="html/Qcert.NRAEnv.Optim.NRAEnvOptimizer.html#run_nraenv_optims">Optimizer</a>,
<a href="html/Qcert.NRAEnv.Optim.NRAEnvOptimizer.html#run_nraenv_optims_correctness">Correctness</a></td>
<td><a href="#nra">[Moer2014]</a>, <a href="#nraenv">[AHMSS2017]</a></td></tr>
<tr><td>NNRC</td>
<td>Named Nested Relational Calculus</td>
<td><a href="html/Qcert.NNRC.Optim.NNRCOptimizer.html#run_nnrc_optims">Optimizer</a>,
<a href="html/Qcert.NNRC.Optim.NNRCOptimizer.html#run_nnrc_optims_correctness">Correctness</a></td>
<td></td></tr>
<tr><td>tDNNRC</td>
<td>Typed DNNRC</td>
<td><a href="html/Qcert.tDNNRC.Optim.tDNNRCOptimizer.html#dnnrcToDataframeRewrite">Optimizer</a></td>
<td></td></tr>
<tr><td>NNRCMR</td>
<td>NNRC extended with Map/Reduce</td>
<td><a href="html/Qcert.NNRCMR.Optim.NNRCMROptimizer.html#run_nnrcmr_optims">Optimizer</a></td>
<td></td></tr>
</table>
<h3>Compiler Driver</h3>
<p>
The <code>coq/Compiler</code> directory contains the compiler
driver.
</p>
<h3>References</h3>
<table class="table table-borderless">
<tbody>
<tr id="nraenv"><th>[AHMSS2017]</th><td>"Handling Environments in
a Nested Relational Algebra with Combinators and an
Implementation in a Verified Query Compiler", by Joshua
Auerbach, Martin Hirzel, Louis Mandel, Avraham Shinnar and
Jérôme Siméon (ACM SIGMOD'2017 conference).</td></tr>
<tr id="nnrc"><th>[BV2007]</th><td><a href="http://alpha.uhasselt.be/~lucp1080/polynrc.pdf">Polymorphic
Type Inference for the Named Nested Relational Calculus</a> by
Jan Van den Bussche and Stijn Vansummeren.</td></tr>
<tr id="cloudant"><th>[Cloudant]</th><td><a href="https://console.bluemix.net/docs/services/Cloudant/api/creating_views.html#views-mapreduce-">Cloudant
Views (Map/Reduce)</a>, IBM Bluemix Cloudant API
Documentation.</td></tr>
<tr id="coq"><th>[Coq]</th><td><a href="https://coq.inria.fr">The
Coq proof assistant</a>, version 8.6.1.</td></tr>
<tr id="nra"><th>[Moer2014]</th><td>The most complete treatment
for the Nested Relational Algebra (NRA) can be found in Guido
Moerkotte's
<a href="http://pi3.informatik.uni-mannheim.de/~moer/querycompiler.pdf">Building
Query Compilers</a> book (See Chapter 7: An Algebra for Sets,
Bags, and Sequences).</td></tr>
<tr id="oql"><th>[ODMG]</th><td><a href="http://www.odbms.org/odmg-standard/odmg-book/">The
Object Data Management Standard: ODMG 3.0</a></td></tr>
<tr id="spark_rdd"><th>[SparkRDD]</th><td><a href="https://spark.apache.org/docs/2.1.1/programming-guide.html">Spark
Programming Guide</a>, Version 2.1.1.</td></tr>
<tr id="spark_df"><th>[SparkDF]</th><td><a href="https://spark.apache.org/docs/2.1.1/sql-programming-guide.html">Spark
SQL, DataFrames and Datasets Guide</a>, Version 2.1.1.</td></tr>
<tr id="camp"><th>[SSH2015]</th><td><a href="http://drops.dagstuhl.de/opus/volltexte/2015/5237/">A
Pattern Calculus for Rule Languages: Expressiveness,
Compilation, and Mechanization</a> by Avraham Shinnar, Jérôme
Siméon and Martin Hirzel.</td></tr>
</tbody>
</table>
<!-- ============================== -->
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="./assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="./bootstrap/js/bootstrap.min.js"></script>
<script src="./assets/js/docs.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="./assets/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>