R-customizers Goal: define relation between graph and its customizers, study domains of adaptive programs, merging of interface class graphs.

Slides:



Advertisements
Similar presentations
NFA algorithms and AP algorithms Suggested by Yannis Smaragdakis.
Advertisements

Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
Minimum Spanning Trees Definition Two properties of MST’s Prim and Kruskal’s Algorithm –Proofs of correctness Boruvka’s algorithm Verifying an MST Randomized.
NP-Completeness: Reductions
1 Lecture 5 (part 2) Graphs II Euler and Hamiltonian Path / Circuit Reading: Epp Chp 11.2, 11.3.
Framework is l Reusable Code, often domain specific (GUI, Net, Web, etc) l expressed as l a set of classes and l the way objects in those classes collaborate.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
INFS614, Fall 08 1 Relational Algebra Lecture 4. INFS614, Fall 08 2 Relational Query Languages v Query languages: Allow manipulation and retrieval of.
Optimization of Pearl’s Method of Conditioning and Greedy-Like Approximation Algorithm for the Vertex Feedback Set Problem Authors: Ann Becker and Dan.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 52 Database Systems I Relational Algebra.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Improvements and Extensions of the EG Interface Fall 2002.
Hardness Results for Problems
Circle Graph and Circular Arc Graph Recognition. 2/41 Outlines Circle Graph Recognition Circular-Arc Graph Recognition.
Lecture 2 COM 3362, April 5, Composition example Use three aspects simultaneously with three classes. Three aspects: –ShowReadWriteAccess –InstanceLogging.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
V. V. Vazirani. Approximation Algorithms Chapters 3 & 22
1 Constructing Class Hierarchies From: Using Types and Inheritance in Object-Oriented Programming, by Daniel C Halbert and Patrick D. O'Brien, IEEE Software,
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Integrating Independent Components with On-Demand Remodularization based on OOPSLA 2002 paper by Mira Mezini Klaus Ostermann Prepared by Karl Lieberherr.
MCS 312: NP Completeness and Approximation algorithms Instructor Neelima Gupta
Lecture 22 More NPC problems
An Algebra for Composing Access Control Policies (2002) Author: PIERO BONATTI, SABRINA DE CAPITANI DI, PIERANGELA SAMARATI Presenter: Siqing Du Date:
Validated Model Transformation Tihamér Levendovszky Budapest University of Technology and Economics Department of Automation and Applied Informatics Applied.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Chapter 10 Analysis and Design Discipline. 2 Purpose The purpose is to translate the requirements into a specification that describes how to implement.
Not only mark-up languages! There are other many other grammar formalisms and tools than XML. Some of them standardized (ASN). Even XML does not always.
EMIS 8374 Optimal Trees updated 25 April slide 1 Minimum Spanning Tree (MST) Input –A (simple) graph G = (V,E) –Edge cost c ij for each edge e 
1 Relational Algebra Chapter 4, Sections 4.1 – 4.2.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Relations and their Properties
Relation. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be.
Aspectual Components Part 2 April 5, Composition example Use three aspects simultaneously with three classes. Three aspects: –ShowReadWriteAccess.
DJ: traversal-visitor-style programming in Java Josh Marshall/ Doug Orleans Want to add more on traversal through collections and Aspectual Components.
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
AOP/cross-cutting What is an aspect?. An aspect is a modular unit that cross-cuts other modular units. What means cross-cutting? Apply AOP to AOP. Tease.
Quality Assurance in the Presence of Variability Kim Lauenroth, Andreas Metzger, Klaus Pohl Institute for Computer Science and Business Information Systems.
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
OBJECTIVES:  Find inverse functions and verify that two functions are inverse functions of each other.  Use graphs of functions to determine whether.
1 Lecture 5 (part 2) Graphs II (a) Circuits; (b) Representation Reading: Epp Chp 11.2, 11.3
Jesse proposal1 Jesse’s proposal Karl Lieberherr.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
Lecture 2-2 NP Class.
Minimum Spanning Trees
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Is AP a sound methodology compared to OO?
Intro to NP Completeness
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
Graph.
Relational Algebra Chapter 4, Sections 4.1 – 4.2
4.1 Inverse Functions.
Structural Patterns: Adapter and Bridge
APPCs revisited 2/25/2019 APPCs revisited.
{(1, 1), (2, 4), (3, 9), (4, 16)} one-to-one
Graphs.
Reductions Complexity ©D.Moshkovitz.
Reductions Complexity ©D.Moshkovitz.
Minimum Spanning Trees
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Lecture 7 Frameworks and AP Notations for strategies
Presentation transcript:

R-customizers Goal: define relation between graph and its customizers, study domains of adaptive programs, merging of interface class graphs

Definition R-customizers(I) = {T : (T R I)} Customizer Theorem: (I1 R I2) if and only if R-customizers(I1)  R-customizers(I2) provided R is reflective and transitive I1 large graph, I2 small graph R: compatible, refinement, strong- refinement

Example for Customizer Theorem I2 : A = B. I1 : A = B. B = C. R = compatible R-customizers(I2) = class graphs that have an A-node and a B-node with a path R-customizers(I1)  R-customizers(I2) I1 is compatible with I2

