-
Notifications
You must be signed in to change notification settings - Fork 0
/
DeltaCCS-Variant.maude
994 lines (794 loc) · 36 KB
/
DeltaCCS-Variant.maude
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
***(
This file is part of the Maude 2 interpreter.
Copyright 1997-2006 SRI International, Menlo Park, CA 94025, USA.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
)
***
*** Maude LTL satisfiability solver and model checker.
*** Version 2.3.
***
fmod LTL is
protecting BOOL .
sort Formula .
*** primitive LTL operators
ops True False : -> Formula [ctor format (g o)] .
op ~_ : Formula -> Formula [ctor prec 53 format (r o d)] .
op _/\_ : Formula Formula -> Formula [comm ctor gather (E e) prec 55 format (d r o d)] .
op _\/_ : Formula Formula -> Formula [comm ctor gather (E e) prec 59 format (d r o d)] .
op O_ : Formula -> Formula [ctor prec 53 format (r o d)] .
op _U_ : Formula Formula -> Formula [ctor prec 63 format (d r o d)] .
op _R_ : Formula Formula -> Formula [ctor prec 63 format (d r o d)] .
*** defined LTL operators
op _->_ : Formula Formula -> Formula [gather (e E) prec 65 format (d r o d)] .
op _<->_ : Formula Formula -> Formula [prec 65 format (d r o d)] .
op <>_ : Formula -> Formula [prec 53 format (r o d)] .
op []_ : Formula -> Formula [prec 53 format (r d o d)] .
op _W_ : Formula Formula -> Formula [prec 63 format (d r o d)] .
op _|->_ : Formula Formula -> Formula [prec 63 format (d r o d)] . *** leads-to
op _=>_ : Formula Formula -> Formula [gather (e E) prec 65 format (d r o d)] .
op _<=>_ : Formula Formula -> Formula [prec 65 format (d r o d)] .
vars f g : Formula .
eq f -> g = ~ f \/ g .
eq f <-> g = (f -> g) /\ (g -> f) .
eq <> f = True U f .
eq [] f = False R f .
eq f W g = (f U g) \/ [] f .
eq f |-> g = [](f -> (<> g)) .
eq f => g = [] (f -> g) .
eq f <=> g = [] (f <-> g) .
*** negative normal form
eq ~ True = False .
eq ~ False = True .
eq ~ ~ f = f .
eq ~ (f \/ g) = ~ f /\ ~ g .
eq ~ (f /\ g) = ~ f \/ ~ g .
eq ~ O f = O ~ f .
eq ~(f U g) = (~ f) R (~ g) .
eq ~(f R g) = (~ f) U (~ g) .
endfm
fmod LTL-SIMPLIFIER is
including LTL .
*** The simplifier is based on:
*** Kousha Etessami and Gerard J. Holzman,
*** "Optimizing Buchi Automata", p153-167, CONCUR 2000, LNCS 1877.
*** We use the Maude sort system to do much of the work.
sorts TrueFormula FalseFormula PureFormula PE-Formula PU-Formula .
subsort TrueFormula FalseFormula < PureFormula <
PE-Formula PU-Formula < Formula .
op True : -> TrueFormula [ctor ditto] .
op False : -> FalseFormula [ctor ditto] .
op _/\_ : PE-Formula PE-Formula -> PE-Formula [ctor ditto] .
op _/\_ : PU-Formula PU-Formula -> PU-Formula [ctor ditto] .
op _/\_ : PureFormula PureFormula -> PureFormula [ctor ditto] .
op _\/_ : PE-Formula PE-Formula -> PE-Formula [ctor ditto] .
op _\/_ : PU-Formula PU-Formula -> PU-Formula [ctor ditto] .
op _\/_ : PureFormula PureFormula -> PureFormula [ctor ditto] .
op O_ : PE-Formula -> PE-Formula [ctor ditto] .
op O_ : PU-Formula -> PU-Formula [ctor ditto] .
op O_ : PureFormula -> PureFormula [ctor ditto] .
op _U_ : PE-Formula PE-Formula -> PE-Formula [ctor ditto] .
op _U_ : PU-Formula PU-Formula -> PU-Formula [ctor ditto] .
op _U_ : PureFormula PureFormula -> PureFormula [ctor ditto] .
op _U_ : TrueFormula Formula -> PE-Formula [ctor ditto] .
op _U_ : TrueFormula PU-Formula -> PureFormula [ctor ditto] .
op _R_ : PE-Formula PE-Formula -> PE-Formula [ctor ditto] .
op _R_ : PU-Formula PU-Formula -> PU-Formula [ctor ditto] .
op _R_ : PureFormula PureFormula -> PureFormula [ctor ditto] .
op _R_ : FalseFormula Formula -> PU-Formula [ctor ditto] .
op _R_ : FalseFormula PE-Formula -> PureFormula [ctor ditto] .
vars p q r s : Formula .
var pe : PE-Formula .
var pu : PU-Formula .
var pr : PureFormula .
*** Rules 1, 2 and 3; each with its dual.
eq (p U r) /\ (q U r) = (p /\ q) U r .
eq (p R r) \/ (q R r) = (p \/ q) R r .
eq (p U q) \/ (p U r) = p U (q \/ r) .
eq (p R q) /\ (p R r) = p R (q /\ r) .
eq True U (p U q) = True U q .
eq False R (p R q) = False R q .
*** Rules 4 and 5 do most of the work.
eq p U pe = pe .
eq p R pu = pu .
*** An extra rule in the same style.
eq O pr = pr .
*** We also use the rules from:
*** Fabio Somenzi and Roderick Bloem,
*** "Efficient Buchi Automata from LTL Formulae",
*** p247-263, CAV 2000, LNCS 1633.
*** that are not subsumed by the previous system.
*** Four pairs of duals.
eq O p /\ O q = O (p /\ q) .
eq O p \/ O q = O (p \/ q) .
eq O p U O q = O (p U q) .
eq O p R O q = O (p R q) .
eq True U O p = O (True U p) .
eq False R O p = O (False R p) .
eq (False R (True U p)) \/ (False R (True U q)) = False R (True U (p \/ q)) .
eq (True U (False R p)) /\ (True U (False R q)) = True U (False R (p /\ q)) .
*** <= relation on formula
op _<=_ : Formula Formula -> Bool [prec 75] .
eq p <= p = true .
eq False <= p = true .
eq p <= True = true .
ceq p <= (q /\ r) = true if (p <= q) /\ (p <= r) .
ceq p <= (q \/ r) = true if p <= q .
ceq (p /\ q) <= r = true if p <= r .
ceq (p \/ q) <= r = true if (p <= r) /\ (q <= r) .
ceq p <= (q U r) = true if p <= r .
ceq (p R q) <= r = true if q <= r .
ceq (p U q) <= r = true if (p <= r) /\ (q <= r) .
ceq p <= (q R r) = true if (p <= q) /\ (p <= r) .
ceq (p U q) <= (r U s) = true if (p <= r) /\ (q <= s) .
ceq (p R q) <= (r R s) = true if (p <= r) /\ (q <= s) .
*** condition rules depending on <= relation
ceq p /\ q = p if p <= q .
ceq p \/ q = q if p <= q .
ceq p /\ q = False if p <= ~ q .
ceq p \/ q = True if ~ p <= q .
ceq p U q = q if p <= q .
ceq p R q = q if q <= p .
ceq p U q = True U q if p =/= True /\ ~ q <= p .
ceq p R q = False R q if p =/= False /\ q <= ~ p .
ceq p U (q U r) = q U r if p <= q .
ceq p R (q R r) = q R r if q <= p .
endfm
fmod SAT-SOLVER is
protecting LTL .
*** formula lists and results
sorts FormulaList SatSolveResult TautCheckResult .
subsort Formula < FormulaList .
subsort Bool < SatSolveResult TautCheckResult .
op nil : -> FormulaList [ctor] .
op _;_ : FormulaList FormulaList -> FormulaList [ctor assoc id: nil] .
op model : FormulaList FormulaList -> SatSolveResult [ctor] .
op satSolve : Formula ~> SatSolveResult
[special (
id-hook SatSolverSymbol
op-hook trueSymbol (True : ~> Formula)
op-hook falseSymbol (False : ~> Formula)
op-hook notSymbol (~_ : Formula ~> Formula)
op-hook nextSymbol (O_ : Formula ~> Formula)
op-hook andSymbol (_/\_ : Formula Formula ~> Formula)
op-hook orSymbol (_\/_ : Formula Formula ~> Formula)
op-hook untilSymbol (_U_ : Formula Formula ~> Formula)
op-hook releaseSymbol (_R_ : Formula Formula ~> Formula)
op-hook formulaListSymbol
(_;_ : FormulaList FormulaList ~> FormulaList)
op-hook nilFormulaListSymbol (nil : ~> FormulaList)
op-hook modelSymbol
(model : FormulaList FormulaList ~> SatSolveResult)
term-hook falseTerm (false)
)] .
op counterexample : FormulaList FormulaList -> TautCheckResult [ctor] .
op tautCheck : Formula ~> TautCheckResult .
op $invert : SatSolveResult -> TautCheckResult .
var F : Formula .
vars L C : FormulaList .
eq tautCheck(F) = $invert(satSolve(~ F)) .
eq $invert(false) = true .
eq $invert(model(L, C)) = counterexample(L, C) .
endfm
fmod SATISFACTION is
protecting BOOL .
sorts State Prop .
op _|=_ : State Prop -> Bool [frozen] .
endfm
fmod MODEL-CHECKER is
protecting QID .
including SATISFACTION .
including LTL .
subsort Prop < Formula .
*** transitions and results
sorts RuleName Transition TransitionList ModelCheckResult .
subsort Qid < RuleName .
subsort Transition < TransitionList .
subsort Bool < ModelCheckResult .
ops unlabeled deadlock : -> RuleName .
op {_,_} : State RuleName -> Transition [ctor] .
op nil : -> TransitionList [ctor] .
op __ : TransitionList TransitionList -> TransitionList [ctor assoc id: nil] .
op counterexample : TransitionList TransitionList -> ModelCheckResult [ctor] .
op modelCheck : State Formula ~> ModelCheckResult
[special (
id-hook ModelCheckerSymbol
op-hook trueSymbol (True : ~> Formula)
op-hook falseSymbol (False : ~> Formula)
op-hook notSymbol (~_ : Formula ~> Formula)
op-hook nextSymbol (O_ : Formula ~> Formula)
op-hook andSymbol (_/\_ : Formula Formula ~> Formula)
op-hook orSymbol (_\/_ : Formula Formula ~> Formula)
op-hook untilSymbol (_U_ : Formula Formula ~> Formula)
op-hook releaseSymbol (_R_ : Formula Formula ~> Formula)
op-hook satisfiesSymbol (_|=_ : State Formula ~> Bool)
op-hook qidSymbol (<Qids> : ~> Qid)
op-hook unlabeledSymbol (unlabeled : ~> RuleName)
op-hook deadlockSymbol (deadlock : ~> RuleName)
op-hook transitionSymbol ({_,_} : State RuleName ~> Transition)
op-hook transitionListSymbol
(__ : TransitionList TransitionList ~> TransitionList)
op-hook nilTransitionListSymbol (nil : ~> TransitionList)
op-hook counterexampleSymbol
(counterexample : TransitionList TransitionList ~> ModelCheckResult)
term-hook trueTerm (true)
)] .
endfm
*** Implementation based on the CCS Implementation from Verdejo and Marti-Oliet
fmod CCS-SYNTAX is inc QID .
sorts Label Act ProcessId Process .
subsorts Qid < Label < Act .
subsorts Qid < ProcessId < Process .
---subsorts Qid < DeltaId < Delta .
---subsorts Qid < DeltaId .
op ~_ : Label -> Label .
eq ~ ~ L:Label = L:Label .
op tau : -> Act .
op 0 : -> Process .
op _._ : Act Process -> Process [frozen prec 25] .
op _+_ : Process Process -> Process [frozen assoc comm prec 35] .
op _|_ : Process Process -> Process [frozen assoc comm prec 30] .
op _[_/_] : Process Label Label -> Process [frozen prec 20] .
op _\_ : Process Label -> Process [frozen prec 20] .
endfm
fmod CCS-CONTEXT is
inc CCS-SYNTAX .
sorts Process? Context .
subsort Process < Process? .
op _=def_ : ProcessId Process -> Context [prec 40] .
op cnil : -> Context .
op _&_ : Context Context -> Context
[assoc comm id: cnil prec 42] .
op _definedIn_ : ProcessId Context -> Bool .
op def : ProcessId Context -> Process? .
op not-defined : -> Process? .
op _isUniqueIn_ : ProcessId Context -> Bool .
op context : -> Context .
vars X X' : ProcessId .
var P : Process .
vars C C' : Context .
eq X definedIn cnil = false .
eq X definedIn (X' =def P & C') = (X == X') or (X definedIn C') .
eq def(X, cnil) = not-defined .
eq def(X, (X' =def P) & C') = if X == X' then P
else def(X, C') fi .
eq X isUniqueIn cnil = true .
eq X isUniqueIn (X' =def P & C') = if X == X' then not (X definedIn C')
else (X isUniqueIn C') fi .
endfm
--- CCS transitions
mod CCS is
pr CCS-CONTEXT .
sorts ActProcess . ---MachineInt .
subsort Process < ActProcess .
op {_}_ : Act ActProcess -> ActProcess [frozen] .
*** {A}P means that the process P has performed the action A
vars L M : Label .
vars A B : Act .
vars P P' Q Q' R : Process .
var X : ProcessId .
var AP : ActProcess .
---var N : MachineInt .
*** Prefix
rl A . P => {A}P .
*** Summation
crl P + Q => {A}P' if P => {A}P' .
*** Composition
crl P | Q => {A}(P' | Q) if P => {A}P' .
crl P | Q => {tau}(P' | Q') if P => {L}P' /\ Q => {~ L}Q' .
*** Restriction
crl P \ L => {A}(P' \ L) if P => {A}P'
/\ A =/= L /\ A =/= ~ L .
*** Relabelling
crl P[M / L] => {M}(P'[M / L]) if P =>{L}P' .
crl P[M / L] => {~ M}(P'[M / L]) if P =>{~ L}P' .
crl P[M / L] => {A}(P'[M / L]) if P =>{A}P'
/\ A =/= L /\ A =/= ~ L .
*** Definition
crl X => {A}P if (X definedIn context) /\ def(X,context) => {A}P .
*** reflexive, transitive closure
sort TProcess .
subsort TProcess < ActProcess .
op [_] : Process -> TProcess [frozen] .
crl [ P ] => {A}Q if P => {A}Q .
crl [ P ] => {A}AP if P => {A}Q /\ [ Q ] => AP .
*** weak semantics
sorts Act*Process OActProcess .
op {_}*_ : Act Process -> Act*Process [frozen] .
op {{_}}_ : Act Process -> OActProcess [frozen] .
sort WProcess .
subsorts WProcess < Act*Process OActProcess .
op |_| : Process -> WProcess [frozen] .
op <_> : Process -> WProcess [frozen] .
rl | P | => {tau}* P .
crl | P | => {tau}* R if P => {tau}Q /\ | Q | => {tau}* R .
crl < P > => {{A}}P' if | P | => {tau}* Q /\
Q => {A}Q' /\
| Q' | => {tau}* P' .
endm
fmod DeltaCCS-Set is
pr CCS-CONTEXT .
pr LTL .
pr SAT-SOLVER .
sorts NeDeltaSet DeltaSet DeltaId Delta Product .
subsort Delta < NeDeltaSet < DeltaSet .
subsort Qid < DeltaId .
subsort Product < Formula .
var D : Delta .
var N : NeDeltaSet .
vars A S S’ : DeltaSet .
vars B B' F F' : Formula .
var FL : FormulaList .
vars I I' : DeltaId .
vars X X' Y Y' : ProcessId .
vars P Q : Process .
var a : Act .
var L : Label .
var C : Nat .
var p : Product .
var CT : Context .
--- delta operators
op _=ddef(_,_,_) : DeltaId ProcessId Formula ProcessId -> Delta [frozen] .
op getSourceId : Delta -> ProcessId .
eq getSourceId( I =ddef( X , B , Y ) ) = X .
op getCondition : Delta -> Formula .
eq getCondition( I =ddef( X , B , Y ) ) = B .
op getTargetId : Delta -> ProcessId .
eq getTargetId( I =ddef( X , B , Y ) ) = Y .
op getDeltaId : Delta -> DeltaId .
eq getDeltaId( I =ddef( X , B , Y ) ) = I .
--- product configuration
op prod : -> Product .
eq prod = True .
--- delta application
op $apply : Delta Process -> Process .
eq $apply (D , 0) = 0 .
eq $apply (D , X) = if ( getSourceId(D) == X )
then getTargetId(D)
else X
fi .
eq $apply (D , a . P) = a . ($apply (D , P)) .
eq $apply (D , P + Q) = ($apply (D , P)) + ( $apply (D , Q) ) .
eq $apply (D , P | Q) = ($apply (D , P)) | ($apply (D , Q)) .
eq $apply (D , P \ L) = ( $apply (D , P) ) \ L .
op apply_to_ : Delta Process -> Process .
eq apply D to P = $apply(D, P) .
--- if not(sat(prod /\ ~(getCondition(D)))) .
--- eq apply D to P = P [owise] .
op applySet_to_ : DeltaSet Process -> Process .
eq applySet empty to P = P .
eq applySet ( D & S ) to P = applySet S to (apply D to P) .
--- standard operators for sets
op empty : -> DeltaSet [ctor] .
op _&_ : DeltaSet DeltaSet -> DeltaSet [ctor assoc comm id: empty prec 121 format (d r os d)] .
op _&_ : NeDeltaSet DeltaSet -> NeDeltaSet [ctor ditto] .
eq N & N = N .
op union : DeltaSet DeltaSet -> DeltaSet .
op union : NeDeltaSet DeltaSet -> NeDeltaSet .
op union : DeltaSet NeDeltaSet -> NeDeltaSet .
eq union(S, S’) = S & S’ .
op insert : Delta DeltaSet -> DeltaSet .
eq insert(D, S) = D & S .
op _in_ : Delta DeltaSet -> Bool .
eq D in (D & S) = true .
eq D in S = false [owise] .
op cardinality : DeltaSet -> Nat .
op cardinality : NeDeltaSet -> NzNat .
eq cardinality(S) = $card(S, 0) .
op $card : DeltaSet Nat -> Nat .
eq $card(empty, C) = C .
eq $card((N & N & S), C) = $card((N & S), C) .
eq $card((D & S), C) = $card(S, C + 1) [owise] .
op _difference_ : DeltaSet DeltaSet -> DeltaSet [gather (E e)].
eq S difference empty = S .
eq S difference N = $diff(S, N, empty) .
op $diff : DeltaSet DeltaSet DeltaSet -> DeltaSet .
eq $diff(empty, S’, A) = A .
eq $diff((D & S), S’, A) = $diff(S, S’, if D in S’ then A else D & A fi) .
--- special operators for delta sets
op getDeltasFor : ProcessId DeltaSet -> DeltaSet .
eq getDeltasFor(X, empty) = empty .
eq getDeltasFor(X, (D & S)) = if (getSourceId(D) == X) then $getDeltasFor(X, S, D) else getDeltasFor(X, S) fi .
op $getDeltasFor : ProcessId DeltaSet DeltaSet -> DeltaSet .
eq $getDeltasFor(X, empty , A) = A .
eq $getDeltasFor(X, (D & S) , A) = if (getSourceId(D) == X) then $getDeltasFor(X, S , (A & D)) else $getDeltasFor(X, S, A) fi .
op deltaSet : -> DeltaSet .
--- feature model operator
op fm : -> Formula .
--- operators for application condition
op $sat : SatSolveResult -> Bool .
eq $sat(model(FL , True)) = true .
eq $sat(false) = false .
op sat : Formula -> Bool .
eq sat(F) = $sat(satSolve(F)) .
op _/\_ : Formula DeltaSet -> Formula .
eq F /\ empty = F .
eq F /\ (D & S) = F /\ getCondition(D) /\ S .
endfm
mod DeltaCCS-Variant is
inc DeltaCCS-Set .
pr CCS .
sorts VProcess ActVProcess .
subsort VProcess < ActVProcess .
vars D D' : DeltaSet .
vars P P' : Process .
vars U U' V V' : VProcess .
var A : Act .
var AVP : ActVProcess .
op [_,_] : Process DeltaSet -> VProcess .
op {_}_ : Act ActVProcess -> ActVProcess [frozen] .
crl [var-step] : [P , D] => {A} [(applySet D to P') , D] if P => {A}P' .
sort TVProcess .
subsort TVProcess < ActVProcess .
op [_] : VProcess -> TVProcess [frozen] .
crl [ U ] => {A}U' if U => {A}U' .
crl [ U ] => {A}AVP if U => {A}U' /\ [ U' ] => AVP .
*** weak semantics
sorts Act*VProcess OActVProcess .
op {_}*_ : Act VProcess -> Act*VProcess [frozen] .
op {{_}}_ : Act VProcess -> OActVProcess [frozen] .
sort WVProcess .
subsorts WVProcess < Act*VProcess OActVProcess .
op |_| : VProcess -> WVProcess [frozen] .
op <_> : VProcess -> WVProcess [frozen] .
rl | U | => {tau}* U .
crl | U | => {tau}* V if U => {tau}U' /\ | U' | => {tau}* V .
crl < U > => {{A}}U' if | U | => {tau}* V /\
V => {A}V' /\
| V' | => {tau}* U' .
endm
fmod SUCC is
inc META-LEVEL .
op MOD : -> Module .
---eq MOD = ['Wiper-Variante1] .
---eq MOD = ['EXAMPLE] .
eq MOD = ['Wiper] .
sort TermSet .
subsort Term < TermSet .
op mt : -> TermSet .
op _++_ : TermSet TermSet -> TermSet [assoc comm id: mt] .
op _isIn_ : Term TermSet -> Bool .
op allOneStep : Term Nat Term -> TermSet .
op filter : Qid TermSet TermSet -> TermSet .
op filter : Qid TermSet -> TermSet .
op succ : Term -> TermSet .
op succ : Term TermSet -> TermSet .
op wsucc : Term -> TermSet .
op wsucc : Term TermSet -> TermSet .
var M : Module .
var F : Qid .
vars T T' X : Term .
var N : Nat .
vars TS TS' : TermSet .
eq T isIn mt = false .
eq T isIn (T' ++ TS) =
(getTerm(metaReduce(MOD, '_==_[T,T'])) == 'true.Bool)
or (T isIn TS) .
eq filter(F,mt, TS') = mt .
ceq filter(F, X ++ TS, TS') =
(if T isIn TS' then T' else mt fi) ++ filter(F,TS,TS')
if F[T,T'] := X .
eq filter(F,mt) = mt .
ceq filter(F, X ++ TS) =
T' ++ filter(F,TS)
if F[T,T'] := X .
eq allOneStep(T,N,X) =
if metaSearch(MOD,T, X, nil, '+,1,N) == failure then mt
else getTerm(metaSearch(MOD,T, X, nil, '+,1,N)) ++
allOneStep(T,N + 1,X) fi .
eq succ(T) = filter(('`{_`}_),
allOneStep(T, 0, 'AVP:ActVProcess)) .
eq succ(T,TS) = filter(('`{_`}_),
allOneStep(T,0,'AVP:ActVProcess),TS) .
eq wsucc(T) = filter(('`{`{_`}`}_),
allOneStep('<_>[T], 0, 'OAVP:OActVProcess)) .
eq wsucc(T,TS) = filter(('`{`{_`}`}_),
allOneStep('<_>[T],0,'OAVP:OActVProcess),TS) .
endfm
*** Modul wie bei Wang Implementierung
fmod mu-calculus is
protecting SUCC .
sorts Environment Definition MuVariable MuFormula .
subsort MuVariable < MuFormula .
subsort Definition < Environment .
*** primitive operators ***
ops tt ff : -> MuFormula .
op ~_ : MuFormula -> MuFormula [ prec 52 ] .
op _/\_ : MuFormula MuFormula -> MuFormula [ comm prec 55 ] .
op _\/_ : MuFormula MuFormula -> MuFormula [ comm prec 59 ] .
op <_>_ : TermSet MuFormula -> MuFormula [ prec 53 ] .
op <<_>>_ : TermSet MuFormula -> MuFormula [ prec 53 ] .
op `[_`]_ : TermSet MuFormula -> MuFormula [ prec 53 ] .
op `[`[_`]`]_ : TermSet MuFormula -> MuFormula [ prec 53 ] .
op <->_ : MuFormula -> MuFormula [ prec 53 ] .
op <<->>_ : MuFormula -> MuFormula [ prec 53 ] .
op `[-`]_ : MuFormula -> MuFormula [ prec 53 ] .
op `[`[-`]`]_ : MuFormula -> MuFormula [ prec 53 ] .
op Mu__ : MuVariable MuFormula -> MuFormula [ prec 61 ] .
op Nu__ : MuVariable MuFormula -> MuFormula [ prec 61 ] .
ops forall exists : Environment TermSet MuFormula -> Bool .
---op _|=_ : Term MuFormula -> Bool [ prec 85 ].
op __|=_ : Environment Term MuFormula -> Bool [ prec 85 ].
---sorts Recquirements Declarations .
---op "_,_" : Recquirements Declarations -> Environment .
---var Recs : Recquirements .
---var Decl : Declarations .
var P : Term .
var K S PS : TermSet .
vars Phi Psi : MuFormula .
vars X Y : MuVariable .
var E : Environment .
var b : Bool .
*** Die beiden folgenden Abschnitt sind aus der Implementierung von Wang, Modul ENVIRONMENT
*** Definition
op _:=___ : MuVariable Bool TermSet MuFormula -> Definition [ prec 81 ] .
*** Environment
op `{`} : -> Environment .
op _&_ : Environment Environment -> Environment [ ctor assoc comm id: {} prec 83 ] .
*** Tableau Rules from Stirling - Modal and Temporal Logics for CCS*
*** Constants
eq E P |= tt = true .
eq E P |= ff = false .
*** Double Negation
eq E P |= ~(~ Psi) = E P |= Psi .
*** Konjunktion
eq E P |= Phi /\ Psi = if E P |= Phi then E P |= Psi else false fi .
ceq E P |= ~(Psi /\ Phi) = true if E P |= ~ Psi .
ceq E P |= ~(Psi /\ Phi) = true if E P |= ~ Phi .
*** Disjunction
ceq E P |= Psi \/ Phi = true if E P |= Psi .
ceq E P |= Psi \/ Phi = true if E P |= Phi .
*** Box-Operator
eq E P |= [ K ] Phi = forall(E, succ(P, K), Phi) .
eq E P |= [[ K ]] Phi = forall(E, wsucc(P, K), Phi) .
eq E P |= [-] Phi = forall(E, succ(P), Phi) .
eq E P |= [[-]] Phi = forall(E, wsucc(P), Phi) .
*** Diamond-Operator
eq E P |= < K > Phi = exists(E, succ(P, K), Phi) .
eq E P |= << K >> Phi = exists(E, wsucc(P, K), Phi) .
eq E P |= <-> Phi = exists(E, succ(P), Phi) .
eq E P |= <<->> Phi = exists(E, wsucc(P), Phi) .
*** Auxiliary-Methods
eq forall(E, mt, Phi) = true .
eq forall(E, P ++ PS, Phi) = (E P |= Phi) and (forall(E, PS, Phi)) .
eq exists(E, mt, Phi) = false .
eq exists(E, P ++ PS, Phi) = (E P |= Phi) or (exists(E, PS, Phi)) .
*** Mu-Operator
eq {} K |= Mu X Phi = (X := false K Phi) K |= Phi .
ceq (E & (Y := b S Psi)) K |= Mu X Phi = E & (Y := b S Psi) & (X := false K Phi) K |= Phi if X =/= Y .
*** Nu-Operator
eq {} K |= Nu X Phi = (X := true K Phi) K |= Phi .
ceq E & (Y := b S Psi) K |= Nu X Phi = E & (Y := b S Psi) & (X := true K Phi) K |= Phi if X =/= Y .
***
ceq E & (X := b S Phi) K |= X = b if K isIn S .
ceq E & (X := b S Phi) K |= X = E & (X := b (K ++ S) Phi) K |= Phi if not (K isIn S) .
endfm
fmod MODAL-LOGIC is
protecting SUCC .
sort HMFormula .
ops tt ff : -> HMFormula .
ops _/\_ _\/_ : HMFormula HMFormula -> HMFormula .
ops <_>_ `[_`]_ : TermSet HMFormula -> HMFormula .
ops <<_>>_ `[`[_`]`]_ : TermSet HMFormula -> HMFormula .
ops forall exists : TermSet HMFormula -> Bool .
op _|=_ : Term HMFormula -> Bool .
var P : Term .
var K PS : TermSet .
vars Phi Psi : HMFormula .
eq P |= tt = true .
eq P |= ff = false .
eq P |= Phi /\ Psi = P |= Phi and P |= Psi .
eq P |= Phi \/ Psi = P |= Phi or P |= Psi .
eq P |= [ K ] Phi = forall(succ(P, K), Phi) .
eq P |= < K > Phi = exists(succ(P, K), Phi) .
eq forall(mt, Phi) = true .
eq forall(P ++ PS, Phi) = P |= Phi and forall(PS, Phi) .
eq exists(mt, Phi) = false .
eq exists(P ++ PS, Phi) = P |= Phi or exists(PS,Phi) .
eq P |= [[ K ]] Phi = forall(wsucc(P, K), Phi) .
eq P |= << K >> Phi = exists(wsucc(P, K), Phi) .
endfm
mod Dependency-Graph is
inc DeltaCCS-Set .
pr CCS .
sorts Tree TreeId .
op Tid(_) : ProcessId -> TreeId [frozen] .
--- A tree is the actual syntax tree
op :: : -> Tree .
op t(nil,_) : DeltaSet -> Tree .
op t(_,_,_) : Act Tree DeltaSet -> Tree .
op t(+,_,_,_) : Tree Tree DeltaSet -> Tree .
op t(|,_,_,_) : Tree Tree DeltaSet -> Tree .
op t(\_,_,_) : Label Tree DeltaSet -> Tree .
op t(_,_,_) : TreeId Tree DeltaSet -> Tree .
vars T T1 T2 DT : Tree .
vars A B : Act .
var L : Label .
vars P Q R : Process .
vars X Y Z : ProcessId .
var C C1 C2 : Context .
vars DD D1 D2 : DeltaSet .
var D : Delta .
op DG : -> Tree .
--- syntax converts a process into a syntax tree
op syntax : Process Context -> Tree [frozen] .
eq syntax( 0 , C ) = t( nil , empty ) .
eq syntax( A . P , C ) = t( A , syntax( P , C ) , empty ) .
eq syntax( P + Q , C ) = t( + , syntax( P , C ) , syntax( Q , C ) , empty ) .
eq syntax( P | Q , C ) = t( | , syntax( P , C ) , syntax( Q , C ) , empty ) .
eq syntax( P \ L , C ) = t( \ L , syntax( P , C ) , empty ) .
eq syntax( X , C ) = if ( X definedIn C )
then t( Tid(X) , :: , empty )
else t( Tid(X) , syntax( def( X , context ) , ( X =def 0 ) & C ) , empty)
fi .
--- by dg we obtain the dependency graph of the current context
op dg : ProcessId -> Tree [frozen] .
eq dg( X ) = syntax( X , cnil ) .
--- addition of deltas
op add_to_ : DeltaSet Tree -> Tree [frozen] .
eq add empty to T = T .
eq add D1 to :: = :: .
eq add D1 to t( nil , DD ) = if ( DD =/= empty ) then t( nil , D1 & DD ) else t( nil , D1 ) fi .
eq add D1 to t( A , T , DD ) = if ( DD =/= empty ) then t( A , T , D1 & DD ) else t( A , T , D1 ) fi .
eq add D1 to t( + , T1 , T2 , DD ) = if ( DD =/= empty ) then t( + , T1 , T2 , D1 & DD ) else t( + , T1 , T2 , D1 ) fi .
eq add D1 to t( | , T1 , T2 , DD ) = if ( DD =/= empty ) then t( | , T1 , T2 , D1 & DD ) else t( | , T1 , T2 , D1 ) fi .
eq add D1 to t( \ L , T , DD ) = if ( DD =/= empty) then t( \ L , T , D1 & DD ) else t( \ L , T , D1 ) fi .
eq add D1 to t( Tid(X) , T , DD ) = if ( DD =/= empty ) then t( Tid(X) , T , D1 & DD ) else t( Tid(X) , T , D1 ) fi .
--- remove unnecessary deltas
op $removen : ProcessId DeltaSet -> DeltaSet [frozen] .
eq $removen( X , (D & DD) ) = if ( getSourceId( D ) == X )
then D
else $removen( X , DD )
fi .
--- eq $removen( X , D ) = if ( getSourceId( D ) == X )
--- then D
--- else empty
--- fi .
eq $removen( X , empty ) = empty .
op removen : ProcessId DeltaSet -> DeltaSet [frozen] .
eq removen( X , DD ) = if ( DD =/= empty and getDeltasFor( X , DD ) == empty )
then DD
else $removen( X , DD )
fi .
crl t( nil , DD ) => t( nil , empty ) if DD =/= empty .
crl t( A , T , DD ) => t( A , add DD to T , empty ) if DD =/= empty .
crl t( + , T1 , T2 , DD ) => t( + , (add DD to T1) , (add DD to T2) , empty ) if DD =/= empty .
--- Parallel Congruence
--- crl t( | , T1 , T2 , D & DD ) => t( | , (add D to T1) , T2 , DD ) if (no getSourceId( D ) sub T2) .
--- crl t( | , T1 , T2 , D ) => t( | , (add D to T1) , T2 , empty ) if (no getSourceId( D ) sub T2) .
--- crl t( | , T1 , T2 , D & DD ) => t( | , T1 , (add D to T2) , DD ) if (no getSourceId( D ) sub T2) .
--- crl t( | , T1 , T2 , D ) => t( | , T1 , (add D to T2) , empty ) if (no getSourceId( D ) sub T2) .
crl t( | , T1 , T2 , DD ) => t( | , add DD to T1 , add DD to T2 , empty ) if DD =/= empty .
crl t( \ L , T , DD ) => t( \ L , (add DD to T) , empty ) if DD =/= empty .
--- ProcessId Congruence
crl t( Tid(X) , T , DD ) => t( Tid(X) , add DD to T , empty ) if DD =/= empty /\ getDeltasFor( X , DD ) == empty .
crl t( Tid(X) , T , DD ) => t( Tid(X) , T , removen( X , DD ) ) if DD =/= empty /\ removen( X , DD ) =/= DD .
op no_sub_ : ProcessId Tree -> Bool .
eq no X sub :: = true .
eq no X sub t( nil , DD ) = true .
eq no X sub t( Tid(Y) , T , DD ) = if ( X == Y ) then false else ( no X sub T ) .
eq no X sub t( A , T , DD ) = no X sub T .
eq no X sub t( + , T1 , T2 , DD ) = ( no X sub T1 ) and ( no X sub T2 ) .
eq no X sub t( | , T1 , T2 , DD ) = ( no X sub T1 ) and ( no X sub T2 ) .
eq no X sub t( \ L , T , DD ) = no X sub T .
endm
mod EXAMPLE is
inc DeltaCCS-Variant .
inc Dependency-Graph .
var AP : ActProcess .
var AVP : ActVProcess .
op Proc : -> VProcess .
op P : -> Process .
eq fm = True .
eq context = ( 'PC =def 'a . 'K | 'c . 'KK ) &
( 'K =def 'b . 'KK ) &
( 'KK =def 'c . 'KK ) &
( 'KKK =def 'd . 'KKK ) .
eq deltaSet = ( 'd1 =ddef ( 'K, True, 'KK ) & 'd2 =ddef ( 'KK, True, 'KKK ) ) .
eq Proc = [ 'PC , deltaSet ] .
op ds : -> DeltaSet .
eq ds = ( 'd1 =ddef ( 'K, True, 'KK ) & 'd2 =ddef ( 'KK, True, 'KKK ) ) .
eq DG = dg('PC) .
endm
red in EXAMPLE : DG .
---set trace on .
red in EXAMPLE : removen( 'K , deltaSet ) .
rew in EXAMPLE : add deltaSet to DG .
---red in EXAMPLE : removen('K , deltaSet) .
---red in mu-calculus : {} 'Proc.VProcess |= Nu X ( < ''a.Act ++ ''b.Act ++ ''c.Act ++ ''d.Act > tt ) /\ ( [ ''a.Act ++ ''b.Act ++ ''c.Act ++ ''d.Act ] X ) .
---red in mu-calculus : {} 'Proc.VProcess |= Nu X ( <-> tt ) /\ ( [-] X ) .
---reduce in Experiments : applySet deltaSet to 'K .
---search in Experiments : ('PC, empty) =>+ ADP .
---search in Experiments : ['PC] =>+ AP .
mod EXAMPLE is
inc DeltaCCS-Variant .
inc Dependency-Graph .
op Proc : -> VProcess .
ops CentralLockingSystem AutomaticLocking AutomaticPowerWindow SafetyFunction ControlAutomaticPowerWindow RemoteControlKey : -> Formula .
eq fm = True .
eq context = ( 'DAddAutoPWCLS%PW_dn =def ~ 'pw_but_up . 'PW_move_up + ~ 'cls_lock . 'PW_cls_dn_mv_up ) &
( 'CLS_unlocking =def 'cls_unlock . 'CLS_unlock ) &
( 'PW_fp_pend =def ~ 'fp_off . 'PW_pend_auto_stop_dn ) &
( 'car_driving_locked =def ~ 'door_open . 'car_unlocking ) &
( 'PW_move_dn =def 'pw_auto_mv_dn . 'PW_pend_auto_dn ) &
( 'DAddCLSAL%CLS_unlock =def ~ 'key_pos_lock . 'CLS_locking + ~ 'car_drives . 'car_driving_locking ) &
( 'PW_moved_dn =def 'pw_auto_mv_stop . 'PW_dn ) &
( 'RCK_pw_up =def 'pw_but_up . 'RCK_idle ) &
( 'CLS_lock =def ~ 'key_pos_unlock . 'CLS_unlocking ) &
( 'RCK_sf_pw_up =def 'pw_but_up . 'RCK_sf_on ) &
( 'PW_cls_up =def ~ 'cls_unlock . 'PW_up ) &
( 'PW_fp_stop =def 'pw_auto_mv_stop . 'PW_fp_pend ) &
( 'RCK_locking =def 'rck_lock . 'RCK_idle ) &
( 'CLS_locking =def 'cls_lock . 'CLS_lock ) &
( 'PW_fp_cls_stop =def 'pw_auto_mv_stop . 'PW_fp_cls_pend ) &
( 'PW_pend_auto_stop_up =def 'pw_auto_mv_up . 'PW_pend_auto_up ) &
( 'CLS_unlock =def ~ 'key_pos_lock . 'CLS_locking ) &
( 'PW_moved_up =def 'pw_auto_mv_stop . 'PW_up ) &
( 'DAddAutoPWCLS%PW_pend_auto_up =def ~ 'pw_pos_up . 'PW_moved_up + ~ 'pw_but_dn . 'PW_pend_auto_up_stop + ~ 'fp_on . 'PW_fp_stop + ~ 'cls_lock . 'PW_cls_pend_mv_up ) &
( 'DAddAutoPWCLS%PW_pend =def ~ 'pw_but_dn . 'PW_pend_auto_stop_dn + ~ 'pw_but_up . 'PW_pend_auto_stop_up + ~ 'cls_lock . 'PW_cls_mv_up ) &
( 'PW_pend_auto_up_stop =def 'pw_auto_mv_stop . 'PW_pend ) &
( 'PW_cls_mv_dn_stop =def 'pw_auto_mv_stop . 'PW_cls_mv_up ) &
( 'DAddRCKCAP%DAddRCKCSF%RCK_idle =def ~ 'rck_but_lock . 'RCK_locking + ~ 'pw_rm_up . 'RCK_pw_up + ~ 'pw_rm_dn . 'RCK_pw_dn + ~ 'rck_but_unlock . 'RCK_sf_unlocking ) &
( 'DAddAutoPWCLS%PW_pend_auto_dn =def ~ 'pw_pos_dn . 'PW_moved_dn + ~ 'pw_but_up . 'PW_pend_auto_dn_stop + ~ 'cls_lock . 'PW_cls_mv_dn_stop ) &
( 'RCK_unlocking =def 'rck_unlock . 'RCK_idle ) &
( 'car_driving_locking =def 'car_locked . 'car_driving_locked ) &
( 'PW_move_up =def 'pw_auto_mv_up . 'PW_pend_auto_up ) &
( 'RCK_sf_pw_dn =def 'pw_but_dn . 'RCK_sf_on ) &
( 'RCK_sf_unlock_idle =def ~ 'rck_but_lock . 'RCK_sf_locking ) &
( 'DAddCLSRCK%CLS_unlock =def ~ 'key_pos_lock . 'CLS_locking + ~ 'rck_lock . 'CLS_locking ) &
( 'RCK_idle =def ~ 'rck_but_lock . 'RCK_locking + ~ 'rck_but_unlock . 'RCK_unlocking ) &
( 'RCK_cap_sf_pw_dn =def 'pw_but_dn . 'RCK_sf_unlock_idle ) &
( 'PW_cls_moved_up =def 'pw_auto_mv_stop . 'PW_cls_up ) &
( 'PW_pend_auto_dn_stop =def 'pw_auto_mv_stop . 'PW_pend ) &
( 'PW_pend_auto_stop_dn =def 'pw_auto_mv_dn . 'PW_pend_auto_dn ) &
( 'PW_pend =def ~ 'pw_but_dn . 'PW_pend_auto_stop_dn + ~ 'pw_but_up . 'PW_pend_auto_stop_up ) &
( 'RCK_cap_sf_pw_up =def 'pw_but_up . 'RCK_sf_unlock_idle ) &
( 'RCK_sf_on =def ~ 'rck_but_lock . 'RCK_locking + ~ 'time_rck_sf_elapsed . 'RCK_locking + ~ 'door_open . 'RCK_sf_unlock_idle ) &
( 'RCK_sf_unlocking =def 'rck_unlock . 'RCK_sf_on ) &
( 'RCK_sf_locking =def 'rck_lock . 'RCK_idle ) &
( 'DAddRCKCSF%RCK_idle =def ~ 'rck_but_lock . 'RCK_locking + ~ 'rck_but_unlock . 'RCK_sf_unlocking ) &
( 'PW_up =def ~ 'pw_but_dn . 'PW_move_dn ) &
( 'RCK_pw_dn =def 'pw_but_dn . 'RCK_idle ) &
( 'DAddAutoPWCLS%PW_up =def ~ 'pw_but_dn . 'PW_move_dn + ~ 'cls_lock . 'PW_cls_up ) &
( 'DAddRCKCAPSF%RCK_sf_unlock_idle =def ~ 'rck_but_lock . 'RCK_sf_locking + ~ 'pw_rm_up . 'RCK_cap_sf_pw_up + ~ 'pw_rm_dn . 'RCK_cap_sf_pw_dn ) &
( 'DAddRCKCAP%RCK_idle =def ~ 'rck_but_lock . 'RCK_locking + ~ 'rck_but_unlock . 'RCK_unlocking + ~ 'pw_rm_up . 'RCK_pw_up + ~ 'pw_rm_dn . 'RCK_pw_dn ) &
( 'PW_cls_mv_up =def 'pw_auto_mv_up . 'PW_cls_pend_mv_up ) &
( 'DAddCLSAL%DAddCLSRCK%CLS_unlock =def ~ 'key_pos_lock . 'CLS_locking + ~ 'car_drives . 'car_driving_locking + ~ 'rck_lock . 'CLS_locking ) &
( 'DAddRCKCAPSF%RCK_sf_on =def ~ 'rck_but_lock . 'RCK_locking + ~ 'time_rck_sf_elapsed . 'RCK_locking + ~ 'door_open . 'RCK_sf_unlock_idle + ~ 'pw_rm_dn . 'RCK_sf_pw_dn + ~ 'pw_rm_up . 'RCK_sf_pw_up ) &
( 'PW_fp_cls_pend =def ~ 'cls_unlock . 'PW_fp_pend ) &
( 'PW_cls_pend_mv_up =def ~ 'pw_pos_up . 'PW_cls_moved_up + ~ 'cls_unlock . 'PW_pend_auto_up + ~ 'fp_on . 'PW_fp_cls_stop ) &
( 'car_unlocking =def 'car_unlocked . 'CLS_unlock ) &
( 'DAddAutoPWCLS%PW_fp_pend =def ~ 'fp_off . 'PW_pend_auto_stop_dn + ~ 'cls_lock . 'PW_fp_cls_pend ) &
( 'PW_pend_auto_dn =def ~ 'pw_pos_dn . 'PW_moved_dn + ~ 'pw_but_up . 'PW_pend_auto_dn_stop ) &
( 'DAddRCKCSF%RCK_unlocking =def ( ~ 'nil . 0 | 'nil . 0 ) \ 'nil ) &
( 'PW_cls_dn_mv_up =def 'pw_auto_mv_up . 'PW_cls_pend_mv_up ) &
( 'Root =def ( ( 'default . 'PW_up | 'default . 'CLS_unlock ) | 'default . 'RCK_idle ) ) &
( 'DAddCLSRCK%CLS_lock =def ~ 'key_pos_unlock . 'CLS_unlocking + ~ 'rck_unlock . 'CLS_unlocking ) &
( 'PW_dn =def ~ 'pw_but_up . 'PW_move_up ) &
( 'PW_pend_auto_up =def ~ 'pw_pos_up . 'PW_moved_up + ~ 'pw_but_dn . 'PW_pend_auto_up_stop + ~ 'fp_on . 'PW_fp_stop ) .
eq deltaSet =
'DAddAutoPWCLS =ddef ( 'PW_fp_pend , AutomaticPowerWindow /\ CentralLockingSystem , 'DAddAutoPWCLS%PW_fp_pend ) &
'DAddCLSRCK =ddef ( 'DAddCLSAL%CLS_unlock , CentralLockingSystem /\ RemoteControlKey , 'DAddCLSAL%DAddCLSRCK%CLS_unlock ) &
'DAddCLSRCK =ddef ( 'CLS_lock , CentralLockingSystem /\ RemoteControlKey , 'DAddCLSRCK%CLS_lock ) &
'DAddCLSRCK =ddef ( 'CLS_unlock , CentralLockingSystem /\ RemoteControlKey , 'DAddCLSRCK%CLS_unlock ) &
'DAddAutoPWCLS =ddef ( 'PW_pend , AutomaticPowerWindow /\ CentralLockingSystem , 'DAddAutoPWCLS%PW_pend ) &
'DAddAutoPWCLS =ddef ( 'PW_up , AutomaticPowerWindow /\ CentralLockingSystem , 'DAddAutoPWCLS%PW_up ) &
'DAddAutoPWCLS =ddef ( 'PW_pend_auto_dn , AutomaticPowerWindow /\ CentralLockingSystem , 'DAddAutoPWCLS%PW_pend_auto_dn ) &
'DAddAutoPWCLS =ddef ( 'PW_dn , AutomaticPowerWindow /\ CentralLockingSystem , 'DAddAutoPWCLS%PW_dn ) &
'DAddAutoPWCLS =ddef ( 'PW_pend_auto_up , AutomaticPowerWindow /\ CentralLockingSystem , 'DAddAutoPWCLS%PW_pend_auto_up ) .
eq Proc = [ ( ( 'Root ) \ 'cls_lock \ 'pw_but_dn \ 'rck_lock \ 'cls_unlock \ 'pw_but_up \ 'rck_unlock ) , deltaSet ] .
eq DG = add deltaSet to dg( 'Root ) .
---op DepG2 : -> Trees .
---eq DepG2 = tadd deltaSet to DepG .
endm
---set trace on .
rew in EXAMPLE : DG .