<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>FOSSIL: A Software Tool for the Formal Synthesis of Lyapunov Functions and Barrier Certificates using Neural Networks</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Alessandro Abate</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Daniele Ahmed</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alec Edwards</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mirco Giaccobe</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andrea Perufo</string-name>
        </contrib>
      </contrib-group>
      <abstract>
        <p>We propose an automatic and formally sound method for synthesising Lyapunov functions for the asymptotic stability, as well as Barrier certificates (or functions) for the safety analysis, of autonomous non-linear dynamics represented as systems of ordinary diferential equations. Typical methods are either analytical and require manual efort or are numerical but lack of formal soundness. Symbolic computational methods instead, give formal guarantees but are typically semi-automatic because they rely on the user to provide appropriate function templates. We propose a method that finds Lyapunov functions or Barrier certificates automaticallyusing machine learning-while also providing formal guarantees-using satisfiability modulo theories (SMT). We employ a counterexample-guided inductive synthesis (CEGIS) approach where a numerical learner and a symbolic verifier interact to construct provably correct Lyapunov neural networks (LNNs). The learner trains a neural network that seeks to satisfy given suficient criteria for asymptotic stability or safety over a set data points sampled from the state space; the verifier proves via SMT-solving that the criteria are satisfied over the specified domain or augments the data set with counterexamples. This work is bolstered by a software tool, FOSSIL [1]. The tool has two core contributions on synthesis-automation and soundness-both of which are attained by means of the inductive, counter-example-based method. This method exploits the flexibility of candidate functions generated by training neural network templates, the formal assertions provided by the verifier, and finally new procedures to ease the exchange of information between the two mentioned components. In particular, FOSSIL combines the neural network templates with an enhanced CEGIS loop, depicted in Figure 1. As input, the procedure requires both the dynamical system in question and the desired specification to certify: either stability-leading to Lyapunov function synthesis-or safety, requiring synthesis of a barrier certificate. The loop contains the fundamental components within CEGIS: namely a learner, previously specified as a neural network, while an SMT-solver</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Lyapunov functions</kwd>
        <kwd>Barrier Certificates</kwd>
        <kwd>Neural Networks</kwd>
        <kwd>SAT Modulo Theory</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>takes on the role of the verifier. In addition to these two base components, FOSSIL augments
the CEGIS architecture with two additional components, known as the translator and the
consolidator. The task of these intermediary components is described as follows.</p>
      <p>Firstly, the translator acts as an intermediary from the learner to the verifier by seeking to
convert the numerical neural network to a symbolic candidate solution. This process involves a
rounding operation on the corresponding weights matrices and biases of the neural network in
order to simplify the expressions passed to the verifier and aid the consequent verification step.
In contrast, the consolidator sits within the communication channel from verifier to learner
and seeks to augment any counterexample obtained by the verifier, so as the ‘consolidate’
the subsequent learning achieved by the learner. This is achieved with two key observations:
further counter-examples likely exist near that given by the SMT-solver, which can be found by
sampling from the state-space around this original point. Secondly, the functions provided to the
verifier as candidate solutions are almost-everywhere diferentiable, allowing for the traversing
of these functions using gradient ascent (or descent). This in turn obtains further states along
the candidate solution which invalidate the required conditions, and can be provided to the
learner for further training. The improved communication achieved using the enhanced CEGIS
loop aids both the robustness and speed of synthesis.</p>
      <p>The work presented builds on previous works involving the use of a counter-example guided
approach to synthesis of Lyapunov functions [2]; [3] then incorporates the use of neural network
templates for these functions before being to extended to the synthesis of barrier certificates in
[4].</p>
      <p>Out of
Loops</p>
    </sec>
    <sec id="sec-2">
      <title>System  ,</title>
    </sec>
    <sec id="sec-3">
      <title>Specificiation</title>
    </sec>
    <sec id="sec-4">
      <title>Learner</title>
    </sec>
    <sec id="sec-5">
      <title>Neural</title>
      <p>Network   ()</p>
    </sec>
    <sec id="sec-6">
      <title>Translator</title>
    </sec>
    <sec id="sec-7">
      <title>CEGIS</title>
      <p>cex+

()</p>
    </sec>
    <sec id="sec-8">
      <title>Consolidator</title>
      <p>cex</p>
    </sec>
    <sec id="sec-9">
      <title>Verifier</title>
      <p>
        valid
[2] D. Ahmed, A. Perufo, A. Abate, Automated and Sound Synthesis of Lyapunov Functions
with SMT Solvers, in: TACAS (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ), volume 12078 of LNCS, Springer, 2020, pp. 97–114.
[3] A. Abate, D. Ahmed, M. Giacobbe, A. Perufo, Formal Synthesis of Lyapunov Neural
      </p>
      <p>Networks, IEEE Control Systems Letters 5 (2021) 773–778.
[4] D. Ahmed, A. Perufo, A. Abate, Automated formal synthesis of neural barrier certificates
for dynamical models, in: TACAS, volume 12651 of LNCS, Springer, 2021, pp. 370–388.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Abate</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Ahmed</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Edwards</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Giacobbe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Perufo</surname>
          </string-name>
          ,
          <article-title>FOSSIL: A Software Tool for the Formal Synthesis of Lyapunov Functions and Barrier Certificates Using Neural Networks, Association for Computing Machinery</article-title>
          , New York, NY, USA,
          <year>2021</year>
          . URL: https://doi.org/10. 1145/3447928.3456646.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>