<!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>Making sense of temporal data: the DECLARE encoding⋆</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>(Discussion/Short Paper)</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Chiara Di Francescomarino</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ivan Donadello</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Chiara Ghidini</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fabrizio Maria Maggi</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Williams Rizzi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>FBK IRST</institution>
          ,
          <addr-line>Via Sommarive 18, Trento</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Free University of Bozen-Bolzano</institution>
          ,
          <addr-line>Bolzano</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Making sense of data, and extracting the knowledge they contain in explicit formalizations, such as the one provided by conceptual or formal models, is an important step in creating human understandable descriptions of data, and in bringing humans in the loop of taking appropriate decisions based on these data. Process discovery aims at exploiting unsupervised learning in order to discover explicit formulations of so-called event logs data. These explicit formulations are usually either expressed in the form of Petri nets or declare patterns. The latter provide a declarative model composed of a set of constraints, usually interpreted in Linear Temporal Logic over finite traces ( LTL ), which is deemed especially important when event logs contain the execution of highly variable processes [2]. In addition to techniques for process discovery, recent works in the field of Deviance Mining and explainable process predictions have paved the way to extract also diferent types of knowledge from data. This knowledge is able to describe the discrepancies among classes of process executions [3], and to describe why a certain prediction is given, not only for a single trace but also for an entire quadrant of the confusion matrix associated to a (binary) classification Machine Learning (ML) model [4]. Most of the state-of-the-art Deviance Mining and explainable process predictions techniques rely on Machine Learning and diferent encodings have been proposed in literature [ 5] so as to exploit diferent characteristics of the event logs by means of ML techniques. Alas, none of them enables the encoding in terms of temporal logic patterns. In this abstract we recall a recent proposal for a declare encoding of execution traces in the context of Deviance Mining [1], where the problem is the one of explaining, in terms of declare patterns, the diferences between a set of positive (ℒ+) and a set of negative (ℒ− ) traces.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        2. Declare
declare [
        <xref ref-type="bibr" rid="ref2 ref6">2, 6</xref>
        ] is a declarative process modeling
