• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LearnLib / automatalib / 13138848026

04 Feb 2025 02:53PM UTC coverage: 92.108% (+2.2%) from 89.877%
13138848026

push

github

mtf90
[maven-release-plugin] prepare release automatalib-0.12.0

16609 of 18032 relevant lines covered (92.11%)

1.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

39.29
/util/src/main/java/net/automatalib/util/ts/copy/TSCopy.java
1
/* Copyright (C) 2013-2025 TU Dortmund University
2
 * This file is part of AutomataLib <https://automatalib.net>.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package net.automatalib.util.ts.copy;
17

18
import java.util.Collection;
19
import java.util.function.Function;
20
import java.util.function.Predicate;
21

22
import net.automatalib.automaton.Automaton;
23
import net.automatalib.automaton.MutableAutomaton;
24
import net.automatalib.automaton.UniversalAutomaton;
25
import net.automatalib.common.util.mapping.Mapping;
26
import net.automatalib.ts.TransitionPredicate;
27
import net.automatalib.ts.TransitionSystem;
28
import net.automatalib.ts.UniversalTransitionSystem;
29
import net.automatalib.util.automaton.predicate.TransitionPredicates;
30
import net.automatalib.util.ts.TS;
31
import net.automatalib.util.ts.traversal.TSTraversalMethod;
32

33
public final class TSCopy {
34

35
    private TSCopy() {
36
        // prevent instantiation
37
    }
38

39
    /**
40
     * Copies an {@link Automaton} to a {@link MutableAutomaton} with possibly heterogeneous input alphabets and state
41
     * and transition properties. State and transitions will not be filtered.
42
     *
43
     * @param method
44
     *         the traversal method to use
45
     * @param in
46
     *         the input transition system
47
     * @param limit
48
     *         the traversal limit, a value less than 0 means no limit
49
     * @param inputs
50
     *         the inputs to consider
51
     * @param out
52
     *         the output automaton
53
     * @param inputsMapping
54
     *         the transformation for input symbols
55
     * @param spMapping
56
     *         the function for obtaining state properties
57
     * @param tpMapping
58
     *         the function for obtaining transition properties
59
     * @param <S1>
60
     *         state type of the input transition system
61
     * @param <I1>
62
     *         input symbol type of the input transition system
63
     * @param <T1>
64
     *         transition type of the input transition system
65
     * @param <S2>
66
     *         state type of the output transition system
67
     * @param <I2>
68
     *         input symbol type of the output transition system
69
     * @param <SP2>
70
     *         state property type of the output transition system
71
     * @param <TP2>
72
     *         transition property type of the output transition system
73
     *
74
     * @return a mapping from old to new states
75
     */
76
    public static <S1, I1, T1, S2, I2, SP2, TP2> Mapping<S1, S2> rawCopy(TSTraversalMethod method,
77
                                                                         TransitionSystem<S1, ? super I1, T1> in,
78
                                                                         int limit,
79
                                                                         Collection<? extends I1> inputs,
80
                                                                         MutableAutomaton<S2, I2, ?, ? super SP2, ? super TP2> out,
81
                                                                         Function<? super I1, ? extends I2> inputsMapping,
82
                                                                         Function<? super S1, ? extends SP2> spMapping,
83
                                                                         Function<? super T1, ? extends TP2> tpMapping) {
84
        return rawCopy(method,
×
85
                       in,
86
                       limit,
87
                       inputs,
88
                       out,
89
                       inputsMapping,
90
                       spMapping,
91
                       tpMapping,
92
                       x -> true,
×
93
                       TransitionPredicates.alwaysTrue());
×
94
    }
95

96
    /**
97
     * Copies an {@link TransitionSystem} to a {@link MutableAutomaton} with possibly heterogeneous input alphabets and
98
     * state and transition properties.
99
     *
100
     * @param method
101
     *         the traversal method to use
102
     * @param in
103
     *         the input transition system
104
     * @param limit
105
     *         the traversal limit, a value less than 0 means no limit
106
     * @param inputs
107
     *         the inputs to consider
108
     * @param out
109
     *         the output automaton
110
     * @param inputsMapping
111
     *         the transformation for input symbols
112
     * @param spMapping
113
     *         the function for obtaining state properties
114
     * @param tpMapping
115
     *         the function for obtaining transition properties
116
     * @param stateFilter
117
     *         the filter predicate for states
118
     * @param transFilter
119
     *         the filter predicate for transitions
120
     * @param <S1>
121
     *         state type of the input transition system
122
     * @param <I1>
123
     *         input symbol type of the input transition system
124
     * @param <T1>
125
     *         transition type of the input transition system
126
     * @param <S2>
127
     *         state type of the output transition system
128
     * @param <I2>
129
     *         input symbol type of the output transition system
130
     * @param <SP2>
131
     *         state property type of the output transition system
132
     * @param <TP2>
133
     *         transition property type of the output transition system
134
     *
135
     * @return a mapping from old to new states
136
     */
