<!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>
      <journal-title-group>
        <journal-title>Workshop on Artificial Intelligence and Formal Verification, Logic, Automata, and Synthesis,
September</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Automated Planning Through Program Verification</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Salvatore La Torre</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gennaro Parlato</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Molise</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Salerno</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2021</year>
      </pub-date>
      <volume>22</volume>
      <issue>2021</issue>
      <fpage>0000</fpage>
      <lpage>0002</lpage>
      <abstract>
        <p>In this paper, we report on a preliminary study on the feasibility of applying techniques and tools for finding errors in programs, or prove them entirely correct, to efectively explore the large state space of instances of the automated planning problem (AP). To leverage the recent advancements in the symbolic program analysis, we design a simple reduction from AP to the configuration reachability problem of programs and then use of-the-shelf program verification tools. We evaluate the feasibility of our approach on the Agricola-sat18 benchmark used at IPC'18.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Automated Planning</kwd>
        <kwd>Formal Methods</kwd>
        <kwd>Program Verification</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        The automated planning problem is a central problem in AI which concerns with the search
and the synthesis of a sequence of actions aimed to reach a given goal. It is a complex and
wellstudied problem, and in the years several eficient solutions have been proposed in the literature
to solve it. These include direct approaches such as forward or backward chain searches and
partial order scheduling [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Other solutions consist of reducing it to other problems for which
scalable and efective solutions exist, such as Boolean formula satisfiability (SAT) or model
checking [
        <xref ref-type="bibr" rid="ref2 ref3">2, 3</xref>
        ].
      </p>
      <p>
        In this paper, we expand this arsenal of solutions by contributing another reduction, this time
to the program verification problem. Given an instance of the planning problem, we construct a
simple imperative program that nondeterministically simulates a sequence of actions starting
from an initial state that fails an assertion whenever a target state is reached (see [
        <xref ref-type="bibr" rid="ref4 ref5 ref6 ref7 ref8 ref9">4, 5, 6, 7, 8, 9</xref>
        ]
for similar approaches in other domains). This type of reduction, although simple, opens up the
possibility of using of-the-shelf automatic techniques and tools designed to verify programs in
order to synthesise plans. These include approaches such as Bounded Model Checking (BMC),
Abstract Interpretation, Counter-example Guided Abstraction Refinement, to name a few (see
[
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]). The programs produced through our reduction have a very particular form that we think
could be exploited to refine and then specialise these approaches and techniques to work well
for this class of noncanonical programs.
      </p>
      <p>We begin our study following this direction, exploring the possibility of using BMC-based
techniques in a simple way. We apply our approach to some benchmarks taken from the
planning competition to demonstrate its feasibility. We leave for future investigations the
possibility of exploiting other program verification techniques and tools.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Preliminaries</title>
      <p>The planning problem is essentially a search problem over instance ::= domain problem
the states of a transition system, a set of states along with a domain ::= (define (domain id )
set of actions that can change the current system state. Thus, ((::cpornesdtiacnattsesidplliisstt))
given a set of states  and a set of actions  over them, the actions )
planning problem simply asks whether there is a sequence actions ::= (aactcitoinosnacidtions |
of actions from  that starting from an initial state take the (:parameters parlist )
system to a state in a goal set . ((::perfefceoctndibt)ion b ) )</p>
      <p>To express the planning problem instances, we consider problem ::= (define (problem id )
a simple PDDL-like language. The syntax is given in Figure (:domain id )
1. Here, an instance is composed of a domain and a problem. ((::ionbijtectastlisitd)list )
The domain part essentially identifies the transition system by (:goal b ) )
defining the possible states through a set of Boolean predicates Figure 1: Planning language.
and constants, and a set of actions. Each action is defined over
a list of parameters (that can assume the values of the given constants) and has a precondition
and an efect with the meaning that an action can be taken on each state where the precondition
holds and when taken, produces the change of the truth values of the predicates as described in
the efect part. The problem part instead completes the domain with more constants (object part),
and gives the initial values for the predicates (identifying the initial state) and the condition
that must old for the goal states.</p>
      <p>The syntax allowed for the preconditions and goals may vary depending on the specific
planning language. Also, constants and objects may be typed, and functions that manipulate
numeric types can be added. To keep the presentation simple here we limit to conditions that are
just conjunctions of positive and negative atoms, and omit functions and types. However, these
features and more complex conditions can be easily included in our code-to-code transformation.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Reduction to program verification: code-to-code translation</title>
      <p>In this section, we describe the code-to-code translation that is the main part of our reduction.
Instead of giving the formal translation we illustrate it by an example. For this we will use a
classical and well-known planning domain, the so-called blocks world.</p>
      <p>Example: blocks world. The blocks world domain consists of a set of cube-shaped blocks
sitting on a table. The blocks can be piled up such that only one block can fit directly on top of
another. A robot can pick up a block that is not below other ones (top) and move it to another
position, either on the table or on top of another block. In this domain, both the initial state and
the goal may consist of one or more piles of blocks.
Code-to-code translation. To illustrate our
codeto-code translation, we refer to the example shown proc move()
in Figure 2 (a). We use a simple imperative pro- bebg=irnand; x=rand; y=rand;
gramming language (such as that of the analyzer if (Clear[y] and Clear[b] and On[b,x])
ConcurInterproc: http://pop-art.inrialpes.fr/interproc/ theCnlear[x] = true; Clear[y] = false;
concurinterprocweb.cgi). The program is shown in On[b,y] = true; On[b,x] = false;
Figure 2 (b). We use scalar variables or arrays with end
global scope to encode predicates. We initialize these proc moveToTable() var b:obj, x:obj;
variables using the expression initial derived from bebg=irnand; x=rand;
the init component of the problem definition. The ac- if (On[b,x] and Clear[b]) then
tions are each modelled with a procedure of the same COlne[abr,[txa]ble] == ttrruuee;;
name. Here we declare a number of local variables On[b,x] = false;
that model the parameters. These variables are ini- end
tialized with a non deterministic value taken from the begin //main procedure
domain of the variables using the expression rand. To whiifl(ebr(atnrdu)e)then move(); endif;
simulate the action we first check that the guessed if (brand) then moveToTable(); endif;
values make the precondition evaluate to true, and if endasser/t/(fnaoitl Oinf[Ag,oBa]l ocronnfotisOnr[eBa,cCh]e)d;
so we update the arrays modelling the predicates with (b) Program encoding
a sequence of assignments derived from the effect
of the action. The simulation is then orchestrated by
the main procedure: it goes through an infinite loop
whose body is crafted to simulate all actions in a
nondeterministic way. The body also contains an assertion whose condition corresponds to the
negation of the goal condition of the problem. Thus, to synthesise a plan we check whether the
program fails this assertion. If so, by inspecting the counterexample we are able to construct a
plan by listing the actions simulated along the counterexample. Of course, an instance of the
planning problem that does not admit a plan leads to a program that is actually correct, that is,
a program that has no executions leading to an assertion violation.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Implementation and experiments</title>
      <p>To evaluate our approach, we implemented it into a prototype tool and conducted some
preliminary experiments on the Agricola-sat18 benchmark taken from the 9th International Planning
Competition (IPC’18) held at ICAPS 2018.</p>
      <p>
        Prototype tool. Our tool is a code-to-code translation from PDDL planning instances to C
programs. It is entirely written in python (version 3.8) and relies on the library pddlpy [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] to
parse the PDDL instances. pddlpy provides a convenient API to extract the diferent kinds of
elements of PDDL domains and problems.We have also extended the API of pddlpy to simplify
the translation into a C program. The prototype uses CBMC (https://www.cprover.org/cbmc/)
as backend for the program analysis. Thus a main parameter in the implemented approach is
the number of rounds where we select the actions (which corresponds to the unwinding depth
of the infinite loop of the main procedure). We support also a few more input parameters that
can be given to trigger a swarm-like analysis (see [
        <xref ref-type="bibr" rid="ref12 ref13">12, 13</xref>
        ]), enable some light partial order
reductions, and few more search heuristics.
      </p>
      <p>Agricola-sat18. This benchmark set is based on the board game Agricola that models a farm
with some workers. The game has a number of turns and stages, in which the player must
select actions for the workers that are finalized to obtain more resources. The player may decide
also to increase the number of workers. To reach the goal the player may take several actions
per turn however this also increases the amount of food consumed at the end of the turn, that
may lead into dead ends. The benchmark is composed of twenty planning instances sharing a
common domain file. The model is written in the STRIPS fragment of PDDL which is slightly
more expressive than the fragment presented in this paper: objects and constants are typed and
also cost functions and numerical types are allowed.</p>
      <p>Experiments. We run our tool on the entire benchmark set with round bound 20 finding
plans for 6/20 problems and taking overall about 900s. We repeated the same experiment with
bound 30, now taking about 7000s (including three 1200s timeouts) and finding plans for six
more problems. We then focused only on the remaining eight unsolved problems by using
increasing number of rounds up to 70 and timeouts up to 7200s. We found plans in three more
problems for a total of 15/20 problems. Interestingly, the new plans where discovered with
relatively low computational resources: 26 rounds and 1800s timeout, 31 rounds and 3000s
timeout, 33 rounds and 300s timeout, respectively. These preliminary experiments show that
our approach, although straightforward, is competitive with the best performing tools at the
ICP’18 which were only able to solve one more problem, thus confirming our intuition that
program verification can play a role in the automated planning domain.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>M.</given-names>
            <surname>Ghallab</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. S.</given-names>
            <surname>Nau</surname>
          </string-name>
          , P. Traverso,
          <source>Automated Planning and Acting</source>
          , Cambridge University Press,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>J.</given-names>
            <surname>Rintanen</surname>
          </string-name>
          ,
          <article-title>Planning and SAT</article-title>
          , in: A.
          <string-name>
            <surname>Biere</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Heule</surname>
          </string-name>
          , H. van Maaren, T. Walsh (Eds.),
          <source>Handbook of Satisfiability</source>
          , volume
          <volume>185</volume>
          <source>of Frontiers in Artificial Intelligence and Applications</source>
          ,
          <year>2009</year>
          , pp.
          <fpage>483</fpage>
          -
          <lpage>504</lpage>
          . URL: https://doi.org/10.3233/978-1-
          <fpage>58603</fpage>
          -929-5-483.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>F.</given-names>
            <surname>Giunchiglia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Traverso</surname>
          </string-name>
          ,
          <article-title>Planning as model checking</article-title>
          ,
          <source>in: Recent Advances in AI Planning</source>
          , Berlin, Heidelberg,
          <year>2000</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>20</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>A. L.</given-names>
            <surname>Ferrara</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Madhusudan</surname>
          </string-name>
          , G. Parlato,
          <article-title>Security analysis of role-based access control through program verification</article-title>
          ,
          <source>in: 25th IEEE Computer Security Foundations Symposium, CSF</source>
          <year>2012</year>
          ,
          <year>2012</year>
          , pp.
          <fpage>113</fpage>
          -
          <lpage>125</lpage>
          . URL: https://doi.org/10.1109/CSF.
          <year>2012</year>
          .
          <volume>28</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>A. L.</given-names>
            <surname>Ferrara</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Madhusudan</surname>
          </string-name>
          , G. Parlato,
          <article-title>Policy analysis for self-administrated role-based access control, in: Tools and Algorithms for the Construction and Analysis of Systems -</article-title>
          19th International Conference,
          <string-name>
            <surname>TACAS</surname>
          </string-name>
          <year>2013</year>
          . Proceedings, volume
          <volume>7795</volume>
          <source>of LNCS</source>
          ,
          <year>2013</year>
          , pp.
          <fpage>432</fpage>
          -
          <lpage>447</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>642</fpage>
          -36742-7_
          <fpage>30</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A. L.</given-names>
            <surname>Ferrara</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Madhusudan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T. L.</given-names>
            <surname>Nguyen</surname>
          </string-name>
          , G. Parlato,
          <article-title>Vac - verifier of administrative role-based access control policies</article-title>
          , in: Computer Aided Verification - 26th International Conference,
          <string-name>
            <surname>CAV</surname>
          </string-name>
          <year>2014</year>
          . Proceedings, volume
          <volume>8559</volume>
          <source>of LNCS</source>
          ,
          <year>2014</year>
          , pp.
          <fpage>184</fpage>
          -
          <lpage>191</lpage>
          . URL: https: //doi.org/10.1007/978-3-
          <fpage>319</fpage>
          -08867-9_
          <fpage>12</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>O.</given-names>
            <surname>Inverso</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Tomasco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Fischer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. La</given-names>
            <surname>Torre</surname>
          </string-name>
          , G. Parlato,
          <article-title>Bounded model checking of multi-threaded C programs via lazy sequentialization</article-title>
          , in: Computer Aided Verification - 26th International Conference,
          <string-name>
            <surname>CAV</surname>
          </string-name>
          <year>2014</year>
          . Proceedings, volume
          <volume>8559</volume>
          <source>of LNCS</source>
          ,
          <year>2014</year>
          , pp.
          <fpage>585</fpage>
          -
          <lpage>602</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>319</fpage>
          -08867-9_
          <fpage>39</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>E.</given-names>
            <surname>Tomasco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Inverso</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Fischer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. La</given-names>
            <surname>Torre</surname>
          </string-name>
          , G. Parlato,
          <article-title>Verifying concurrent programs by memory unwinding, in: Tools and Algorithms for the Construction and Analysis of Systems -</article-title>
          21st International Conference,
          <string-name>
            <surname>TACAS</surname>
          </string-name>
          <year>2015</year>
          . Proceedings, volume
          <volume>9035</volume>
          <source>of LNCS</source>
          ,
          <year>2015</year>
          , pp.
          <fpage>551</fpage>
          -
          <lpage>565</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>662</fpage>
          -46681-0_
          <fpage>52</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>T. L.</given-names>
            <surname>Nguyen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Fischer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. La</given-names>
            <surname>Torre</surname>
          </string-name>
          , G. Parlato,
          <article-title>Lazy sequentialization for the safety verification of unbounded concurrent programs</article-title>
          ,
          <source>in: Automated Technology for Verification and Analysis - 14th International Symposium, ATVA 2016. Proceedings</source>
          , volume
          <volume>9938</volume>
          <source>of LNCS</source>
          ,
          <year>2016</year>
          , pp.
          <fpage>174</fpage>
          -
          <lpage>191</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>319</fpage>
          -46520-3_
          <fpage>12</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>E. M.</given-names>
            <surname>Clarke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T. A.</given-names>
            <surname>Henzinger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Veith</surname>
          </string-name>
          , R. Bloem (Eds.),
          <source>Handbook of Model Checking</source>
          ,
          <year>2018</year>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>319</fpage>
          -10575-8.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>H.</given-names>
            <surname>Fofani</surname>
          </string-name>
          , A python PDDL parser,
          <year>2017</year>
          . URL: https://pypi.org/project/pddlpy/.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>G. J.</given-names>
            <surname>Holzmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Joshi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Groce</surname>
          </string-name>
          ,
          <article-title>Swarm verification techniques</article-title>
          ,
          <source>IEEE Trans. Software Eng</source>
          .
          <volume>37</volume>
          (
          <year>2011</year>
          )
          <fpage>845</fpage>
          -
          <lpage>857</lpage>
          . URL: https://doi.org/10.1109/TSE.
          <year>2010</year>
          .
          <volume>110</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>E.</given-names>
            <surname>Tomasco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Fischer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. La</given-names>
            <surname>Torre</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T. L.</given-names>
            <surname>Nguyen</surname>
          </string-name>
          , G. Parlato,
          <string-name>
            <given-names>P.</given-names>
            <surname>Schrammel</surname>
          </string-name>
          ,
          <article-title>Parallel bug-finding in concurrent programs via reduced interleaving instances</article-title>
          ,
          <source>in: Proceedings of the 32nd IEEE/ACM International Conference on Automated Software Engineering, ASE</source>
          <year>2017</year>
          ,
          <year>2017</year>
          , pp.
          <fpage>753</fpage>
          -
          <lpage>764</lpage>
          . URL: https://doi.org/10.1109/ASE.
          <year>2017</year>
          .
          <volume>8115686</volume>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>