# Mining Road Traffic Rules with Signal Temporal Logic and Grammar-Based Genetic Programming
## 7 Conclusions and Future Work  
We have considered the case of monitoring and describing the behavior of traffic systems by means of Signal Temporal Logic (STL) formulas. Authoring these formulas is a hard task due to the necessity of knowing the system at hand and mastering language syntax. Automatically learning STL formulas would allow for the real-time monitoring of traffic systems with the result of improving safety and providing an explanation for the behaviors of autonomous agents. We endeavor to do so with the goal of learning formulas that describe the system at hand and are interpretable for a human.  
We proposed a methodology to learn STL formulas for real-world traffic trajectories; the trajectories are unlabeled, in the sense that there are no human-assigned labels discriminating between positive and negative behaviors. Since the STL language can be specified by means of grammar, we use a grammar-based evolutionary optimization algorithm to evolve STL formulas. We evaluate formulas against a fitness function that rewards those that tightly fit the pool of trajectories at hand.  
With an experimental campaign, we showed that our approach (1) learns formulas that tightly fit the pool of trajectories and (2) appears interpretable to a human due to its parsimony. We believe that, by applying our approach for inferring formulas describing road traffic in different conditions (e.g., different countries), one could systematically compare alternatives using formulas instead of raw data.  
In the future, we will extend our approach to supervised binary classification scenarios, i.e., scenarios in which trajectories come accompanied by human-assigned labels discriminating between positive and negative behaviors. We will also consider anomaly detection, in which only a subset of the positive trajectories is labeled and we want an STL classifier to correctly detect negative trajectories.  
Conceptualization, F.P., E.M. and L.N.; methodology, F.P., E.M. and L.N.; software, F.P., E.M. and L.N.; validation, F.P.; formal analysis, F.P., E.M. and L.N.; investigation, F.P., E.M. and L.N.; resources, not applicable; data curation, F.P.; writing--original draft preparation, F.P., E.M. and L.N.; writing--review and editing, F.P., E.M. and L.N.; visualization, F.P.; supervision, E.M. and L.N.; project administration, E.M.; funding acquisition, E.M. and L.N. All authors have read and agreed to the published version of the manuscript.  
The experimental evaluation of this work has been done on CINECA HPC cluster within the CINECA-University of Trieste agreement. F.P. was partially supported by a Google Faculty Research Award granted to E.M. L.N. was partially supported by the Austrian FWF projects ZK-35 and by the Italian PRIN project \"SEDUCE\" n. 2017 TWRCNB.  
Not applicable.  
The software for the experiments reported in this paper is publicly available at [[https://github.com/pigozzif/STLRulesEvolutionaryInferenceNoClass](https://github.com/pigozzif/STLRulesEvolutionaryInferenceNoClass)]([https://github.com/pigozzif/STLRulesEvolutionaryInferenceNoClass](https://github.com/pigozzif/STLRulesEvolutionaryInferenceNoClass)) (accessed on 1 November 2021). The data is publicly available and provided by [29].  
The authors declare no conflict of interest.