Comprehensive Isomorphic Subtree Enumeration - PowerPoint PPT Presentation

1 / 28
About This Presentation
Title:

Comprehensive Isomorphic Subtree Enumeration

Description:

Comprehensive Isomorphic Subtree Enumeration. Partha Biswas ... Isomorphic Subtree. Finding complex shareable resources. Finding reusable instructions as ISEs ... – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 29
Provided by: hsienhs
Category:

less

Transcript and Presenter's Notes

Title: Comprehensive Isomorphic Subtree Enumeration


1
Comprehensive Isomorphic Subtree Enumeration
  • Partha Biswas
  • Girish Venkataramani

2
Two operation subtrees
A
B

-
-




-
3
After swapping the subtrees
A
B


-


-

-




-
4
Isomorphic Subtree
A
B


-


-

-

Finding complex shareable resources


Finding reusable instructions as ISEs

-
Finding code reuse patterns for code size
reduction
5
Agenda
  • Existing approaches
  • Problem Definition
  • Our approach
  • Experimental results

6
Existing Approaches
A
B


-
-

-

-




-
Maximal Subgraph
Bottom-up Approach (Aho et al., Valiente)
Common Application Value numbering
7
Existing Approaches
A
B


-


-

-



Top-down Approach
Common Application Resource sharing
8
Existing Approaches
A
B




-



Pattern matching (Aho et al., Keutzer et al.)
Common Applications Instruction selection,
technology mapping
9
Problem Definition
A
B


-


-

-




-
Given two reference trees A and B, find all
isomorphic subtrees contained within the trees.
10
Our Approach
  • Convert reference trees into canonical strings.
  • Apply dynamic programming on canonical strings.
  • Map the solution back to the reference trees.

11
Prefix String










-



-
-
(

(

(

,


(

,

(

,
)

-
,
(
)
(

)

,
)
)

,
)

,
)
12
Step 1 Canonicalize

















-
-((,),)


((,),(,))


-
13
After canonicalization of tree B
A
B















-


-

-

A simple substring match is not a solution!




-

(,(-(,),((,),-(,))))
-((-((,),),((,),(,))),)
14
Skipping subtrees OP notation










-


Prefix String
OP

(

(

,


(

,

(

,
)

-
,
(
)
(

)

,
)
)

,
)

,
)
15
Case 1 for deciding a match



A
B










-




-

-






-
( , ( - ( , ) , ( ( , ) , - (
, ) ) ) )
- ( ( - ( ( , ) , ) , ( ( , ) ,
( , ) ) ) , )
16
Case 2 for deciding a match



A
B




-






-







-




( , ( - ( , ) , ( ( , ) , - (
, ) ) ) )
-
- ( ( - ( ( , ) , ) , ( ( , ) ,
( , ) ) ) , )
OP
17
Case 3 for deciding a match



A
B




-






-







-




( , ( - ( , ) , ( ( , ) , - (
, ) ) ) )
-
OP
- ( ( - ( ( , ) , ) , ( ( , ) ,
( , ) ) ) , )
OP
18
Case 4 for deciding a match



A
B










-




-

-






-
( , ( - ( , ) , ( ( , ) , - (
, ) ) ) )
OP
- ( ( - ( ( , ) , ) , ( ( , ) ,
( , ) ) ) , )
OP
OP
19
Step 2 Dynamic Programming
Input Prefix strings of lengths m and n
Output LCPSLp,q, (P_NEXT,Q_NEXT)p,q
Longest Common Prefix String Length
p
p
1
m
1
m
1
1
q
q
LCPSLp,q
(P_NEXT,Q_NEXT)p,q
n
n
Complexity O(mn)
20
The LCPSL matrix
21
The (PNEXT, QNEXT) Pairs
22
The LCPSL matrix solution 1
B
A
Substring in A (-(,),((,),OP)))
Substring in B (-(OP,),((,),OP)))
23
Step 3 Mapping solution 1 back
A
B


-


-

-




-
Substring in A (-(,),((,),OP)))
Substring in B (-(OP,),((,),OP)))
24
The LCPSL matrix solution 2
B
A
Substring in A (,(OP,OP))
Substring in B (OP,(,))
25
Step 3 Mapping solution 2 back
A
B


-


-

-




-
Substring in A (-(,),((,),OP)))
Substring in B (-(OP,),((,),OP)))
Substring in A (,(OP,OP))
Substring in B (OP,(,))
26
Resource sharing opportunities
27
Resource sharing opportunities
28
Conclusion
  • A fast dynamic programming based approach to
    operation tree isomorphism
  • Successfully applied on resource sharing
  • Other embedded applications can benefit from this
    approach
Write a Comment
User Comments (0)
About PowerShow.com