Upload
shalin
View
21
Download
0
Embed Size (px)
DESCRIPTION
A Characterization of Reuse Technologies. Ted J. Biggerstaff [email protected]. Reuse Technologies. Concrete components e.g., Functions, OOP, Frameworks, DCOM, … Compositionally Derived Components e.g., Templates, GenVoca, … Pattern-directed transformation systems - PowerPoint PPT Presentation
Citation preview
A Characterization of Reuse Technologies
Ted J. BiggerstaffTed J. [email protected]@austin.rr.com
Reuse Technologies Concrete componentsConcrete components
e.g., Functions, OOP, Frameworks, DCOM, …e.g., Functions, OOP, Frameworks, DCOM, … Compositionally Derived Components Compositionally Derived Components
e.g., Templates, GenVoca, …e.g., Templates, GenVoca, … Pattern-directed transformation systemsPattern-directed transformation systems
e.g., Draco, CAPE, IP, DMS, Sinapse, ...e.g., Draco, CAPE, IP, DMS, Sinapse, ...
Control Regimes
PD Search – Independent Local ChoicesPD Search – Independent Local Choices Strategically Blind – exploding search spaceStrategically Blind – exploding search space Biased Toward Local Syntactic StructureBiased Toward Local Syntactic Structure Rules are General & Allow Easy ExtensionRules are General & Allow Easy Extension
Control Regimes PD Search – Independent Local ChoicesPD Search – Independent Local Choices
Strategically Blind – exploding search spaceStrategically Blind – exploding search space Biased Toward Local Syntactic StructureBiased Toward Local Syntactic Structure Rules are General & Allow Easy ExtensionRules are General & Allow Easy Extension
MetaPrograms – Algorithmic MetaPrograms – Algorithmic Strategically & Tactically PurposefulStrategically & Tactically Purposeful State Dependent Actions Reduce Search SpaceState Dependent Actions Reduce Search Space Representation Makes Extensions HardRepresentation Makes Extensions Hard
Constraint Propagation Problem
Refine tox
Program
x Constraint
Reuse LibraryAlternative Refinementsof
PD Explosion Control
Group Rules by PhaseGroup Rules by Phase Implicit Phases based on Distinct DSLsImplicit Phases based on Distinct DSLs
Mutually Exclusive DSL Operators & OperandsMutually Exclusive DSL Operators & Operands
Draco Domains
Abstractions:
Keys,Relations,Attributes, …Operations:
Search, Delete,Add, Update,
Attach,Detach, ...
Abstractions:Cursor, Container,
Keys,Relations,Attributes, …Operations:
Search, Delete,Add, Update,
Attach,Detach, ...
Data Base
RelationalAlgebra
Abstract DataTypes
C Code
Tuple Index
Refinements
Data Base
Relational
Algebra
Abstract Data
TypesC Code
Tuple Index
Component: Insert(Value V, Container C){Refinement: Stack Condition: LIFO(C) Code: {Push(V,C)}}{Refinement: Sorted Container Condition: SortedOn(C, Value) Assertion: SortedOn(C, Value) Code: {Merge(V,C)}}
...}
PD Explosion Control
Group Rules by PhaseGroup Rules by Phase Implicit Phases based on Distinct DSLsImplicit Phases based on Distinct DSLs
Mutually Exclusive DSL Operators & OperandsMutually Exclusive DSL Operators & Operands … … and based MetaProgramand based MetaProgram
{Refine DSL; Optimize Refined DSL}{Refine DSL; Optimize Refined DSL}
Domain to self:Join(?Relation1, Empty_Relation, ?Attribute)=>Empty_RelationSelect(?Relation1,TRUE_expression)=>Relation1Select(?Relation1,FALSE_expression)=> Empty_Relation
Data Base
Relational
Algebra
Abstract Data
TypesC Code
Tuple Index
Optimizing Transforms
Kinds of Optimization
Simplification & DS OptimizationsSimplification & DS Optimizations Key Point: DS Reductions Not CombinationsKey Point: DS Reductions Not Combinations
Pattern-Directed Systems Example domain: communications protocols Example domain: communications protocols Benefits:Benefits:
Fine grain rules allow great horizontal scalingFine grain rules allow great horizontal scaling Small search spaces (DSL->DSL) vs. one largeSmall search spaces (DSL->DSL) vs. one large Powerful in-domain optimizationsPowerful in-domain optimizations
Shortcomings:Shortcomings: Global reorganizing optimizations can explode Global reorganizing optimizations can explode
search spacesearch space
Essence of The Technology
ClassClass ElementsElements OperationsOperationsConcrete Reuse PL Struct. Concrete Reuse PL Struct. Hand Assem.Hand Assem.CompositionComposition Abstract PL Abstract PL InliningInliningPD GeneratorPD Generator DSL Struct. DSL Struct. PD XformsPD Xforms
Reuse Technologies Concrete componentsConcrete components
e.g., Functions, OOP, Frameworks, DCOM, …e.g., Functions, OOP, Frameworks, DCOM, … Compositionally Derived Components Compositionally Derived Components
e.g., Templates, GenVoca, …e.g., Templates, GenVoca, … Pattern-directed transformation systemsPattern-directed transformation systems
e.g., Draco, CAPE, IP, DMS, Sinapse, ...e.g., Draco, CAPE, IP, DMS, Sinapse, ... Reorganizing generator systemsReorganizing generator systems
AO generator (AOG), AOP, ...AO generator (AOG), AOP, ...
DSL for Sobel Edge Detection
b=[(a s)2 + (a s’)2]1/2
a b
Problem: Antagonistic Goals
High level operators and operands provide High level operators and operands provide programming leverage & variationsprogramming leverage & variations
E.g., (image E.g., (image neighborhood) convolution neighborhood) convolution
But fracture and de-localize code piecesBut fracture and de-localize code pieces b=((a b=((a s) s)22 + (a + (a s’) s’)22 ) )1/21/2
Needed optimizations: code sharing, re-org. & re-weavingNeeded optimizations: code sharing, re-org. & re-weaving
Conventional Optimization approaches induce Conventional Optimization approaches induce large search spaces (EXPLOSION)large search spaces (EXPLOSION)
Kinds of Optimization Simplification & DS OptimizationsSimplification & DS Optimizations
Key Point: DS Reductions Not CombinationsKey Point: DS Reductions Not Combinations LocalizationLocalization
Separate Parts Woven into Computational FormSeparate Parts Woven into Computational Form
General Interdependent Parts Problem NP CompleteGeneral Interdependent Parts Problem NP Complete Tractable Via Narrow Domain Knowledge & GroupingTractable Via Narrow Domain Knowledge & Grouping
Weave
Explosion Control Group Rules by PhaseGroup Rules by Phase
Implicit Phases based on Distinct DSLs & Implicit Phases based on Distinct DSLs & {Refine; Optimize} MetaProgram{Refine; Optimize} MetaProgram
Explicit Finer Grain PhasesExplicit Finer Grain Phases {Loop Optimization, Code Generation, …}{Loop Optimization, Code Generation, …}
Group Rules by Named EntityGroup Rules by Named Entity E.g., Type or Operator or Arbitrary EntityE.g., Type or Operator or Arbitrary Entity Mechanisms in AOG, Stratego, etc.Mechanisms in AOG, Stratego, etc.
AOG Uses Both Entity and PhaseAOG Uses Both Entity and Phase
Explicit Entities & Phases Phase (Job)Phase (Job)
Type Type (Semantics)(Semantics)
Loop Loop OptimizationOptimization(Fusion2)(Fusion2)
CodeCodeGenerationGeneration(Fusion3)(Fusion3)
. . .. . .
OperatorOperator ,, ,, . . .. . .ImageImage , , , , . . .. . .Neighbor-Neighbor-hoodhood
,, , , . . .. . .
. . .. . . . . .. . . . . .. . . . . .. . .
Example Loop Opt. Transform Phase (Job)Phase (Job)
Type Type (Semantics)(Semantics)
Loop Loop OptimizationOptimization(Fusion2)(Fusion2)
CodeCodeGenerationGeneration(Fusion3)(Fusion3)
. . .. . .
OperatorOperator . . .. . .ImageImage , , . . .. . .Neighbor-Neighbor-hoodhood
. . .. . .
. . .. . . . . .. . . . . .. . . . . .. . .
Example Loop Opt. Transform
(=> compositeleaf fusion2 image
Refine Image to BWPixel with loop shorthand tags
Name, Phase, Location
LHS
RHS
PreRoutine PostRoutine)
Example Loop Opt. Transform
(=> compositeleaf fusion2 image
Refine Image to BWPixel with loop shorthand tags
Name, Phase, Location
`$(pand $(por (leaf ?op) ?op)) …sub-pattern to get type …
…sub-pattern to get dimensions of ?op…)
RHS
LHS
PreRoutine PostRoutine)
Example Loop Opt. Transform
(=> compositeleaf fusion2 image
Refine Image to BWPixel with loop shorthand tags
Name, Phase, Location
`$(pand $(por (leaf ?op) ?op)) ($(spanto ?pre (tags)) (tags $(spanto ?pretags (itype ?itype))
?spaceover $(remain ?posttags))) …sub-pattern to get dimensions of ?op…)
RHS
LHS
PreRoutine PostRoutine)
Example Loop Opt. Transform
(=> compositeleaf fusion2 image
Refine Image to BWPixel with loop shorthand tags
Name, Phase, Location
RHS
enablecompositeleaf nil)
Enablecompositeleaf creates ?newleaf, ?idx1, ?idx2
Pre &Post Routines
`$(pand $(por (leaf ?op) ?op)) ($(spanto ?pre (tags)) (tags $(spanto ?pretags (itype ?itype))
?spaceover $(remain ?posttags))) …sub-pattern to get dimensions of ?op…)
LHS
Example Loop Opt. Transform
(=> compositeleaf fusion2 image
Refine Image to BWPixel with loop shorthand tags
Name, Phase, Location
`(leaf ?newleaf (tags (commasplice ?pretags)
(_Q (_FORALL (?newleaf) (,arefop (?op) ?idx1 ?idx2)))
(Itype BWPixel) (commasplice ?posttags)))enablecompositeleaf nil)
Enablecompositeleaf creates ?newleaf, ?idx1, ?idx2
Pre &Post Routines
`$(pand $(por (leaf ?op) ?op)) ($(spanto ?pre (tags)) (tags $(spanto ?pretags (itype ?itype))
?spaceover $(remain ?posttags))) …sub-pattern to get dimensions of ?op…)
LHS
RHS
Loop Control Phase Traversal
b=[(a s)2 + (a s’)2]1/2
You Are Here
(leaf a (tags (itype image)))
BehindThe
Scenes
CLOS Object
PropertyList
Pattern Match Resultb=[(a s)2 + (a s’)2]1/2
(leaf a (tags (itype image)))
BehindThe
Scenes
`$(pand $(por (leaf ?op) ?op)) ($(spanto ?pre (tags)) (tags $(spanto ?pretags (itype ?itype))
?spaceover $(remain ?posttags)))…)
{ {
{
?op?spaceover
?pre?pretags ?itype ?posttags
Pattern Match Resultb=[(a s)2 + (a s’)2]1/2
(leaf a (tags (itype image)))
BehindThe
Scenes
Define enablecompositeleaf (at, bindings){?idx1 = Create iterator; ?idx2 = Create iterator; ?newleaf = Create bwpixel; return extended bindings}
{ {
{
?op?spaceover
?pre?pretags ?itype ?posttags
?idx1 idx48146?idx2 idx48149?newleaf bwpixel48143
Rewrite Resultb=[(bwpixel48143 s)2 + (a s’)2]1/2
BehindThe
Scenes
`(leaf ?newleaf (tags (commasplice ?pretags)
(_Q (_FORALL (?newleaf) (,arefop (?op) ?idx1 ?idx2)))
(itype bwpixel) (commasplice ?posttags)))
(leaf bwpixel48143 (tags (_q (_forall (bwpixel48143) (aref (a) idx48146 idx48149))) (itype bwpixel)))
Kinds of Optimization Simplification & DS OptimizationsSimplification & DS Optimizations
Key Point: DS Reductions Not CombinationsKey Point: DS Reductions Not Combinations LocalizationLocalization
Separate Parts Woven into Computational FormSeparate Parts Woven into Computational Form Architectural ShapingArchitectural Shaping
Interdependent, Composed Parts Changed per Interdependent, Composed Parts Changed per Global ConstraintsGlobal Constraints
Architectural Shaping
Computational Structure Shaped per Computational Structure Shaped per External ConstraintsExternal Constraints SIMD (MMX), DB, UI, Middleware, NetworkSIMD (MMX), DB, UI, Middleware, Network
Non-Parallel Architectural EffectsB=(A s)
Image A
B[i,j]=0
B[i,j]+
* s-1,-1
* s-1,0
* s-1,1
* s1,1
“b=[(a s)2 + (a s’)2]1/2”
INT JM1, JP1, IM1, IP1; FOR (I=0; I < (M-1); ++I)
{ IM1=I-1; IP1= I+1; FOR (J=0; J < (N-1); ++J)
{ JM1= J-1; JP1 = J+1; IF(I==0 || J==0 || (I==(M-1)) || (J==(N-1))) THEN {B[I, J] = 0 ; } ELSE
{T1=A[IP1 , JP1] - A[IP1 , JM1] +(A[I , JP1] * 2) - (A[I , JM1] * 2) + A[IM1 , JP1] - A[IM1 , JM1];
T2 = A[IP1 , JP1] + (A[IP1 , J] * 2) +A[IP1 , JM1] - A[IM1 , JP1] -(A[IM1 , J] * 2) - A[IM1 , JM1];
B[I, J] = SQRT(T1*T1 + T2*T2 );}}}
Parallel Architectural EffectsB=(A s)
Image AB[0,j]=0
B[(m-1),j]=0B[i,0]=0
B[i, (n-1)]=0
Pixels Weights S
B[i,j]+
Pmadd3( * )
Pmadd3( * )
Pmadd3( * )
“b=[(a s)2 + (a s’)2]1/2”
{int s[(-1:1), (-1:1)]={{-1, 0, 1}, {-2, 0 , 2}, {-1, 0, 1}};int sp [(-1:1), (-1:1)]={{-1, -2, -1}, {0, 0, 0}, {-1, -2, -1}};for (j=0; j < n; j++) b[0,j] = 0 ;for (i=0; i < m; i++) b[i,0] = 0 ;for (j=0; j < n; j++) b[(m-1),j] = 0 ;for (i=0; i < m; i++) b[i,(n-1)] = 0 ;{for (i=1; i < (m-1); i++) {for (j=1; j < (n-1); j++) {t1 = UNPACKADD(PADD2
(PADD2(PMADD3 (&(a[i-1, j-1]), &(s[-1, -1])) , PMADD3 (&(a[i, j-1]), &(s[ 0, -1]))), PMADD3 (&(a[i+1,j-1]), &(s[ 1, -1])));
t2 = UNPACKADD(PADD2 (PADD2(PMADD3 (&(a[i-1, j-1]), &(sp[-1, -1])),
PMADD3 (&(a[i, j-1]), &(sp[ 0, -1]))), PMADD3 (&(a[i+1, j-1]), &(sp[ 1, -1])))));
b[i,j] = sqrt(t1*t1 + t2*t2);}}}
Architectural Shaping Computational Structure Shaped per External Computational Structure Shaped per External
ConstraintsConstraints SIMD (MMX), DB, UI, Middleware, NetworkSIMD (MMX), DB, UI, Middleware, Network
Central MetaProgram Combinatorial ComplexityCentral MetaProgram Combinatorial Complexity O(100) Transforms To Parallelize ExampleO(100) Transforms To Parallelize Example Must Recognize Opportunity and PlaceMust Recognize Opportunity and Place Must Rediscover Domain Knowledge (DK)Must Rediscover Domain Knowledge (DK)
Much DK Known About Parts at Creation TimeMuch DK Known About Parts at Creation Time Optimization Trajectories of Parts Known at Optimization Trajectories of Parts Known at
CreationCreation
Explosion Control Constraint Propagation NP CompleteConstraint Propagation NP Complete Simplify Constraint PropagationSimplify Constraint Propagation
MetaPrograms Exploit DS KnowledgeMetaPrograms Exploit DS Knowledge Global Constraints (MMX) Determine Cooperating, Global Constraints (MMX) Determine Cooperating,
Distributed MetaProgramsDistributed MetaPrograms Pre-Propagation of Constraints via TagsPre-Propagation of Constraints via Tags Pre-Plan Ordering Constraints on Distributed Pre-Plan Ordering Constraints on Distributed
MetaProgramsMetaPrograms Result: Tag-Directed TransformationsResult: Tag-Directed Transformations
Explosion Control Tag-Directed TransformationsTag-Directed Transformations MetaPrograms Tagged onto Reusable PartsMetaPrograms Tagged onto Reusable Parts
WHATWHAT Transformation Transformation (SplitLoopOnCases)(SplitLoopOnCases)
WHENWHEN to Fire to Fire (on (on EventNameEventName (SplitLoopOnCases)) (SplitLoopOnCases))
WHEREWHERE to Apply to Apply (if (if CaseTestCaseTest then SpecialCase then SpecialCase
else else GeneralCaseGeneralCase (Tags (on … (Tags (on …
(SplitLoopOnCases))))(SplitLoopOnCases))))
Example: SplitLoopOnCases
for(i=0, j=0; i<m && j<n; i++, j++)if(i==0 || j==0 || i==(m-1) ||
j==(n-1)) ...then case...; ...else case...;
for(j=0; j<n; j++)...then case with i=0...;for(j=0; j<n; j++)...then case with i=(m-1)...;for(i=0; i<m; i++)...then case with j=0...;for(i=0; i<m; i++)...then case with j=(n-1)...;for(i=1, j=1; i<(m-1) && j<(n-1); i++, j++)
...else case...;
Cooperating TD Transforms
Generate Weight MatricesGenerate Weight Matrices Create Loops, Unwrap, Partially EvaluateCreate Loops, Unwrap, Partially Evaluate
Split Loop+If into Loop CasesSplit Loop+If into Loop Cases Simplify Special Case LoopsSimplify Special Case Loops
Create Loops, Infer Control, Partially EvaluateCreate Loops, Infer Control, Partially Evaluate Reshape Image Loop BodyReshape Image Loop Body
Ordering Dependencies
Dependencies SupportedDependencies Supported Per Strategic Plan – (on PlanStep …)Per Strategic Plan – (on PlanStep …) Before & After – (on (completion Xform)…)Before & After – (on (completion Xform)…) On Local Action – (on substitutionofme …)On Local Action – (on substitutionofme …) On Signal – (on ?signalvbl …)On Signal – (on ?signalvbl …)
Explosion Control Summary Refinements – Implied DSL to DSL PhasesRefinements – Implied DSL to DSL Phases Specialized OptimizationsSpecialized Optimizations
Simplification & DS Opt. – PE & PD RulesSimplification & DS Opt. – PE & PD Rules Localization – Explicit Rule GroupingLocalization – Explicit Rule Grouping Architectural Shaping –Tag-Directed ControlArchitectural Shaping –Tag-Directed Control
Distributed MetaPrograms on Reusable PartsDistributed MetaPrograms on Reusable Parts Avoid General NP Complete ProblemAvoid General NP Complete Problem
Specialized Sub-Problems & Use DKSpecialized Sub-Problems & Use DK
References Katz & Volper, Constraint Propagation in Software Katz & Volper, Constraint Propagation in Software
Libraries of Transformation Systems, Libraries of Transformation Systems, IJSE&KE 2,3, IJSE&KE 2,3, 19921992..
Biggerstaff, Fixing Some Transformation Problems, Biggerstaff, Fixing Some Transformation Problems, Proc. Of Automated Software Engineering, 1999.Proc. Of Automated Software Engineering, 1999.
Biggerstaff, A New Control Structure for Biggerstaff, A New Control Structure for Transformation-Based GeneratorsTransformation-Based Generators, ICSR 2000ICSR 2000.
Neighbors, Draco: A Method for Engineering Neighbors, Draco: A Method for Engineering Reusable Software Systems, inReusable Software Systems, in Software Software Reusability, 1989. Reusability, 1989.
Reuse Technologies Concrete componentsConcrete components
e.g., Functions, OOP, Frameworks, DCOM, …e.g., Functions, OOP, Frameworks, DCOM, … Compositionally Derived Components Compositionally Derived Components
e.g., Templates, GenVoca, …e.g., Templates, GenVoca, …
Essence of The Technology
ClassClass ElementsElements OperationsOperationsConcrete Reuse PL Struct. Concrete Reuse PL Struct. Hand Assem.Hand Assem.CompositionComposition Abstract PL Abstract PL InliningInlining
The scaling plane
Vertical(Programming
leverage)
Horizontal (Optimality of fit)
Feature variabilityOne-sizefits all
Customized
Small, lowpayoff
Large, highpayoff
Reu
se P
ayof
f
Reorganizing Generators
Benefits:Benefits: Inter-component optimizations (reweavings)Inter-component optimizations (reweavings) Small search space = reasonably fastSmall search space = reasonably fast
Shortcomings:Shortcomings: Technology immatureTechnology immature Unclear how far it can be pushedUnclear how far it can be pushed
Reuse Technologies Concrete componentsConcrete components
e.g., Functions, OOP, Frameworks, DCOM, …e.g., Functions, OOP, Frameworks, DCOM, …
Essence of The Technology
ClassClass ElementsElements OperationsOperationsConcrete Reuse PL Struct. Concrete Reuse PL Struct. Hand Assem.Hand Assem.
Niches in the scaling plane
Vertical(Programming
leverage)
Horizontal (Optimality of fit)
PatternDirected
ReorganizingSubsystem
LevelComponents
DerivedComponents
ConventionalComponents
Niches in the scaling plane
Vertical(Programming
leverage)
Horizontal (Optimality of fit)
SubsystemLevel
Components
DerivedComponents
PatternDirected
ConventionalComponents
Concrete Components Small components don’t work wellSmall components don’t work well
Assembly work per unit payoff is lowAssembly work per unit payoff is low Small components specialized niches OKSmall components specialized niches OK
Overhead masked by human response (e.g., UI)Overhead masked by human response (e.g., UI) Standards or domain narrowness mitigateStandards or domain narrowness mitigate
Big components work wellBig components work well Programs or subsystemsPrograms or subsystems High programming leverageHigh programming leverage Payoff dominates overhead costsPayoff dominates overhead costs
Example: UI Controls
Niches in the scaling plane
Vertical(Programming
leverage)
Horizontal (Optimality of fit)
SubsystemLevel
Components
ConventionalComponents
GenVoca derives a container
deque_usm = deq_sync [ deque2c [ dlist [ avail [ heap [ transient ]]]]];
ContainerClass
ElementClass
dlist
heap
deq-sync
deque2c
avail
transient
Refinements
List elements from heap
Deque
Synchronized deque
Container
Doubly linked list
Managed linked list
Transient elements
TypeEquation
Compositional Derivation Example domain: Data structuresExample domain: Data structures Benefits:Benefits:
Improve reuse by raising level of abstractionImprove reuse by raising level of abstraction Combinatorial amplification of library (horz.)Combinatorial amplification of library (horz.) Generation is fastGeneration is fast
Shortcomings:Shortcomings: Level of abstraction still lowLevel of abstraction still low Large grain components mitigate horz. scalingLarge grain components mitigate horz. scaling Dependencies limit extensibilityDependencies limit extensibility Inter-component optimization difficultInter-component optimization difficult
Niches in the scaling plane
Vertical(Programming
leverage)
Horizontal (Optimality of fit)
SubsystemLevel
Components
DerivedComponents
ConventionalComponents
Reuse Technologies Concrete componentsConcrete components
e.g., Functions, OOP, Frameworks, DCOM, …e.g., Functions, OOP, Frameworks, DCOM, … Compositionally Derived Components Compositionally Derived Components
e.g., Templates, GenVoca, …e.g., Templates, GenVoca, … Pattern-directed transformation systemsPattern-directed transformation systems
e.g., Draco, CAPE, IP, DMS, ...e.g., Draco, CAPE, IP, DMS, ... Reorganizing generator systemsReorganizing generator systems
AO generator, AOP, ...AO generator, AOP, ...
Inference-driven generator systemsInference-driven generator systems Kids, Synapse, ...Kids, Synapse, ...
Inference-Based Generators
Paradigm: Schema + rules of inferenceParadigm: Schema + rules of inference Example: Divide-and-conquer schemaExample: Divide-and-conquer schema
Broad framework for solutionBroad framework for solution User specification: Formal specification User specification: Formal specification
(e.g., predicate calculus)(e.g., predicate calculus)
Inference-Based Generators Example: Kids generatorExample: Kids generator Benefits:Benefits:
Highest levels of horizontal scalingHighest levels of horizontal scaling Shortcomings:Shortcomings:
Formal specifications require ultra-stable Formal specifications require ultra-stable applicationapplication
Requires well-understood domain with deep theoryRequires well-understood domain with deep theory Immaturity and narrow => low vertical scaling Immaturity and narrow => low vertical scaling
Essence of The Technology
ClassClass ElementsElements OperationsOperationsConcrete Reuse PL Struct. Concrete Reuse PL Struct. Hand Assem.Hand Assem.CompositionComposition Abstract PL Abstract PL InliningInliningPD GeneratorPD Generator DSL Struct. DSL Struct. PD XformsPD XformsReorg Generator Tagged DSLReorg Generator Tagged DSL PDX & PDX &
TDXTDXInfer GeneratorInfer Generator DSL+Logic DSL+Logic InferenceInference
Niches in the scaling plane
Vertical(Programming
leverage)
Horizontal (Optimality of fit)
SubsystemLevel
Components
DerivedComponents
PatternDirected
Reorganizing
InferenceBasedConventional
Components
Reuse Technologies Concrete componentsConcrete components
Limited islands of successful reuseLimited islands of successful reuse Compositionally Derived Components Compositionally Derived Components
More horizontal scaling but no inter-part reweavingMore horizontal scaling but no inter-part reweaving Pattern-directed transformation systemsPattern-directed transformation systems
Extends both but big search space for reweavingExtends both but big search space for reweaving Reorganizing generator systemsReorganizing generator systems
Reweavings gain horiz. scaling but immature Reweavings gain horiz. scaling but immature
Inference-driven generator systemsInference-driven generator systems Greatest horiz. scaling but formality limits useGreatest horiz. scaling but formality limits use
Essence of The Technology
ClassClass ElementsElements OperationsOperationsConcrete Reuse PL Struct. Concrete Reuse PL Struct. Hand Assem.Hand Assem.CompositionComposition Abstract PL Abstract PL InliningInliningPD GeneratorPD Generator DSL Struct. DSL Struct. PD XformsPD XformsReorg Generator Tagged DSLReorg Generator Tagged DSL PDX & PDX &
TDXTDX
Niches in the scaling plane
Vertical(Programming
leverage)
Horizontal (Optimality of fit)
SubsystemLevel
Components
DerivedComponents
PatternDirected
Reorganizing
InferenceBasedConventional
Components
Operators with Implicit ControlB=(A s)
Image A
B[i,j]=0
B[i,j]+
* s-1,-1
* s-1,0
* s-1,1
* s1,1
Non-Parallel Pseudo-Code
If (Off Edge)then t1 = 0else t1 = ( a[i-1, j-1]*(-1)+
a[i-1, j]*(-2) + a[i-1, j+1]*(-1)+ a[i+1, j-1]*1 + a[i+1, j]*2 + a[i+1, j+1]*1 ) ;
. . . code for t2 . . .
b[i,j] = sqrt((t1 * t1) + (t2 * t2));
Parallel Pseudo-Code
t1 = unpackadd(padd2(padd2(pmadd3(&(a[i-1,j-1]), &(s[-1, -1])),
pmadd3(&(a[i, j-1]), &(s[0, -1]))),
pmadd3(&(a[i+1,j-1]), &(s[ 1, -1])));
. . . code for t2 . . .
b[i,j] = sqrt((t1 * t1) + (t2 * t2));
AOG Features Schema language foundationSchema language foundation Pattern-driven & tag-driven transformsPattern-driven & tag-driven transforms
Organized by inheritance type and by stageOrganized by inheritance type and by stage Tags capture non-pattern-driven knowledgeTags capture non-pattern-driven knowledge Tags act like AST-localized interrupts for performing Tags act like AST-localized interrupts for performing
optimizationsoptimizations
TD’s are large-grain programmatic transformsTD’s are large-grain programmatic transforms Specialists: Partial evaluator & inference engineSpecialists: Partial evaluator & inference engine No explicit loopsNo explicit loops PerformancePerformance with small search spaceswith small search spaces
Generate Weight Matrices Create Loops, Unwrap, Partially EvaluateCreate Loops, Unwrap, Partially Evaluate dsdeclare dsarrayofint arr57391 dsdeclare dsarrayofint arr57391 [ -1, 1][ -1, 1] ((1 0 -1) (2 0 -2) (1 0 -1)) ;[ -1, 1][ -1, 1] ((1 0 -1) (2 0 -2) (1 0 -1)) ;
simplsimpl
{for (i = [0, (m – 1)], j =[0, (n – 1)], (i == 0)) {tmp1= 0; tmp2 = 0; b[i, j] = sqrt (( (tmp2 * tmp2) + (tmp1 *tmp1))) }}
{for (j =[0, (n – 1)] ) b[0, j] = 0}
Control Regimes
PD Search – Independent Local ChoicesPD Search – Independent Local Choices Strategically Blind – exploding search spaceStrategically Blind – exploding search space Biased Toward Local Syntactic StructureBiased Toward Local Syntactic Structure Rules are General & Allow Easy ExtensionRules are General & Allow Easy Extension
Results of Compositeleaf Xform
(leaf a (tags (itype image)))
(leaf bwpixel48143 (tags (_q (_forall (bwpixel48143) (aref (a) idx48146 idx48149))) (itype bwpixel)))
BeforeBefore
AfterAfter
Internal PD Transform View
See Bindings onPrevious Chart