-
Notifications
You must be signed in to change notification settings - Fork 0
/
lata18.tex
1157 lines (982 loc) · 38.1 KB
/
lata18.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{listings}
%\usepackage[francais]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
%\usepackage{MyriadPro}
\usepackage{cabin}
\usepackage{graphicx}
\usepackage{array}
\usepackage{tikz}
\usetikzlibrary{positioning, backgrounds, shapes, chains, decorations.pathmorphing}
\usepackage{forest}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{stmaryrd}
%\usepackage{mdsymbol}
\usepackage{MnSymbol}
\usepackage{xcolor}
\usepackage{verbatim}
\usepackage{array}
%\usepackage{csquotes}
\useoutertheme{infolines}
\input{macros}
\renewcommand{\hidden}[1]{}
%colors
\definecolor{darkgreen}{rgb}{0,0.5,0}
\usebeamercolor{block title}
\definecolor{beamerblue}{named}{fg}
\usebeamercolor{alert block title}
\definecolor{beamealert}{named}{fg}
\renewcommand{\colon}{\!:\!}
\newcommand\paraitem{%
\quad
\makebox[\labelwidth][r]{%
\makelabel{%
\usebeamertemplate{itemize \beameritemnestingprefix item}}}\hskip\labelsep}
\newcommand{\mmid}{\mathbin{{\mid}{\mid}}}
\begin{document}
\title{Efficient Translation with Linear Bimorphisms}
\author[Antoine Venant]{Christoph Teichmann \and \underline{Antoine Venant} \and Alexander Koller}
\institute{Saarland University}
\date{\today}
\maketitle
\section{Introduction}
\begin{frame}
\frametitle{General grammatical frameworks}
\begin{itemize}
\item Bringing different grammar formalisms within a common framework makes analyses and comparison easier.
\item Makes common structure and differences explicit.
\item Enable stating generic facts about grammar formalisms.
\item Particularly salient in computational linguistics (C.L.), given the variety of (synchronous) grammars and transducers.
\item One desirable theoretical benefit: generic parsing (translation) complexity bounds.
\item Use generic parsing/translation algorithm accross formalisms.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{The program}
\begin{itemize}
\item Brief overview of Interpreted Regular Tree Grammar (IRTG) [Koller \& Kuhlmann, '11], which offers such a general framework.
\item Review the generic parsing algorithm and identify factors preventing a generic complexity analyses.
\item Highlight the complexity problem.
\item Solve the problem by reducing the grammar to specific kind of normal form, for which the complexity analysis is straightforward.
\end{itemize}
\end{frame}
%\begin{frame}
% \frametitle{What this talk is about -- Bimorphisms and IRTG}
% \begin{itemize}
% \item \textbf{Bimorphisms} offer a succint way to represent relation between trees.
% %\item Model syntax-based relations between objects.
% \item Two trees are related when both are homomorphic images of a common third one under two fixed distinct homomorphisms.
% %\item Admissible derivation trees are compactly specified as a regular tree language.
% \item Interpreting tree nodes as algebraic operations, one can represent relations between objects of arbitrary nature.
% \item This yields \textbf{IRTG}s -- Interpreted Regular Tree Grammars.
% \item IRTGs offer a common theoretical foundation to a wide range of grammatic formalisms relevant to Computational Linguistics.
% \end{itemize}
%\end{frame}
\section{Bimorphisms, IRTG and translation.}
\begin{frame}
\frametitle{An example regular tree grammar and derivation.}
\begin{center}
\begin{minipage}{0.49\linewidth}
\[
\overbrace{
\begin{aligned}
&E \rightarrow r_{a}(E,E) \\& E \rightarrow r_{m}(E,E)\\
&E \rightarrow 1 \mid \dots \mid n\\
\end{aligned}}^{G}
\]
\end{minipage}
\begin{minipage}{0.49\linewidth}
\begin{forest}
[$r_{m}$ [ $r_{a}$ [$1$] [$2$]] [$3$] ]
\end{forest}
\end{minipage}
\end{center}
\end{frame}
\begin{frame}
\frametitle{An example bimorphism and IRTG.}
\begin{center}
\begin{tabular}{cc}
%$h_1$ & $h_2$\\
$
\begin{aligned}
& r_a(x_1, x_2) \mapsto^{h_1} \cdot(\texttt{v}, \cdot(\cdot(\cdot(x_1, {+}), x_2) , \texttt{v}))\\
& r_m(x_1, x_2) \mapsto^{h_1} \cdot(\cdot(x_1, {\times}), x_2)\\
& i \rightarrow i
\end{aligned}
$
&
$
\begin{aligned}
& r_a(x_1, x_2) \mapsto^{h_2} \texttt{add}(x_1, x_2)\\
& r_m(x_1, x_2) \mapsto^{h_2} \texttt{mul}(x_1, x_2)\\
& i \rightarrow i
\end{aligned}
$
\\
\end{tabular}\\\vspace{1pt}
\fontsize{6}{7}
\begin{minipage}{0.1\linewidth}
$\texttt{v} 1 + 2\texttt{v} \times 3$
\end{minipage}
$\xleftarrow{\llbracket \cdot \rrbracket_{\Sigma^{\ast}}}$
\begin{minipage}{0.18\linewidth}
\centering
\begin{forest}
[$\cdot$, blue [$\cdot$, blue, edge=blue [ $\cdot$, red, edge=blue [ \texttt{v}, red, edge=red ] [$\cdot$, red, edge=red [$\cdot$, red, edge=red [$\cdot$, red, edge=red [1, edge=red] [+, red, edge=red]] [2, edge=red] ] [\texttt{v}, red, edge=red] ] ] [ $\times$, blue, edge=blue] ] [3, edge=blue] ]
\end{forest}
\end{minipage}
$\xleftarrow{h_1}$
\begin{minipage}{0.1\linewidth}
\centering
\begin{forest}
[$r_{m}$, blue [ $r_{a}$, red, edge=blue [$1$, edge=red] [$2$, edge=red] ] [$3$, edge=blue] ]
\end{forest}
\end{minipage}
$\xrightarrow{h_2}$
\begin{minipage}{0.18\linewidth}
\centering
\begin{forest}
[\texttt{mul}, blue [ \texttt{add},red, edge=blue [$1$, edge=red] [$2$, edge=red] ] [$3$, edge=blue] ]
\end{forest}
\end{minipage}
$\xrightarrow{\llbracket \cdot \rrbracket_{\mathbb{N}}}$
\begin{minipage}{0.05\linewidth}
\centering
$9$
\end{minipage}
\end{center}
\end{frame}
\begin{frame}
\frametitle{The program.}
\begin{itemize}
\item The image of a regular language through a bimorphism can be computed.
\item \alert{But how efficiently can this be done, w.r.t. different shapes of homomorphisms?}
\item Also forms the basis of a generic 2-step algorithm to translate an input object using an IRTG:
\begin{enumerate}
\item Find the set of algebraic decompositions of the input object.
\item Translate this set of decompositions through the underlying bimorphism.
\end{enumerate}
\item \alert{step 1. is the algebra-dependent part. Can step 2 add to the general complexity of translating?}
\item We answer these questions for the class of bimorphisms with \emph{linear} homomorphisms over \emph{binary} signatures ($LB$-bimorphisms).
\end{itemize}
\end{frame}
\begin{frame}{Further motivation from C.L.}
\begin{itemize}
\item In Computational Linguistics, one commonly deals with very large FTAs (millions of rules).
\item Knowing whether the shape of homomorphisms induce a complexity overhead is therefore a pressing issue.
\item For a range of known formalisms encodable as IRTGs, translation complexity has been obversed to be exactly the complexity of algebraic decomposition.
\item Does this generalize?
\item If I design a new grammatical formalism using IRTGs and a known algebra, can I immediately conclude to a complexity upper bound?
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Translation problems.}
\begin{block}{For a bimorphism $\langle G, h_1, h_2 \rangle$}
Given as input a finite tree automaton (FTA) $F$, compute (a compact representation of)
\[ \{ \langle h_1(t), h_2(t) \rangle \mid t \in L(G) \textnormal{ and } h_1(t) \in L(F) \} \]
\end{block}
\begin{itemize}
\item Solve this by computing an automaton recognizing \[h_1^{-1}(L(F)) \cap L(G)\].
\item \alert{How expensive is computing $h_1^{-1}(F)$ (Invhom problem)?}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Translation problems (cont'd)}
\begin{block}{For an IRTG $\langle G, h_1, h_2, \mathcal{A}_1 \triangleeq \langle D_1, \llbracket \cdot \rrbracket_1 \rangle , \mathcal{A}_2 \triangleeq \langle D_2, \llbracket \cdot \rrbracket_2 \rangle \rangle$}
Given as input an object $o \in D_1$, compute (a compact representation of)
\[ \{ \langle \llbracket h_1(t) \rrbracket_1, \llbracket h_2(t) \rrbracket_2 \rangle \mid t \in L(G) \textnormal{ and } \llbracket h_1(t) \rrbracket_1 = o \} \]
\end{block}
\begin{itemize}
\item Solve this in two steps:
\begin{enumerate}
\item (assuming feasible) compute a decomposition automaton $D_o$ recognizing $\{ t \mid \llbracket t \rrbracket_1 = o \}$
\item Solve the translation problem for $\langle G, h_1, h_2 \rangle$ over $D_o$.
\end{enumerate}
\item \alert{Can we express the complexity of this procedure in terms of $|D_o|$ only?}
\item Parsing and recognazibility problems definable and reducible to translation.
\end{itemize}
\end{frame}
\section{Cost of the invhom.}
\begin{frame}
\frametitle{Reminder}
\begin{center}
\begin{tabular}{cc}
%$h_1$ & $h_2$\\
$
\begin{aligned}
& r_a(x_1, x_2) \mapsto^{h_1} \cdot(\texttt{v}, \cdot(\cdot(\cdot(x_1, {+}), x_2) , \texttt{v}))\\
& r_m(x_1, x_2) \mapsto^{h_1} \cdot(\cdot(x_1, {\times}), x_2)\\
& i \rightarrow i
\end{aligned}
$
&
$
\begin{aligned}
& r_a(x_1, x_2) \mapsto^{h_2} \texttt{add}(x_1, x_2)\\
& r_m(x_1, x_2) \mapsto^{h_2} \texttt{mul}(x_1, x_2)\\
& i \rightarrow i
\end{aligned}
$
\\
\end{tabular}\\\vspace{1pt}
\fontsize{6}{7}
\begin{minipage}{0.1\linewidth}
$\texttt{v} 1 + 2\texttt{v} \times 3$
\end{minipage}
$\xleftarrow{\llbracket \cdot \rrbracket_{\Sigma^{\ast}}}$
\begin{minipage}{0.18\linewidth}
\centering
\begin{forest}
[$\cdot$, blue [$\cdot$, blue, edge=blue [ $\cdot$, red, edge=blue [ \texttt{v}, red, edge=red ] [$\cdot$, red, edge=red [$\cdot$, red, edge=red [$\cdot$, red, edge=red [1, edge=red] [+, red, edge=red]] [2, edge=red] ] [\texttt{v}, red, edge=red] ] ] [ $\times$, blue, edge=blue] ] [3, edge=blue] ]
\end{forest}
\end{minipage}
$\xleftarrow{h_1}$
\begin{minipage}{0.1\linewidth}
\centering
\begin{forest}
[$r_{m}$, blue [ $r_{a}$, red, edge=blue [$1$, edge=red] [$2$, edge=red] ] [$3$, edge=blue] ]
\end{forest}
\end{minipage}
$\xrightarrow{h_2}$
\begin{minipage}{0.18\linewidth}
\centering
\begin{forest}
[\texttt{mul}, blue [ \texttt{add},red, edge=blue [$1$, edge=red] [$2$, edge=red] ] [$3$, edge=blue] ]
\end{forest}
\end{minipage}
$\xrightarrow{\llbracket \cdot \rrbracket_{\mathbb{N}}}$
\begin{minipage}{0.05\linewidth}
\centering
$9$
\end{minipage}
\end{center}
\end{frame}
\begin{frame}
\frametitle{The invhom problem.}
\begin{itemize}
\item Going back to the minimal 'arithmetic' bimorphism.
\item Consider $F$ with axiom $S$ and $O(n)$ rules:
\[
\begin{aligned}
& S \rightarrow \cdot(Y, N_i) \quad (i \in [1,n])\\
& Y \rightarrow \cdot(N_i, M) \quad (i \in [1,n])\\
& M \rightarrow \times\\
& N_i \rightarrow i \quad (i \in [1,n])\\
\end{aligned}
\]
($\llbracket L(F) \rrbracket_{\Sigma^\ast}$ is the set of strings of the form $i \times j$ for some $0 \le i,j \le n $).
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{The invhom problem (cont'd)}
\[
\begin{aligned}
& S \rightarrow \cdot(Y, N_i) \quad (i \in [1,n])\\
& Y \rightarrow \cdot(N_i, M) \quad (i \in [1,n])\\
& M \rightarrow \times\\
& N_i \rightarrow i \quad (i \in [1,n])\\
\end{aligned}
\]
\begin{itemize}
\item Apply generic algorithm to compute the image of $F$ (\emph{i.e.} the set $[1, n^2]$).
\item Need to compute an automaton for $h_1^{-1}(L(F))$.
\item Standard construction (top-down): for each label $l$ in $G$ and state $X$ in $F$, run $F$ from $X$ on $h_1(l)$. If this succeeds and reaches children states $Y_1, \dots, Y_n$, add a rule $X \rightarrow l(Y_1, \dots, Y_n)$ to the invhom automaton.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{The invhom problem (cont'd)}
\[
\begin{aligned}
& S \rightarrow \cdot(Y, N_i) \quad (i \in [1,n])\\
& Y \rightarrow \cdot(N_i, M) \quad (i \in [1,n])\\
& M \rightarrow \times\\
& N_i \rightarrow i \quad (i \in [1,n])\\
\end{aligned}
\]
\begin{itemize}
\item Recall $r_m(x_1, x_2) \mapsto^{h_1} \cdot(\cdot(x_1, {\times}), x_2)$.
\item We have $S \rightarrow^{*}_{F} \cdot(\cdot(N_i, {\times}), N_j)$ for $i,j \in [1,n]$.
\item Hence we add $S \rightarrow r_m(N_i, N_j)$ to the invhom for $i,j \in [1,n]$.
\item \alert{$O(n^2)$ rules v.s. $O(n)$ rules for $F$!}.
\item Still, $[1,n^2]$ can be described in the arithmetic signature with only $n$ rules, just as $F$.
\end{itemize}
\end{frame}
\section{Normal Form}
\begin{frame}
\frametitle{Reminder}
\begin{center}
\begin{tabular}{cc}
%$h_1$ & $h_2$\\
$
\begin{aligned}
& r_a(x_1, x_2) \mapsto^{h_1} \cdot(\texttt{v}, \cdot(\cdot(\cdot(x_1, {+}), x_2) , \texttt{v}))\\
& r_m(x_1, x_2) \mapsto^{h_1} \cdot(\cdot(x_1, {\times}), x_2)\\
& i \rightarrow i
\end{aligned}
$
&
$
\begin{aligned}
& r_a(x_1, x_2) \mapsto^{h_2} \texttt{add}(x_1, x_2)\\
& r_m(x_1, x_2) \mapsto^{h_2} \texttt{mul}(x_1, x_2)\\
& i \rightarrow i
\end{aligned}
$
\\
\end{tabular}\\\vspace{1pt}
\fontsize{6}{7}
\begin{minipage}{0.1\linewidth}
$\texttt{v} 1 + 2\texttt{v} \times 3$
\end{minipage}
$\xleftarrow{\llbracket \cdot \rrbracket_{\Sigma^{\ast}}}$
\begin{minipage}{0.18\linewidth}
\centering
\begin{forest}
[$\cdot$, blue [$\cdot$, blue, edge=blue [ $\cdot$, red, edge=blue [ \texttt{v}, red, edge=red ] [$\cdot$, red, edge=red [$\cdot$, red, edge=red [$\cdot$, red, edge=red [1, edge=red] [+, red, edge=red]] [2, edge=red] ] [\texttt{v}, red, edge=red] ] ] [ $\times$, blue, edge=blue] ] [3, edge=blue] ]
\end{forest}
\end{minipage}
$\xleftarrow{h_1}$
\begin{minipage}{0.1\linewidth}
\centering
\begin{forest}
[$r_{m}$, blue [ $r_{a}$, red, edge=blue [$1$, edge=red] [$2$, edge=red] ] [$3$, edge=blue] ]
\end{forest}
\end{minipage}
$\xrightarrow{h_2}$
\begin{minipage}{0.18\linewidth}
\centering
\begin{forest}
[\texttt{mul}, blue [ \texttt{add},red, edge=blue [$1$, edge=red] [$2$, edge=red] ] [$3$, edge=blue] ]
\end{forest}
\end{minipage}
$\xrightarrow{\llbracket \cdot \rrbracket_{\mathbb{N}}}$
\begin{minipage}{0.05\linewidth}
\centering
$9$
\end{minipage}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Sketch of the solution.}
\begin{itemize}
\item We formalize a solution for the class of $LB$-bimorphism -- bimorphisms as above involving linear homomorphisms, with symbol of max-arity $2$.
\item Classically encountered in C.L.
\end{itemize}
We build on the following:
\begin{enumerate}
\item Solutions to the translation problem are invariant through weak-equivalence $\rightarrow$ one can transform the grammar.
\item If all homomorphic images $h(l)$ have height at most $1$ , it is trivial that the standard construction of the invhom $h^{-1}(L(F))$ has at most as many rules as $F$.
\end{enumerate}
\end{frame}
\begin{frame}
\frametitle{Sketch of the solution (cont'd).}
\begin{block}{Thm}
for every $LB$-bimorphism (resp. IRTG), there exists an $LB$-bimorphism (resp. IRTG) with same relation and in which every homomorphic images have height at most 1.
\end{block}
\begin{itemize}
\item We call such an equivalent $LB$-bimorphism (IRTG) a truncated normal form (\textbf{TNF}).
\item We provide an algorithm bringing an arbitrary $LB$-bimorphism (IRTG) into TNF and prove its correctness.
\end{itemize}
\end{frame}
\section{Bringing $LB$-bimorphisms into TNF.}
\begin{frame}
\frametitle{Sketch}
\begin{itemize}
\item The procedure consists in an elementary truncation step applied until saturation.
\item Each truncation step targets a single homomorphism $h$ and a single rule $r$ with an homomorphic image of height $ > 1$.
\item The truncation step `splits' $r$ and into several `fresh' labels, adding corresponding rules to the grammar.
\item $h(r)$ is distributed over the new label thereby lessening the maximal images' height.
\item One need to carefully adapt other homomorphisms, to prevent modifying the translation relation.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Example -- 2 case}
\begin{center}
\begin{minipage}{0.49\linewidth}
\[
\begin{aligned}
&E \rightarrow r_{a}(E,E) \quad \underbrace{E \rightarrow r_{m}(E,E)}_{{\color{blue} \cdot ({\color{red}\cdot(x_1, {\times})}, {\color{darkgreen}x_2})}}\\
&E \rightarrow 1 \mid \dots \mid n\\
\end{aligned}
\]
\end{minipage}
\begin{minipage}{0.49\linewidth}
\begin{forest}
[$r_{m}$ [ $r_{a}$ [$1$] [$2$]] [$3$] ]
\end{forest}
\end{minipage}
\end{center}
\begin{itemize}
\item Target $r_{m}$ and $h_1$.
\end{itemize}
\begin{center}
\begin{minipage}{0.49\linewidth}
\[
\begin{aligned}
&E \rightarrow r_{a}(E,E) \\
&\underbrace{E \rightarrow r^1_{m}(M^2,M^3)}_{\color{blue}\cdot(x_1, x_2)}\\
&\underbrace{M^2 \rightarrow r_m^2(E)}_{{\color{red}\cdot(x_1, {\times})}} \quad \underbrace{M^3 \rightarrow r_m^3(E)}_{\color{darkgreen} x_1}\\
&E \rightarrow 1 \mid \dots \mid n\\
\end{aligned}
\]
\end{minipage}
\begin{minipage}{0.49\linewidth}
\begin{forest}
[$r^1_{m}$ [ $r^2_m$ [ $r_{a}$ [$1$] [$2$]] ] [ $r^3_m$ [$3$]] ]
\end{forest}
\end{minipage}
\end{center}
\end{frame}
\begin{frame}
\frametitle{What about the unselected $h_2$?}
\begin{center}
\begin{minipage}{0.49\linewidth}
\[
\begin{aligned}
&E \rightarrow r_{a}(E,E) \quad \overbrace{E \rightarrow r_{m}(E,E)}^{{\color{blue} \texttt{mult}(x_1, x_2)}}\\
&E \rightarrow 1 \mid \dots \mid n\\
\end{aligned}
\]
\end{minipage}
\begin{minipage}{0.49\linewidth}
\begin{forest}
[$r_{m}$ [ $r_{a}$ [$1$] [$2$]] [$3$] ]
\end{forest}
\end{minipage}
\end{center}
\begin{itemize}
\item Move the whole image to $r_m^1$ which references both children.
\end{itemize}
\begin{center}
\begin{minipage}{0.49\linewidth}
\[
\begin{aligned}
&E \rightarrow r_{a}(E,E) \\
&\overbrace{E \rightarrow r^1_{m}(M^2,M^3)}^{{\color{blue} \texttt{mult}(x_1, x_2)}}\\
&\overbrace{M^2 \rightarrow r_m^2(E)}^{ x_1} \quad \overbrace{M^3 \rightarrow r_m^3(E)}^{x_1}\\
&E \rightarrow 1 \mid \dots \mid n\\
\end{aligned}
\]
\end{minipage}
\begin{minipage}{0.49\linewidth}
\begin{forest}
[$r^1_{m}$ [ $r^2_m$ [ $r_{a}$ [$1$] [$2$]] ] [ $r^3_m$ [$3$]] ]
\end{forest}
\end{minipage}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Transformation so far:}
\begin{center}
\fontsize{6}{7}
\begin{minipage}{0.1\linewidth}
$\texttt{v} 1 + 2\texttt{v} \times 3$
\end{minipage}
$\xleftarrow{\llbracket \cdot \rrbracket_{\Sigma^{\ast}}}$
\begin{minipage}{0.18\linewidth}
\centering
\begin{forest}
[$\cdot$, blue [$\cdot$, red, edge=blue [ $\cdot$, edge=red [ \texttt{v} ] [$\cdot$ [$\cdot$ [$\cdot$ [1] [+]] [2] ] [\texttt{v}] ] ] [ $\times$, red, edge=red] ] [3, edge=blue] ]
\end{forest}
\end{minipage}
$\xleftarrow{h_1}$
\begin{minipage}{0.1\linewidth}
\centering
\begin{forest}
[$r^1_{m}$, blue [ $r^2_{m}$, red, edge=blue [$r_{a}$, edge=red [$1$] [$2$]]] [$r^3_{m}$, darkgreen, edge=blue [$3$, edge=darkgreen]]]
\end{forest}
\end{minipage}
$\xrightarrow{h_2}$
\begin{minipage}{0.18\linewidth}
\centering
\begin{forest}
[\texttt{mul}, blue [ \texttt{add}, edge=blue [$1$] [$2$] ] [$3$, edge=blue] ]
\end{forest}
\end{minipage}
$\xrightarrow{\llbracket \cdot \rrbracket_{\mathbb{N}}}$
\begin{minipage}{0.05\linewidth}
\centering
$9$
\end{minipage}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Example -- 1 case}
\begin{minipage}{0.49\linewidth}
\[
\begin{aligned}
&\underbrace{E \rightarrow r_{a}(E,E)}_{{\color{blue} \cdot({\color{red} \texttt{v}}, {\color{darkgreen} \cdot(\cdot(\cdot(x_1, {+}), x_2) , \texttt{v})})}}\\
\end{aligned}
\]
\begin{itemize}
\item Target $r_{m}$ and $h_1$.
\end{itemize}
\[
\begin{aligned}
&\underbrace{E \rightarrow r^1_{a}(A^2, A^3)}_{\color{blue}\cdot(x_1, x_2)}\\
&\underbrace{A^2 \rightarrow r_a^2}_{{\color{red}\texttt{v}}} \quad \underbrace{A^3 \rightarrow r_a^3(E, E)}_{{\color{darkgreen} \cdot(\cdot(\cdot(x_1, {+}), x_2) , \texttt{v})}}\\
\end{aligned}
\]
\end{minipage}
\begin{minipage}{0.49\linewidth}
\begin{center}
\begin{forest}
[$r^1_{m}$ [ $r^2_m$ [$r^1_{a}$ [$r^2_a$] [$r^3_a$ [$1$] [$2$]] ]] [$r^3_m$ [$3$]] ]
\end{forest}
\end{center}
\end{minipage}
\end{frame}
\begin{frame}
\frametitle{Unselected homomorphism $h_2$}
\begin{minipage}{0.49\linewidth}
\[
\begin{aligned}
&\overbrace{\underbrace{E \rightarrow r_{a}(E,E)}_{{\color{blue} \cdot({\color{red} \texttt{v}}, {\color{darkgreen} \cdot(\cdot(\cdot(x_1, {+}), x_2) , \texttt{v})})}}}^{{\color{darkgreen} \texttt{add}(x_1, x_2) }}\\
\end{aligned}
\]
\begin{itemize}
\item Again, affect the whole image to rule referencing both children, here, $r_a^3$.
\end{itemize}
\[
\begin{aligned}
&\overbrace{\underbrace{E \rightarrow r^1_{a}(A^2, A^3)}_{\color{blue}\cdot(x_1, x_2)}}^{x_2}\\
&\overbrace{\underbrace{A^2 \rightarrow r_a^2}_{{\color{red}\texttt{v}}}}^{\bot} \quad \overbrace{\underbrace{A^3 \rightarrow r_a^3(E, E)}_{{\color{darkgreen} \cdot(\cdot(\cdot(x_1, {+}), x_2) , \texttt{v})}}}^{{\color{darkgreen} \texttt{add}(x_1, x_2)}}\\
\end{aligned}
\]
\end{minipage}
\begin{minipage}{0.49\linewidth}
\begin{center}
\begin{forest}
[$r^1_{m}$ [ $r^2_m$ [$r^1_{a}$ [$r^2_a$] [$r^3_a$ [$1$] [$2$]] ]] [$r^3_m$ [$3$]] ]
\end{forest}
\end{center}
\end{minipage}
\end{frame}
\begin{frame}
\frametitle{Transformation so far:}
\begin{center}
\fontsize{6}{7}
\begin{minipage}{0.1\linewidth}
$\texttt{v} 1 + 2\texttt{v} \times 3$
\end{minipage}
$\xleftarrow{\llbracket \cdot \rrbracket_{\Sigma^{\ast}}}$
\begin{minipage}{0.18\linewidth}
\centering
\begin{forest}
[$\cdot$, [$\cdot$ [ $\cdot$, blue [ \texttt{v}, red, edge=blue ] [$\cdot$, darkgreen, edge=blue [$\cdot$, darkgreen, edge=darkgreen [$\cdot$, darkgreen, edge=darkgreen [1, edge=darkgreen] [+, darkgreen, edge=darkgreen]] [2, edge=darkgreen] ] [\texttt{v}, darkgreen, edge=darkgreen] ] ] [ $\times$] ] [3] ]
\end{forest}
\end{minipage}
$\xleftarrow{h_1}$
\begin{minipage}{0.1\linewidth}
\centering
\begin{forest}
[$r^1_{m}$ [ $r^2_m$ [$r^1_{a}$, blue [$r^2_a$, red, edge=blue] [$r^3_a$, darkgreen, edge=blue [$1$, edge=darkgreen] [$2$, edge=darkgreen]] ]] [$r^3_m$ [$3$]] ]
\end{forest}
\end{minipage}
$\xrightarrow{h_2}$
\begin{minipage}{0.18\linewidth}
\centering
\begin{forest}
[\texttt{mul} [ \texttt{add}, darkgreen [$1$, edge=darkgreen] [$2$, edge=darkgreen] ] [$3$] ]
\end{forest}
\end{minipage}
$\xrightarrow{\llbracket \cdot \rrbracket_{\mathbb{N}}}$
\begin{minipage}{0.05\linewidth}
\centering
$9$
\end{minipage}
\end{center}
\end{frame}
\begin{frame}
\frametitle{The general picture -- 2 case}
\centering
\begin{tabular}{|c|c|c|}
\hline
& Selected Homomorphism & Unselected Homomorphism \\
\hline
\parbox{0.1\textwidth}{Before} &
\begin{minipage}{0.33 \textwidth}
%\resizebox{1\columnwidth}{3cm}
{
\begin{tikzpicture}[scale=0.5, every node/.style={scale=0.5}]
\tikzset{decoration={snake,amplitude=1mm,segment length=5mm,
post length=1mm,pre length=1mm}}
\node (image) at (-3,-1) {$h_1(r) =$};
\node (root) at (0,0) {};
\node (left) at (-3,-3) {};
\node (right) at (3,-3) {};
\node (top) at (0,-0.4) {f};
\node (internalL) at (-1,-1.75) {$t_1$};
\node (internalR) at (1,-1.75) {$t_2$};
\node (lml) at (-2,-3) {};
\node (lmm) at (-1.5,-2.5) {};
\node (lmr) at (-1,-3) {};
\node (rml) at (1,-3) {};
\node (rmm) at (1.5,-2.5) {};
\node (rmr) at (2,-3) {};
\node (x1) at (-1.5,-3) {$x_1$};
\node (x2) at (1.5,-3) {$x_2$};
\path (root.center) edge node (cutL) [near start]{} (left.center) edge node (cutR) [near start] {} (right.center);
\path (left.center) edge (lml.center);
\path (lml.center) edge (lmm.center);
\path (lmm.center) edge (lmr.center);
\path (lmr.center) edge node (cutB) [midway] {} (rml.center);
\path (rml.center) edge (rmm.center);
\path (rmm.center) edge (rmr.center);
\path (rmr.center) edge (right.center);
\path (cutL.center) edge node (cutC) [midway] {} (cutR.center);
\path (cutC.center) edge (cutB.center);
\end{tikzpicture}
}
\end{minipage}
&
\begin{minipage}{0.3\textwidth}
%\resizebox{1\columnwidth}{3cm}
{
\begin{tikzpicture}[scale=0.5, every node/.style={scale=0.5}]
\tikzset{decoration={snake,amplitude=1mm,segment length=5mm,
post length=1mm,pre length=1mm}}
\node (image) at (-3,-1) {$h_2(r) =$};
\node (root) at (0,0) {};
\node (left) at (-3,-3) {};
\node (right) at (3,-3) {};
\node (internalL) at (0,-1.75) {$t'$};
\node (lml) at (-2,-3) {};
\node (lmm) at (-1.5,-2.5) {};
\node (lmr) at (-1,-3) {};
\node (rml) at (1,-3) {};
\node (rmm) at (1.5,-2.5) {};
\node (rmr) at (2,-3) {};
\node (x1) at (-1.5,-3) {$x_1$};
\node (x2) at (1.5,-3) {$x_2$};
\path (root.center) edge node (cutL) [near start]{} (left.center) edge node (cutR) [near start] {} (right.center);
\path (left.center) edge (lml.center);
\path (lml.center) edge (lmm.center);
\path (lmm.center) edge (lmr.center);
\path (lmr.center) edge node (cutB) [midway] {} (rml.center);
\path (rml.center) edge (rmm.center);
\path (rmm.center) edge (rmr.center);
\path (rmr.center) edge (right.center);
\end{tikzpicture}
}
\end{minipage}
\\
\hline
\parbox{0.1\textwidth}{After} &
\begin{minipage}{0.33 \textwidth}
%\resizebox{1\columnwidth}{3cm}
{
\begin{tikzpicture}[scale=0.5, every node/.style={scale=0.5}]
\tikzset{decoration={snake,amplitude=1mm,segment length=5mm,
post length=1mm,pre length=1mm}}
\node (image) at (-3,-0.4) {$\hat{h}_1(r\up{1}) =$};
\node (root) at (0,0) {};
\node (left) at (-1.5,-1.5) {};
\node (right) at (1.5,-1.5) {};
\node (top) at (0,-0.4) {f};
\node (lml) at (-1,-1.5) {};
\node (lmm) at (-0.5,-1) {};
\node (lmr) at (0,-1.5) {};
\node (rml) at (0,-1.5) {};
\node (rmm) at (0.5,-1) {};
\node (rmr) at (1,-1.5) {};
\node (x1) at (-0.5,-1) {$x_1$};
\node (x2) at (0.5,-1) {$x_2$};
\path (top) edge (x1) edge (x2);
%\path (root.center) edge node (cutL) [near start]{} (left.center) edge node (cutR) [near start] {} (right.center);
%\path (left.center) edge (lml.center);
%\path (lml.center) edge (lmm.center);
%\path (lmm.center) edge (lmr.center);
%\path (rml.center) edge (rmm.center);
%\path (rmm.center) edge (rmr.center);
%\path (rmr.center) edge (right.center);
%\path (lmr.center) edge (rml.center);
\node (lcRoot) at (-0.5,-1.3) {};
\node (lcLeft) at (-3.3,-2.8) {};
\node (lcRight) at (-0.5,-2.8) {};
\node (lcml) at (-1.8,-2.8) {};
\node (lcmm) at (-1.3,-2.3) {};
\node (lcmr) at (-0.8,-2.8) {};
\node (lcInternal) at (-1,-2) {$t_1$};
\node (rcInternal) at (1,-2) {$t_2$};
\node (lcLabel) at (-3,-2) {$\hat{h}_1(r\up{2})=$};
\node (lcLabel) at (3,-2) {$=\hat{h}_1(r\up{3})$};
\node (rcRoot) at (0.5,-1.3) {};
\node (rcLeft) at (0.5,-2.8) {};
\node (rcRight) at (3.3,-2.8) {};
\node (rcml) at (0.8,-2.8) {};
\node (rcmm) at (1.3,-2.3) {};
\node (rcmr) at (1.8,-2.8) {};
\node (x1) at (-1.3,-2.8) {$x_1$};
\node (x2) at (1.3,-2.8) {$x_1$};
\path (lcRoot.center) edge (lcLeft.center);
\path (rcRoot.center) edge (rcLeft.center);
\path (lcRoot.center) edge (lcRight.center);
\path (rcRoot.center) edge (rcRight.center);
\path (lcLeft.center) edge (lcml.center);
\path (rcLeft.center) edge (rcml.center);
\path (lcml.center) edge (lcmm.center);
\path (rcml.center) edge (rcmm.center);
\path (lcmm.center) edge (lcmr.center);
\path (rcmm.center) edge (rcmr.center);
\path (lcmr.center) edge (lcRight.center);
\path (rcmr.center) edge (rcRight.center);
\end{tikzpicture}
}
\end{minipage}
&
\begin{minipage}{0.3 \textwidth}
%\resizebox{1\columnwidth}{3cm}
{
\begin{tikzpicture}[scale=0.5, every node/.style={scale=0.5}]
\tikzset{decoration={snake,amplitude=1mm,segment length=5mm,
post length=1mm,pre length=1mm}}
\node (image) at (-3,-1) {$h_2(r\up{1}) =$};
\node (root) at (0,0) {};
\node (left) at (-2,-2) {};
\node (right) at (2,-2) {};
\node (internalL) at (0,-1) {$t'$};
\node (lml) at (-1.5,-2) {};
\node (lmm) at (-1,-1.5) {};
\node (lmr) at (-0.5,-2) {};
\node (rml) at (0.5,-2) {};
\node (rmm) at (1,-1.5) {};
\node (rmr) at (1.5,-2) {};
\node (x1) at (-1,-2) {$x_1$};
\node (x2) at (1,-2) {$x_2$};
\path (root.center) edge node (cutL) [near start]{} (left.center) edge node (cutR) [near start] {} (right.center);
\path (left.center) edge (lml.center);
\path (lml.center) edge (lmm.center);
\path (lmm.center) edge (lmr.center);
\path (lmr.center) edge node (cutB) [midway] {} (rml.center);
\path (rml.center) edge (rmm.center);
\path (rmm.center) edge (rmr.center);
\path (rmr.center) edge (right.center);
\node (lcLabel) at (-3,-2.5) {$\hat{h}_2(r\up{2})=$};
\node (x1) at (-1,-2.5) {$x_1$};
\node (lcLabel) at (3,-2.5) {$=\hat{h}_2(r\up{3})$};
\node (x2) at (1,-2.5) {$x_1$};
\end{tikzpicture}
}
\end{minipage}
\\
\hline
\end{tabular}
\end{frame}
\begin{frame}
\frametitle{The general picture -- 1 Case}
\centering
\begin{tabular}{|c|c|c|}
\hline
& Selected Homomorphism & Unselected Homomorphisms \\
\hline
\parbox{0.1\textwidth}{Before} &
\begin{minipage}{0.33 \textwidth}
%\resizebox{1\columnwidth}{3cm}
{
\begin{tikzpicture}[scale=0.5, every node/.style={scale=0.5}]
\tikzset{decoration={snake,amplitude=1mm,segment length=5mm,
post length=1mm,pre length=1mm}}
\node (image) at (-3,-1) {$h_1(r) =$};
\node (root) at (0,0) {};
\node (left) at (-3,-3) {};
\node (right) at (3,-3) {};
\node (top) at (0,-0.4) {f};
\node (internalL) at (-0.75,-1.75) {$t_1$};
\node (internalR) at (1.15,-1.75) {$t_2$};
\node (lml) at (-2.6,-3) {};
\node (lmm) at (-2.1,-2.5) {};
\node (lmr) at (-1.6,-3) {};
\node (rml) at (-1.1,-3) {};
\node (rmm) at (-0.6,-2.5) {};
\node (rmr) at (-0.1,-3) {};
\node (x1) at (-2.1,-3) {$x_1$};
\node (x2) at (-0.6,-3) {$x_2$};
\node (it) at (0,-3) {};
\path (root.center) edge node (cutL) [near start]{} (left.center) edge node (cutR) [near start] {} (right.center);
\path (left.center) edge (lml.center);
\path (lml.center) edge (lmm.center);
\path (lmm.center) edge (lmr.center);
\path (lmr.center) edge (rml.center);
\path (rml.center) edge (rmm.center);
\path (rmm.center) edge (rmr.center);
\path (rmr.center) edge node (cutB) [near start] {} (right.center);
\path (cutL.center) edge node (cutC) [midway] {} (cutR.center);
\path (cutC.center) edge (it.center);
\end{tikzpicture}
}
\end{minipage}
&
\begin{minipage}{0.2 \textwidth}
%\resizebox{1\columnwidth}{3cm}
{
\begin{tikzpicture}[scale=0.3, every node/.style={scale=0.5}]
\tikzset{decoration={snake,amplitude=1mm,segment length=5mm,
post length=1mm,pre length=1mm}}
\node (image) at (-3,-1) {$h_2(r\up{1}) =$};
\node (root) at (0,0) {};
\node (left) at (-3,-3) {};
\node (right) at (3,-3) {};
\node (internalL) at (0,-1.75) {$t'$};
\node (lml) at (-2,-3) {};
\node (lmm) at (-1.5,-2.5) {};
\node (lmr) at (-1,-3) {};
\node (rml) at (1,-3) {};
\node (rmm) at (1.5,-2.5) {};
\node (rmr) at (2,-3) {};
\node (x1) at (-1.5,-3) {$x_1$};
\node (x2) at (1.5,-3) {$x_2$};
\path (root.center) edge node (cutL) [near start]{} (left.center) edge node (cutR) [near start] {} (right.center);
\path (left.center) edge (lml.center);
\path (lml.center) edge (lmm.center);
\path (lmm.center) edge (lmr.center);
\path (lmr.center) edge node (cutB) [midway] {} (rml.center);
\path (rml.center) edge (rmm.center);
\path (rmm.center) edge (rmr.center);
\path (rmr.center) edge (right.center);
\end{tikzpicture}
}
\end{minipage}
\\
\hline
\parbox{0.1\textwidth}{After} &
\begin{minipage}{0.33 \textwidth}
%\resizebox{1\columnwidth}{3cm}
{
\begin{tikzpicture}[scale=0.5, every node/.style={scale=0.5}]
\tikzset{decoration={snake,amplitude=1mm,segment length=5mm,
post length=1mm,pre length=1mm}}
\node (image) at (-3,-0.4) {$\hat{h}_1(r\up{1}) =$};
\node (root) at (0,0) {};
\node (left) at (-1.5,-1.5) {};
\node (right) at (1.5,-1.5) {};
\node (top) at (0,-0.4) {f};
\node (lml) at (-1,-1.5) {};
\node (lmm) at (-0.5,-1) {};
\node (lmr) at (0,-1.5) {};
\node (rml) at (0,-1.5) {};
\node (rmm) at (0.5,-1) {};
\node (rmr) at (1,-1.5) {};
\node (x1) at (-0.5,-1) {$x_1$};
\node (x2) at (0.5,-1) {$x_2$};