Mining specifications from execution traces presents an automated way of capturing characteristic system behaviors. However, existing approaches are largely restricted to Boolean abstractions of events, limiting their ability to express data-aware properties. In this paper, we extend mining procedures to operate over richer datatypes. We first establish candidate functions in our domain that cover the set of traces by leveraging Syntax Guided Synthesis (SyGuS) techniques. To capture these function applications temporally, we formalize the semantics of TSLf, a finite-prefix interpretation of Temporal Stream Logic (TSL) that extends LTLf with support for first-order predicates and functional updates. This allows us to unify a corresponding procedure for learning the data transformations and temporal specifications of a system. We demonstrate our approach synthesizing reactive programs from mined specifications on the OpenAI-Gymnasium ToyText environments, finding that our method is more robust and orders of magnitude more sample-efficient than passive learning baselines on generalized problem instances.
Figures & tables
Figure 1: FrozenLake [ 11 ] . Two positive (green) and two negative (red) traces.
Figure 3: Function discovery procedure. After choosing input-output pairs, the SyGuS solver determines unique functions for each constraint. Constraints are merged by their synthesized functions, at which point smaller constraint sets attempt to merge into larger ones, eliminating spurious functions.
Figure 4: Constructing well-formed TSL f traces. Having learned the functions of our system, we model a valid interpretation of system behavior. For the trace to be well-formed, each variable must only have one update (until the last timestep).
Figure 5: Full OpenAI-Gym ToyText [ 11 ] suite. We evaluate on generalized instances. Left to right: FrozenLake , CliffWalking , Taxi , and Blackjack .
Figure 6: FrozenLake varied configuration results. Specification mining is more sample-efficient and generalizes better than imitation learning baselines.
Method
Train
Test
4
8
12
16
20
50
100
500
1000
SpecMining(TSL f )
fixed
var_conf
24
42
50
50
50
-
-
-
-
var_conf
var_conf
45
50
50
50
50
-
-
-
-
fixed
var_size
24
50
50
50
50
-
-
-
-
var_size
var_size
42
50
50
50
50
-
-
-
-
Alergia(SMM)
fixed
var_conf
24
23
21
22
21
22
24
24
21
var_conf
var_conf
20
22
14
25
29
26
33
34
42
Table 1: FrozenLake win rates (out of 50 test instances). var_conf : fixed 4×4 board with varied hole/goal positions. var_size : 3×3 to 5×5 boards with varied positions. Columns show number of training samples.
Table 2: Unique specifications found by TSL f and LTL-BB on FrozenLake .
Method
Train
Test
4
8
12
16
20
50
100
200
500
1000
SpecMining(TSL f )
fixed
var_size
17
17
17
17
17
-
-
-
-
-
var_size
var_size
50
50
50
50
50
-
-
-
-
-
var_mov_fixed
var_size
17
17
17
17
17
-
-
-
-
-
var_mov_size
var_size
0
50
50
50
50
-
-
-
-
-
Alergia(SMM)
fixed
var_size
19
21
22
22
21
20
18
19
20
20
var_size
var_size
50
50
50
50
50
50
50
50
50
50
Table 3: CliffWalking win counts from training over fixed boards and varied board configurations. Test on 50 var_size instances (cliff height h∈[1,3] , board width w∈[3,12] , board length l∈[4,6] ).
Method
Liveness
Safety
TSL f
F((eqxgoalx)∧(eqygoaly))
G((eqxgoaly)∨((eqygoaly)→(eqxgoalx)))
G((eqxgoalx)∨((ltycliffHeight)→(eqxgoalx)))
LTL-BB
F(G((x_b0)∧(x_b1)))
G((XcliffHeight_b1)→((x_b0)∧(x_b1)))
F(G((x_b0)∧(x_b3)))
G((XcliffHeight_b1)→((x_b0)∧(x_b3)))
F(¬((Xx_b3)→(y_b1)))
G((XcliffHeight_b2)→(x_b3))
Table 4: Unique specifications found by TSL f and LTL-BB on CliffWalking .
Method
Train
Test
4
8
12
16
20
50
100
200
500
1000
SpecMining(TSL f )
fixed
var_pos
2
31
50
50
50
-
-
-
-
-
var_pos
var_pos
2
50
50
50
50
-
-
-
-
-
Alergia(SMM)
fixed
var_pos
14
19
5
14
17
14
17
17
23
19
var_pos
var_pos
27
27
23
18
23
29
32
28
30
31
BehavClon(NN)
fixed
var_pos
0
0
0
1
0
0
2
1
0
0
var_pos
var_pos
2
4
3
12
0
9
9
14
17
14
Table 5: Taxi win counts from training over fixed boards and varied board configurations. Test on 50 var_pos instances, varying the wall, passenger, and destinations positions. ∗ implies a dual-stage system with two baselines chained.
Table 6: Unique specifications mined by TSL f and LTL-BB on Taxi . LTL-BB mining times out for n≥12 .
Method
Strategy
4
8
12
16
20
SpecMining(TSL f )
Threshold
50 (22)
50 (22)
50 (22)
50 (22)
50 (22)
Conservative
50 (24)
40 (22)
50 (24)
50 (24)
50 (24)
Basic
44 (22)
44 (22)
50 (25)
50 (25)
50 (25)
Alergia(SMM)
Threshold
50 (22)
50 (22)
50 (22)
50 (22)
50 (22)
Conservative
50 (24)
50 (24)
50 (24)
50 (24)
50 (24)
Basic
44 (22)
50 (25)
50 (25)
50 (25)
50 (25)
Table 7: Strategy adherence (win rate) on Blackjack for different training set sizes on 50 instances. As strategy becomes more complex, win rates improve.
Table 8: Specifications mined by TSL f and LTL-BB on Blackjack . Legend: c = player card total, lo = 2, med = 6, sThresh = 17, sWeak = 12.
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
Game
Method
4
8
12
16
20
50
100
500
1000
FrozenLake
TSL f
3.1
2.2
3.0
3.8
5.0
–
–
–
–
Alergia
< .01
< .01
< .01
< .01
< .01
.02
.03
.18
.27
BehavClone
.23
.54
1.1
1.6
1.3
3.1
5.0
29
58
CART
< .01
< .01
< .01
< .01
< .01
< .01
< .01
.09
.13
CliffWalking
TSL f
14
8.9
9.8
12
11
–
–
–
–
Alergia
< .01
< .01
< .01
< .01
< .01
.05
.02
.09
.24
Appendix
Table 9: Training time (seconds) across all environments. Alergia and CART train in milliseconds; BehavClone scales linearly with n . TSL f requires 3–14s but achieves perfect generalization with 1–2 orders of magnitude fewer samples.
Linear Temporal Logic (LTL) specifies how properties should hold over sequences of events, enabling verification, monitoring, and synthesis of system behavior.
Automated mining of formal specifications is vital for verifying real-time systems. However, existing passive learning approaches remain restricted to deterministic specifications or limited fragments of Timed Regular Expressions (TRE). To our knowledge, this paper presents the first framework to tackle precise passive learning for an expressive timed logic, Metric Interval Temporal Logic (MITL) without relying on predefined templates or restricted logic fragments. Our approach formally reduces the timed learning problem into a scalable untimed one. By identifying quantitative timing differences between positive and negative traces, we synthesise precise timed constraints and inject them as new Boolean atomic propositions. This embeds timing into the alphabet, delegating the complex formula evaluation to highly optimised, off-the-shelf untimed LTL tools. Crucially, our framework is complete, guaranteeing a separating specification can always be found. We evaluate our implementation across several benchmarks, demonstrating the effectiveness of our approach.
Learning temporal logic specifications from system demonstrations is essential for tasks such as formal verification and controller synthesis, especially in safety-critical domains. Existing approaches typically assume demonstrations are correct or only affected by misclassification errors. In practice, however, system traces are often uncertain or incomplete due to sensor faults, measurement errors, or data loss. We present a framework for learning minimal Linear Temporal Logic (LTL) formulas from demonstrations with uncertainty. Our approach models uncertainty via Hamming distance to generate possible estimates around each observed trace, which are grouped with constraints requiring that at least one trace per group is consistent with the learned formula. Our problem is then reduced to an equivalent Pseudo-Boolean Optimization. We evaluate our method against state-of-the-art LTL learning approaches and show that it recovers specifications that more closely align with ground-truth formulas under uncertainty.
Several applications demand the timely detection of critical situations, such as threats to safety and transparency, over high-velocity streams of symbolic events. This demand has motivated the development of (i) event specification languages, which define composite events via temporal patterns over simpler events, and (ii) stream reasoning frameworks, evaluating patterns expressed in these languages. However, event specification languages are typically studied in isolation, complicating their comparison in terms of expressivity and obscuring the scope of their associated stream reasoners. To mitigate this issue, we map practical fragments of prominent event specification languages into Temporal Datalog->-, a temporal Datalog with stratified negation and no future dependencies. To support efficient stream reasoning over Temporal Datalog->-, we propose Streaming Trigger Graphs, an extension of a state-of-the-art technique for Datalog materialisation. Our approach yields a uniform composite event recognition mechanism that has the potential to generalise across a wide range of practical event specification languages.