-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
5010 lines (4336 loc) · 618 KB
/
index.html
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
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="coqdoc.css" rel="stylesheet" type="text/css" />
<title>coq_proof_semantics_equivalence</title>
</head>
<body>
<div id="page">
<div id="header">
</div>
<div id="main">
<div class="code">
</div>
<div class="doc">
<a id="lab1"></a><h1 class="section">Coq Proof for the equivalence of three semantics defined on a formal language for modelling distributed systems</h1>
Erwan Mahe - 2021
<div class="paragraph"> </div>
We use Coq to:
<ul class="doclist">
<li> formally encode an Interaction Language for modelling the behavior of distributed systems
</li>
<li> define a formal semantics in denotational style on this language
</li>
<li> define another formal semantics, this time in operational style
</li>
<li> prove the equivalence between the denotational and operational semantics
</li>
<li> propose an algorithmization of the operational semantics that we call the execution semantics
</li>
<li> prove the equivalence between the execution and the operational semantics and therefore also w.r.t. the denotational semantics
</li>
</ul>
<div class="paragraph"> </div>
This proof accompanies the manuscript of my thesis
<div class="paragraph"> </div>
<a id="lab2"></a><h2 class="section">Context</h2>
<div class="paragraph"> </div>
The formal language that we consider is that of interactions.
Interactions can be described as a formalisation of graphical models such as Message Sequence Charts or UML Sequence Diagrams.
<div class="paragraph"> </div>
An interaction describes the behaviors that can be expressed by a distributed system.
Those behaviors take the form of sequences of obserable events (discrete events), that we call traces (traces of execution).
In a more practical setting, a trace can for instance correspond to a log file,
in which the occurence of some discrete events have been recorded progressively during an execution of the system.
<div class="paragraph"> </div>
The events that constitute traces are atomic communication actions that occur on the interfaces of the distributed
system's sub-systems.
Those atomic actions correspond to either the emission or the reception of
a given message on a given sub-system.
<div class="paragraph"> </div>
The semantic domain of interest is therefore that of traces. The semantics of a given interaction is a given set of traces.
In the following, we will propose three different manners to define the semantics of interactions, and we will prove the equivalence
of those definitions. Those three definitions correspond to:
<ul class="doclist">
<li> a <i>denotational-style</i> semantics, which consists in constructing sets of accepted traces by <i>composition</i> and using algebraic properties of some operators on sets of traces
</li>
<li> an <i>operational-style</i> semantics, which consists in considering how can an interaction model be executed dynamically, and which behaviors it thus expresses. For a given interaction "i", it may be possible to transform it into interaction "i'" through the expression of an action. By considering all those possible transformations, we can construct the semantics of interaction "i" using <i>recursion</i> on the semantics of those transformed "i'" interactions.
</li>
<li> an <i>execution</i> semantics, which is an algorithmization of the <i>operational-style</i> semantics that consists in separating the process described by the operational semantics into two parts. At first we identify which actions can be immediately executed in a given interaction. And then, we construct the interaction term that remains to be executed.
</li>
</ul>
<div class="paragraph"> </div>
<a id="lab3"></a><h2 class="section">Related works</h2>
<div class="paragraph"> </div>
<a id="lab4"></a><h3 class="section">Publications</h3>
<div class="paragraph"> </div>
<ul class="doclist">
<li> <a href="https://link.springer.com/chapter/10.1007%2F978-3-030-45234-6_24">Revisiting Semantics of Interactions for Trace Validity Analysis</a>
</li>
<li> <a href="https://dl.acm.org/doi/10.1145/3412841.3442054">A small-step approach to multi-trace checking against interactions</a>
</li>
</ul>
<div class="paragraph"> </div>
<a id="lab5"></a><h3 class="section">Other Coq proves and tools</h3>
<div class="paragraph"> </div>
The coq file itself is hosted on the following repository:
<ul class="doclist">
<li> <a href="https://github.com/erwanM974/coq_hibou_label_semantics_equivalence">https://github.com/erwanM974/coq_hibou_label_semantics_equivalence</a>
</li>
</ul>
<div class="paragraph"> </div>
A prototype tool, which implements some formal verification techniques using the execution semantics
is available on the following repository:
<ul class="doclist">
<li> <a href="https://github.com/erwanM974/hibou_label">https://github.com/erwanM974/hibou_label</a>
</li>
</ul>
<div class="paragraph"> </div>
The nature of distributed systems makes so that it is often impossible to reorder globally the events that occured on distrinct sub-systems during an execution
of the system. Let us remark that this is related to the absence of a global clock.
In any case, what can be concretely logged during the execution of a distributed system is most oftentimes rather a set of locally defined log files.
In the semantic domain, this translates into having sets of locally observed traces, which we call multi-traces.
Another Coq proof, that is interested in the handling of multi-traces
and how one can test them w.r.t. the semantics (the Oracle problem for some form of a trace conformance relation / membership)
is available on the following repository:
<ul class="doclist">
<li> <a href="https://github.com/erwanM974/coq_hibou_label_multi_trace_analysis">https://github.com/erwanM974/coq_hibou_label_multi_trace_analysis</a>
</li>
</ul>
<div class="paragraph"> </div>
<a id="lab6"></a><h2 class="section">Dependencies</h2>
Below are listed the libraries required for this Coq proof.
<ul class="doclist">
<li> "Coq.Bool.Bool." provides utilities related to the manipulation of booleans
</li>
<li> "Coq.Lists.List." provides utilities on lists. I use lists - among other things - to represent traces.
</li>
<li> "Coq.Vectors.Fin." provides a means to represent finite sets indexed by {1,...,n}.
</li>
<li> "Psatz." is required for using the "lia" tactic to solve simple arithemtic problems.
</li>
<li> "Coq.Program.Equality." is required for using the "dependent induction" tactic with "generalizing", allowing the generalisation of some variables of the problem in the induction hypothesis.
</li>
<li> "Coq.Init.Logic." for (among other things) the "not_eq_sym" theorem
</li>
<li> "Coq.Init.Nat.", "Coq.Arith.PeanoNat." and "Coq.Arith.Peano_dec." for the manipulation of natural integers and the use of some lemmas
</li>
</ul>
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <span class="id" title="var">Coq.Bool.Bool</span>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <span class="id" title="var">Coq.Lists.List</span>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="var">Coq.Vectors.Fin</span>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <span class="id" title="var">Psatz</span>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <span class="id" title="var">Coq.Program.Equality</span>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <span class="id" title="var">Coq.Init.Logic</span>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <span class="id" title="var">Coq.Init.Nat</span>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <span class="id" title="var">Coq.Arith.PeanoNat</span>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <span class="id" title="var">Coq.Arith.Peano_dec</span>.<br/>
<br/>
</div>
<div class="doc">
<a id="lab7"></a><h1 class="section">Preliminaries</h1>
<div class="paragraph"> </div>
This section is dedicated to enoncing some basic types and properties on which the remainder of the proof will be based.
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Theorem</span> <span class="id" title="var">cons_eq_app</span> (<span class="id" title="var">A</span> : <span class="id" title="keyword">Type</span>) (<span class="id" title="var">l</span> <span class="id" title="var">l1</span> <span class="id" title="var">l2</span>:<span class="id" title="var">list</span> <span class="id" title="var">A</span>) (<span class="id" title="var">a</span>:<span class="id" title="var">A</span>) :<br/>
(<span class="id" title="var">a</span> :: <span class="id" title="var">l</span> = <span class="id" title="var">l1</span> ++ <span class="id" title="var">l2</span>) <br/>
-> <br/>
( (<span class="id" title="var">l1</span> = <span class="id" title="var">nil</span> /\ <span class="id" title="var">l2</span> = <span class="id" title="var">a</span>::<span class="id" title="var">l</span>)<br/>
\/ (<span class="id" title="tactic">exists</span> (<span class="id" title="var">l1'</span>:<span class="id" title="var">list</span> <span class="id" title="var">A</span>), <span class="id" title="var">l1</span> = <span class="id" title="var">a</span> :: <span class="id" title="var">l1'</span>)<br/>
).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">dependent</span> <span class="id" title="tactic">induction</span> <span class="id" title="var">l1</span>.<br/>
- <span class="id" title="tactic">simpl</span> <span class="id" title="tactic">in</span> *.<br/>
<span class="id" title="tactic">left</span>.<br/>
<span class="id" title="tactic">symmetry</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">split</span>.<br/>
+ <span class="id" title="tactic">reflexivity</span>.<br/>
+ <span class="id" title="tactic">assumption</span>.<br/>
- <span class="id" title="tactic">simpl</span> <span class="id" title="tactic">in</span> *.<br/>
<span class="id" title="tactic">right</span>.<br/>
<span class="id" title="tactic">inversion</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">destruct</span> <span class="id" title="var">H1</span>.<br/>
<span class="id" title="tactic">exists</span> <span class="id" title="var">l1</span>.<br/>
<span class="id" title="tactic">reflexivity</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
</div>
<div class="doc">
<div class="paragraph"> </div>
<a id="lab8"></a><h2 class="section">Signature & Actions</h2>
<div class="paragraph"> </div>
The interaction language that I define depends on a signature that is composed of:
<ul class="doclist">
<li> a set of "lifelines" L, which elements represent the individual sub-systems that can be found in the disctributed system (or some groups of sub-systems via abstraction/refinement)
</li>
<li> a set of "messages" M, which elements represent the individual distinguishable messages that can be exchanged (via asynchronous communication) within (i.e. internally) or without (i.e externally) the distributed system
</li>
</ul>
<div class="paragraph"> </div>
Given that I consider finitely many such lifelines and messages, I use finite vectors from "Coq.Vectors.Fin."
to model those sets.
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Parameter</span> <span class="id" title="var">LCard</span> : <span class="id" title="var">nat</span>.<br/>
<span class="id" title="keyword">Parameter</span> <span class="id" title="var">MCard</span> : <span class="id" title="var">nat</span>.<br/>
<br/>
<span class="id" title="keyword">Definition</span> <span class="id" title="var">L</span> := <span class="id" title="var">Fin.t</span> (<span class="id" title="var">S</span> <span class="id" title="var">LCard</span>).<br/>
<span class="id" title="keyword">Definition</span> <span class="id" title="var">M</span> := <span class="id" title="var">Fin.t</span> (<span class="id" title="var">S</span> <span class="id" title="var">MCard</span>).<br/>
<br/>
</div>
<div class="doc">
Given that we will manipulate elements of "L" (lifelines)
for the proofs regarding the execution semantics,
we formulate the following three basic properties:
<ul class="doclist">
<li> "L_neqb", which states that the inequality "l <> l'" (as a proposition) is equivalent to the fact that the boolean "Fin.eqb l l'" is false
</li>
<li> "L_not_neq", which states that if a lifeline "l" is not different from a lifeline "l'" then "l=l'"
</li>
<li> "L_neq_or_not_neq", which is a Lemma on the decidability of the unequality of lifelines
</li>
</ul>
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">L_neqb</span> :<br/>
<span class="id" title="keyword">forall</span> (<span class="id" title="var">l</span> <span class="id" title="var">l'</span>:<span class="id" title="var">L</span>),<br/>
(<span class="id" title="var">l</span> <> <span class="id" title="var">l'</span>) <-> (<span class="id" title="var">Fin.eqb</span> <span class="id" title="var">l</span> <span class="id" title="var">l'</span> = <span class="id" title="var">false</span>).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="var">Admitted</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">L_not_neq</span> :<br/>
<span class="id" title="keyword">forall</span> (<span class="id" title="var">l</span> <span class="id" title="var">l'</span>:<span class="id" title="var">L</span>), <br/>
(~ (<span class="id" title="var">l</span> <> <span class="id" title="var">l'</span>))<br/>
-> (<span class="id" title="var">l</span> = <span class="id" title="var">l'</span>).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="var">Admitted</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">L_neq_or_not_neq</span> (<span class="id" title="var">x</span> <span class="id" title="var">y</span>:<span class="id" title="var">L</span>) :<br/>
(<span class="id" title="var">x</span> <> <span class="id" title="var">y</span>) \/ (<span class="id" title="var">not</span>(<span class="id" title="var">x</span><><span class="id" title="var">y</span>)).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">pose</span> <span class="id" title="var">proof</span> (<span class="id" title="var">Fin.eq_dec</span> <span class="id" title="var">x</span> <span class="id" title="var">y</span>).<br/>
<span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span>.<br/>
- <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="var">contradiction</span>.<br/>
- <span class="id" title="tactic">left</span>. <span class="id" title="tactic">assumption</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
</div>
<div class="doc">
We denote by "l!m" the emission of message "m" (element of "M") from lifeline "l" (element of "L").
We denote by "l?m" the reception of message "m" (element of "M") by lifeline "l" (element of "L").
To distinguish between emissions and receptions I encode the kind of action
({!,?}) with an inductive type "ActKind".
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Inductive</span> <span class="id" title="var">ActKind</span> : <span class="id" title="keyword">Set</span> :=<br/>
|<span class="id" title="var">ak_snd</span>:<span class="id" title="var">ActKind</span><br/>
|<span class="id" title="var">ak_rcv</span>:<span class="id" title="var">ActKind</span>.<br/>
<br/>
</div>
<div class="doc">
I can now define actions with the "Action" type via a cartesian product of types L, ActKind and M.
<div class="paragraph"> </div>
A utility function "lifeline" returns, for any action, the lifeline on which it occurs.
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Definition</span> <span class="id" title="var">Action</span> :<span class="id" title="keyword">Set</span>:= <span class="id" title="var">L</span>*<span class="id" title="var">ActKind</span>*<span class="id" title="var">M</span>.<br/>
<br/>
<span class="id" title="keyword">Definition</span> <span class="id" title="var">lifeline</span>: <span class="id" title="var">Action</span> -> <span class="id" title="var">L</span> :=<br/>
<span class="id" title="keyword">fun</span> '(<span class="id" title="var">_</span> <span class="id" title="keyword">as</span> <span class="id" title="var">l</span>,<span class="id" title="var">_</span>,<span class="id" title="var">_</span>) => <span class="id" title="var">l</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">exists_action_on_lifeline</span> (<span class="id" title="var">l</span>:<span class="id" title="var">L</span>) :<br/>
(<span class="id" title="tactic">exists</span> <span class="id" title="var">a</span>:<span class="id" title="var">Action</span>, <span class="id" title="var">l</span> = (<span class="id" title="var">lifeline</span> <span class="id" title="var">a</span>) ).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="var">Admitted</span>.<br/>
<br/>
</div>
<div class="doc">
<a id="lab9"></a><h1 class="section">Trace Language (Semantic Domain)</h1>
<div class="paragraph"> </div>
This section is dedicated to the semantic domain of our interaction language i.e. the domain of definition of its semantics.
After defining this domain, I will study the properties of this domain,
notably how one can manipulate its elements through some operators and which are the properties of those operators.
<div class="paragraph"> </div>
As hinted at ealier, in this modelling framework:
<ul class="doclist">
<li> it is the expected behavior of distributed systems that is modelled
</li>
<li> this behavior is expressed in terms of accepted traces i.e. sequences of atomic actions that may be expressed
</li>
</ul>
<div class="paragraph"> </div>
The semantic domain is therefore the universe of traces.
<div class="paragraph"> </div>
The "Trace" type is formally defined below as that of lists of actions ("Action" type).
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Definition</span> <span class="id" title="var">Trace</span> : <span class="id" title="keyword">Type</span> := <span class="id" title="var">list</span> <span class="id" title="var">Action</span>.<br/>
<br/>
</div>
<div class="doc">
<a id="lab10"></a><h2 class="section">Some consideration on the decidability of equalities</h2>
<div class="paragraph"> </div>
In the following I construct the decidability of the equality of traces in several steps:
<ul class="doclist">
<li> in "eq_or_not_eq_actkind" is proven the decidability of the equality for the "ActKind" type. It is immediate given the inductive nature of "ActKind"
</li>
<li> in "eq_or_not_eq_action" is proven the decidability of the equality for the "Action" type. It relies on that of its subtypes L, ActKind and M. We have proven the decidability property for ActKind juste before, and, for L and M, it is provided by the "eq_dec" Lemma from "Coq.Vectors.Fin.".
</li>
<li> finally, in "eq_or_not_eq_trace" it is proven for the "Trace" type
</li>
</ul>
<div class="paragraph"> </div>
This last proof relies on a custom induction principle defined and checked in the "double_trace_induction" Lemma.
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">eq_or_not_eq_actkind</span> (<span class="id" title="var">x</span> <span class="id" title="var">y</span>:<span class="id" title="var">ActKind</span>) :<br/>
(<span class="id" title="var">x</span> = <span class="id" title="var">y</span>) \/ (<span class="id" title="var">x</span> <> <span class="id" title="var">y</span>).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">induction</span> <span class="id" title="var">x</span>; <span class="id" title="tactic">induction</span> <span class="id" title="var">y</span>.<br/>
- <span class="id" title="tactic">left</span>. <span class="id" title="tactic">reflexivity</span>.<br/>
- <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">discriminate</span>.<br/>
- <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">discriminate</span>.<br/>
- <span class="id" title="tactic">left</span>. <span class="id" title="tactic">reflexivity</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">eq_or_not_eq_action</span> (<span class="id" title="var">x</span> <span class="id" title="var">y</span>:<span class="id" title="var">Action</span>) :<br/>
(<span class="id" title="var">x</span> = <span class="id" title="var">y</span>) \/ (<span class="id" title="var">x</span> <> <span class="id" title="var">y</span>).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">destruct</span> <span class="id" title="var">x</span> ; <span class="id" title="tactic">destruct</span> <span class="id" title="var">y</span>.<br/>
<span class="id" title="tactic">destruct</span> <span class="id" title="var">p</span> ; <span class="id" title="tactic">destruct</span> <span class="id" title="var">p0</span>.<br/>
<span class="id" title="tactic">pose</span> <span class="id" title="var">proof</span> (<span class="id" title="var">Fin.eq_dec</span> <span class="id" title="var">m</span> <span class="id" title="var">m0</span>) <span class="id" title="keyword">as</span> <span class="id" title="var">Hm</span>.<br/>
<span class="id" title="tactic">pose</span> <span class="id" title="var">proof</span> (<span class="id" title="var">Fin.eq_dec</span> <span class="id" title="var">l</span> <span class="id" title="var">l0</span>) <span class="id" title="keyword">as</span> <span class="id" title="var">Hl</span>.<br/>
<span class="id" title="tactic">pose</span> <span class="id" title="var">proof</span> (<span class="id" title="var">eq_or_not_eq_actkind</span> <span class="id" title="var">a</span> <span class="id" title="var">a0</span>) <span class="id" title="keyword">as</span> <span class="id" title="var">Ha</span>.<br/>
<span class="id" title="tactic">destruct</span> <span class="id" title="var">Hm</span> ; <span class="id" title="tactic">destruct</span> <span class="id" title="var">Hl</span> ; <span class="id" title="tactic">destruct</span> <span class="id" title="var">Ha</span>.<br/>
- <span class="id" title="tactic">destruct</span> <span class="id" title="var">e</span> ; <span class="id" title="tactic">destruct</span> <span class="id" title="var">e0</span> ; <span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">left</span>. <span class="id" title="tactic">reflexivity</span>.<br/>
- <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">injection</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">intros</span>. <span class="id" title="var">contradiction</span>.<br/>
- <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">injection</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">intros</span>. <span class="id" title="var">contradiction</span>.<br/>
- <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">injection</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">intros</span>. <span class="id" title="var">contradiction</span>.<br/>
- <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">injection</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">intros</span>. <span class="id" title="var">contradiction</span>.<br/>
- <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">injection</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">intros</span>. <span class="id" title="var">contradiction</span>.<br/>
- <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">injection</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">intros</span>. <span class="id" title="var">contradiction</span>.<br/>
- <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">injection</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">intros</span>. <span class="id" title="var">contradiction</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">double_trace_induction</span> (<span class="id" title="var">P</span>: <span class="id" title="var">Trace</span> -> <span class="id" title="var">Trace</span> -> <span class="id" title="keyword">Prop</span>):<br/>
(<span class="id" title="var">P</span> <span class="id" title="var">nil</span> <span class="id" title="var">nil</span>)<br/>
-> (<span class="id" title="keyword">forall</span> <span class="id" title="var">t</span>:<span class="id" title="var">Trace</span>, (<span class="id" title="var">t</span><><span class="id" title="var">nil</span>) -> ((<span class="id" title="var">P</span> <span class="id" title="var">t</span> <span class="id" title="var">nil</span>) /\ (<span class="id" title="var">P</span> <span class="id" title="var">nil</span> <span class="id" title="var">t</span>)) ) <br/>
-> (<span class="id" title="keyword">forall</span> (<span class="id" title="var">a1</span> <span class="id" title="var">a2</span>:<span class="id" title="var">Action</span>) (<span class="id" title="var">t1</span> <span class="id" title="var">t2</span>:<span class="id" title="var">Trace</span>), <span class="id" title="var">P</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span> -> <span class="id" title="var">P</span> (<span class="id" title="var">a1</span>::<span class="id" title="var">t1</span>) (<span class="id" title="var">a2</span>::<span class="id" title="var">t2</span>) ) -><br/>
<span class="id" title="keyword">forall</span> (<span class="id" title="var">t1</span> <span class="id" title="var">t2</span>:<span class="id" title="var">Trace</span>), <span class="id" title="var">P</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span>.<br/>
<span class="id" title="tactic">dependent</span> <span class="id" title="tactic">induction</span> <span class="id" title="var">t1</span>.<br/>
- <span class="id" title="tactic">induction</span> <span class="id" title="var">t2</span>.<br/>
+ <span class="id" title="tactic">assumption</span>.<br/>
+ <span class="id" title="tactic">specialize</span> <span class="id" title="var">H0</span> <span class="id" title="keyword">with</span> (<span class="id" title="var">t</span>:=(<span class="id" title="var">a</span>::<span class="id" title="var">t2</span>)).<br/>
<span class="id" title="tactic">apply</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">discriminate</span>.<br/>
- <span class="id" title="tactic">dependent</span> <span class="id" title="tactic">induction</span> <span class="id" title="var">t2</span>.<br/>
+ <span class="id" title="tactic">specialize</span> <span class="id" title="var">H0</span> <span class="id" title="keyword">with</span> (<span class="id" title="var">t</span>:=(<span class="id" title="var">a</span>::<span class="id" title="var">t1</span>)).<br/>
<span class="id" title="tactic">apply</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">discriminate</span>.<br/>
+ <span class="id" title="tactic">apply</span> <span class="id" title="var">H1</span>. <span class="id" title="tactic">apply</span> <span class="id" title="var">IHt1</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">eq_or_not_eq_trace</span> (<span class="id" title="var">x</span> <span class="id" title="var">y</span>:<span class="id" title="var">Trace</span>) :<br/>
(<span class="id" title="var">x</span> = <span class="id" title="var">y</span>) \/ (<span class="id" title="var">x</span> <> <span class="id" title="var">y</span>).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">pose</span> <span class="id" title="var">proof</span> <span class="id" title="var">double_trace_induction</span>.<br/>
<span class="id" title="tactic">specialize</span> <span class="id" title="var">H</span> <span class="id" title="keyword">with</span> (<span class="id" title="var">P</span>:= (<span class="id" title="keyword">fun</span> <span class="id" title="var">x</span> <span class="id" title="var">y</span>:<span class="id" title="var">Trace</span> => (<span class="id" title="var">x</span> = <span class="id" title="var">y</span>) \/ (<span class="id" title="var">x</span> <> <span class="id" title="var">y</span>))).<br/>
<span class="id" title="tactic">apply</span> <span class="id" title="var">H</span>.<br/>
- <span class="id" title="tactic">left</span>. <span class="id" title="tactic">reflexivity</span>.<br/>
- <span class="id" title="tactic">intros</span>. <span class="id" title="tactic">split</span>.<br/>
+ <span class="id" title="tactic">right</span>. <span class="id" title="tactic">assumption</span>.<br/>
+ <span class="id" title="tactic">right</span>. <span class="id" title="tactic">apply</span> <span class="id" title="var">not_eq_sym</span>. <span class="id" title="tactic">assumption</span>.<br/>
- <span class="id" title="tactic">intros</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span>.<br/>
+ <span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span>.<br/>
<span class="id" title="tactic">pose</span> <span class="id" title="var">proof</span> (<span class="id" title="var">eq_or_not_eq_action</span> <span class="id" title="var">a1</span> <span class="id" title="var">a2</span>).<br/>
<span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span>.<br/>
* <span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">left</span>. <span class="id" title="tactic">reflexivity</span>.<br/>
* <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">inversion</span> <span class="id" title="var">H1</span>. <span class="id" title="var">contradiction</span>.<br/>
+ <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">inversion</span> <span class="id" title="var">H1</span>. <span class="id" title="var">contradiction</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
</div>
<div class="doc">
<a id="lab11"></a><h2 class="section">Some operators on traces and some of their algebraic properties</h2>
<div class="paragraph"> </div>
In the following let us focus on four operators on traces:
<ul class="doclist">
<li> the classical concatenation of lists "++" which is extended to traces:
<ul class="doclist">
<li> for any two traces t1 and t2, there is a single traces t such that t = t1 ++ t2
</li>
<li> this traces t is defined as the concatenation of t1 and t2 as a single contiguous list
</li>
</ul>
</li>
<li> an interleaving operator on traces
<ul class="doclist">
<li> for any two traces t1 and t2, there can exist may traces t such that (is_interleaving t1 t2 t)
</li>
<li> those traces correspond to potential interleavings of the actions from t1 and t2
</li>
<li> within such a t, one must find all the actions from t1 and all the actions from t2 in the order in which they are found in t1 and t2 respectively
</li>
<li> however actions from t1 can be put in any order w.r.t. the actions from t2
</li>
</ul>
</li>
<li> a weak sequencing operator on traces:
<ul class="doclist">
<li> for any two traces t1 and t2, there can exist may traces t such that (is_weak_seq t1 t2 t)
</li>
<li> weak sequencing allows some interleaving between the actions from t1 and t2
</li>
<li> however it is a more restrictive operator than interleaving given that it onlt allows some interleavings and not all
</li>
<li> the definition of what is allowed or not is reliant upon a conflict operator
</li>
<li> in a certain prefix of the trace t:
<ul class="doclist">
<li> actions from t1 can be added freely
</li>
<li> actions from t2 can only be added if they do not enter into conflict with the actions from t1 that are waiting to be added
</li>
</ul>
</li>
<li> the notion of conflict correspond to the fact, for two actions, to occur on the same lifeline
</li>
</ul>
</li>
<li> a special merge operator which merges an ordered list of traces into a single merged trace.
</li>
</ul>
I define this operator in such a way that is is configurable so as to act
as any of three different merge operators:
<ul class="doclist">
<li> the merging of traces using classical concatenation
</li>
<li> the merging of traces using the interleaving operator
</li>
<li> the merging of traces using the weak sequenceing operator
</li>
</ul>
<div class="paragraph"> </div>
In this section, those four operators will be defined (except for the concatenation which is already provided by Coq)
and some of their properties stated and proven.
<div class="paragraph"> </div>
<div class="paragraph"> </div>
<a id="lab12"></a><h3 class="section">Concatenation</h3>
<div class="paragraph"> </div>
For the concatenation operator "++", most interesting properties are already shipped in with Coq
and can be used in proofs more or less direclty (with "simpl.", "inversion." and so on).
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">concat_nil_prop0</span> (<span class="id" title="var">t1</span> <span class="id" title="var">t2</span>:<span class="id" title="var">Trace</span>) :<br/>
(<span class="id" title="var">t1</span> ++ <span class="id" title="var">t2</span> <> <span class="id" title="var">nil</span>)<br/>
<-> ( (<span class="id" title="var">t1</span> <> <span class="id" title="var">nil</span>) \/ (<span class="id" title="var">t2</span> <> <span class="id" title="var">nil</span>) ).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">pose</span> <span class="id" title="var">proof</span> (<span class="id" title="var">eq_or_not_eq_trace</span> <span class="id" title="var">t1</span> <span class="id" title="var">nil</span>) <span class="id" title="keyword">as</span> <span class="id" title="var">H1</span>.<br/>
<span class="id" title="tactic">pose</span> <span class="id" title="var">proof</span> (<span class="id" title="var">eq_or_not_eq_trace</span> <span class="id" title="var">t2</span> <span class="id" title="var">nil</span>) <span class="id" title="keyword">as</span> <span class="id" title="var">H2</span>.<br/>
<span class="id" title="tactic">destruct</span> <span class="id" title="var">H1</span> ; <span class="id" title="tactic">destruct</span> <span class="id" title="var">H2</span>.<br/>
- <span class="id" title="tactic">symmetry</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">symmetry</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span>.<br/>
<span class="id" title="tactic">split</span> ; <span class="id" title="tactic">intros</span>.<br/>
+ <span class="id" title="tactic">simpl</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span>. <span class="id" title="var">contradiction</span>.<br/>
+ <span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> ; <span class="id" title="var">contradiction</span>.<br/>
- <span class="id" title="tactic">symmetry</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span>. <span class="id" title="tactic">simpl</span>.<br/>
<span class="id" title="tactic">split</span> ; <span class="id" title="tactic">intros</span>.<br/>
+ <span class="id" title="tactic">right</span>. <span class="id" title="tactic">assumption</span>.<br/>
+ <span class="id" title="tactic">assumption</span>.<br/>
- <span class="id" title="tactic">symmetry</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">simpl</span>.<br/>
<span class="id" title="tactic">split</span> ; <span class="id" title="tactic">intros</span>.<br/>
+ <span class="id" title="tactic">left</span>. <span class="id" title="tactic">assumption</span>.<br/>
+ <span class="id" title="tactic">rewrite</span> <span class="id" title="var">app_nil_r</span>. <span class="id" title="tactic">assumption</span>.<br/>
- <span class="id" title="tactic">split</span> ; <span class="id" title="tactic">intros</span>.<br/>
+ <span class="id" title="tactic">left</span>. <span class="id" title="tactic">assumption</span>.<br/>
+ <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">apply</span> <span class="id" title="var">app_eq_nil</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H2</span>.<br/>
<span class="id" title="tactic">destruct</span> <span class="id" title="var">H2</span>. <span class="id" title="var">contradiction</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
</div>
<div class="doc">
<a id="lab13"></a><h3 class="section">Interleaving</h3>
<div class="paragraph"> </div>
I formalise the interleaving operator in Coq using an inductive predicate
"is_interleaving" such that
"(is_interleaving t1 t2 t)" states the membership of a given trace t
into the set of interleavings between traces t1 and t2.
<div class="paragraph"> </div>
This inductive predicate can be inferred inductively using four construction rules:
<ul class="doclist">
<li> "interleaving_nil_left" which states that for any trace t, t is an interleaving of the empty trace and t
</li>
<li> "interleaving_nil_right" which states that for any trace t, t is an interleaving of t and the empty trace
</li>
<li> "interleaving_cons_left" which states that for any interleaving t of traces t1 and t2, (a::t) is an interleaving of (a::t1) and t2
</li>
<li> "interleaving_cons_right" which states that for any interleaving t of traces t1 and t2, (a::t) is an interleaving of t1 and (a::t2)
</li>
</ul>
<div class="paragraph"> </div>
Those two last rules signify that, when constructing an interleaving, we can mix in actions from either traces in any order
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Inductive</span> <span class="id" title="var">is_interleaving</span> : <span class="id" title="var">Trace</span> -> <span class="id" title="var">Trace</span> -> <span class="id" title="var">Trace</span> -> <span class="id" title="keyword">Prop</span> :=<br/>
| <span class="id" title="var">interleaving_nil_left</span> : <span class="id" title="keyword">forall</span> (<span class="id" title="var">t</span>:<span class="id" title="var">Trace</span>), <br/>
(<span class="id" title="var">is_interleaving</span> <span class="id" title="var">nil</span> <span class="id" title="var">t</span> <span class="id" title="var">t</span>)<br/>
| <span class="id" title="var">interleaving_nil_right</span> : <span class="id" title="keyword">forall</span> (<span class="id" title="var">t</span>:<span class="id" title="var">Trace</span>), <br/>
(<span class="id" title="var">is_interleaving</span> <span class="id" title="var">t</span> <span class="id" title="var">nil</span> <span class="id" title="var">t</span>)<br/>
| <span class="id" title="var">interleaving_cons_left</span> : <span class="id" title="keyword">forall</span> (<span class="id" title="var">t</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span>:<span class="id" title="var">Trace</span>) (<span class="id" title="var">a</span>:<span class="id" title="var">Action</span>),<br/>
(<span class="id" title="var">is_interleaving</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">t</span>) -> (<span class="id" title="var">is_interleaving</span> (<span class="id" title="var">a</span>::<span class="id" title="var">t1</span>) <span class="id" title="var">t2</span> (<span class="id" title="var">a</span>::<span class="id" title="var">t</span>))<br/>
| <span class="id" title="var">interleaving_cons_right</span> : <span class="id" title="keyword">forall</span> (<span class="id" title="var">t</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span>:<span class="id" title="var">Trace</span>) (<span class="id" title="var">a</span>:<span class="id" title="var">Action</span>),<br/>
(<span class="id" title="var">is_interleaving</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">t</span>) -> (<span class="id" title="var">is_interleaving</span> <span class="id" title="var">t1</span> (<span class="id" title="var">a</span>::<span class="id" title="var">t2</span>) (<span class="id" title="var">a</span>::<span class="id" title="var">t</span>)).<br/>
<br/>
</div>
<div class="doc">
Interesting properties of the "is_interleaving" that will be useful later on
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">is_interleaving_existence</span> (<span class="id" title="var">t1</span> <span class="id" title="var">t2</span>:<span class="id" title="var">Trace</span>) :<br/>
<span class="id" title="tactic">exists</span> <span class="id" title="var">t</span>:<span class="id" title="var">Trace</span>, <span class="id" title="var">is_interleaving</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">t</span>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">dependent</span> <span class="id" title="tactic">induction</span> <span class="id" title="var">t1</span>.<br/>
- <span class="id" title="tactic">exists</span> <span class="id" title="var">t2</span>. <span class="id" title="tactic">apply</span> <span class="id" title="var">interleaving_nil_left</span>.<br/>
- <span class="id" title="tactic">specialize</span> <span class="id" title="var">IHt1</span> <span class="id" title="keyword">with</span> (<span class="id" title="var">t2</span>:=<span class="id" title="var">t2</span>).<br/>
<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHt1</span>.<br/>
<span class="id" title="tactic">exists</span> (<span class="id" title="var">a</span>::<span class="id" title="var">x</span>).<br/>
<span class="id" title="tactic">apply</span> <span class="id" title="var">interleaving_cons_left</span>.<br/>
<span class="id" title="tactic">assumption</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">is_interleaving_nil_prop0</span> (<span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">t</span>:<span class="id" title="var">Trace</span>) :<br/>
(<span class="id" title="var">is_interleaving</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">t</span>)<br/>
-> (<br/>
(<span class="id" title="var">t</span> <> <span class="id" title="var">nil</span>)<br/>
<-> ( (<span class="id" title="var">t1</span> <> <span class="id" title="var">nil</span>) \/ (<span class="id" title="var">t2</span> <> <span class="id" title="var">nil</span>) )<br/>
).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">dependent</span> <span class="id" title="tactic">induction</span> <span class="id" title="var">t</span> <span class="id" title="var">generalizing</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span>.<br/>
- <span class="id" title="tactic">inversion</span> <span class="id" title="var">H</span>.<br/>
+ <span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H1</span>.<br/>
<span class="id" title="tactic">symmetry</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H2</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H2</span>.<br/>
<span class="id" title="tactic">split</span> ; <span class="id" title="tactic">intros</span>.<br/>
* <span class="id" title="tactic">left</span>. <span class="id" title="tactic">assumption</span>.<br/>
* <span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span> ; <span class="id" title="tactic">assumption</span>.<br/>
+ <span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H1</span>.<br/>
<span class="id" title="tactic">symmetry</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H2</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H2</span>.<br/>
<span class="id" title="tactic">split</span> ; <span class="id" title="tactic">intros</span>.<br/>
* <span class="id" title="tactic">left</span>. <span class="id" title="tactic">assumption</span>.<br/>
* <span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span> ; <span class="id" title="tactic">assumption</span>.<br/>
- <span class="id" title="tactic">split</span> ; <span class="id" title="tactic">intro</span>.<br/>
+ <span class="id" title="tactic">inversion</span> <span class="id" title="var">H</span>.<br/>
* <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">discriminate</span>.<br/>
* <span class="id" title="tactic">left</span>. <span class="id" title="tactic">assumption</span>.<br/>
* <span class="id" title="tactic">left</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">discriminate</span>.<br/>
* <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">discriminate</span>.<br/>
+ <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">discriminate</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">is_interleaving_nil_prop1</span> (<span class="id" title="var">t1</span> <span class="id" title="var">t2</span>: <span class="id" title="var">Trace</span>) :<br/>
(<span class="id" title="var">is_interleaving</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">nil</span>)<br/>
-> ( (<span class="id" title="var">t1</span> = <span class="id" title="var">nil</span>) /\ (<span class="id" title="var">t2</span> = <span class="id" title="var">nil</span>) ).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">inversion</span> <span class="id" title="var">H</span> ; <span class="id" title="tactic">split</span> ; <span class="id" title="tactic">reflexivity</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">is_interleaving_nil_prop2</span> (<span class="id" title="var">t</span> <span class="id" title="var">t2</span>: <span class="id" title="var">Trace</span>) :<br/>
(<span class="id" title="var">is_interleaving</span> <span class="id" title="var">nil</span> <span class="id" title="var">t2</span> <span class="id" title="var">t</span>)<br/>
-> (<span class="id" title="var">t2</span> = <span class="id" title="var">t</span>).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">dependent</span> <span class="id" title="tactic">induction</span> <span class="id" title="var">H</span>.<br/>
- <span class="id" title="tactic">reflexivity</span>.<br/>
- <span class="id" title="tactic">reflexivity</span>.<br/>
- <span class="id" title="tactic">assert</span> (<span class="id" title="var">t2</span>=<span class="id" title="var">t</span>).<br/>
{ <span class="id" title="tactic">apply</span> <span class="id" title="var">IHis_interleaving</span>.<br/>
<span class="id" title="tactic">trivial</span>.<br/>
}<br/>
<span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span>.<br/>
<span class="id" title="tactic">reflexivity</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">is_interleaving_nil_prop3</span> (<span class="id" title="var">t1</span> <span class="id" title="var">t</span>: <span class="id" title="var">Trace</span>) :<br/>
(<span class="id" title="var">is_interleaving</span> <span class="id" title="var">t1</span> <span class="id" title="var">nil</span> <span class="id" title="var">t</span>)<br/>
-> (<span class="id" title="var">t1</span> = <span class="id" title="var">t</span>).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">dependent</span> <span class="id" title="tactic">induction</span> <span class="id" title="var">H</span>.<br/>
- <span class="id" title="tactic">reflexivity</span>.<br/>
- <span class="id" title="tactic">reflexivity</span>.<br/>
- <span class="id" title="tactic">assert</span> (<span class="id" title="var">t1</span>=<span class="id" title="var">t</span>).<br/>
{ <span class="id" title="tactic">apply</span> <span class="id" title="var">IHis_interleaving</span>.<br/>
<span class="id" title="tactic">trivial</span>.<br/>
}<br/>
<span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span>.<br/>
<span class="id" title="tactic">reflexivity</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">is_interleaving_commutativity</span> (<span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">t</span>:<span class="id" title="var">Trace</span>) :<br/>
(<span class="id" title="var">is_interleaving</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">t</span>) <-> (<span class="id" title="var">is_interleaving</span> <span class="id" title="var">t2</span> <span class="id" title="var">t1</span> <span class="id" title="var">t</span>).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">dependent</span> <span class="id" title="tactic">induction</span> <span class="id" title="var">t</span> <span class="id" title="var">generalizing</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span>.<br/>
- <span class="id" title="tactic">split</span> ; <span class="id" title="tactic">intros</span> ; <span class="id" title="tactic">apply</span> <span class="id" title="var">is_interleaving_nil_prop1</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span><br/>
; <span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> ; <span class="id" title="tactic">symmetry</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span> ; <span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> ; <span class="id" title="tactic">symmetry</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H0</span> ; <span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span><br/>
; <span class="id" title="tactic">apply</span> <span class="id" title="var">interleaving_nil_left</span>.<br/>
- <span class="id" title="tactic">split</span> ; <span class="id" title="tactic">intros</span>.<br/>
+ <span class="id" title="tactic">inversion</span> <span class="id" title="var">H</span>.<br/>
* <span class="id" title="tactic">apply</span> <span class="id" title="var">interleaving_nil_right</span>.<br/>
* <span class="id" title="tactic">apply</span> <span class="id" title="var">interleaving_nil_left</span>.<br/>
* <span class="id" title="tactic">destruct</span> <span class="id" title="var">H1</span>. <span class="id" title="tactic">apply</span> <span class="id" title="var">interleaving_cons_right</span>.<br/>
<span class="id" title="tactic">apply</span> <span class="id" title="var">IHt</span>. <span class="id" title="tactic">assumption</span>.<br/>
* <span class="id" title="tactic">destruct</span> <span class="id" title="var">H2</span>. <span class="id" title="tactic">apply</span> <span class="id" title="var">interleaving_cons_left</span>.<br/>
<span class="id" title="tactic">apply</span> <span class="id" title="var">IHt</span>. <span class="id" title="tactic">assumption</span>.<br/>
+ <span class="id" title="tactic">inversion</span> <span class="id" title="var">H</span>.<br/>
* <span class="id" title="tactic">apply</span> <span class="id" title="var">interleaving_nil_right</span>.<br/>
* <span class="id" title="tactic">apply</span> <span class="id" title="var">interleaving_nil_left</span>.<br/>
* <span class="id" title="tactic">destruct</span> <span class="id" title="var">H1</span>. <span class="id" title="tactic">apply</span> <span class="id" title="var">interleaving_cons_right</span>.<br/>
<span class="id" title="tactic">apply</span> <span class="id" title="var">IHt</span>. <span class="id" title="tactic">assumption</span>.<br/>
* <span class="id" title="tactic">destruct</span> <span class="id" title="var">H2</span>. <span class="id" title="tactic">apply</span> <span class="id" title="var">interleaving_cons_left</span>.<br/>
<span class="id" title="tactic">apply</span> <span class="id" title="var">IHt</span>. <span class="id" title="tactic">assumption</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">is_interleaving_assoc</span> (<span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">t3</span> <span class="id" title="var">tmA</span> <span class="id" title="var">tmB</span> <span class="id" title="var">t</span>:<span class="id" title="var">Trace</span>):<br/>
(<span class="id" title="var">is_interleaving</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">tmA</span>)<br/>
-> (<span class="id" title="var">is_interleaving</span> <span class="id" title="var">t2</span> <span class="id" title="var">t3</span> <span class="id" title="var">tmB</span>)<br/>
-> ( (<span class="id" title="var">is_interleaving</span> <span class="id" title="var">tmA</span> <span class="id" title="var">t3</span> <span class="id" title="var">t</span>) <-> (<span class="id" title="var">is_interleaving</span> <span class="id" title="var">t1</span> <span class="id" title="var">tmB</span> <span class="id" title="var">t</span>)).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="var">Admitted</span>.<br/>
<br/>
</div>
<div class="doc">
<a id="lab14"></a><h3 class="section">Weak Sequencing</h3>
<div class="paragraph"> </div>
As explained earlier, the weak sequencing operator on traces relies upon a notion of "conflict" between actions.
To encode it in code, I define the "no_conflict" inductive predicate such that (no_conflict t a)
states that there are not actions in t that occur on the same lifeline as action "a".
<div class="paragraph"> </div>
This predicate can be inferred inductively from the following two rules:
<ul class="doclist">
<li> "no_conflict_nil", which states that for any action "a", there can be no conflict between "a" and the empty trace
</li>
<li> "no_conflict_cons", which states that for any action "a" and trace (a'::t) which starts with action "a'" as its head, if "a" and "a'" occur on different lifelines and there is no conflict between "a" and "t" then there is no conflict between "a" and (a'::t)
</li>
</ul>
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Inductive</span> <span class="id" title="var">no_conflict</span> : <span class="id" title="var">Trace</span> -> <span class="id" title="var">Action</span> -> <span class="id" title="keyword">Prop</span> :=<br/>
| <span class="id" title="var">no_conflict_nil</span> : <span class="id" title="keyword">forall</span> (<span class="id" title="var">a</span>:<span class="id" title="var">Action</span>), (<span class="id" title="var">no_conflict</span> <span class="id" title="var">nil</span> <span class="id" title="var">a</span>)<br/>
| <span class="id" title="var">no_conflict_cons</span> : <span class="id" title="keyword">forall</span> (<span class="id" title="var">a</span> <span class="id" title="var">a'</span>:<span class="id" title="var">Action</span>) (<span class="id" title="var">t</span>:<span class="id" title="var">Trace</span>),<br/>
(<br/>
(<span class="id" title="var">not</span> ((<span class="id" title="var">lifeline</span> <span class="id" title="var">a</span>) = (<span class="id" title="var">lifeline</span> <span class="id" title="var">a'</span>)))<br/>
/\ (<span class="id" title="var">no_conflict</span> <span class="id" title="var">t</span> <span class="id" title="var">a</span>)<br/>
) -> (<span class="id" title="var">no_conflict</span> (<span class="id" title="var">a'</span>::<span class="id" title="var">t</span>) <span class="id" title="var">a</span>).<br/>
<br/>
</div>
<div class="doc">
As for the interleaving, I formalise the weak sequencing operator in Coq using an inductive predicate
"is_weak_seq" such that
"(is_weak_seq t1 t2 t)" states the membership of a given trace t
into the set of weakly sequenced traces between traces t1 and t2.
<div class="paragraph"> </div>
This inductive predicate can be inferred inductively using four construction rules:
<ul class="doclist">
<li> "weak_seq_nil_left" which states that for any trace t, t is a weak sequence of the empty trace and t
</li>
<li> "weak_seq_nil_right" which states that for any trace t, t is a weak sequence of t and the empty trace
</li>
<li> "weak_seq_cons_left" which states that for any weak sequence t of traces t1 and t2, (a::t) is a weak sequence of (a::t1) and t2
</li>
<li> "weak_seq_cons_right" which states that for any weak sequence t of traces t1 and t2, if there is no conflict between "a" and t1 then (a::t) is a weak sequence of t1 and (a::t2)
</li>
</ul>
<div class="paragraph"> </div>
Those two last rules signify that, when constructing a weak sequence:
<ul class="doclist">
<li> we can freely add actions from the left-hand side trace t1
</li>
<li> but we only allow the addition of events from t2 if they are not preempted by the occurence of events from t1
</li>
</ul>
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Inductive</span> <span class="id" title="var">is_weak_seq</span> : <span class="id" title="var">Trace</span> -> <span class="id" title="var">Trace</span> -> <span class="id" title="var">Trace</span> -> <span class="id" title="keyword">Prop</span> :=<br/>
| <span class="id" title="var">weak_seq_nil_left</span> : <span class="id" title="keyword">forall</span> (<span class="id" title="var">t</span>:<span class="id" title="var">Trace</span>), <br/>
(<span class="id" title="var">is_weak_seq</span> <span class="id" title="var">nil</span> <span class="id" title="var">t</span> <span class="id" title="var">t</span>)<br/>
| <span class="id" title="var">weak_seq_nil_right</span> : <span class="id" title="keyword">forall</span> (<span class="id" title="var">t</span>:<span class="id" title="var">Trace</span>), <br/>
(<span class="id" title="var">is_weak_seq</span> <span class="id" title="var">t</span> <span class="id" title="var">nil</span> <span class="id" title="var">t</span>)<br/>
| <span class="id" title="var">weak_seq_cons_left</span> : <span class="id" title="keyword">forall</span> (<span class="id" title="var">t</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span>:<span class="id" title="var">Trace</span>) (<span class="id" title="var">a</span>:<span class="id" title="var">Action</span>),<br/>
(<span class="id" title="var">is_weak_seq</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">t</span>) -> (<span class="id" title="var">is_weak_seq</span> (<span class="id" title="var">a</span>::<span class="id" title="var">t1</span>) <span class="id" title="var">t2</span> (<span class="id" title="var">a</span>::<span class="id" title="var">t</span>))<br/>
| <span class="id" title="var">weak_seq_cons_right</span> : <span class="id" title="keyword">forall</span> (<span class="id" title="var">t</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span>:<span class="id" title="var">Trace</span>) (<span class="id" title="var">a</span>:<span class="id" title="var">Action</span>),<br/>
(<span class="id" title="var">is_weak_seq</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">t</span>)<br/>
-> (<span class="id" title="var">no_conflict</span> <span class="id" title="var">t1</span> <span class="id" title="var">a</span>) <br/>
-> (<span class="id" title="var">is_weak_seq</span> <span class="id" title="var">t1</span> (<span class="id" title="var">a</span>::<span class="id" title="var">t2</span>) (<span class="id" title="var">a</span>::<span class="id" title="var">t</span>)).<br/>
<br/>
</div>
<div class="doc">
In a similar fashion to what I did for the interleaving operator, I state some properties of the weak sequencing operator
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">is_weak_seq_existence</span> (<span class="id" title="var">t1</span> <span class="id" title="var">t2</span>:<span class="id" title="var">Trace</span>) :<br/>
<span class="id" title="tactic">exists</span> <span class="id" title="var">t</span>:<span class="id" title="var">Trace</span>, <span class="id" title="var">is_weak_seq</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">t</span>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">dependent</span> <span class="id" title="tactic">induction</span> <span class="id" title="var">t1</span>.<br/>
- <span class="id" title="tactic">exists</span> <span class="id" title="var">t2</span>. <span class="id" title="tactic">apply</span> <span class="id" title="var">weak_seq_nil_left</span>.<br/>
- <span class="id" title="tactic">specialize</span> <span class="id" title="var">IHt1</span> <span class="id" title="keyword">with</span> (<span class="id" title="var">t2</span>:=<span class="id" title="var">t2</span>).<br/>
<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHt1</span>.<br/>
<span class="id" title="tactic">exists</span> (<span class="id" title="var">a</span>::<span class="id" title="var">x</span>).<br/>
<span class="id" title="tactic">apply</span> <span class="id" title="var">weak_seq_cons_left</span>.<br/>
<span class="id" title="tactic">assumption</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">is_weak_seq_nil_prop0</span> (<span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">t</span>:<span class="id" title="var">Trace</span>) :<br/>
(<span class="id" title="var">is_weak_seq</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">t</span>)<br/>
-> (<br/>
(<span class="id" title="var">t</span> <> <span class="id" title="var">nil</span>)<br/>
<-> ( (<span class="id" title="var">t1</span> <> <span class="id" title="var">nil</span>) \/ (<span class="id" title="var">t2</span> <> <span class="id" title="var">nil</span>) )<br/>
).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">dependent</span> <span class="id" title="tactic">induction</span> <span class="id" title="var">t</span> <span class="id" title="var">generalizing</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span>.<br/>
- <span class="id" title="tactic">inversion</span> <span class="id" title="var">H</span>.<br/>
+ <span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H1</span>.<br/>
<span class="id" title="tactic">symmetry</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H2</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H2</span>.<br/>
<span class="id" title="tactic">split</span> ; <span class="id" title="tactic">intros</span>.<br/>
* <span class="id" title="tactic">left</span>. <span class="id" title="tactic">assumption</span>.<br/>
* <span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span> ; <span class="id" title="tactic">assumption</span>.<br/>
+ <span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H1</span>.<br/>
<span class="id" title="tactic">symmetry</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H2</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">H2</span>.<br/>
<span class="id" title="tactic">split</span> ; <span class="id" title="tactic">intros</span>.<br/>
* <span class="id" title="tactic">left</span>. <span class="id" title="tactic">assumption</span>.<br/>
* <span class="id" title="tactic">destruct</span> <span class="id" title="var">H0</span> ; <span class="id" title="tactic">assumption</span>.<br/>
- <span class="id" title="tactic">split</span> ; <span class="id" title="tactic">intro</span>.<br/>
+ <span class="id" title="tactic">inversion</span> <span class="id" title="var">H</span>.<br/>
* <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">discriminate</span>.<br/>
* <span class="id" title="tactic">left</span>. <span class="id" title="tactic">assumption</span>.<br/>
* <span class="id" title="tactic">left</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">discriminate</span>.<br/>
* <span class="id" title="tactic">right</span>. <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">discriminate</span>.<br/>
+ <span class="id" title="tactic">intro</span>. <span class="id" title="tactic">discriminate</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">is_weak_seq_nil_prop1</span> (<span class="id" title="var">t1</span> <span class="id" title="var">t2</span>: <span class="id" title="var">Trace</span>) :<br/>
(<span class="id" title="var">is_weak_seq</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span> <span class="id" title="var">nil</span>)<br/>
-> ( (<span class="id" title="var">t1</span> = <span class="id" title="var">nil</span>) /\ (<span class="id" title="var">t2</span> = <span class="id" title="var">nil</span>) ).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">inversion</span> <span class="id" title="var">H</span> ; <span class="id" title="tactic">split</span> ; <span class="id" title="tactic">reflexivity</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">is_weak_seq_nil_prop2</span> (<span class="id" title="var">t1</span> <span class="id" title="var">t2</span>: <span class="id" title="var">Trace</span>) :<br/>
(<span class="id" title="var">is_weak_seq</span> <span class="id" title="var">nil</span> <span class="id" title="var">t1</span> <span class="id" title="var">t2</span>)<br/>
-> (<span class="id" title="var">t1</span> = <span class="id" title="var">t2</span>).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">assert</span> (<span class="id" title="var">H0</span>:=<span class="id" title="var">H</span>).<br/>
<span class="id" title="tactic">dependent</span> <span class="id" title="tactic">induction</span> <span class="id" title="var">H</span>.<br/>
- <span class="id" title="tactic">reflexivity</span>.<br/>
- <span class="id" title="tactic">reflexivity</span>.<br/>
- <span class="id" title="tactic">assert</span> (<span class="id" title="var">t2</span>=<span class="id" title="var">t</span>).<br/>
{ <span class="id" title="tactic">apply</span> <span class="id" title="var">IHis_weak_seq</span>.<br/>
- <span class="id" title="tactic">trivial</span>.<br/>
- <span class="id" title="tactic">assumption</span>.<br/>
}<br/>
<span class="id" title="tactic">destruct</span> <span class="id" title="var">H2</span>.<br/>
<span class="id" title="tactic">reflexivity</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <span class="id" title="var">is_weak_seq_nil_prop3</span> (<span class="id" title="var">t1</span> <span class="id" title="var">t2</span>: <span class="id" title="var">Trace</span>) :<br/>
(<span class="id" title="var">is_weak_seq</span> <span class="id" title="var">t1</span> <span class="id" title="var">nil</span> <span class="id" title="var">t2</span>)<br/>
-> (<span class="id" title="var">t1</span> = <span class="id" title="var">t2</span>).<br/>
<span class="id" title="keyword">Proof</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">H</span>.<br/>
<span class="id" title="tactic">dependent</span> <span class="id" title="tactic">induction</span> <span class="id" title="var">H</span>.<br/>
- <span class="id" title="tactic">reflexivity</span>.<br/>
- <span class="id" title="tactic">reflexivity</span>.<br/>
- <span class="id" title="tactic">assert</span> (<span class="id" title="var">t1</span>=<span class="id" title="var">t</span>).<br/>
{ <span class="id" title="tactic">apply</span> <span class="id" title="var">IHis_weak_seq</span>.<br/>