137
    public static <S1, I1, T1, S2, I2, SP2, TP2> Mapping<S1, S2> rawCopy(TSTraversalMethod method,
138
                                                                         TransitionSystem<S1, ? super I1, T1> in,
139
                                                                         int limit,
140
                                                                         Collection<? extends I1> inputs,
141
                                                                         MutableAutomaton<S2, I2, ?, ? super SP2, ? super TP2> out,
142
                                                                         Function<? super I1, ? extends I2> inputsMapping,
143
                                                                         Function<? super S1, ? extends SP2> spMapping,
144
                                                                         Function<? super T1, ? extends TP2> tpMapping,
145
                                                                         Predicate<? super S1> stateFilter,
146
                                                                         TransitionPredicate<? super S1, ? super I1, ? super T1> transFilter) {
147
        TSCopyVisitor<S1, I1, T1, S2, I2, SP2, TP2> vis =
2✔
148
                new TSCopyVisitor<>(in, out, inputsMapping, spMapping, tpMapping, stateFilter, transFilter);
149

150
        method.traverse(in, limit, inputs, vis);
2✔
151
        return vis.getStateMapping();
2✔
152
    }
153

154
    /**
155
     * Copies an {@link Automaton} to a {@link MutableAutomaton} with a compatible input alphabet, but possibly
156
     * heterogeneous state and transition properties. States and transitions will not be filtered.
157
     *
158
     * @param method
159
     *         the traversal method to use
160
     * @param in
161
     *         the input transition system
162
     * @param limit
163
     *         the traversal limit, a value less than 0 means no limit
164
     * @param inputs
165
     *         the inputs to consider
166
     * @param out
167
     *         the output automaton
168
     * @param spMapping
169
     *         the function for obtaining state properties
170
     * @param tpMapping
171
     *         the function for obtaining transition properties
172
     * @param <S1>
173
     *         state type of the input transition system
174
     * @param <I1>
175
     *         input symbol type of the input transition system
176
     * @param <T1>
177
     *         transition type of the input transition system
178
     * @param <S2>
179
     *         state type of the output transition system
180
     * @param <SP2>
181
     *         state property type of the output transition system
182
     * @param <TP2>
183
     *         transition property type of the output transition system
184
     *
185
     * @return a mapping from old to new states
186
     */
187
    public static <S1, I1, T1, S2, SP2, TP2> Mapping<S1, S2> rawCopy(TSTraversalMethod method,
188
                                                                     TransitionSystem<S1, ? super I1, T1> in,
189
                                                                     int limit,
190
                                                                     Collection<? extends I1> inputs,
191
                                                                     MutableAutomaton<S2, I1, ?, SP2, TP2> out,
192
                                                                     Function<? super S1, ? extends SP2> spMapping,
193
                                                                     Function<? super T1, ? extends TP2> tpMapping) {
194
        return rawCopy(method,
×
195
                       in,
196
                       limit,
197
                       inputs,
198
                       out,
199
                       spMapping,
200
                       tpMapping,
201
                       x -> true,
×
202
                       TransitionPredicates.alwaysTrue());
×
203
    }
204

205
    /**
206
     * Copies an {@link Automaton} to a {@link MutableAutomaton} with a compatible input alphabet, but possibly
207
     * heterogeneous state and transition properties.
208
     *
209
     * @param method
210
     *         the traversal method to use
211
     * @param in
212
     *         the input transition system
213
     * @param limit
214
     *         the traversal limit, a value less than 0 means no limit
215
     * @param inputs
216
     *         the inputs to consider
217
     * @param out
218
     *         the output automaton
219
     * @param spMapping
220
     *         the function for obtaining state properties
221
     * @param tpMapping
222
     *         the function for obtaining transition properties
223
     * @param stateFilter
224
     *         the filter predicate for states
225
     * @param transFilter
226
     *         the filter predicate for transitions
227
     * @param <S1>
228
     *         state type of the input transition system
229
     * @param <I1>
230
     *         input symbol type of the input transition system
231
     * @param <T1>
232
     *         transition type of the input transition system
233
     * @param <S2>
234
     *         state type of the output transition system
235
     * @param <SP2>
236
     *         state property type of the output transition system
237
     * @param <TP2>
238
     *         transition property type of the output transition system
239
     *
240
     * @return a mapping from old to new states
241
     */
