-
Notifications
You must be signed in to change notification settings - Fork 0
/
sicsa-planrecognition-presentation.tex
2743 lines (2511 loc) · 121 KB
/
sicsa-planrecognition-presentation.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
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{colortbl}
\usepackage{epstopdf}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{listings}
\usepackage{letltxmacro}
\usepackage[noend]{algorithm, algpseudocode}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{pgfplots}
\usepackage{mathtools}
\newcommand\myeq{\stackrel{\mathclap{\normalfont\mbox{def}}}{=}}
\newcommand{\idest}{{\it i.e.}}
\newcommand{\exemp}{{\it e.g.}}
\newcommand{\etc}{{\it etc.}}
\newcommand{\etal}{{\it et al.}}
\lstdefinelanguage
{PDDL}[]{LISP}
{alsoletter={:,?},
morekeywords={define,domain,problem,:domain,:extends,:requirements,:strips,:equality,:typing,:conditional-effects,:strips,:types,:objects,:negative-preconditions,:disjunctive-preconditions,:existential-preconditions,:universal-preconditions, :constants,:domain-variables,:timeless,:domain-axioms,:action-expansions,:predicates,:action,:parameters,:precondition,:effect,:fluents,:primary-effect,:side-effect,:init,:goal,when,not,forall,exists,goal-type,choice,forsome,in-context}}
%[[⟨list of required aspects (keywordcomments,texcs,etc.)⟩]]
\lstdefinelanguage
{SHOP}[]{LISP}
{alsoletter={:,?,!},
morekeywords={defdomain,defproblem,:domain,:method,:operator
:goal,when,not,forall,exists,goal-type,choice,forsome,in-context}}
\lstset{language=PDDL}
\newcommand{\todo}[1]{ {\color{red} #1} }
\def\masterclass{1}
% \def\masterclass{0}
\usetheme{Madrid}
\usecolortheme{seagull}
\title[\fontsize{0.08cm}{1em}\selectfont Plan and Goal Recognition]{Plan and Goal Recognition \\ SICSA DVF Master Class}
\author[F. Meneguzzi]{Felipe Meneguzzi
}
\institute[PUCRS]{Pontifical Catholic University of Rio Grande do Sul, Brazil
\\
\url{[email protected]}
}
\date{Aberdeen, October, 2017}
\setbeamertemplate{subsection page}
{
\begingroup
\begin{beamercolorbox}[sep=12pt,center]{section title}
\usebeamerfont{section title}\insertsection\par
\end{beamercolorbox}
\vspace*{10pt}
\begin{beamercolorbox}[sep=8pt,center]{subsection title}
\usebeamerfont{subsection title}\insertsubsection\par
\end{beamercolorbox}
\endgroup
}
\AtBeginSection[]
{
\begin{frame}
\frametitle{Table of Contents}
\tableofcontents[currentsection]
\end{frame}
}
\AtBeginSubsection[]
{
\frame{\subsectionpage}
}
\begin{document}
%---------------------------------------------------------------------------------
\begin{frame}
\titlepage
\end{frame}
%---------------------------------------------------------------------------------
\section{Introduction}
\subsection[Motivation]{Motivation and Intuition}
% \begin{frame}[c]\frametitle{Tentative Structure}
% \begin{itemize}
% \item Introduction to plan recognition (from Automated Planning)
% \item Goal recognition heuristics
% \item Hybrid goal recognition heuristics (ask Mor)
% \item Optimality monitoring and applications
% \item Recognizing plans using real-time video data
% \item Future work
% \end{itemize}
% \end{frame}
\begin{frame}[c]\frametitle{Overview}
\begin{itemize}
\item Recognizing plans and goals of others is a critical ability for intelligent interaction:
\begin{itemize}
\item important for humans/agents working in the same environment
\item increasingly important as we build more intelligent systems
\end{itemize}
\item Overall area of Plan, Activity and Intent Recognition
\begin{itemize}
\item Activity recognition: recognizing meaningful activities from low-level sensor data
\item Plan/Intent/Goal recognition: recognizing intentional higher-level sequences of activities
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Goal Recognition}
\begin{itemize}
\item \textbf{Goal Recognition} is the task of recognizing agents' goal that explains a sequence of observations of its actions;
\begin{itemize}
\item Related to plan recognition, i.e. recognizing a \emph{top-level} action
\item A specific form of the problem of abduction
\end{itemize}
\item Approaches to goal and plan recognition divided into roughly two types:
\begin{itemize}
\item Plan-library based (\emph{classical} plan recognition)
\item Domain-theory based (plan recognition as planning, or PRAP)
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{An example of Activity Recognition}
% \animategraphics[loop,type=png,width=\linewidth]{2}{fig/egg-}{1}{4}
\begin{center}
\only<1>{\includegraphics[width=.5\linewidth]{fig/egg-1.jpg}}
\only<2>{\includegraphics[width=.5\linewidth]{fig/egg-2.jpg}}
\only<3>{\includegraphics[width=.5\linewidth]{fig/egg-3.jpg}}
\only<4>{\includegraphics[width=.5\linewidth]{fig/egg-4.jpg} \\
\texttt{breaking egg}
}
\end{center}
% {\color{red} Complete this once I figure out how to include graphics}
\end{frame}
\begin{frame}[c]\frametitle{An Example of Goal/Plan Recognition}
from Miquel Ramirez's thesis
\begin{columns}
\begin{column}{0.5\textwidth}
\includegraphics[width=.9\textwidth]{fig/roboschool-example.pdf}\\
Wooden pieces $p_1,p_2, \dots p_n$\\
Pieces have shapes and colors\\
Bins $b_1, b_2, \dots, b_n$
\end{column}
\begin{column}{0.5\textwidth}
\only<1>{
The possible \textbf{goals} the trainer expected to pursue:
\begin{enumerate}
\item Store all triangles in $b_1$
\item Store all spheres in $b_2$
\item Store all cubes in $b_3$
\item Store red objects in $b_2$
\item Store green objects in $b_3$
\item Store blue objects in $b_1$
\end{enumerate}
}
\only<2>{
One possible \emph{plan} for the trainer to achieve task \#1 \\(store all triangles in $b_1$):
\begin{enumerate}
\item Walk from B3 into A4
\item Pick $p_3$ up
\item Walk from A4 into B3
\item Walk from B3 into C2
\item Pick $p_4$ up
\item Throw $p_3$ into $b_1$
\item Throw $p_4$ into $b_1$
\end{enumerate}
}
\only<3->{
If sensors miss 70\% of \emph{walk} actions and half \emph{pick} and \emph{drop} actions, we may only see:
\begin{enumerate}
\item Pick $p_3$ up
\item Walk from A4 into B3
\end{enumerate}
}
\only<4->{
Here, we could deduce either task \#1 or \#4 (store all red objects in $b_2$), as other tasks are less \emph{likely}.
}
\end{column}
\end{columns}
\end{frame}
%---------------------------------------------------------------------------------
\if\masterclass1
\subsection{Formalism}
\begin{frame}[c]\frametitle{Flavors of Recognition Formalism}
\begin{columns}
\begin{column}[t]{0.5\textwidth}
Plan Library
\includegraphics[width=\textwidth]{examples/fig_plan_library.pdf}
\end{column}
\begin{column}[t]{0.5\textwidth}
Domain Theory (PRAP)
\lstinputlisting[basicstyle=\fontsize{4}{4.5}\selectfont,language=PDDL]{examples/easy_ipc_grid.pddl.txt}
\end{column}
\end{columns}
\end{frame}
\begin{frame}[c]\frametitle{Automated Planning}
\begin{definition} [\textbf{Planning}]
A planning instance is represented by a triple $\Pi = \langle \Xi, \mathcal{I}, G\rangle$, in which:
\begin{itemize}
\item $\Xi = \langle \Sigma, \mathcal{A} \rangle$ is the \textbf{domain definition}, and consists of a finite set of \textbf{facts} $\Sigma$ and a finite set of \textbf{actions} $\mathcal{A}$ (action costs typically 1);
\item $\mathcal{I} \subseteq \Sigma$ and $G \subseteq \Sigma$ represent the \textbf{planning problem}, in which $\mathcal{I} \subseteq \Sigma$ is the \textbf{initial state}, and $G \subseteq \Sigma$ is the \textbf{goal state}.
\end{itemize}
\end{definition}
\begin{itemize}
\item Actions $a \in \mathcal{A}$ are tuples $a = \langle \mathit{name}, \mathit{pre}(a), \mathit{eff}(a), \mathit{cost}(a) \rangle$
\item Facts $\Sigma$ can be modeled in a variety of ways:
\begin{itemize}
\item As a logic language (restricted FOL): \\states are truth assignments
\item As a set of variables $\mathcal{V}$ with finite domains: \\states are variable assignments
\end{itemize}
%\todo{Complete this in a new slide}
\end{itemize}
\end{frame}
% \begin{frame}[t]\frametitle{Roboschool Formalization in PDDL}
% \begin{columns}
% \begin{column}[t]{0.6\textwidth}
% \lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL]{examples/roboschool.pddl.txt}
% \end{column}
% \begin{column}[t]{0.4\textwidth}
% \lstinputlisting[basicstyle=\fontsize{3.5}{3.8}\selectfont,language=PDDL]{examples/pb2_full.pddl.txt}
% \end{column}
% \end{columns}
% \end{frame}
\begin{frame}[t]\frametitle{Roboschool Domain in PDDL}
\begin{columns}
\begin{column}[t]{0.5\textwidth}
\lstinputlisting[basicstyle=\fontsize{6}{6.5}\selectfont,language=PDDL,linerange=1-26]{examples/roboschool.pddl.txt}
\end{column}
\begin{column}[t]{0.5\textwidth}
\lstinputlisting[basicstyle=\fontsize{6}{6.5}\selectfont,language=PDDL,linerange=27-50]{examples/roboschool.pddl.txt}
\end{column}
\end{columns}
\end{frame}
\begin{frame}[t]\frametitle{Roboschool Problem in PDDL}
\begin{columns}
\begin{column}[t]{0.5\textwidth}
\lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL,linerange=1-24]{examples/pb2_full.pddl.txt}
\end{column}
\begin{column}[t]{0.5\textwidth}
\lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL,linerange=25-50]{examples/pb2_full.pddl.txt}
\end{column}
\end{columns}
\end{frame}
% \begin{frame}[c]\frametitle{Automated Planning: Plans}
% \begin{definition} [\textbf{Planning}]
% A planning instance is represented by a triple $\Pi = \langle \Xi, \mathcal{I}, G\rangle$, in which:
% \begin{itemize}
% \item $\Xi = \langle \Sigma, \mathcal{A} \rangle$ is the \textbf{domain definition}, and consists of a finite set of \textbf{facts} $\Sigma$ and a finite set of \textbf{actions} $\mathcal{A}$ (action costs typically 1);
% \item $\mathcal{I} \subseteq \Sigma$ and $G \subseteq \Sigma$ represent the \textbf{planning problem}, in which $\mathcal{I} \subseteq \Sigma$ is the \textbf{initial state}, and $G \subseteq \Sigma$ is the \textbf{goal state}.
% \end{itemize}
% \end{definition}
% A solution to a planning instance is a plan $\pi = \langle a_1, \dots a_n\rangle$ that modifies the initial state $\mathcal{I}$ into one where the goal state $\mathcal{G}$ holds by the successive application of actions $a_i \in \pi$
% \end{frame}
\begin{frame}[c]\frametitle{Solving Planning Problems}
Actions $a \in \mathcal{A}$ are tuples $a = \langle \mathit{name}, \mathit{pre}(a), \mathit{eff}(a), \mathit{cost}(a) \rangle$.
They induce a state transition system such that:
\begin{itemize}
\item $\mathit{eff}(a)$ constitute a set of negative (delete) and positive (add) effects: $\mathit{eff}^{+}(a)$, $\mathit{eff}^{-}(a)$
\item an action $a$ is applicable to a state $s$ iff $s \models \mathit{pre}(a)$
\item applying $a$ to $s$ ($\gamma(s,a)$) yields a state $s' = (s / \mathit{eff}^{-}(a)) \cup \mathit{eff}^{+}(a)$, \\i.e. it is such that $s' \models \mathit{eff}(a)$
\end{itemize}
The solution to a planning problem $\Pi = \langle \Xi, \mathcal{I}, G\rangle$ is a plan $\pi = \langle a_1, \dots, a_n\rangle$ such that:
\begin{itemize}
\item $\mathcal{I} \models \mathit{pre}(a_1)$
\item $\gamma(\gamma(\dots \gamma(I, a_1),\dots), a_n) \models G$
\item The cost of $\pi$ is $\sum_{i=1}^{n}\mathit{cost}(a_i)$
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Roboschool PDDL Plan}
\begin{columns}
\begin{column}{0.5\textwidth}
\lstinputlisting[basicstyle=\fontsize{7}{7.5}\selectfont,language=PDDL]{examples/pb2_plan.txt}
\end{column}
\begin{column}{0.5\textwidth}
\includegraphics[width=.9\textwidth]{fig/roboschool-example.pdf}\\
\end{column}
\end{columns}
\end{frame}
\begin{frame}[c]\frametitle{Goals in PDDL}
\begin{columns}
\begin{column}[t]{0.3\textwidth}
\lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL]{examples/pb1.pddl.txt}
\lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL]{examples/pb1_plan.txt}
\end{column}
\begin{column}[t]{0.3\textwidth}
\lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL]{examples/pb2.pddl.txt}
\lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL]{examples/pb2_plan.txt}
\end{column}
\begin{column}[t]{0.3\textwidth}
\lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL]{examples/pb3.pddl.txt}
\lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL]{examples/pb3_plan.txt}
\end{column}
\end{columns}
% \begin{columns}
% \begin{column}[t]{0.3\textwidth}
% \lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL]{examples/pb4.pddl.txt}
% \lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL]{examples/pb4_plan.txt}
% \end{column}
% \begin{column}[t]{0.3\textwidth}
% \lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL]{examples/pb5.pddl.txt}
% \lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL]{examples/pb5_plan.txt}
% \end{column}
% \begin{column}[t]{0.3\textwidth}
% \lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL]{examples/pb6.pddl.txt}
% \lstinputlisting[basicstyle=\fontsize{5}{5.5}\selectfont,language=PDDL]{examples/pb6_plan.txt}
% \end{column}
% \end{columns}
\end{frame}
\begin{frame}[c]\frametitle{Goal Recognition Problem}
\begin{definition}[\textbf{Goal Recognition Problem}]
A goal recognition problem is a tuple $P_{G} = \langle \Xi, \mathcal{I}, \mathcal{G}, \mathbf{O} \rangle$, where:
\begin{itemize}
\item $\Xi = \langle \Sigma, \mathcal{A} \rangle$ is the domain definition (facts and actions) ;
\item $\mathcal{I} \subseteq \Sigma$ is the initial state;
\item $\mathcal{G}$ s.t. $\forall{G \in \mathcal{G}}, G \subseteq \Sigma$ is a set of candidate goals (with an assumed hidden goal $G$); and
\item $\mathbf{O}$ is a sequence $\langle o_1, \dots o_n \rangle$ of observations, where $o_i \in \mathcal{A}$
\end{itemize}
\end{definition}
\begin{itemize}
\item The solution for a goal recognition problem is the hidden goal $G \in \mathcal{G}$ that is most consistent with observation sequence $O$.
\item Caveat: we may have other representations for the observations
\item This is what I will refer to as PRAP
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Plan Recognition Problem}
\begin{definition}[Plan Recognition Problem]
A plan recognition problem is a tuple $P_{P} = \langle \Xi, \mathcal{M}, \mathcal{I}, \mathbf{O} \rangle$, where:
\begin{itemize}
\item $\Xi = \langle \Sigma, \mathcal{A} \rangle$ is the domain definition (facts and actions) ;
\item $\mathcal{M}$ is a plan-library containing task-decomposing methods of the form $\langle t, \langle t_1, \dots t_n \rangle \rangle$ (implicitly defining a set $\mathcal{T}$ of task symbols); and
\item $\mathcal{I} \subseteq \Sigma$ is the initial state;
\item $\mathbf{O}$ is a sequence $\langle o_1, \dots o_n \rangle$ of observations, where $o_i \in \mathcal{A}$
\end{itemize}
Here, $\mathcal{T}$ comprises non-primitive tasks and primitive tasks corresponding to the names of actions $a \in \mathcal{A}$.
\end{definition}
\begin{itemize}
\item The solution to a plan recognition goal is the top level task $t_{I} \in \mathcal{T}$ that generates a decomposition consistent with the observations in $\mathcal{O}$
\item Requires a lot more domain knowledge (i.e. the plan-library)
\item This is what I will refer to as classical plan recognition
\end{itemize}
\end{frame}
% \begin{frame}[c]\frametitle{Roboschool}
% {\color{red} Add Roboschool problem for master class}
% \end{frame}
\begin{frame}[c]\frametitle{Observations}
\begin{itemize}
\item Observations often refer to \emph{observed action symbols}
\begin{itemize}
\item This observation sequence can be either \textbf{partial} or \textbf{full}
\item Observation sequence can be \textbf{noisy}
\item Observations can also be of \textbf{states/fluents} rather than actions
\end{itemize}
\end{itemize}
\begin{columns}
\begin{column}[t]{0.3\textwidth}
{\color{red} Original Plan}\\
\lstinputlisting[basicstyle=\fontsize{6}{6.5}\selectfont,language=PDDL]{examples/pb2_plan.txt}
\end{column}
\begin{column}[t]{0.6\textwidth}
\only<2>{
{\color{red} Full Observation}\\
\lstinputlisting[basicstyle=\fontsize{6}{6.5}\selectfont,language=PDDL,linerange={1-15}]{examples/pb2_plan.txt}}
\only<3>{
{\color{red} Partial Observation}\\
\lstinputlisting[basicstyle=\fontsize{6}{6.5}\selectfont,language=PDDL,linerange={1-1,4-5,8-9,13-15}]{examples/pb2_plan.txt}}
\only<4>{
{\color{red} Noisy Observation}\\
\lstinputlisting[basicstyle=\fontsize{6}{6.5}\selectfont,language=PDDL,linerange={1-17}]{examples/pb2_plan-noisy.txt}}
\only<5>{
{\color{red} Noisy Partial Observation}\\
\lstinputlisting[basicstyle=\fontsize{6}{6.5}\selectfont,language=PDDL,linerange={1-3,5-8,10-13,16-17}]{examples/pb2_plan-noisy.txt}}
\only<6>{
{\color{red} State Observation}\\
\lstinputlisting[basicstyle=\fontsize{6}{6.5}\selectfont,language=PDDL]{examples/pb2_observation.txt}}
\only<7>{
{\color{red} Noisy State Observation}\\
\lstinputlisting[basicstyle=\fontsize{6}{6.5}\selectfont,language=PDDL]{examples/pb2_observation-noisy.txt}}
\end{column}
\end{columns}
\end{frame}
\fi
% @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
\section{Goal Recognition as reasoning over Heuristics}
\subsection{Motivation and Background}
\if\masterclass1
% \begin{frame}[c]\frametitle{Goal Recognition}
% Background on other PRAP approaches:
% \begin{itemize}
% \item Ramirez and Geffner
% \item Martin
% \item Sohrabi
% \end{itemize}
% \end{frame}
\begin{frame}[c]\frametitle{Motivation}
\begin{itemize}
\item Plan Recognition as Planning (PRAP) requires much less domain knowledge \\
No need for a plan library
\item Existing approaches are accurate, but very inefficient
\item Key Insight: Landmark-based heuristics are efficient and informative\\
\begin{itemize}
\item landmarks provide evidence of \textbf{expected sequence} of observations
\item can be computed once before recognition time
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Previous Work: Ramirez and Geffner (2009 and 2010)}
\begin{itemize}
\item First approaches to goal recognition: Plan Recognition as Planning (PRAP)
\item Probabilistic model aims to compute $P(G \mid O)$
\item Following Bayes Rule $P(G \mid O) = \alpha P(O \mid G) P(G)$
\item Given $P(G)$ as a prior, key bottleneck is computing $P(O \mid G)$
\begin{itemize}
\item In their work $P(O \mid G)$ is computed in terms of a cost difference $c(G,O) - c(G,\bar{O})$
\item Computational cost is \textbf{two planner calls per goal hypothesis}
\item For online recognition: two planner calls per goal hypothesis \textbf{per observation}
\end{itemize}
\item Some conclusions challenged for path planning domains\\ (Masters and Sardina 2017)
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Previous Work: E-Martín et al. (2015)}
\begin{itemize}
\item Improvement over Ramirez and Geffner's approach:
\begin{itemize}
\item Relaxes assumption that $c(G \mid O) < c(G,\bar{O})$
\item Based on pre-computation of cost estimates using a planning graph
\item Often orders of magnitude faster than Ramirez
\end{itemize}
\item Performance degrades substantially with low observability
\item Does not cope with noisy observations
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Previous Work: Sohrabi et al.}
\begin{itemize}
\item Formalizes PRAP with explicit assumptions and notions of
\begin{itemize}
\item noisy observations
\item incomplete observations
\item action costs
\end{itemize}
\item Solves the goal recognition problem using a combination of:
\begin{itemize}
\item transformation of the recognition problem into a new $P'$ planning problem
\item approximation of $P(G \mid O)$ by generating ``diverse plans'' for $P'$
\end{itemize}
\item Very accurate recognition for some domains
\item No runtime efficiency evaluation (likely to be slow)
\end{itemize}
\end{frame}
\fi
\begin{frame}{Overview}
\begin{itemize}
\item In this work, we use a \textbf{planning domain definition} to represent agent behavior and environment properties;
\item Previous approaches involve multiple calls to a modified planner.
\item Our main contribution is twofold:
\begin{itemize}
\item We \textbf{obviate the need to execute a planner multiple times} for recognizing goals; and
\item We develop novel goal recognition heuristics that \textbf{use planning landmarks}.
\end{itemize}
% \item We evaluate our approaches against the fastest and most accurate approach of Ramírez and Geffner ({\footnotesize Plan Recognition as Planning. IJCAI, 2009}) over \textbf{15 planning domains};
\item We show that our approaches are \textbf{more accurate} and \textbf{orders of magnitude faster} than Ramírez and Geffner's approach.
\end{itemize}
\end{frame}
\if\masterclass1
% \subsection{Planning Heuristics}
% \begin{frame}[c]\frametitle{Solving Planning Problems}
% Actions $a \in \mathcal{A}$ are tuples $a = \langle \mathit{name}, \mathit{pre}(a), \mathit{eff}(a), \mathit{cost}(a) \rangle$.
% They induce a state transition system such that:
% \begin{itemize}
% \item $\mathit{eff}(a)$ constitute a set of negative (delete) and positive (add) effects: $\mathit{eff}^{+}(a)$, $\mathit{eff}^{-}(a)$
% \item an action $a$ is applicable to a state $s$ iff $s \models \mathit{pre}(a)$
% \item applying $a$ to $s$ ($\gamma(s,a)$) yields a state $s' = (s / \mathit{eff}^{-}(a)) \cup \mathit{eff}^{+}(a)$, \\i.e. it is such that $s' \models \mathit{eff}(a)$
% \end{itemize}
% The solution to a planning problem $\Pi = \langle \Xi, \mathcal{I}, G\rangle$ is a plan $\pi = \langle a_1, \dots, a_n\rangle$ such that:
% \begin{itemize}
% \item $\mathcal{I} \models \mathit{pre}(a_1)$
% \item $\gamma(\gamma(\dots \gamma(I, a_1),\dots), a_n) \models G$
% \item The cost of $\pi$ is $\sum_{i=1}^{n}\mathit{cost}(a_i)$
% \end{itemize}
% \end{frame}
\begin{frame}[c]\frametitle{From STRIPS Problem P to state model S(P)}
Most modern planning algorithms convert a planning problem $\Pi = \langle \Xi, \mathcal{I}, G\rangle$, with $\Xi = \langle \Sigma, \mathcal{A} \rangle$ into one of state space search, where:
\begin{itemize}
\item the states $s \in S$ are \textbf{collections of atoms} from $\Sigma$
\item the initial state $s_0 = I$
\item the goal states $S_g$ are such that $\forall{s \in S_g} s \models G$
\item the applicable actions for a state $s$ in $A(s)$ are actions from $a \in \mathcal{A}$ such that $s \models \mathit{pre}(a)$
\item the successor state $s' = (s / \mathit{eff}^{-}(a)) \cup \mathit{eff}^{+}(a)$
\item all action costs are assumed to be 1
\end{itemize}
How do we solve these problems?
\end{frame}
\begin{frame}[c]\frametitle{Heuristic Search Planning}
\begin{itemize}
\item Explicitly \textbf{searches} graph associated with model $S(P)$ with \textbf{heuristic} $h(s)$ that estimates cost from $s$ to goal
\item \textbf{Key idea:} Heuristic $h$ extracted automatically from problem $\Pi$
\item This is the mainstream approach in classical planning \\(and other forms of planning as well), \\ enabling the solution of problems over \textbf{huge spaces}
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Heuristic Graph Search}
\begin{algorithmic}[1]
\small
\Function{graphSearch}{problem $p$, strategy $s$}
\State{$\mathit{closed} \gets \{ \}$}\Comment{We now keep a list of explored states}
\State{$\mathit{frontier}.\Call{add}{new Node(\mathit{p.initial})}$}
\Loop
\If{$\mathit{frontier}$ is empty}
\State{\textbf{return} $\mathbf{fail}$}
\EndIf
\State{$n \gets s.\Call{removeChoice}{\mathit{frontier}}$}
\State{$\mathit{closed}.\Call{add}{n.state}$}\Comment{Where we keep states we already visisted}
\If{$\Call{p.goalTest}{\mathit{n.state}}$}
\State{\textbf{return} $\Call{getPath}{n}$}
\EndIf
\ForAll{$a \in p.\Call{actions}{n}$}
\State{$n' \gets a.\Call{result}{\mathit{n.state}}$}
\If{$\mathit{n'.state} \notin \mathit{closed}$}
\State{$\mathit{frontier}.\Call{add}{n'}$} \Comment{And only explore states we haven't visited}
\EndIf
\EndFor
\EndLoop
\EndFunction
\end{algorithmic}
\end{frame}
\begin{frame}[c]\frametitle{Heuristics}
\begin{itemize}
\item A heuristic function \textbf{estimates} the true cost of reaching a goal $G$
\item Only requirement for an heuristic $h(n)$ to \textbf{work} with $A^{*}$ is that $h(G)=0$
\begin{itemize}
\item Though this is \textbf{not} necessarily \textbf{optimal}
\end{itemize}
\end{itemize}
\end{frame}
\newcommand\puzzle[9]{
{\Large
\begin{tabular}{|m{.5em}|m{.5em}|m{.5em}|}
\hline
#1 & #2 & #3\\
\hline
#4 & #5 & #6\\
\hline
#7 & #8 & #9\\
\hline
\end{tabular}
}
}
\begin{frame}[c]\frametitle{Heuristic Functions}
\begin{columns}
\begin{column}{0.5\textwidth}
\begin{center}
\puzzle{7}{2}{4}
{5}{ }{6}
{8}{3}{1}\\[1em]
Start State
\end{center}
\end{column}
\begin{column}{0.5\textwidth}
\begin{center}
\puzzle{1}{2}{3}
{4}{5}{6}
{7}{8}{ }\\[1em]
Goal State
\end{center}
\end{column}
\end{columns}
\begin{itemize}
\item Heuristics
\begin{itemize}
\item<2-> The number of misplaced tiles -- \textbf{Hamming distance} ($h_1 = 7$)
\item<2-> The sum of distances of the tiles from their goal positions -- \textbf{Manhattan distance} ($h_2 = 16$)
\end{itemize}
\item<2-> Are they admissible?
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Creating Heuristics}
\begin{itemize}
\item Ignore specific preconditions of actions (need some domain knowledge)
\item Consider the sliding blocks from search
\end{itemize}
\lstinputlisting[basicstyle=\fontsize{8}{8.5}\selectfont,language=PDDL]{examples/sliding_blocks.pddl.txt}
\begin{itemize}
\item If we remove \texttt{(blank s2)}, we are left with Manhattan distance
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Domination}
\begin{itemize}
\item h2 is always greater than h1.
\begin{itemize}
\item It therefore dominates h1 (it is a tighter bound on the actual cost)
\item And is more efficient
\end{itemize}
\item How can we invent good heuristics?
\item Typically, by \textbf{relaxing} the problem.
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Heuristics for Classical Planning}
\begin{itemize}
\item Key development in planning in the 90’s, is automatic extraction of \textbf{heuristic functions} to guide search for plans
\item The general idea was known: heuristics often \textbf{explained} as \textbf{optimal} cost functions of \textbf{relaxed} (simplified) problems (Minsky 61; Pearl 83)
\item Most common relaxation in planning, $P^+$, obtained by dropping \textbf{delete-lists} from ops in P. If $c^*(P)$ is optimal cost of P, then
$$h^{+}(P) \myeq c^{*}(P^{+})$$
\item Heuristic $h^{+}$ \textbf{intractable} but easy to \textbf{approximate}; i.e.
\begin{itemize}
\item computing \textbf{optimal} plan for $P^{+}$ is \textbf{intractable}, but
\item computing a non-optimal plan for $P^{+}$ \textbf{(relaxed plan)} easy
\end{itemize}
\item State-of-the-art heuristics as in FF or LAMA still rely on $P^{+}$
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Additive Heuristic}
\begin{itemize}
\item For all \textbf{atoms} $p$:
$$h(p;s) \myeq \begin{cases}
0 & \mathit{if} p \in s, \mathit{else} \\
\min_{a \in O}\left[ \mathit{cost}(a) + h(Pre(a); s) \right]
\end{cases}$$
\item For \textbf{sets} of atoms $C$, assume \textbf{independence}:
$$h(C;s) \myeq \sum_{r \in C} h(r; s)$$
\item Resulting \textbf{heuristic function} $h_{add}(s)$:
$$h_{\mathit{add}}(s) \myeq h(Goal; s)$$
\item Heuristic not admissible, but informative and fast
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Max Heuristic}
\begin{itemize}
\item For all \textbf{atoms} $p$:
$$h(p;s) \myeq \begin{cases}
0 & \mathit{if} p \in s, \mathit{else} \\
\min_{a \in O}\left[ 1 + h(Pre(a); s) \right]
\end{cases}$$
\item For \textbf{sets} of atoms $C$, assume \textbf{independence}:
$$h(C;s) \myeq \max_{r \in C} h(r; s)$$
\item Resulting \textbf{heuristic function} $h_{add}(s)$:
$$h_{\mathit{max}}(s) \myeq h(Goal; s)$$
\item Heuristic admissible, but not very informative
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Max Heuristic and (Relaxed) Planning Graph}
\begin{itemize}
\item Build reachability graph $P_0, A_0, P_1, A_1, \dots$
\end{itemize}
\begin{center}
\includegraphics[width=.5\textwidth]{fig/rpg-example.pdf}
\end{center}
\begin{itemize}
\item Graph implicitly \textbf{represents} max heuristic
$$h_{\mathit{max}}(s) = \min~i~\mathit{such~that}~G \subseteq P_{i}$$
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Relaxed Planning Graph}
\begin{itemize}
\item A variation of the Planning Graph from Graphplan
\begin{itemize}
\item Alternating fact and action levels
\item Ignores negative effects from actions, no mutex relations
\end{itemize}
\item Fact level $F_0$ contains the facts that are true in the initial state,
\item Action level $A_0$ contains actions whose preconditions are reached from $F_0$,
\item $F_1$ contains $F_0$ plus the add effects of the actions in $A_0$, and so on.
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{RPG Construction}
\begin{algorithmic}[1]
\small
\Function{BuildFullRPG}{$\Xi$, $\mathcal{I}$, $G$}
\State $i \gets 0$
\State \textsc{RPG.FactLevel$_{0}$} $\gets \mathcal{I}$
\While{$G \nsubseteq$ \textsc{RPG.FactLevel$_{i}$}}
\State \textsc{RPG.ActionLevel$_{i}$} $\gets \lbrace a \in \mathcal{A} \mid$ \textit{pre}($a$) $\in$ \textsc{RPG.FactLevel$_{i}$}$\rbrace$
\State \textsc{RPG.FactLevel$_{i+1}$} $\gets$ \textsc{RPG.FactLevel$_{i}$} $\cup$ \textit{eff}($a$)$^+$, $\forall a \in$ \textsc{RPG.ActionLevel$_{i}$}
\If{\textsc{RPG.FactLevel$_{i+1}$} $\equiv$ \textsc{RPG.FactLevel$_{i}$}}
\State \textbf{return} $G$ \textsc{unreachable} \Comment{\textit{The algorithm fails if at some point before reaching the facts of the goal no new fact level is added in the graph.}}
\EndIf
\State $i \gets i + 1$
\EndWhile
\State \textbf{return} \textsc{RPG}
\EndFunction
\end{algorithmic}
\end{frame}
\begin{frame}[c]\frametitle{Blocks World: RPG}
\begin{center}
\includegraphics[width=\textwidth]{fig/blocksworld-landmarks-rpg.pdf}
\end{center}
\vspace{-2cm}
Blocks World Problem\\
\includegraphics[width=.5\textwidth]{fig/blocksworld-problem.pdf}
\end{frame}
\subsection{Estimating Goal Completion with Landmarks}
\begin{frame}{Background: Planning and Landmarks}
\begin{definition} [\textbf{Planning}]
A planning instance is represented by a triple $\Pi = \langle \Xi, \mathcal{I}, G\rangle$, in which:
\begin{itemize}
\item $\Xi$ $=$ $\langle$$\Sigma$, $\mathcal{A}$$\rangle$ is the \textbf{domain definition}, and consists of a finite set of \textbf{facts} $\Sigma$ and a finite set of \textbf{actions} $\mathcal{A}$ (action costs $=$ 1);
\item $\mathcal{I}$ and $G$ represent the \textbf{planning problem}, in which $\mathcal{I}$ $\subseteq$ $\Sigma$ is the \textbf{initial state}, and $G$ $\subseteq$ $\Sigma$ is the \textbf{goal state}.
\end{itemize}
\end{definition}
\begin{definition}[\textbf{Landmarks}]
Given a planning instance $\Pi = \langle \Xi, \mathcal{I}, G\rangle$, a \textbf{fact} (or \textbf{action}) $L$ is a landmark in $\Pi$ iff $L$ must be \textbf{satisfied} (or \textbf{executed}) at some point along all valid plans that achieve $G$ from $\mathcal{I}$.
\end{definition}
% \begin{itemize}
% \item To extract landmarks and their ordering, we use an algorithm developed by Hoffman \emph{et al.} {\footnotesize (Ordered Landmarks in Planning. JAIR, 2004)}.
% \end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Computing Landmarks}
\begin{itemize}
\item Deciding whether a fact is a landmark is PSPACE-complete\\
Involves deciding whether a plan exists with out actions that achieve it
\item Multiple types of landmarks/orderings
\item Multiple ways of computing landmarks:
\begin{itemize}
\item Complete set of landmarks (very expensive)
\item Various methods to compute incomplete set of landmarks \\(e.g. delete relaxation, backchaining on RPG)
\item Disjunctive landmarks
\end{itemize}
\item In our work we use an algorithm from Hoffman \emph{et al.} (2004) to compute an incomplete set of landmarks with a partial order relation
\end{itemize}
\end{frame}
\begin{frame}[c]\frametitle{Computing Landmarks}
% \begin{columns}
% \begin{column}{0.5\textwidth}
% \includegraphics[width=\textwidth]{fig/blocksworld-landmarks-rpg.pdf}
% \end{column}
% \begin{column}{0.5\textwidth}
% \includegraphics[width=\textwidth]{fig/blocksworld-landmarks-example.pdf}
% \end{column}
% \end{columns}
\begin{center}
\includegraphics[width=\textwidth]{fig/blocksworld-landmarks-rpg.pdf}
\end{center}
\vspace{-2cm}
Blocks World Problem\\
\includegraphics[width=.4\textwidth]{fig/blocksworld-landmarks-example.pdf}
\end{frame}
\fi
%---------------------------------------------------------------------------------
\begin{frame}{Computing Achieved Landmarks}
\if\masterclass1
% \todo{Change this example to the one from Ramirez}
\fi
\begin{center}
\includegraphics[width=.4\textwidth]{example.pdf}
\end{center}
\begin{itemize}
\item Our heuristics require identifying which fact landmarks have been achieved during the observed plan execution for every candidate goal $G \in \mathcal{G}$;
\item For every candidate goal $G \in \mathcal{G}$:
\begin{itemize}
\item Extract \emph{ordered} landmarks for $G$;
\item Use achieved landmarks of $G$ in preconditions and effects of every observed action $o \in O$;
\item Under partial observability, we deal with missing actions by inferring that predecessors of observed landmarks must have been achieved;
\end{itemize}
\end{itemize}
% \begin{figure}[here]
% \centering
% \includegraphics[width=0.65\linewidth]{algo1-computing_achieved_landmarks.pdf}
% \end{figure}
\end{frame}
%---------------------------------------------------------------------------------
\begin{frame}{Landmark-Based Goal Completion Heuristic}
\begin{itemize}
\item Goal Completion $h_{gc}$ aggregates the percentage of completion of each sub-goal into an overall percentage of completion for all facts of a candidate goal;
\end{itemize}
\begin{equation}
h_{gc}(G, \mathcal{AL}_{G}, \mathcal{L}_{G}) = \left(\frac{\sum_{g \in G} \frac{|\mathcal{AL}_{g} \in \mathcal{AL}_{G} |}{|\mathcal{L}_{g} \in \mathcal{L}_{G}|}}{ |G| }\right)
\end{equation}
where:
\begin{itemize}
\item $\mathcal{AL}_{G}$ achieved landmarks for goals in $G$
\item $\mathcal{L}_{G}$ all landmarks for goals in $G$
\end{itemize}
\end{frame}
% @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
\if\masterclass1
\begin{frame}{Landmark-Based Goal Completion Heuristic: Algorithm}
\begin{itemize}
\item Our approach allows the use of a threshold $\theta$, giving us \textbf{flexibility to avoid eliminating candidate goals} whose the percentage of goal completion are close to the highest completion value;
\end{itemize}
\begin{figure}[here]
\centering
\includegraphics[width=0.8\linewidth]{algo2-heuristic_goalcompletion.pdf}
\end{figure}
\end{frame}
\fi
\begin{frame}{Example (1 of 3)}
\begin{figure}[here]
\centering
\includegraphics[width=0.75\linewidth]{example-blocksworld.pdf}
\end{figure}
\begin{itemize}
\item Observations:
\begin{itemize}
\item \texttt{(unstack D B)}; and
\item \texttt{(unstack C A)}.
\end{itemize}
\item The real goal is: \texttt{(and (ontable D) (on C D) (clear C))}
\end{itemize}
\end{frame}
\newcommand{\achieved}[1]{{\color{red}#1}}
\begin{frame}{Example (2 of 3)}
\textbf{Achieved Landmarks in Observations:}
\begin{itemize}
\item \texttt{(and (ontable D) (clear A) (on A D))}:%, 5 out of 8:
\begin{itemize}\scriptsize \setlength{\itemindent}{-3em}
% \item {\scriptsize \texttt{[(clear A)]}, \texttt{[(clear A) (ontable A) (handempty)]},
% \\ \texttt{[(on C A) (clear C) (handempty)]}, \texttt{[(holding D)]},
% \\ \texttt{[(clear D) (on D B) (handempty)]}}
\item[] \texttt{(ontable d) $\rightarrow$ \achieved{[(clear d), (on d b), (handempty)]}, \achieved{[(holding d)]}, \break [(ontable d)]} % 2 achieved
\item[] \texttt{(clear a) $\rightarrow$ \achieved{[(on c a), (clear c), (handempty)]}, \achieved{[(clear a)]}}, % 2 achieved
\item[] \texttt{(on a d) $\rightarrow$ \achieved{[(on c a), (clear c), (handempty)]}, \break \achieved{[(clear a), (ontable a), (handempty)]}, \break [(holding a), (clear d)], [(on a d)]}, % 2 achieved
\end{itemize}
\item \texttt{(and (ontable D) (clear B) (on B D))}:%, 4 out of 7
\begin{itemize}\scriptsize \setlength{\itemindent}{-3em}
% \item {\scriptsize \texttt{[(clear B)]}, \texttt{[(ontable B) (handempty)]},
% \\ \texttt{[(on D B) (clear D) (handempty)]}, \texttt{[(holding D)]}}
\item[] \texttt{(ontable d) $\rightarrow$ \achieved{[(clear d), (on d b), (handempty)]}, \achieved{[(holding d)]}, \break [(ontable d)]} % 2 achieved
\item[] \texttt{(clear b) $\rightarrow$ \achieved{[(clear d), (on d b), (handempty)]}, \achieved{[(clear b)]}} % 2 achieved
\item[] \texttt{(on b d) $\rightarrow$ \achieved{[(ontable b), (handempty)]}, [(clear d), (holding b)], [(on b d)]} % 1 achieved
\end{itemize}
\item \texttt{(and (ontable D) (clear C) (on C D))}:%, 5 out of 7
\begin{itemize}\scriptsize \setlength{\itemindent}{-3em}
% \item {\scriptsize \texttt{[(clear C)]}, \texttt{[(clear C) (on C A) (handempty)]}, \texttt{[(clear D) (holding C)]}
% \\ \texttt{[(clear D) (on D B) (handempty)]}, \texttt{[(holding D)]}}
\item[] \texttt{(ontable d) $\rightarrow$ \achieved{[(clear d), (on d b) (handempty)]}, \achieved{[(holding d)]}, [ontable d]} % 2 achieved
\item[] \texttt{(clear c) $\rightarrow$ \achieved{[(clear c)]}} % 1 achieved
\item[] \texttt{(on c d) $\rightarrow$ \achieved{[(on c a), (clear c), (handempty)]}, \achieved{[(holding c), (clear d)]}, [on c d]} % 2 achieved
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{Example (3 of 3) - $h_{gc}$}
\textbf{Landmark-Based Goal Completion Heuristic}
% TODO break this down in more detail
\begin{itemize}
\item \texttt{(and (ontable D) (clear A) (on A D))}:%, 5 out of 8:
\begin{itemize}
%\item Goal Completion: 0.7222
\item Goal Completion: $\displaystyle \frac{\frac{2}{3}+\frac{2}{2}+\frac{2}{4}}{3} = 0.7222$
\end{itemize}
\item \texttt{(and (ontable D) (clear B) (on B D))}:%, 4 out of 7:
\begin{itemize}
\item Goal Completion: $\displaystyle \frac{\frac{2}{3}+\frac{2}{2}+\frac{1}{3}}{3} = 0.6666$
\end{itemize}
\item \texttt{(and (ontable D) (clear C) (on C D))}:%, 5 out of 7:
\begin{itemize}
\item Goal Completion: $\displaystyle \frac{\frac{2}{3}+\frac{1}{1}+\frac{2}{3}}{3} = 0.7733$ \textbf{(highest estimated value)}
\end{itemize}
\end{itemize}
\end{frame}
%---------------------------------------------------------------------------------
\begin{frame}{Landmark-Based Uniqueness Heuristic (1 of 2)}
\begin{itemize}
\item Our second heuristic computes \textbf{landmark uniqueness}: \\inverse frequency of a landmark within landmarks for candidate goals:%, \emph{i.e.}, how unique (and thus informative) each landmark is among all landmarks;
\end{itemize}
\begin{equation}
L_{\mathit{Uniq}}(L, \mathcal{L}_{\mathcal{G}}) = \left(\frac{1}{\displaystyle\sum_{\mathcal{L} \in \mathcal{L_G}} |\{L |L \in \mathcal{L}\}|}\right)
\end{equation}
\begin{center}
\includegraphics[width=.4\textwidth]{example.pdf}
\quad
\begin{minipage}{.4\textwidth}
\vspace{-6em}
$L_{\mathit{Uniq}}(L2)=1/2$ \\
$L_{\mathit{Uniq}}(L1)=1/3$ \\
$L_{\mathit{Uniq}}(L3)=1$
\end{minipage}
\end{center}
\end{frame}
% @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
\begin{frame}{Landmark-Based Uniqueness Heuristic (2 of 2)}
\begin{itemize}
\item Our second heuristic, called $h_{uniq}$, estimates the goal completion of a candidate goal $G$ by calculating the ratio between the sum of the uniqueness value of the achieved landmarks of $G$ and the sum of the uniqueness value of all landmarks of $G$;
\end{itemize}
\begin{equation}
h_{\mathit{uniq}}(G, \mathcal{AL}_{G}, \mathcal{L}_{G}, \Upsilon_{uv}) = \left(
\frac
{\displaystyle\sum_{\mathcal{A}_{L} \in \mathcal{AL}_{G}}\Upsilon_{uv}(\mathcal{A}_{L})}
{\displaystyle\sum_{L \in \mathcal{L}_{G}}\Upsilon_{uv}(L)}\right)
\end{equation}
where:
\begin{itemize}
\item $\Upsilon_{uv}$ is a table of uniqueness values
\item $\mathcal{AL}_{G}$ achieved landmarks for goals in $G$
\item $\mathcal{L}_{G}$ all landmarks for goals in $G$
\end{itemize}
\end{frame}
% @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
\if\masterclass1
\begin{frame}{Landmark-Based Uniqueness Heuristic: Algorithm}
\begin{itemize}
\item Our second heuristic is called $h_{uniq}$;
\end{itemize}
\begin{figure}[here]
\centering
\includegraphics[width=0.75\linewidth]{algo3-heuristic_uniqueness.pdf}
\end{figure}
\end{frame}
\fi
%---------------------------------------------------------------------------------
\begin{frame}{Example (1 of 2)}
\begin{figure}[here]
\centering
\includegraphics[width=0.75\linewidth]{example-blocksworld.pdf}
\end{figure}
\begin{itemize}
\item Observations:
\begin{itemize}
\item \texttt{(unstack D B)}; and
\item \texttt{(unstack C A)}.
\end{itemize}
\item The real goal is: \texttt{(and (ontable D) (on C D) (clear C))}
\end{itemize}
\end{frame}