be taken after 4.5 hours of accumulated driving or the
break can be taken splitted in two parts of at least 15
mins and 30 mins respectively. This feature is good
for drivers since it provides flexibility to their work,
but complicates the interpretability of what they are
doing. Regulations also define additional constraints
(for example, the maximum number of occurrences of
a reduced rest in a weekly driving period), or the hi-
erarchical relationship between the different types of
sub-sequences, as well as their internal structure (see
Figure 2).
2.1 The Problem
In summary, the problem consists of classifying and
labeling events of a given log by considering the legal
terms above described about HoS regulations. Con-
cretely, the observed behavior has to be tagged in
terms of driving periods, daily driving periods (and
their types), and weekly driving periods (and their
types) as shown in Figures 1 (right-hand table) and
2. Last but not least, identified subsequences have to
be tagged as legal or illegal according to their compli-
ance with HoS regulation.
The main contribution of this work consists of ad-
dressing the above described labeling of activities and
classification of illegal sequences as a parsing process
based on automated planning (AP) techniques, as well
as an experimentation that validates our approach. AP
is a widely known field of Artificial Intelligence de-
voted to develop algorithms, called planners, that im-
plement search-based problem solving processes to
determine a plan (sequence of actions) for a situated
agent to achieve a goal. The inputs provided to a plan-
ner are a model of actions that describes the behavior
of the agent, called a planning domain, and, a plan-
ning problem, a description of the current state of the
agent and the goal to be achieved.
The main use of these techniques is the generation
of plans, but recent works have shown their usefulness
to recognize sequences of actions. This last use lays
on the fact that when a planner is provided with an
initial state that incorporates a sequence of observa-
tions representing the past activities of an agent, and
a repertory of possible goals the agent is intended to
achieve, the planning process can be used to deter-
mine which of the possible goals is intended to be
achieved by the agent executing the observed actions.
This view of automated planning is called plan recog-
nition and it is the one followed by our approach.
Concretely we are using in this work temporal hi-
erarchical task network planning techniques (tempo-
ral HTN), a variant of AP where the planning do-
main is represented as a hierarchical knowledge base
in which the behavior of the agent is defined in terms
of a compositional hierarchy of tasks/subtasks where
primitive tasks represent temporally annotated actions
to be executed by the agent, and compound tasks rep-
resent temporal ordering strategies of actions. The
key aspect in HTN is that compound task can be de-
composed in alternative ways by means of methods.
A method is a pair (t, d) that describes one way to
achieve the task t is to perform the tasks specified
in the task network d, a temporally constrained set
of tasks/subtasks representing things that need to be
done. The hierarchical planning process is based on
a search process that starts at a given top-level task
network, and recursively reduces it by opportunisti-
cally applying methods. The current task network is
transformed step by step in each reduction by insert-
ing tasks according to the order and temporal con-
straints specified in the methods, until it consists of
a plan only composed of primitive actions.
The reason to use a temporal and hierarchical
planning approach is two-fold: on the one hand, the
event log observations are temporally annotated and
constrained, hence we need to resort on a technique
able to manage such temporal constraints. On the
other hand, the HoS regulation can be naturally rep-
resented as a hierarchy of temporal tasks.
In our case a given event log represents a se-
quence of temporally annotated observations and the
planning process 1) identifies different temporal sub-
sequences of a driver’s daily and weekly driving ac-
tivity, 2) labels them according to the terms defined by
HoS regulation, and 3) classifies them as legal/illegal.
It is important to note that the identification of tempo-
ral sub-sequences is a process analogous to grammar
parsing, and in our case is addressed as a knowledge-
driven search process with two main features: i) it is
implemented in a hierarchical planner, ii) the planner
is provided with a knowledge-based model represent-
ing the HoS regulation. The parsing task is performed
over the entire event log considering that the decom-
position methods provided in the HTN model can be
seen as a set of production rules of an attribute gram-
mar.
In the following sections we describe the gen-
eral steps of our method, provide a description of
the knowledge-based representation of HoS regula-
tion, then we briefly describe the knowledge-driven
search process to parse the log, and the experimenta-
tion and proof of concept carried out to validate our
approach.
Analyzing Driver Behavior Compliance under HoS Regulations
465