Hey there,
I find myself with some motivation to implement support for synthesis of temporal logics (e.g. SVA/PSL), at the beginning focusing on FV uses.
The algorithm I have selected after some research is the one proposed in [1]. It would allow simple addition of more operators later and provide a basis to expand from. Furthermore, it allows to push most of the hard verification algorithms (construction of automata) into the model checker.
My proposed structure for this implementation is:
- dedicated $temporal cell to store the formula
- formula stored as cell parameter in appropriate format (polish notation string of AST)
- → simple implementation/generation of temporal logic for frontends
- passes to prepare $temporal cells
- transformations of formulas (e.g. LTL’s NNF)
- marking of formulas for assert or assume as some algorithms might like to handle these internally, attaching assert/assume cells to the appropriate structures
- → reusability of code
- a single pass to perform the desired construction (temporal logic → circuit/transition system)
- easy expandability by simple addition of an algorithm as a new pass
- configurability
- different algorithms for different uses (e.g. alg A for FV, alg B for quick and dirty control circuit generation, …)
What are your thoughts on this structure?
The implementation of the selected algorithm I am very confident to be able to. However, I have not yet worked extensively with the yosys codebase (a small temporary tweak here and there to get something working, until I found a better way) and am still how to get a new cell into yosys (but i’m sure that it cannot possibly be that hard…).
The commit structure I have in mind would involve one PR for the $temporal cell, some preparation passes and the algorithm in [1] for basic LTL. A later PR’s would than add PLTL- and SERE-support to this algorithm respectively.
Any input/thoughts/pointers are greatly appreciated.
General overview LTL (I cannot give the exact equivalence for SVA/PSL operators):
- basic boolean operation
- and
- or
- not
- implication (
a -> b = !a | b) - equivalence
- temporal operators
- X (next;
X aholds iffaholds in the next cycle) - G (global;
G aholds iffaholds this and all following cycles) - F (future;
F aholds iffaholds now or some time in the future) - U (until;
a U bholds iffaholds up until the cyclebholds andF aholds) - some other versions of these which I will not get into detail
- X (next;
PLTL being LTL with additional temporal operators, which look into the past.
SERE covers the parts of SVA/PSL not covered by PLTL.
[1] Claessen, Koen, Niklas Een, and Baruch Sterin. “A circuit approach to LTL model checking.” 2013 Formal Methods in Computer-Aided Design. IEEE, 2013.