-
Notifications
You must be signed in to change notification settings - Fork 0
/
bnf.tex
588 lines (513 loc) · 25.3 KB
/
bnf.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
\documentclass[letterpaper]{article} % DO NOT CHANGE THIS
\usepackage[submission]{aaai23} % DO NOT CHANGE THIS
\usepackage{times} % DO NOT CHANGE THIS
\usepackage{helvet} % DO NOT CHANGE THIS
\usepackage{courier} % DO NOT CHANGE THIS
\usepackage[hyphens]{url} % DO NOT CHANGE THIS
\usepackage{graphicx} % DO NOT CHANGE THIS
\urlstyle{rm} % DO NOT CHANGE THIS
\def\UrlFont{\rm} % DO NOT CHANGE THIS
\usepackage{natbib} % DO NOT CHANGE THIS AND DO NOT ADD ANY OPTIONS TO IT
\usepackage{caption} % DO NOT CHANGE THIS AND DO NOT ADD ANY OPTIONS TO IT
\frenchspacing % DO NOT CHANGE THIS
\setlength{\pdfpagewidth}{8.5in} % DO NOT CHANGE THIS
\setlength{\pdfpageheight}{11in} % DO NOT CHANGE THIS
%
\usepackage[ruled,linesnumbered,noend]{algorithm2e}
\usepackage{multirow}
\usepackage{subcaption}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{subfiles}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{url}
\definecolor{mygreen}{rgb}{0,0.6,0}
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
\definecolor{mymauve}{rgb}{0.58,0,0.82}
\definecolor{myred}{rgb}{0.9,0.2,0.2}
\lstdefinelanguage{pddl}
{
sensitive=false, % not case-sensitive
morecomment=[l]{;}, % line comment
alsoletter={:,-}, % consider extra characters
morekeywords={
define,domain,problem,not,and,or,when,imply,forall,exists,either,
:domain,:extends,:requirements,:types,:objects,:constants,
:constraints,:ordered-substasks,:subtasks,:tasks,
:predicates,:action,:durative-action,:duration,:method,:durative-method,
:htn,:parameters,:precondition,:condition,:effect,:functions,
:fluents,:primary-effect,:side-effect,:init,:goal,assign
:strips,:adl,:equality,:task,:typing,:conditional-effects,:metric,
:negative-preconditions,:disjunctive-preconditions,
:existential-preconditions,:universal-preconditions,:ordered-subtasks,:ordering
},
keywords=[2]{object,at,start,over,all,end,always,at-most-once,sometime-before,sometime,sometime-after,hold-during,hold-between,hold-after,within,minimize,maximize,total-time} % Objects, temporal elmts
keywords=[3]{calib_direction,image_direction,instrument,satellite,mode}, % Types
keywords=[4]{calibrate,turn_approx,turn_precise,take_image,turn_to,activate_instrument,point_to,take_video,method_stereo,do_observation_stereo, do_observation,decrease_overall_quality,method_observe}, % Actions, Methods
keywords=[5]{observable,calibrated,pointing,supports,power_on,power_avail,on_board,calib_target,have_image,
image-quality,calib-time,turn-time} % Functions and predicetes
}
\lstset
{
language={pddl},
basicstyle=\small\ttfamily, % Global Code Style
captionpos=b, % Position of the Caption (t for top, b for bottom)
extendedchars=true, % Allows 256 instead of 128 ASCII characters
tabsize=2, % number of spaces indented when discovering a tab
columns=fixed,
keepspaces=true,
showstringspaces=false,
breaklines=true,
numberstyle=\tiny\ttfamily, % style of the line numbers
commentstyle=\color{mygrey}, % style of comments
keywordstyle=[2]\color{mymauve},
keywordstyle=[3]\color{mygreen},
keywordstyle=[4]\color{blue},
keywordstyle=[5]\color{myred},
stringstyle=\color{blue}, % style of strings
keywordstyle=\bfseries, % style of keywords
numbers=left
}
\sloppy
% Don't use commands within pdfinfo
%\pdfinfo{
%/Title (An Accurate PDDL Domain Learning Algorithm from Partial and Noisy Observations)
%/Author (Maxence Grand, Damien Pellier, Humbert Fiorino)
%}
\pdfinfo{
/Title (HDDL2.1 Syntax)
/Author (Paper \#)
}
\newtheorem{definition}{Definition}
\newcommand{\at}{\text{\it at}}
\newcommand{\holdafter}{\text{\it hold-after}}
\newcommand{\holdduring}{\text{\it hold-during}}
\newcommand{\before}{\text{\it before}}
\newcommand{\after}{\text{\it after}}
\renewcommand{\between}{\text{\it between}}
\newcommand{\atstart}{\text{\it at start}}
\newcommand{\atend}{\text{\it at end}}
\newcommand{\always}{\text{\it always}}
\newcommand{\overall}{\text{\it overall}}
\newcommand{\sometimes}{\text{\it sometimes}}
\newcommand{\sometimebefore}{\text{\it sometimes-before}}
\newcommand{\sometimeafter}{\text{\it sometimes-after}}
\newcommand{\alwayswithin}{\text{\it always-within}}
\newcommand{\within}{\text{\it within}}
\newcommand{\atmostonce}{\text{\it at-most-once}}
\newcommand{\name}{\text{\it name}}
\newcommand{\pre}{\text{\it precond}}
\newcommand{\param}{\text{\it param}}
\newcommand{\effect}{\text{\it effect}}
\newcommand{\add}{\text{\it effect}^{+}}
\newcommand{\del}{\text{\it effect}^{-}}
\newcommand{\duration}{\text{\it duration}}
\newcommand{\tstart}{\text{\it start}}
\newcommand{\tend}{\text{\it end}}
\newcommand{\tinv}{\text{\it inv}}
\newcommand{\task}{\text{\it task}}
\newcommand{\tn}{\text{\it tn}}
\newcommand{\hbefore}{\text{\it xx }}
\newcommand{\hafter}{\text{\it xx }}
\setcounter{secnumdepth}{2}
\setlength\titlebox{2.5in}
\title{HDDL 2.1 Syntax}
\author{
Damien Pellier, Humbert Fiorino\\
Univ. Grenoble Alpes, LIG\\
38000 Grenoble, France\\
\{Damien.Pellier, Humbert.Fiorino\}@univ-grenoble-alpes.fr}
\title{Annex: Full HDDL 2.1 Syntax}
%\author{Paper \#}
\sloppy
\begin{document}
\maketitle
%\section{HDDL 2.1 Syntax}
The proposed syntax, called HDDL2.1, takes its roots in HDDL~\citep{holler20}.
\section{Domain Description}
\newcommand{\specReq}[1]{\ensuremath{\mathtt{^{#1}}}}
The domain definition has been extended to durative actions (line~\ref{l:durative-actions}) and durative methods (line~\ref{l:durative-methods}).
\begin{lstlisting}[escapechar=~]
<domain> ::= (define (domain <name>)
[<require-def>]
[<types-def>]~\specReq{:typing}~
[<predicates-def>]
[<functions-def>]~\specReq{:fluents}~
[<constants-def>]
[<task-defs>]
<structure-def>*)
\end{lstlisting}
%
% Domain definition
%
% Requirement Statement
% Type Definition
% Domain Constant Definition
% Predicate Definition
%
% @HDDL 1.0
\noindent The definition of the basic domain elements is nearly unchanged.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<require-def> ::= (:requirements ~\mbox{<require-key>+}~)
<require-key> ::= ~\textit{(see \S\ref{Sec:Requirements})}~
<types-def> ::= (:types ~\mbox{<typed-list(<primitive-type>)>}~)
<predicates-def> ::= (:predicates ~\mbox{<atomic-formula-skeleton>+}~)
<function-def> ::= (<function-typed-list ~\mbox{(<atomic-function-skeleton>)}~>)
<constants-def> ::= (:constants <typed-list (constant)>)
<atomic-formula-skeleton> ::= ~\linebreak~(<predicate> <typed-list(variable)>)
<atomic-function-skeleton> ::= ~\linebreak~(<function> <typed-list (variable)>)
<typed-list (x)> ::= x+ - <type> ~\linebreak~[<typed list (x)>]~\label{l:typedlist}~
<type> ::= (either <primitive-type>+)
<type> ::= <primitive-type>
<function-typed-list (x)> ::= x+ - ~\linebreak~<function-type> <function-typed-list(x)>
<function-typed-list (x)> ::=
<function-type> ::=~\specReq{:numeric-fluents}~number
<function-type> ::=~\specReq{:typing} \specReq{+} \specReq{:object-fluents}~<type>
<predicate> ::= <name>
<function> ::= <name>
<constant> ::= <name>
<variable> ::= ?<name>
<primitive-type> ::= <name>
<primitive-type> ::= ~object
\end{lstlisting}
%
% Task definition
%
% @HDDL 1.0
\noindent Abstract tasks are defined similarly to actions as in HDDL 1.0
\begin{lstlisting}[firstnumber=last, escapechar=~]
<tasks-def> ::= (:task <task-def>)
<task-def> ::= <task-symbol> ~\linebreak~:parameters (<typed list (variable)>)~\label{l:compTask}~
<task-symbol> ::= <name>
\end{lstlisting}
\noindent The structure of a temporal HDDL domain is composed of durative and non-durative methods and actions. Durative and non-durative actions are defined as in PDDL \cite{pddl3} and non-durative methods as in HDDL.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<structure-def> ::= <action-def>
<structure-def> ::=~\specReq{:durative-actions}~ ~\mbox{<durative-action-def>}~
<structure-def> ::= <method-def>
<structure-def> ::=~\specReq{:durative-methods}~ ~\mbox{<durative-method-def>}~
\end{lstlisting}
%
% Method Definition
%
% @HDDL 1.0
Methods consist of a parameter list (line~\ref{l:mparams}), the abstract task they decompose (line~\ref{l:mabstask}), and the resulting task network (line~\ref{l:msubtasks}). By setting the \verb+:method-preconditions+ requirement, one can use method preconditions (line~\ref{l:mprec}, which can be used for example to filter the hierarchical decomposition).
\begin{lstlisting}[firstnumber=last, escapechar=~]
<method-def> ::= (:method <name>~\label{l:methods}~
:parameters (<typed list (variable)>)~\label{l:mparams}~
:task (<task-symbol> <term>*)~\label{l:mabstask}~
[:precondition <gd>]~\specReq{:method-preconditions}~~\label{l:mprec}~
<tasknetwork-def>~\label{l:msubtasks}~)
\end{lstlisting}
%
% Durative Method Definition
%
% @HDDL 2.1
Like methods, durative methods have parameters, the abstract task they decompose, and the resulting task network, and, like durative actions, they can have duration constraints and a condition that has to hold to apply the decomposition. Note that, unlike for durative actions, duration constraints are not mandatory. By default the duration of a method is the sum of all the durations of the primitive tasks that compose it. However, it can be interesting to specify temporal constraints on the execution of the decomposition such as, for example, whatever decomposition is chosen, the duration of the primitive tasks must not exceed a given value, or that a subtask must last less than another subtask. These durative constraints can be declared if the requirement {\tt :durative-inequalities} is set. We use here the same requirement as for PDDL.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<durative-method-def> ::=~\label{l:durative-methods}~
:durative-method <name>
:parameters (<typed list (variable)>)
:task (<task-symbol> <term>*)
[:duration <method-duration-constraint>]~\specReq{:duration-inequalities}~
[:condition <da-gd>]~\specReq{:method-preconditions}~~\label{l:mcond}~
<tasknetwork-def>~\label{l:msubtasks2}~)
\end{lstlisting}
%%%%%%
%
% Task Definition
%
% @HDDL 1.0
The definition of task networks is used in method definitions as well as in the problem definition to define the initial task network. It contains the definition of sub-tasks (line~\ref{l:tnsubtasks}), ordering constraints (line~\ref{l:tnordering}), and logical constraints (line~\ref{l:tnconstraints}) on the sub-tasks of the method. We keep here the same definition as in HDDL.
When the key \verb+:ordered-subtasks+ is used, the network is considered totally ordered. In the other cases, ordering relations have to be defined explicitly. This is done by including ids into the task definition that can then be referenced in the ordering definition.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<tasknetwork-def> ::=
[~\textbf{:}~[~\textbf{ordered-}~][~\textbf{sub}~]~\textbf{tasks}~
<subtask-defs>]~\label{l:tnsubtasks}~
[~\textbf{:order}~[~\textbf{ing}~] <ordering-defs>]~\label{l:tnordering}~
[:constraints <constraint-defs>]~\label{l:tnconstraints}~
\end{lstlisting}
%
% Subtasks
%
% @HDDL 1.0
\noindent The subtask definition can contain one or more subtasks.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<subtask-defs> ::= () | <subtask-def> ~\linebreak~| (and <subtask-def>+)
<subtask-def> ::= (<task-symbol> <term>*) ~\linebreak~| (<subtask> (<task-symbol> <term>*))
<subtask> ::= <name>
\end{lstlisting}
%
% Ordering
%
% @HDDL 2.1
The ordering constraints are defined via the task ids, and have to induce a partial order. To deal with time we add time specifiers on task ids to specify if the ordering constraints are about the start time or the end time of the task. The time specifiers are like in PDDL: ~{\tt start} to define the start time of a task, and {\tt end} to define the end time of a task. Note that we extend also the list of operators available to express ordering constraints between tasks. It has been extended to define any constraints on the start or end of a sub-task of a method, and allows to express all Allen's intervals \citep{allen81} between these subtasks.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<ordering-defs> ::= () | <ordering-def> ~\linebreak~| (and <ordering-def>+)
<ordering-def> ::= ~\linebreak~(<d-task> <task-id> <task-id>)
<ordering-def> ::=~\specReq{:durative-action} \linebreak~(not (<ordering-def>))
<d-task> ::= <
<d-task> ::=~\specReq{:durative-action} ~>=
<d-task> ::=~\specReq{:durative-action} ~<=
<d-task> ::=~\specReq{:durative-action} ~>
<d-task> ::=~\specReq{:durative-action} ~<
<d-task> ::=~\specReq{:durative-action} ~=
<task-id> ::= <name>
<task-id> ::= ~\specReq{:durative-action} <time-task-id>~
<time-task-id> ::= (<time-specifier> ~\mbox{<task-id>)}~
<time-specifier> ::= ~start~
<time-specifier> ::= ~end
\end{lstlisting}
%
% Constraints extensions
%
% @HDDL 2.1
HDDL~1.0 only accepts equality constraints or inequality on method parameters in the task network. To increase the expressiveness of the language, we have chosen to add two kinds of constraints: the {\em classical decomposition constraints} ($\before$, $\after$, $\between$) used in HTN planning introduced first by \citep{erol94} to represent constraints between tasks for non temporal HTN problem and the {\em temporal decomposition constraints} based on the plan trajectory constraint from PDDL~3.0 \cite{gerevini05}. To allow the specification of such the constraints added, it is necessary to use \verb+:method-constraints+.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<constraint-def> ::= () | <constraint-def> | (and <constraint-def>+)
<constraint-def> ::= (not (= <term> <term>))~\linebreak~| (= <term> <term>)
<constraint-def> ::=~\specReq{:method-constraints}~ ~\linebreak~(~before <task-id> <gd>)~
<constraint-def> ::=~\specReq{:method-constraints}~ ~\linebreak~(~after <task-id> <gd>)~
<constraint-def> ::=~\specReq{:method-constraints}~ ~\linebreak~(~between <task-id> <task-id> <gd>)~
<constraint-def> ::=~\specReq{:durative-action + :method-constraints}~ ~\linebreak~<timed-constraint-def>
<timed-constraint-def> ::= ~\linebreak~(~at <timed-task-id> <gd>)~
<timed-constraint-def> ::= ~\linebreak~(~hold-during <timed-task-id> <gd>)~
<timed-constraint-def> ::= ~\linebreak~(~within <timed-task-id> <gd>)~
<timed-constraint-def> ::= ~\linebreak~(~hold-after <timed-task-id> <gd>)~
<timed-constraint-def> ::= (~at start <gd>)~
<timed-constraint-def> ::= (~at end <gd>)~
<timed-constraint-def> ::= (~always <gd>)~
<timed-constraint-def> ::= (~at-most-once <gd>)~
<timed-constraint-def> ::= (~sometime <gd>)~
<timed-constraint-def> ::= ~\linebreak~(~sometime-before <gd> <gd>)~
<timed-constraint-def> ::= ~\linebreak~(~sometime-after <gd> <gd>)~
<timed-constraint-def> ::= ~\linebreak~(~always-within number <gd> <gd>)~
\end{lstlisting}
%
% Action Definition
%
% HDDL 1.0
The orginal action or durative action definitions defined in PDDL stay mainly unchanged. The only difference is that for simplicity, it is not possible to specify preferences. The non-durative actions are defined as follows:
\begin{lstlisting}[firstnumber=last, escapechar=~]
<action-def> ::= (:action <task-def>~\label{l:action}~
[:precondition <gd>]
[:effect <effect>])
\end{lstlisting}
%
% Durative Action Definition
%
% PDDL 3.0 add to HDDL 2.1
\noindent The durative actions are defined as follows:
\begin{lstlisting}[firstnumber=last, escapechar=~]
<durative-action-def> ::= ~\linebreak~(:durative-action <task-def>~\label{l:durative-actions}~
:duration <duration-constraint>
[:condition <da-gd)>]
[:effect <da-effect>])
\end{lstlisting}
%
% Durative Action Constraints Definition
%
% PDDL 3.0 add to HDDL 2.1
As in PDDL, duration constraints with the \verb|:duration-inequalities| requirement allow to express duration inequalities. The definition of the duration constraints for durative actions does not change.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<action-duration-constraint> ::=~\specReq{:duration-inequalities}~(and ~\linebreak~ <simple-action-duration-constraint>+)
<action-duration-constraint> ::= ()
<action-duration-constraint> ::= ~\mbox{<simple-action-duration-constraint>}~
<action-simple-duration-constraint>::= ~\linebreak~(<d-op> ?duration <d-value>)
<action-simple-duration-constraint>::= ~\linebreak~ (~{at}~ <time-specifier> ~\mbox{\hspace{2em}<simple-duration-constraint>}~)
<d-op> :: <=
<d-op> :: >=
<d-op> :: =
<d-value> ::= <number>
<d-value> ::=~\specReq{:numeric-fluents}~<f-exp>
<f-exp> ::=~\specReq{:numeric-fluents}~<number>
<f-exp> ::=~\specReq{:numeric-fluents}~(<binary-op> <f-exp> <f-exp>)
<f-exp> ::=~\specReq{:numeric-fluents}~(<multi-op> <f-exp> <f-exp>+)
<f-exp> ::=~\specReq{:numeric-fluents}~(- <f-exp>)
<f-exp> ::=~\specReq{:numeric-fluents}~<f-head>
<f-head> ::= (<function-symbol> <term>*)
<f-head> ::= <function-symbol>
<binary-op> ::= <multi-op>
<binary-op> ::= -
<binary-op> ::= /
<multi-op> ::= *
<multi-op> ::= +
<binary-comp> ::= >
<binary-comp> ::= <
<binary-comp> ::= =
<binary-comp> ::= >=
<binary-comp> ::= <=
\end{lstlisting}
%
% Durative Method Constraints Definition
%
% @HDDL 2.1
The duration of a method is by default the sum of the durations of the sub-tasks that compose it. Optional constraints might be specified to restrict the allowed value for the
duration of the method or the sub-tasks that compose it. Therefore, it is necessary to be able to refer explicitly to the duration of a subtask and not only to the duration of the method with the variable {\tt ?duration}.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<method-duration-constraint> ::=~\specReq{:duration-inequalities}~ (and~\linebreak~ <method-simple-duration-constraint>+)
<method-duration-constraint> ::= ()
<method-duration-constraint> ::= ~\mbox{<simple-method-duration-constraint>}~
<simple-method-duration-constraint>::= ~\linebreak~(<binary-comp> <duration> <td-value>)
<simple-method-duration-constraint>::= ~\linebreak~(~{at}~ <time-specifier> ~\mbox{\hspace{2em}<simple-method-duration-constraint>}~)
<duration> :: = ?duration
<duration> :: = <task-duration>
<td-value> ::= <d-value>
<td-value> ::= <task-duration>
<task-duration> :: = (duration <task-id>)
\end{lstlisting}
%
% Goal Description
%
% @HDDL 1.0
\noindent Compared to HDDL 1.0 we allow to define numerical and temporal preconditions. The syntax used from numeric preconditions is the same as that of PDDL 3.0. For the sake of simplicity, we chose to not include the preferences.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<gd> ::= ()
<gd> ::= <literal (term)>
<gd> ::= (and <gd>*)
<gd> ::=~\specReq{:disjunctive-preconditions}~ (or <gd>*)
<gd> ::=~\specReq{:negative-preconditions}~ (not <gd>)
<gd> ::=~\specReq{:disjunctive-preconditions \ :negative-preconditions}~ ~\mbox{(imply <gd> <gd>)}~
<gd> ::=~\specReq{:existential-preconditions}~ ~\linebreak~(exists (<typed list (variable)>*) <gd>)
<gd> ::=~\specReq{:universal-preconditions}~ ~\linebreak~(forall (<typed list (variable)>*) <gd>)
<gd> ::= (= <term> <term>)
<gd> ::=~\specReq{:numeric-fluents} <f-comp>
<f-comp> ::= (<binary-comp> <f-exp> <f-exp>)
\end{lstlisting}
\begin{lstlisting}[firstnumber=last, escapechar=~]
<literal (t)> ::= <atomic formula(t)>
<literal (t)> ::= (not <atomic formula(t)>)
<atomic formula(t)> ::= (<predicate> t*)
\end{lstlisting}
\begin{lstlisting}[firstnumber=last, escapechar=~]
<term> ::= <name>
<term> ::= <variable>
\end{lstlisting}
%
% Goal Description
%
% PDDL 3.0 add to HDDL 2.1
\noindent The same approach is used for temporal precondition definition. The syntax used is the same as in PDDL 3.0.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<da-gd> ::= <timed-gd>
<da-gd> ::= (and <da-gd>*)
<da-gd> ::=~\specReq{:universal-preconditions}~ (forall ~\linebreak~ <typed-list (variable)>) <da-gd>)
<timed-gd> ::= (~at <time-specifier> <gd>)~
<timed-gd> ::= (~over <interval> <gd>)~
<interval> ::= ~all
\end{lstlisting}
%
% Effects
%
% @HDDL 1.0
\noindent Symmetrically, we add to the effect definition the temporal and numeric aspect based on the same syntax as in PDDL 3.0.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<effect> ::= ()
<effect> ::= (and <c-effect>*)
<effect> ::= <c-effect>
<c-effect> ::=~\specReq{:conditional-effects}~ ~\linebreak~(forall (<variable>*) <effect>)
<c-effect> ::=~\specReq{:conditional-effects}~ ~\linebreak~(when <gd> <cond-effect>)
<c-effect> ::= <p-effect>
<p-effect> ::= (not <atomic formula(term)>)
<p-effect> ::= <atomic formula(term)>
<cond-effect> ::= (and <p-effect>*)
<cond-effect> ::= <p-effect>
\end{lstlisting}
%
% Temporal Method Definition
%
% From PDDL 3.0 add to HDDL 2.1
\noindent The temporal and numeric definitions of effects are as follows:
\begin{lstlisting}[firstnumber=last, escapechar=~]
<da-effect> ::= (and <da-effect>*)
<da-effect> ::= <timed-effect>
<da-effect> ::=~\specReq{:conditional-effects}~ (forall ~\linebreak~(<typed list (variable)>) <da-effect>)
<da-effect> ::=~\specReq{:conditional-effects}~ ~\linebreak~(when <da-gd> <timed-effect>)
<timed-effect> ::= ~\linebreak~(~at <time-specifier> <cond-effect>)~
<timed-effect> ::=~\specReq{:numeric-fluents}~ ~\linebreak~(~at <time-specifier> <f-assign-da>)~
<f-assign-da> ::= (<assign-op> <f-head>~\linebreak ~<f-exp-da>)
<f-exp-da> ::= (<binary-op> <f-exp-da>~\linebreak ~ <f-exp-da>)
<f-exp-da> ::= (<multi-op> <f-exp-da>~\linebreak ~ <f-exp-da>+)
<f-exp-da> ::= (- <f-exp-da>)
<f-exp-da> ::=~\specReq{:duration-inequalities}~ ?duration
<f-exp-da> ::= <f-exp>
<assign-op-t> ::= increase
<assign-op-t> ::= decrease
\end{lstlisting}
% continuous-effects rules removed
%<timed-effect> ::=~\specReq{:continuous-effects + :numeric-fluents}~ ~\linebreak~(<assign-op-t> <f-head> <f-exp-t>)
%<f-exp-t> ::= (* <f-exp> #t)
%<f-exp-t> ::= (* #t <f-exp>)
%<f-exp-t> ::= #t
\section{Problem Description}
%
% Problem Definition
%
% @HDDL 1.0 + initial timed literal + initial function values + metric spec
The problem definition includes as additional element the initial task network (line~\ref{l:tnihtn}) as in HDDL 1.0. But now, it is possible to define in the initial state of the problem initial function values and initial time literals. It is also possible to define metric specs on solution plans. We have chosen here not to allow the definition of preferences. But preferences could be added in a next extension of the language. Likewise we have also chosen not to allow the definition of constraints on plans although it is possible in PDDL. We believe that it is preferable to add constraints on plans by adding logical constraints associated with task networks. This allows for a more unified language.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<problem> ::= (define (problem <name>)
(:domain <name>)
[<require-def>]
[<object-declaration>]
[<htn>]~\label{l:tnihtn}~
<init>
[<goal>])~\label{l:goal}~
[<metric-spec>]~\specReq{:numeric-fluents}
\end{lstlisting}
Most of the elements of a problem remain unchanged from HDDL. Now timed initial literal and function are allowed in the declartion of the initial of the problem.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<object-declaration> ::= ~\linebreak~(:objects <typed list (name)>)
<htn> ::= (:htn
[:parameters (<typed list (variable)>)] ~\label{l:tniparams}~
<tasknetwork-def>)~\label{l:tnitasks}~
<init> ::= (:init <init-el>*)
<init-el> ::= <literal (name)>
<init-el> ::=~\specReq{:timed-initial-literals}~(~at ~<number>~ <literal (name)>)~
<init-el> ::=~\specReq{:numeric-fluents}~ (= ~<basic-function-term>~ <number>)
<basic-function-term> ::= <function-symbol>
<basic-function-term> ::= (<function-symbol> <name>*)
<goal> ::= (:goal <gd>)
\end{lstlisting}
%
% Metric spec
%
% @HDDL 2.1
Finally, the optional metric spec is added using the same syntax as in PDDL 3.0.
\begin{lstlisting}[firstnumber=last, escapechar=~]
<metric-spec> ::=~\specReq{:numeric-fluents}~
(:metric <optimization> <metric-f-exp>)
<optimization> ::= ~minimize~
<optimization> ::= ~maximize~
<metric-f-exp> ::= (<binary-op>
<metric-f-exp> <metric-f-exp>)
<metric-f-exp> ::= (<multi-op>
<metric-f-exp> <metric-f-exp>+)
<metric-f-exp> ::= (- <metric-f-exp>)
<metric-f-exp> ::= <number>
<metric-f-exp> ::= ( <function-symbol>
<name>* )
<metric-f-exp> ::= <function-symbol>
<metric-f-exp> ::= ~total-time
\end{lstlisting}
\section{Temporal and Numeric HDDL Requirements}
\label{Sec:Requirements}
The overall definition includes all the following requirement flags as in HDDL 1.0:
\begin{itemize}
\item \verb+:hierarchy+ requires the applied system to support HTN planning, so this can be seen as the basic requirement for the language defined here.
\item \verb+:method-preconditions+ requires the applied system to support method preconditions or condition when define in durative methods.
\end{itemize}
But now, the following requirement flags are also compatible with HDDL 2.1:
\begin{description}
\item \verb+:durative-actions+ requires the applied system to support durative actions and temporal ordering constraints in method definitions.
\item \verb+:duration-inequalities+ requires the applied system to support duration inequalities in durative actions declarations. Implies \verb+:durative-actions+.
\item \verb+:timed-initial-literals+ requires the applied system to support initial state with literals that become true at a specified time point. Implies \verb+:durative-actions+.
\item \verb+:numeric-fluent+ requires the applied system to support numeric fluents in preconditions and effects of actions and methods.
%\item \verb+:continuous-effects+ requires the applied system to support continuous action effects.
\end{description}
We add the following requirement flag:
\begin{description}
\item \verb+:method-constraints+ requires to specify decomposition constraints in methods.
\end{description}
\bibliography{ref}
\end{document}