242
    public static <S1, I1, T1, S2, SP2, TP2> Mapping<S1, S2> rawCopy(TSTraversalMethod method,
243
                                                                     TransitionSystem<S1, ? super I1, T1> in,
244
                                                                     int limit,
245
                                                                     Collection<? extends I1> inputs,
246
                                                                     MutableAutomaton<S2, I1, ?, SP2, TP2> out,
247
                                                                     Function<? super S1, ? extends SP2> spMapping,
248
                                                                     Function<? super T1, ? extends TP2> tpMapping,
249
                                                                     Predicate<? super S1> stateFilter,
250
                                                                     TransitionPredicate<? super S1, ? super I1, ? super T1> transFilter) {
251
        return rawCopy(method,
×
252
                       in,
253
                       limit,
254
                       inputs,
255
                       out,
256
                       Function.identity(),
×
257
                       spMapping,
258
                       tpMapping,
259
                       stateFilter,
260
                       transFilter);
261
    }
262

263
    /**
264
     * Copies a {@link UniversalAutomaton} to a {@link MutableAutomaton} with possibly heterogeneous input alphabets and
265
     * state and transition properties. States and transitions will not be filtered
266
     *
267
     * @param method
268
     *         the traversal method to use
269
     * @param in
270
     *         the input transition system
271
     * @param limit
272
     *         the traversal limit, a value less than 0 means no limit
273
     * @param inputs
274
     *         the inputs to consider
275
     * @param out
276
     *         the output automaton
277
     * @param inputsMapping
278
     *         the transformation for input symbols
279
     * @param spTransform
280
     *         the transformation for state properties
281
     * @param tpTransform
282
     *         the transformation for transition properties
283
     * @param <S1>
284
     *         state type of the input transition system
285
     * @param <I1>
286
     *         input symbol type of the input transition system
287
     * @param <SP1>
288
     *         state property type of the input transition system
289
     * @param <TP1>
290
     *         transition property type of the input transition system
291
     * @param <S2>
292
     *         state type of the output transition system
293
     * @param <I2>
294
     *         input symbol type of the output transition system
295
     * @param <SP2>
296
     *         state property type of the output transition system
297
     * @param <TP2>
298
     *         transition property type of the output transition system
299
     *
300
     * @return a mapping from old to new states
301
     */
302
    public static <S1, I1, SP1, TP1, S2, I2, SP2, TP2> Mapping<S1, S2> copy(TSTraversalMethod method,
303
                                                                            UniversalTransitionSystem<S1, ? super I1, ?, ? extends SP1, ? extends TP1> in,
304
                                                                            int limit,
305
                                                                            Collection<? extends I1> inputs,
306
                                                                            MutableAutomaton<S2, I2, ?, ? super SP2, ? super TP2> out,
307
                                                                            Function<? super I1, ? extends I2> inputsMapping,
308
                                                                            Function<? super SP1, ? extends SP2> spTransform,
309
                                                                            Function<? super TP1, ? extends TP2> tpTransform) {
310
        return copy(method,
×
311
                    in,
312
                    limit,
313
                    inputs,
314
                    out,
315
                    inputsMapping,
316
                    spTransform,
317
                    tpTransform,
318
                    x -> true,
×
319
                    TransitionPredicates.alwaysTrue());
×
320
    }
321

322
    /**
323
     * Copies a {@link UniversalAutomaton} to a {@link MutableAutomaton} with possibly heterogeneous input alphabets and
324
     * state and transition properties.
325
     *
326
     * @param method
327
     *         the traversal method to use
328
     * @param in
329
     *         the input transition system
330
     * @param limit
331
     *         the traversal limit, a value less than 0 means no limit
332
     * @param inputs
333
     *         the inputs to consider
334
     * @param out
335
     *         the output automaton
336
     * @param inputsMapping
337
     *         the transformation for input symbols
338
     * @param spTransform
339
     *         the transformation for state properties
340
     * @param tpTransform
341
     *         the transformation for transition properties
342
     * @param stateFilter
343
     *         the filter predicate for states
344
     * @param transFilter
345
     *         the filter predicate for transitions
346
     * @param <S1>
347
     *         state type of the input transition system
348
     * @param <I1>
349
     *         input symbol type of the input transition system
350
     * @param <T1>
351
     *         transition type of the input transition system
352
     * @param <SP1>
353
     *         state property type of the input transition system
354
     * @param <TP1>
355
     *         transition property type of the input transition system
356
     * @param <S2>
357
     *         state type of the output transition system
358
     * @param <I2>
359
     *         input symbol type of the output transition system
360
     * @param <SP2>
361
     *         state property type of the output transition system
362
     * @param <TP2>
363
     *         transition property type of the output transition system
364
     *
365
     * @return a mapping from old to new states
366
     */