Key concepts: compatability Let G 1 =(V1,E1) and G 2 =(V2,E2) be directed graphs with V2 a subset of V1. Graph G 1 is a compatible with G 2 if for all u,v in V 2 we have that (u,v) in E 2 implies that there exists a path in G 1 between u and v Polynomial. Motivation: All of G 2 is used in G 1.

A A BB C C D D E E F F G1G1 G2G2 G 1 compatible G 2

Key concepts: refinement Let G1=(V1,E1) and G2=(V2,E2) be directed graphs with V2 a subset of V1. Graph G 1 is a refinement of G 2 if for all u,v in V 2 we have that (u,v) in E 2 implies that there exists a path in G 1 between u and v which does not use in its interior a node in V 2. Polynomial. Motivation: No surprises.

A A BB C C D D E E F F G1G1 G2G2 G 1 refinement G 2 Implementation: create strategy constraint map: bypassing all nodes of G 2

Motivation for Refinement Refinement has nice implications on instances of G 1 and G 2 (consider the graphs to be class graphs). By contracting edges of instances of G 1 without eliminating G 2 nodes and by deleting parts from instances of G 1 we can transform any G 1 instance to a G 2 instance. G 1 objects are similar to G 2 objects.

Motivation for Refinement Extra paths in G 1 can be eliminated during traversal. Similarity between G 1 and G 2 objects helps to guarantee that program for G 2 works correctly when applied to G 1.

A A B B G1G1 G2G2 not G 1 strong refinement G 2 C C Refinement means: no surprises not G 1 refinement G 2 G 1 compatible G 2

A A B B G1G1 G2G2 C C No Refinement: objects are not similar not G 1 refinement G 2 aA( aB( aC())) aA( aC( aB() aC() aB())))) Code in C updates the B-object: need to visit B before C

A B G1G1 G2G2 G 1 refinement G 2 C Refinement means: no surprises A B C

A B G1G1 G2G2 G 1 refinement G 2 C A B C aA( aB( aC( aA()))) aA( aB( aC( aX( aA()) aB()) aA()) aX())) X contracting

Instantiation view Interface class graph: instances are class graphs Class graph: instances are objects Want objects to “conform” to interface class graph: objects of class graph and immediate objects of interface class graph must be similar

Key concepts: strong refinement Let G1=(V1,E1) and G2=(V2,E2) be directed graphs with V2 a subset of V1. Graph G 1 is a strong refinement of G 2 if for all u,v in V 2 we have that (u,v) in E 2 if and only if there exists a path in G 1 between u and v which does not use in its interior a node in V 2. Polynomial. Motivation: no surprises, no extra paths

A A BB C C D D E E F F G1G1 G2G2 G 1 strong refinement G 2

Connections Strong refinement implies Refinement implies Compatible When do we use which relationship?

Roles graphs play in OOD

Refinement For each edge in G2 there must be a corresponding pure path in G1. Pure path = in interior no nodes of G2. Refinement = strong refinement with “if and only if” replaced by “implies”.

A A BB C C D D E E F F G1G1 G2G2 G 1 strong refinement G 2

A A BB C C D D E E F F G1G1 G2G2 G 1 refinement G 2 Implementation: create strategy constraint map: bypassing all nodes of G 2

A A BB C C D D E E F F G1G1 G2G2 G 1 compatible G 2

A A B B G1G1 G2G2 not G 1 strong refinement G 2 C C Refinement means: no surprises not G 1 refinement G 2 G 1 compatible G 2

A A B B G1G1 G2G2 G 1 refinement G 2 C C Refinement means: no surprises X G 1 strong refinement G 2

A B G1G1 G2G2 G 1 compatible G 2 not G 1 strong refinement G 2 G 1 refinement G 2 C Refinement means: no surprises A B C

Implementation of refinement: reduce to compatability Translate G 2 into a strategy graph S that has “bypassing all nodes” as constraint on each edge. Check whether S is compatible with G 1, i.e. there is a path in G 1 satisfying the constraint for each edge in S. Reuses Traversal Graph Algorithm.

Traversing pure paths only Use same strategy graph construction Compute traversal graph for that strategy graph Run-time traversals will only follow pure paths

Intersection R-customizers(I1) intersect R-customizers(I2) is always non-empty if R = refinement. Choose union of two graphs.

Co-existence of multiple organizations in software systems OOP: class graph Many issues cross-cut the class organization: subgraph of class graph plus additional decorations on class graph problem: subgraph definitions are brittle with respect to class graph: change of class graphs requires changes to many subgraphs

Lift subgraphs: define them abstractly and compose them. Subgraph definitions are graphs themselves: call them interface class graphs Set of interface class graphs: When can they be used together on a class graph. Want to automate the mapping.

View View of AP Multiple views of the same class graph Application class graph V1 V2 V3 V4 V5 In Demeter/Java: view = strategy graph

Connection to Frameworks A framework is a set of cooperating classes that make up a reusable behavior Typical use of a framework: by subclassing Leads to inversion of control: “We will call you; don’t call us”

Adaptive Programming and Frameworks Frameworks –a few big ones –hard to combine –hard to map –conventional technology APPCs –many small ones –easy to combine –easy to map –new