1
Overgraph Representation for Multi-Result Supercompilation
Sergei Grechanik
Keldysh Institute of Applied Mathematics Russian Academy of Sciences Meta 2012
Overgraph Representation for Multi-Result Supercompilation Sergei - - PowerPoint PPT Presentation
Overgraph Representation for Multi-Result Supercompilation Sergei Grechanik Keldysh Institute of Applied Mathematics Russian Academy of Sciences Meta 2012 1 General Idea of Multi-Resultness P1 P1 We use heuristics to guess the best path
1
Keldysh Institute of Applied Mathematics Russian Academy of Sciences Meta 2012
2
P1 SC(P1) P1
We use heuristics to guess the best path
SC(P1)
And get a single residual program
3
P1 SC(P1) P1 SC(P1)
We take (almost)
We get a set of residual programs And then we choose the best one (optionally)
4
5
Whistle Generalization Strategy Driving Rules Folding Strategy
Graph C Rewriting Steps Residualization R
6
C1 C2 C3 C4 C5 C6 C7 C2' C8
7
1 2
8
9
10
11
12
13
14
15
– Use some heuristics
Shared
16
These subtrees are likely to be equal but they won't be shared
17
18
19
20
f(g(h(x))) f(g(x)) h(x) g(h(x)) f(x) f(x) g(x) g(x) h(x) Duplication
21
f(g(h(x))) f(g(x)) h(x) g(h(x)) f(x) g(x)
22
f(x) f(g(y)) f(z) g(y)
f(x) f(g(y)) g(y)
23
– One configuration ― one node – No special folding edges
– Can we use binary whistles? – How can we control generalization?
24
f g h ∘ ∘ f g ∘ h g h ∘ f g
C1 C2 incomplete nodes have
no outgoing hyperedges
25
26
27
This precondition is monotone
28
NOT monotone
OK This green path won't disappear
29
This incomplete node is useless
30
31
1 4 3 2 5 6 1 4 3 2 5 6 4 5 6 2
32
1 4 3 2 5 6 1 4 3 2 5 6 4 5 6 2
33
1 4 3 2 5 6 1 4 3 2 5 6 4 5 6
34
1 4 3 2
2 4 2' 1
35
1 3 2
4
36
N
History Won't be in a history Can be in a history but cannot be folded against These can influence folding
37
38
add mul fict idle evenBad nrev 2 4 6 8 10 12 14
39
40
41
Synapse MSI MOSI MESI MOESI Illinois Berkley Firefly Xerox Java ReaderWriter DataRace
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
42
43
– need graph-based language – tree-producing algorithm seems unsuitable for
44
– Caching residualization algorithm – Truncation for counter systems
45
Please return to the previous slide
46
a b id id
a b c
47
Y (λ f → ...) f
48
49