367
    public static <S1, I1, T1, SP1, TP1, S2, I2, SP2, TP2> Mapping<S1, S2> copy(TSTraversalMethod method,
368
                                                                                UniversalTransitionSystem<S1, ? super I1, T1, ? extends SP1, ? extends TP1> in,
369
                                                                                int limit,
370
                                                                                Collection<? extends I1> inputs,
371
                                                                                MutableAutomaton<S2, I2, ?, ? super SP2, ? super TP2> out,
372
                                                                                Function<? super I1, ? extends I2> inputsMapping,
373
                                                                                Function<? super SP1, ? extends SP2> spTransform,
374
                                                                                Function<? super TP1, ? extends TP2> tpTransform,
375
                                                                                Predicate<? super S1> stateFilter,
376
                                                                                TransitionPredicate<? super S1, ? super I1, ? super T1> transFilter) {
377
        Function<? super S1, ? extends SP2> spMapping = TS.stateProperties(in).andThen(spTransform);
2✔
378
        Function<? super T1, ? extends TP2> tpMapping = TS.transitionProperties(in).andThen(tpTransform);
2✔
379
        return rawCopy(method, in, limit, inputs, out, inputsMapping, spMapping, tpMapping, stateFilter, transFilter);
2✔
380
    }
381

382
    /**
383
     * Copies a {@link UniversalAutomaton} to a {@link MutableAutomaton} with compatible input alphabets, but possibly
384
     * heterogeneous properties. States and transitions will not be filtered.
385
     *
386
     * @param method
387
     *         the traversal method to use
388
     * @param in
389
     *         the input transition system
390
     * @param limit
391
     *         the traversal limit, a value less than 0 means no limit
392
     * @param inputs
393
     *         the inputs to consider
394
     * @param out
395
     *         the output automaton
396
     * @param spTransform
397
     *         the transformation for state properties
398
     * @param tpTransform
399
     *         the transformation for transition properties
400
     * @param <S1>
401
     *         state type of the input transition system
402
     * @param <I1>
403
     *         input symbol type of the input transition system
404
     * @param <SP1>
405
     *         state property type of the input transition system
406
     * @param <TP1>
407
     *         transition property type of the input transition system
408
     * @param <S2>
409
     *         state type of the output transition system
410
     * @param <SP2>
411
     *         state property type of the output transition system
412
     * @param <TP2>
413
     *         transition property type of the output transition system
414
     *
415
     * @return a mapping from old to new states
416
     */
417
    public static <S1, I1, SP1, TP1, S2, SP2, TP2> Mapping<S1, S2> copy(TSTraversalMethod method,
418
                                                                        UniversalTransitionSystem<S1, ? super I1, ?, ? extends SP1, ? extends TP1> in,
419
                                                                        int limit,
420
                                                                        Collection<? extends I1> inputs,
421
                                                                        MutableAutomaton<S2, I1, ?, ? super SP2, ? super TP2> out,
422
                                                                        Function<? super SP1, ? extends SP2> spTransform,
423
                                                                        Function<? super TP1, ? extends TP2> tpTransform) {
424
        return copy(method,
×
425
                    in,
426
                    limit,
427
                    inputs,
428
                    out,
429
                    spTransform,
430
                    tpTransform,
431
                    x -> true,
×
432
                    TransitionPredicates.alwaysTrue());
×
433
    }
434