language based on Linear Temporal Logic over finite traces Template LTL
(LTL ) [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. More specifically, a declare model fixes a existence(A) ♢ 
set of activities, and a set of constraints over such ac- responded existence(A,B) ♢  → ♢ 
tivities, formalized using LTL formulae. The overall raelstepronnastee(Are,sBp)onse(A,B) □□ (( →→ ♢○ (¬)  ))
model is then formalized as the conjunction of the LTL chain response(A,B) □ ( → ○ )
formulae of its constraints. Among all possible LTL nnoott scuo-cecxeissstieonnc(Ae(,AB,)B) □♢ (→→¬¬♢♢ ())
formulae, declare selects some pre-defined patterns not chain succession(A,B) □ ( → ¬○ )
such as the ones represented in Table 1. Each pattern is
represented as a declare template, i.e., a formula with Table 1: declare constraints in LTL .
placeholders to be substituted by concrete activities to obtain a constraint.
      </p>
      <p>
        For binary constraints (i.e., constraints specifying a relationship between two activities),
one of the two activities is called activation, and the other target; while testing a trace for
conformance over one of these constraints, the presence of the activation in the trace triggers
the clause verification, requiring the (non-)execution of an event containing the target in the
same trace. The notion of activation is related to the notion of vacuity detection in model
checking [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. For example, in the constraint response[ doSurgery,doRehab], if doSurgery
never occurs in a trace, then the constraint is “vacuously” satisfied, that is, satisfied without
showing any form of interaction with the trace.
3. Encoding traces using LTL temporal patterns
How to encode. Traces in an event log need to be transformed into numerical feature
vectors, which can then be used to train a classifier. To this aim, encodings can be used where
each element of the feature vector corresponds to the LTL temporal pattern derived from
a declare constraint (taken from a list of selected constraints). Depending on the need to
to distinguish vacuously satisfied constraints from non-vacuously satisfied, we introduce the
following parametric encoding values:
• − 1, if the corresponding declare constraint is violated in the trace;
• 1, if the corresponding declare constraint is (non vacuously) satisfied in the trace.
•  if the corresponding declare constraint is vacuously satisfied in the trace, with  = 0
if we aim at distinguishing vacuously satisfied constraints and  = 1 otherwise.
The event log is transformed into a matrix of numerical values where each row corresponds to
a trace and each column corresponds to a feature.
      </p>
      <p>Let us assume we aim at distinguishing between satisfied and vacuously satisfied. Given the
trace ⟨a, b, c, a, b, c, d, a, b⟩:
• constraint response(a, c) is violated, since the third activation (the third occurrence of a)
leads to a violation (is not eventually followed by c) and is encoded as 0;
• constraint response(a, b) is satisfied and is encoded as 1;
• constraint response(e, b) is (vacuously) satisfied and is encoded as 0.</p>
      <p>
        We also adopt the same approach for representing data-aware [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] declarative features. E.g.,
given a trace ⟨a{color = white}, c, b{color = black}, c, d, a{color = white}, c⟩, where e.g., a {color =
white} indicates that a has an attribute color having value white in its payload, we have:
• constraint response(a,c,color = white) is satisfied, and is hence encoded as 1;
• constraint response(a,d,color = white) is violated, since the second occurrence of a is not
eventually followed by d, and is encoded as 0;
• constraint response(b,c,color = white) is vacuously satisfied and encoded as 0 ( b is not an
activation, because the data condition color = white does not hold on its payload).
How to build the feature vector. While apparently extremely natural, the usage of the
declare encoding requires some preprocessing. In particular, even assuming to restrict to the
typical set of declare templates, the number of patterns to be considered present in any trace
is, generally, too large to use all of them to build the feature vectors. This triggers the need of a
method to select an appropriate set of patterns for building the feature vectors.
      </p>
      <p>To select the declare constraints to be used for building the feature vectors, the first step is
to discover a list of constraints from the event log, similarly to what is usually done in process
discovery. Since the problem we are addressing is the discriminative explanation of positive
(ℒ+) and negative (ℒ− ) traces, declare constraints need to be extracted separately from ℒ+
and ℒ− . In particular, we first discover frequent activity sets separately in ℒ+ and in ℒ− . Then,
we build a list of candidates as done for process discovery. Each candidate is checked separately
over ℒ+ and ℒ− (depending on whether it is derived from an activity set discovered from ℒ+
or ℒ− ) to verify if it is satisfied in a percentage of traces that is above a given support threshold.</p>
      <p>
        The number of patterns generated from the discovery is, generally, still too large to use all
of them to build the feature vectors. Therefore, it becomes important to remove the ones that
do not give much value for training the explanatory model. To this aim, the temporal patterns
discovered in the previous step are selected by first ranking them according to the Fisher score
[
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. The Fisher score for the j-th feature (i.e., pattern) is computed as:
 =
∑︀=1 (  −  )2
∑︀
=1  2
where  denotes the number of traces in class i (in our case the number of positive traces
in ℒ+ and the number of negative traces in ℒ− ),   and  2 denote mean and variance of the
values of the j-th feature for traces in class , and  and  are mean and variance of the values
of the j-th feature for all traces in the event log.  = {0, 1} denotes the set of classes for our
binary classification task. Following the ranking, patterns are selected until every trace satisfies
(non-vacuously) at least a fixed number of patterns ( coverage threshold). A pattern is only
chosen if it is non-vacuously satisfied in at least one of the traces not totally covered yet.
      </p>
    </sec>
    <sec id="sec-2">
      <title>4. Using the declare encoding for Deviance Mining.</title>
      <p>A hospital carries out the procedures for the treatment of fractures, whose executions are logged
in its information system. Some lengthy traces reflect hospital ineficiencies, which might
resolve into patients’ complaints: the hospital director needs to understand the discrimination
between two distinct trace classes - the fast (ℒ+) and the lengthy ones (ℒ− ) - by characterizing
the slow executions with respect to the fast ones. A resulting list of temporal logic patterns will
give suggestions on how to intervene so to match the behavior of the desired (fast) traces.</p>
      <p>
        In the context of a scenario like this, the work in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] investigates how a declarative encoding,
paired with feature selection, can accurately discriminate between (ℒ+) and (ℒ− ) executions of
a process using synthetic and real-life event logs from multiple domains. Moreover, the paper
analyzes the possible outcomes returned to the users. Two diferent methods, based on the
white-box classifiers Ripper  (Repeated Incremental Pruning to Produce Error Reduction) [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]
and decision trees [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] are used to identify the declarative patterns, and compared both in terms
of their classification performance and in terms of amount and length of the decision rules
returned (to investigate user readability and explanation conciseness).
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>G.</given-names>
            <surname>Bergami</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Di Francescomarino</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Ghidini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. M.</given-names>
            <surname>Maggi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Puura</surname>
          </string-name>
          ,
          <article-title>Exploring business process deviance with sequential and declarative patterns</article-title>
          ,
          <source>arXiv:2111.12454v1</source>
          ,
          <year>2022</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>M.</given-names>
            <surname>Pesic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Schonenberg</surname>
          </string-name>
          ,
          <string-name>
            <surname>W. M. P. van der Aalst</surname>
          </string-name>
          ,
          <article-title>Declare: Full support for looselystructured processes</article-title>
          ,
          <source>in: Proc. of EDOC, IEEE Computer Society</source>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>F.</given-names>
            <surname>Taymouri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. La</given-names>
            <surname>Rosa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dumas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. M.</given-names>
            <surname>Maggi</surname>
          </string-name>
          ,
          <article-title>Business process variant analysis: Survey and classification</article-title>
          ,
          <source>Knowl. Based Syst</source>
          .
          <volume>211</volume>
          (
          <year>2021</year>
          )
          <fpage>106557</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>W.</given-names>
            <surname>Rizzi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Di Francescomarino</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. M.</given-names>
            <surname>Maggi</surname>
          </string-name>
          ,
          <article-title>Explainability in predictive process monitoring: When understanding helps improving</article-title>
          ,
          <source>in: BPM Forum</source>
          <year>2020</year>
          , Proceedings, volume
          <volume>392</volume>
          <source>of LNBIP</source>
          , Springer,
          <year>2020</year>
          , pp.
          <fpage>141</fpage>
          -
          <lpage>158</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>C.</given-names>
            <surname>Di Francescomarino</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Ghidini</surname>
          </string-name>
          ,
          <article-title>Predictive process monitoring</article-title>
          ,
          <source>in: Process Mining Handbook</source>
          , volume
          <volume>448</volume>
          <source>of LNBIP</source>
          , Springer,
          <year>2022</year>
          , pp.
          <fpage>320</fpage>
          -
          <lpage>346</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>V.</given-names>
            <surname>Skydanienko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Di Francescomarino</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Ghidini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. M.</given-names>
            <surname>Maggi</surname>
          </string-name>
          ,
          <article-title>A tool for generating event logs from multi-perspective declare models</article-title>
          ,
          <source>in: Proc. of the Dissertation Award, Demonstration, and Industrial Track at BPM</source>
          <year>2018</year>
          , volume
          <volume>2196</volume>
          <source>of CEUR Workshop Proc., CEUR-WS.org</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>111</fpage>
          -
          <lpage>115</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>G.</given-names>
            <surname>De Giacomo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. Y.</given-names>
            <surname>Vardi</surname>
          </string-name>
          ,
          <article-title>Linear temporal logic and linear dynamic logic on finite traces</article-title>
          ,
          <source>in: Proc. of IJCAI</source>
          , AAAI Press,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>I.</given-names>
            <surname>Beer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Eisner</surname>
          </string-name>
          ,
          <article-title>Eficient detection of vacuity in temporal model checking</article-title>
          ,
          <source>Formal Methods in System Design</source>
          <volume>18</volume>
          (
          <year>2001</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Montali</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Chesani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Mello</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. M.</given-names>
            <surname>Maggi</surname>
          </string-name>
          ,
          <article-title>Towards data-aware constraints in declare</article-title>
          ,
          <source>in: Proc. of SAC</source>
          <year>2013</year>
          , ACM,
          <year>2013</year>
          , pp.
          <fpage>1391</fpage>
          -
          <lpage>1396</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>X.</given-names>
            <surname>He</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Cai</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Niyogi</surname>
          </string-name>
          ,
          <article-title>Laplacian score for feature selection</article-title>
          ,
          <source>in: NIPS</source>
          <year>2005</year>
          ,
          <year>2005</year>
          , pp.
          <fpage>507</fpage>
          -
          <lpage>514</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>W. W.</given-names>
            <surname>Cohen</surname>
          </string-name>
          ,
          <article-title>Fast efective rule induction</article-title>
          ,
          <source>in: In Proc. of the 12th Int. Conf. on Machine Learning</source>
          , Morgan Kaufmann,
          <year>1995</year>
          , pp.
          <fpage>115</fpage>
          -
          <lpage>123</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>J. R.</given-names>
            <surname>Quinlan</surname>
          </string-name>
          ,
          <year>C4</year>
          .
          <article-title>5: Programs for Machine Learning</article-title>
          , Morgan Kaufmann Publishers Inc., San Francisco, CA, USA,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>