traceforge 0.2.1

TraceForge is a model checker for concurrent and distributed programs written in Rust
Documentation
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
use traceforge::thread;
use traceforge::*;
use thread::ThreadId;
use SchedulePolicy::*;

const TEST_RUNS: u32 = 10;

// the "sem1/2/3_comp_" tests check the number of executions of program1 and program2 when strenghening the semantics

// Besides a first part where the main thread sends process ids to everyone (each receiver must acknowledge every message received so the order of thread id sends is preserved),
//      - actor_a sends a message to actor_m and then a message to actor_b
//      - actor_b receives the message from actor_a and then sends a message to actor_m
//      - main sends two messages to actor_m
fn program1() {
    let actor_m = thread::spawn(move || {
        // receiving the id of the main thread and sending an ACK message
        let tmain: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);

        // receives that determine the number of executions
        // under causal delivery and mailbox, all prefixes of length 3 of interleavings between [1;2] and [3;4] (messages 3 is causally-before 4)
        // under fifo, all prefixes of length 3 of interleavings between [1;2], [3], and [4]
        // under bag, all orders between 3 out of the 4 values {1,2,3,4}
        let _: i32 = traceforge::recv_msg_block();
        let _: i32 = traceforge::recv_msg_block();
        let _: i32 = traceforge::recv_msg_block();
    });
    let actor_a = thread::spawn(move || {
        // receiving the ids of the other threads, sending an ACK message for each receive
        // the last receive ensures that actor_a does not start sending important messages before actor_b received all thread ids
        let tmain: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let m: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let b: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let _: i32 = traceforge::recv_msg_block();

        // important messages
        traceforge::send_msg(m, 3);
        traceforge::send_msg(b, 5);
    });
    let actor_b = thread::spawn(move || {
        // receiving the ids of the other threads and sending an ACK message for each receive
        let tmain: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let m: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let _a: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);

        // important messages
        let _: i32 = traceforge::recv_msg_block();
        traceforge::send_msg(m, 4);
    });

    // sending thread ids: the additional sends/receives are needed in order to "separate" the phase of exchanging thread ids from the "important" part
    traceforge::send_msg(actor_m.thread().id(), thread::current().id());
    let _: i32 = traceforge::recv_msg_block();

    traceforge::send_msg(actor_a.thread().id(), thread::current().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_a.thread().id(), actor_m.thread().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_a.thread().id(), actor_b.thread().id());
    let _: i32 = traceforge::recv_msg_block();

    traceforge::send_msg(actor_b.thread().id(), thread::current().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_b.thread().id(), actor_m.thread().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_b.thread().id(), actor_a.thread().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_a.thread().id(), 0);

    // important messages
    traceforge::send_msg(actor_m.thread().id(), 1);
    traceforge::send_msg(actor_m.thread().id(), 2);
}

#[test]
fn sem1_comp_bag() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::Bag)
                .build(),
            program1,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        assert_eq!(stats.execs, 24); // all orders between 3 out of the 4 values {1,2,3,4}
    }
}

#[test]
fn sem1_comp_fifo() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::FIFO)
                .build(),
            program1,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        assert_eq!(stats.execs, 12); // all prefixes of length 3 of interleavings between [1;2], [3], and [4]
    }
}

#[test]
fn sem1_comp_causal() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::Causal)
                .build(),
            program1,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        assert_eq!(stats.execs, 6); // all prefixes of length 3 of interleavings between [1;2] and [3;4] (messages 3 is causally-before 4)
    }
}

#[test]
fn sem1_comp_mailbox() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::Mailbox)
                .build(),
            program1,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        assert_eq!(stats.execs, 6); // all prefixes of length 3 of interleavings between [1;2] and [3;4] (messages 3 is causally-before 4)
    }
}

// Like program1, except that the messages sent to actor_m by actor_a and actor_b are not anymore causally related, i.e., actor_a sends no message to actor_b
fn program2() {
    let actor_m = thread::spawn(move || {
        // receiving the id of the main thread and sending an ACK message
        let tmain: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);

        // receives that determine the number of executions
        // under mailbox, causal delivery, and fifo, all prefixes of length 3 of interleavings between [1;2], [3], and [4]
        // under bag, all orders between 3 out of the 4 values {1,2,3,4}
        let _: i32 = traceforge::recv_msg_block();
        let _: i32 = traceforge::recv_msg_block();
        let _: i32 = traceforge::recv_msg_block();
    });
    let actor_a = thread::spawn(move || {
        // receiving the ids of the other threads, sending an ACK message for each receive
        // the last receive ensures that actor_a does not start sending important messages before actor_b received all thread ids
        let tmain: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let m: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let _b: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let _: i32 = traceforge::recv_msg_block();

        // important messages
        traceforge::send_msg(m, 3);
    });
    let actor_b = thread::spawn(move || {
        // receiving the ids of the other threads and sending an ACK message for each receive
        let tmain: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let m: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let _a: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);

        // important messages
        traceforge::send_msg(m, 4);
    });

    // sending thread ids: the additional sends/receives are needed in order to "separate" the phase of exchanging thread ids from the "important" part
    traceforge::send_msg(actor_m.thread().id(), thread::current().id());
    let _: i32 = traceforge::recv_msg_block();

    traceforge::send_msg(actor_a.thread().id(), thread::current().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_a.thread().id(), actor_m.thread().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_a.thread().id(), actor_b.thread().id());
    let _: i32 = traceforge::recv_msg_block();

    traceforge::send_msg(actor_b.thread().id(), thread::current().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_b.thread().id(), actor_m.thread().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_b.thread().id(), actor_a.thread().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_a.thread().id(), 0);

    // important messages
    traceforge::send_msg(actor_m.thread().id(), 1);
    traceforge::send_msg(actor_m.thread().id(), 2);
}