435
    /**
436
     * Copies a {@link UniversalAutomaton} to a {@link MutableAutomaton} with compatible input alphabets, but possibly
437
     * heterogeneous properties.
438
     *
439
     * @param method
440
     *         the traversal method to use
441
     * @param in
442
     *         the input transition system
443
     * @param limit
444
     *         the traversal limit, a value less than 0 means no limit
445
     * @param inputs
446
     *         the inputs to consider
447
     * @param out
448
     *         the output automaton
449
     * @param spTransform
450
     *         the transformation for state properties
451
     * @param tpTransform
452
     *         the transformation for transition properties
453
     * @param stateFilter
454
     *         the filter predicate for states
455
     * @param transFilter
456
     *         the filter predicate for transitions
457
     * @param <S1>
458
     *         state type of the input transition system
459
     * @param <I1>
460
     *         input symbol type of the input transition system
461
     * @param <T1>
462
     *         transition type of the input transition system
463
     * @param <SP1>
464
     *         state property type of the input transition system
465
     * @param <TP1>
466
     *         transition property type of the input transition system
467
     * @param <S2>
468
     *         state type of the output transition system
469
     * @param <SP2>
470
     *         state property type of the output transition system
471
     * @param <TP2>
472
     *         transition property type of the output transition system
473
     *
474
     * @return a mapping from old to new states
475
     */
476
    public static <S1, I1, T1, SP1, TP1, S2, SP2, TP2> Mapping<S1, S2> copy(TSTraversalMethod method,
477
                                                                            UniversalTransitionSystem<S1, ? super I1, T1, ? extends SP1, ? extends TP1> in,
478
                                                                            int limit,
479
                                                                            Collection<? extends I1> inputs,
480
                                                                            MutableAutomaton<S2, I1, ?, ? super SP2, ? super TP2> out,
481
                                                                            Function<? super SP1, ? extends SP2> spTransform,
482
                                                                            Function<? super TP1, ? extends TP2> tpTransform,
483
                                                                            Predicate<? super S1> stateFilter,
484
                                                                            TransitionPredicate<? super S1, ? super I1, ? super T1> transFilter) {
485
        return copy(method,
×
486
                    in,
487
                    limit,
488
                    inputs,
489
                    out,
490
                    Function.identity(),
×
491
                    spTransform,
492
                    tpTransform,
493
                    stateFilter,
494
                    transFilter);
495
    }
496

497
    /**
498
     * Copies a {@link UniversalAutomaton} with possibly heterogeneous input alphabets, but compatible properties.
499
     * States and transitions will not be filtered
500
     *
501
     * @param method
502
     *         the traversal method to use
503
     * @param in
504
     *         the input transition system
505
     * @param limit
506
     *         the traversal limit, a value less than 0 means no limit
507
     * @param inputs
508
     *         the inputs to consider
509
     * @param out
510
     *         the output automaton
511
     * @param inputsMapping
512
     *         a mapping from inputs in the input automaton to inputs in the output automaton
513
     * @param <S1>
514
     *         state type of the input transition system
515
     * @param <I1>
516
     *         input symbol type of the input transition system
517
     * @param <SP1>
518
     *         state property type of the input transition system
519
     * @param <TP1>
520
     *         transition property type of the input transition system
521
     * @param <S2>
522
     *         state type of the output transition system
523
     * @param <I2>
524
     *         input symbol type of the output transition system
525
     *
526
     * @return a mapping from old to new states
527
     */
528
    public static <S1, I1, SP1, TP1, S2, I2> Mapping<S1, S2> copy(TSTraversalMethod method,
529
                                                                  UniversalTransitionSystem<S1, ? super I1, ?, ? extends SP1, ? extends TP1> in,
530
                                                                  int limit,
531
                                                                  Collection<? extends I1> inputs,
532
                                                                  MutableAutomaton<S2, I2, ?, ? super SP1, ? super TP1> out,
533
                                                                  Function<? super I1, ? extends I2> inputsMapping) {
534
        return copy(method, in, limit, inputs, out, inputsMapping, x -> true, TransitionPredicates.alwaysTrue());
×
535
    }
536

537
    /**
538
     * Copies a {@link UniversalAutomaton} with possibly heterogeneous input alphabets, but compatible properties.
539
     *
540
     * @param method
541
     *         the traversal method to use
542
     * @param in
543
     *         the input transition system
544
     * @param limit
545
     *         the traversal limit, a value less than 0 means no limit
546
     * @param inputs
547
     *         the inputs to consider
548
     * @param out
549
     *         the output automaton
550
     * @param inputsMapping
551
     *         the transformation for input symbols
552
     * @param stateFilter
553
     *         the filter predicate for states
554
     * @param transFilter
555
     *         the filter predicate for transitions
556
     * @param <S1>
557
     *         state type of the input transition system
558
     * @param <I1>
559
     *         input symbol type of the input transition system
560
     * @param <T1>
561
     *         transition type of the input transition system
562
     * @param <SP1>
563
     *         state property type of the input transition system
564
     * @param <TP1>
565
     *         transition property type of the input transition system
566
     * @param <S2>
567
     *         state type of the output transition system
568
     * @param <I2>
569
     *         input symbol type of the output transition system
570
     *
571
     * @return a mapping from old to new states
572
     */
