Package: ml2
ML2 is an open source Python library for machine learning research on mathematical and logical reasoning problems. The library includes the (re-)implementation of the research papersTeaching Temporal Logics to Neural NetworksandNeural Circuit Synthesis from Specification Patterns. So far, the focus of ML2 is on propositional and linear-time temporal logic (LTL) and transformer architectures. ML2 is actively developed atCISPA Helmholtz Center for Information Security.RequirementsDockerPython 3.8Note on Docker: For data generation, evaluation, and benchmarking ML2 uses a variety of research tools (e.g. SAT solvers, model checkers, and synthesis tools). For ease of use, each tool is encapsulated in a Docker container that is automatically pulled and started when the tool is needed. Thus, ML2 requires Docker to be installed and running.InstallationBefore installing ML2, please note the Docker requirement.From PyPIInstall ML2 from PyPI withpip install ml2.From SourceTo install ML2 from source, clone the git repo and install with pip as follows:gitclonehttps://github.com/reactive-systems/ml2.git&&\cdml2&&\pipinstall.For development pip install in editable mode and include the development dependencies as follows:pipinstall-e.[dev]Neural Circuit Synthesis (presented at NeurIPS 21)In this project, hierarchical Transformers were trained to synthesize hardware circuits directly out of high-level specifications in a temporal logic. The lack of sufficient amounts of training data was tackled with a method to generate large amounts of additional training data, i.e., pairs of specifications and circuits implementing them by mining common specification patterns from the annual synthesis competitionSYNTCOMP.TrainingTo train a hierarchical Transformer with default parameters:python-mml2.experiment.runconfigs/ltl-syn/neurips21/ht.jsonEvaluationTo evaluate a hierarchical Transformer trained on the circuit synthesis task:python-mml2.experiment.runconfigs/ltl-syn/neurips21/ht-sem-eval.json`Datasets and Data GenerationTo generate a dataset of specifications and AIGER circuits:python-mml2.ltl.ltl_syn.ltl_syn_data_gen_patterns--namedataset`How to Cite@inproceedings{neural_circuit_synthesis,
    author    ={Frederik Schmitt and Christopher Hahn and Markus N. Rabe and Bernd Finkbeiner},
    title     ={Neural Circuit Synthesis from Specification Patterns},
    booktitle ={Advances in Neural Information Processing Systems 34 Pre-proceedings},
    year      ={2021}url       ={https://proceedings.neurips.cc/paper/2021/hash/8230bea7d54bcdf99cdfe85cb07313d5-Abstract.html}}Teaching Temporal Logics to Neural Networks (presented at ICLR 21)In this project, Transformers were trained on the problem of finding a satisfying trace to a linear-time temporal logic (LTL) formula. While the training data was generated with classical solvers, providing only one of a possibly infinite number of solutions, the Transformers successfully generalized: while often deviating from the solutions found by the classical solver, they still predicted a correct solution to most formulas. Generalization was also demonstrated on larger formulas and formulas on which the classical solver timed out.TrainingTo train a Transformer with default parameters on the trace generation problem:python-mml2.experiment.runconfigs/ltl-strace/iclr21/t.jsonFor the propositional satisfiability experiment:python-mml2.experiment.runconfigs/prop-sat/iclr21/t.jsonEvaluationTo evaluate a Transformer trained on the trace generation problem:python-mml2.experiment.runconfigs/ltl-strace/iclr21/t-sem-eval.json`How to Cite@inproceedings{teaching_temporal_logics,
    title     ={Teaching Temporal Logics to Neural Networks},
    author    ={Christopher Hahn and Frederik Schmitt and Jens U. Kreber and Markus N. Rabe and Bernd Finkbeiner},
    booktitle ={International Conference on Learning Representations},
    year      ={2021},
    url       ={https://openreview.net/forum?id=dOcQK-f4byz}}