#[test]
fn sem2_comp_bag() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::Bag)
                .build(),
            program2,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        assert_eq!(stats.execs, 24); // all orders between 3 out of the 4 values {1,2,3,4}
    }
}

#[test]
fn sem2_comp_fifo() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::FIFO)
                .build(),
            program2,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        assert_eq!(stats.execs, 12); // all prefixes of length 3 of interleavings between [1;2], [3], and [4]
    }
}

#[test]
fn sem2_comp_causal() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::Causal)
                .build(),
            program2,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        assert_eq!(stats.execs, 12); // all prefixes of length 3 of interleavings between [1;2], [3], and [4]
    }
}

#[test]
fn sem2_comp_mailbox() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::Causal)
                .build(),
            program2,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        assert_eq!(stats.execs, 12); // all prefixes of length 3 of interleavings between [1;2], [3], and [4]
    }
}

// the "sem3_comp..." tests check that program3 has the same number of executions under Mailbox, Causal, FIFO, and more executions under Bag

// Besides a first part where the main thread sends process ids to everyone,
//      - actor_a sends a message to actor_m and then a message to actor_b
//      - actor_b receives the message from actor_a and then sends a message to actor_m
//      - main sends two messages to actor_m
// Under causal delivery, actor_m should receive the message from actor_a before the one from actor_b, interleaved with the two messages from main
// Under peer-to-peer, any order is possible between the messages from actor_a and actor_b, and hence, the number of executions is larger
fn program3() {
    let actor_a = thread::spawn(move || {
        // receiving the messages from the main thread
        let _: i32 = traceforge::recv_msg_block();
        let _: i32 = traceforge::recv_msg_block();
        let _: i32 = traceforge::recv_msg_block();
    });

    // important messages
    traceforge::send_msg(actor_a.thread().id(), 1);
    traceforge::send_msg(actor_a.thread().id(), 2);
    traceforge::send_msg(actor_a.thread().id(), 3);
}

#[test]
fn sem3_comp_bag() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::Bag)
                .build(),
            program3,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        assert_eq!(stats.execs, 6); // all orders between 1, 2, 3
    }
}

#[test]
fn sem3_comp_fifo() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::FIFO)
                .build(),
            program3,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        assert_eq!(stats.execs, 1); // exactly the order 1,2,3
    }
}

#[test]
fn sem3_comp_causal() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::Causal)
                .build(),
            program3,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        assert_eq!(stats.execs, 1); // exactly the order 1,2,3
    }
}

#[test]
fn sem3_comp_mailbox() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::Mailbox)
                .build(),
            program3,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        assert_eq!(stats.execs, 1); // exactly the order 1,2,3
    }
}

// This reproduces the non mailbox execution from Fig 7(a) in "A Partial Order View of Message-Passing Communication Models" (POPL'23)
// Besides a first part where the main thread sends process ids to everyone (each receiver must acknowledge every message received so these messages do not mix with the important ones),
//      - main sends a message to actor_m and then one to actor_a
//      - actor_a receives two messages
//      - actor_b sends a message to actor_a and then one to actor_m
//      - actor_m receives two messages
// Under causal delivery, both actor_a and actor_m can receive messages in any order. 4 executions in total.
// Under mailbox, actor_a cannot receive from main and then actor_b while actor_m receives from actor_b and then main. 3 executions in total
fn program4() {
    let actor_m = thread::spawn(move || {
        // receiving the id of the main thread and sending an ACK message
        let tmain: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);

        // important receives
        let _: i32 = traceforge::recv_msg_block();
        let _: i32 = traceforge::recv_msg_block();
    });
    let actor_a = thread::spawn(move || {
        // receiving the ids of the other threads, sending an ACK message for each message
        let tmain: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let _m: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let _b: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);

        // important receives
        let _: i32 = traceforge::recv_msg_block();
        let _: i32 = traceforge::recv_msg_block();
    });
    let actor_b = thread::spawn(move || {
        // receiving the ids of the other threads and sending an ACK message
        let tmain: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let m: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let a: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);

        // important messages
        traceforge::send_msg(a, 3);
        traceforge::send_msg(m, 4);
    });

    // sending thread ids: the additional sends/receives are needed in order to "separate" the phase of exchanging thread ids from the "important" part
    traceforge::send_msg(actor_m.thread().id(), thread::current().id());
    let _: i32 = traceforge::recv_msg_block();

    traceforge::send_msg(actor_a.thread().id(), thread::current().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_a.thread().id(), actor_m.thread().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_a.thread().id(), actor_b.thread().id());
    let _: i32 = traceforge::recv_msg_block();

    traceforge::send_msg(actor_b.thread().id(), thread::current().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_b.thread().id(), actor_m.thread().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_b.thread().id(), actor_a.thread().id());
    let _: i32 = traceforge::recv_msg_block();

    // important messages
    traceforge::send_msg(actor_m.thread().id(), 1);
    traceforge::send_msg(actor_a.thread().id(), 2);
}

#[test]
fn mailbox1_mb() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::Mailbox)
                .build(),
            program4,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        assert_eq!(stats.execs, 3);
    }
}

#[test]
fn mailbox1_cd() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::Causal)
                .build(),
            program4,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        assert_eq!(stats.execs, 4);
    }
}

// Like program4, but with an assertion that checks a property which should be satisfied under mailbox but not causal.
// actor_a sends a message to main if it receives from main before actor_b
// actor_m sends a message to main if it receives from actor_b before main
// if main receives both messages if fails the assertion
fn program5() {
    let actor_m = thread::spawn(move || {
        // receiving the id of the main thread and sending an ACK message
        let tmain: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);

        // important receives
        let z: i32 = traceforge::recv_msg_block();
        let t: i32 = traceforge::recv_msg_block();

        if z > t {
            traceforge::send_msg(tmain, 5);
        }
    });
    let actor_a = thread::spawn(move || {
        // receiving the ids of the other threads, sending an ACK for each message
        let tmain: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let _m: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let _b: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);

        // important receives
        let x: i32 = traceforge::recv_msg_block();
        let y: i32 = traceforge::recv_msg_block();
        if x < y {
            traceforge::send_msg(tmain, 5);
        }
    });
    let actor_b = thread::spawn(move || {
        // receiving the ids of the other threads and sending an ACK for each message
        let tmain: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let m: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);
        let a: ThreadId = traceforge::recv_msg_block();
        traceforge::send_msg(tmain, 0);

        // important messages
        traceforge::send_msg(a, 3);
        traceforge::send_msg(m, 4);
    });

    // sending thread ids: the additional sends/receives are needed in order to "separate" the phase of exchanging thread ids from the "important" part
    traceforge::send_msg(actor_m.thread().id(), thread::current().id());
    let _: i32 = traceforge::recv_msg_block();

    traceforge::send_msg(actor_a.thread().id(), thread::current().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_a.thread().id(), actor_m.thread().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_a.thread().id(), actor_b.thread().id());
    let _: i32 = traceforge::recv_msg_block();

    traceforge::send_msg(actor_b.thread().id(), thread::current().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_b.thread().id(), actor_m.thread().id());
    let _: i32 = traceforge::recv_msg_block();
    traceforge::send_msg(actor_b.thread().id(), actor_a.thread().id());
    let _: i32 = traceforge::recv_msg_block();

    // important messages
    traceforge::send_msg(actor_m.thread().id(), 1);
    traceforge::send_msg(actor_a.thread().id(), 2);

    let _: i32 = traceforge::recv_msg_block();
    let _: i32 = traceforge::recv_msg_block();
    traceforge::assert(false);
}

#[test]
fn mailbox2_mb() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::Mailbox)
                .with_verbose(1)
                .build(),
            program5,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        // now the main can block and therefore we count both terminated and blocked executions
        assert_eq!(stats.execs + stats.block, 3); // the number of executions remains the same as for program1
    }
}

#[test]
#[should_panic(expected = "assertion failed")]
fn mailbox2_cd() {
    for _i in 0..TEST_RUNS {
        let stats = traceforge::verify(
            Config::builder()
                .with_policy(Arbitrary)
                .with_cons_type(ConsType::Causal)
                .build(),
            program5,
        );
        println!("Number of executions explored {}", stats.execs);
        println!("Number of blocked executions explored {}", stats.block);
        // now the main can block and therefore we count both terminated and blocked executions
        assert_eq!(stats.execs + stats.block, 5); // for the non-mailbox execution, main can receive the messages from actor_a and actor_m in two possible orders (the number of execution grows with 1)
    }
}