573
    public static <S1, I1, T1, SP1, TP1, S2, I2> Mapping<S1, S2> copy(TSTraversalMethod method,
574
                                                                      UniversalTransitionSystem<S1, ? super I1, T1, ? extends SP1, ? extends TP1> in,
575
                                                                      int limit,
576
                                                                      Collection<? extends I1> inputs,
577
                                                                      MutableAutomaton<S2, I2, ?, ? super SP1, ? super TP1> out,
578
                                                                      Function<? super I1, ? extends I2> inputsMapping,
579
                                                                      Predicate<? super S1> stateFilter,
580
                                                                      TransitionPredicate<? super S1, ? super I1, ? super T1> transFilter) {
581
        return copy(method,
2✔
582
                    in,
583
                    limit,
584
                    inputs,
585
                    out,
586
                    inputsMapping,
587
                    Function.identity(),
2✔
588
                    Function.identity(),
2✔
589
                    stateFilter,
590
                    transFilter);
591
    }
592

593
    /**
594
     * Copies a {@link UniversalAutomaton} with compatible input alphabets and properties. States and transitions will
595
     * not be filtered.
596
     *
597
     * @param method
598
     *         the traversal method to use
599
     * @param in
600
     *         the input transition system
601
     * @param limit
602
     *         the traversal limit, a value less than 0 means no limit
603
     * @param inputs
604
     *         the inputs to consider
605
     * @param out
606
     *         the output automaton
607
     * @param <S1>
608
     *         state type of the input transition system
609
     * @param <I1>
610
     *         input symbol type of the input transition system
611
     * @param <SP1>
612
     *         state property type of the input transition system
613
     * @param <TP1>
614
     *         transition property type of the input transition system
615
     * @param <S2>
616
     *         state type of the output transition system
617
     *
618
     * @return a mapping from old to new states.
619
     */
620
    public static <S1, I1, SP1, TP1, S2> Mapping<S1, S2> copy(TSTraversalMethod method,
621
                                                              UniversalTransitionSystem<S1, ? super I1, ?, ? extends SP1, ? extends TP1> in,
622
                                                              int limit,
623
                                                              Collection<? extends I1> inputs,
624
                                                              MutableAutomaton<S2, I1, ?, ? super SP1, ? super TP1> out) {
625
        return copy(method, in, limit, inputs, out, x -> true, TransitionPredicates.alwaysTrue());
2✔
626
    }
627

628
    /**
629
     * Copies a {@link UniversalAutomaton} with compatible input alphabets and properties.
630
     *
631
     * @param method
632
     *         the traversal method to use
633
     * @param in
634
     *         the input transition system
635
     * @param limit
636
     *         the traversal limit, a value less than 0 means no limit
637
     * @param inputs
638
     *         the inputs to consider
639
     * @param out
640
     *         the output automaton
641
     * @param stateFilter
642
     *         the filter predicate for states
643
     * @param transFilter
644
     *         the filter predicate for transitions
645
     * @param <S1>
646
     *         state type of the input transition system
647
     * @param <I1>
648
     *         input symbol type of the input transition system
649
     * @param <T1>
650
     *         transition type of the input transition system
651
     * @param <SP1>
652
     *         state property type of the input transition system
653
     * @param <TP1>
654
     *         transition property type of the input transition system
655
     * @param <S2>
656
     *         state type of the output transition system
657
     *
658
     * @return a mapping from old to new states
659
     */
660
    public static <S1, I1, T1, SP1, TP1, S2> Mapping<S1, S2> copy(TSTraversalMethod method,
661
                                                                  UniversalTransitionSystem<S1, ? super I1, T1, ? extends SP1, ? extends TP1> in,
662
                                                                  int limit,
663
                                                                  Collection<? extends I1> inputs,
664
                                                                  MutableAutomaton<S2, I1, ?, ? super SP1, ? super TP1> out,
665
                                                                  Predicate<? super S1> stateFilter,
666
                                                                  TransitionPredicate<? super S1, ? super I1, ? super T1> transFilter) {
667
        return copy(method, in, limit, inputs, out, Function.identity(), stateFilter, transFilter);
2✔
668
    }
669

670
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc