Predicate : The word or words in a proposition which express what is affirmed of the subject. International Workshop on Foundations and Developments of Object-Oriented Languages FOOL/WOOD
Typing is enforcement of the Class of object. Type checking to check whether the message calls conforms to same type.
that is, whether is a logical consequence of the union of the built-in theories and the set of formulas .Roughly speaking, when is universal and all the formulas in are existential (i.e., when and contain at most universal, respectively existential, quantifiers), CVC3 is in fact a decision procedure: it is always guaranteed (well, modulo bugs and memory limits) to return a correct \"valid\" or \"invalid\" answer. In all other cases, CVC3 is only guaranteed to be sound: it will never say that an invalid formula is valid. However, it may either never return or give up and return \"unknown\" even if .When CVC3 returns \"valid\" it can return a formal proof of the validity of under the logical context , together with the subset of used in the proof, such that .When CVC3 returns \"invalid\" it can return, in the current terminology, both a counter-example to 's validity under and a counter-model. Both a counter-example and a counter-models are a set of additional formulas consistent with in , but entailing the negation of . In formulas: and .The difference is that a counter-model is given as a set of equations providing a concrete assignment of values for the free symbols in and (see QUERY for more details).CVC3 can be used in two modes: as a C/C++ library, or as a command-line executable (implemented as a command-line interface to the library). This manual mainly describes the command-line interface on a unix-type platform.
Expressive And Modular Predicate Dispatch In Java - Presentation Transcript
Anjan.K
II Sem M.Tech
Dept of CSE
M.S.R.I.T
Technical Seminar : EMPD in Java 05/22/09 1
ï½ Prerequisites
ï½ Introduction
â—¦ Paper
â—¦ Contributions
 Dynamic Vs Predicate Dispatch
ï½ Salient features-Jpred
â—¦ Expressiveness
â—¦ Modular Static type
ï½ Jpred - Merits
ï½ Demerits
ï½ Conclusion And Future Work
Technical Seminar : EMPD in Java 05/22/09 2
ï½ Object oriented programming
â—¦ Languages
â—¦ Applications
â—¦ Pillars of OO Concept
ï½ Java
â—¦ Fundamental Of J2SE
â—¦ Different flavors
ï‚– Compliers- Open Source Vs Proprietary
ï‚– Framework like Playgot
ï‚– Java Virtual Machine (JVM)
 Integrated Development Environment (IDE) –eclipse,
NetBeans, Myeclipse Technical Seminar : EMPD in Java 05/22/09 3
ï½ Authors – Todd Millstein, ï½ Key Terminologies
Christoper Frost, Jason Ryder, ◦ Dynamic Dispatch – a
Alessandro Warth of Dept of declarative mechanism
Computer Science, University for determining code to
of California, LA executed upon function
ï½ Initial version of work was invocation.
presented at OOPSLA 2004 , ◦ Predicate Dispatch –
FOOL/WOOD 2006 and Object oriented
TOPLAS 2009 mechanism for
determining the method
ï½ Permission to use for
implementation to be
personal or class room as
invoked upon predicate
digital or hard copies is
guard condition.
ACM Transaction on Programming Languages and System Vol 31,No2,Article 7 Feb 2009.
granted
â—¦ Jpred compiler to
support predicate
Technical Seminar : EMPD in Java 05/22/09 4
ï½ Design of Jpred can practically included in
traditional OO languages making
programming idioms easier to express and
validate.
ï½ Jpred as extension in FWJava proves it type
soundness for modular type checking system
and its usage.
ï½ In addition to modular type checking strategy
Jpred also introduces modular compilation
strategy Technical Seminar : EMPD in Java 05/22/09 5
Dynamic Dispatch Predicate Dispatch
ï½ Guards are specified ï½ Overriding is done
declaratively on method
based on predicate
ï½ OO Inheritance style, DD logically implication of
makes function
predicates say m1 &
extensible.
m2.
ï½ Better static type
ï½ Includes all support
checking then manual
concept of DD,
approach.
multimethod &
ï½ Fails to address issues
functional-style
â—¦ Message-not-
pattern matching.
understood Technical Seminar : EMPD in Java 05/22/09 6
ï½ Jpred
â—¦ Backward Compatible extension of Java supporting
predicate dispatch.
â—¦ New generation compiler that employs general
purpose, off-the-shelf decision procedures.
â—¦ Compatible with many of the open source Java
compilers like playgot, Jikes and even Sun javac
and works on standard JVM.
â—¦ Formally introduced with Java, Featherweight
Java and MultiJava.
â—¦ Included in method declaration with clause when
pred before throws clause. Seminar : EMPD in Java 05/22/09
Technical
Also called as 7
ï½ Expressiveness – predicate expression pred is
Boolean condition under which method may
be invoked. Discussed under
â—¦ Multimethod Dispatch
ï‚– Event Based System (EBS)
ï‚– Generalized Multi methods
â—¦ Interface Dispatch and Ordered Dispatch
â—¦ Field Dispatch
â—¦ Equality under Finite State Machine (FSM)
â—¦ Linear Arithmetic
â—¦ Pure Methods
Technical Seminar : EMPD in Java 05/22/09 8
class FileEditor { class FileEditor {
void handle(Event e) { void handle(Event e)
if(e instanceof Open) { when e@Open
{../* Open File*/}
/* Open File*/}
void handle(Event e)
else if(e instanceof
when e@SaveAs
SaveAs){
{../* save it new file
/*save it new file*/}
*/}
else if (e instanceof
void handle(Event e)
Save){
when e@SaveAs
/*save the file */ }
{../* save the file */}
File editor {/* Handle in Java
else implemented File editor implemented in e)
void handle(Event Jpred
unexpected events*/}
{../* Handle
} Technical Seminar : EMPD in Java 05/22/09 9
ï½ Modular Type Checking
◦ Type checking message sends – message type
checking in Jpred is exactly as in Java
â—¦ Type checking method declarations in Jpred requires
 Local checks –on each predicate method in
isolation
 Exhaustiveness Checking – ensure that
“message-not-understood†errors cannot happen at
runtime. Java and MultiJava shares the same Jpred’s
conservatism
 Ambiguity Checking – ensure that “message-
ambiguous†errors cannot happen atJava 05/22/09
Technical Seminar : EMPD in
runtime 10
ï½ CVC3
◦ Automatic theorem prover for Satisfiability
Modulo Theories (SMT)Â problems.
â—¦ built-in base theories:
ï‚– rational and integer linear arithmetic,
ï‚– arrays, tuples, records, inductive data types,
ï‚– bit vectors, and
ï‚– equality over un interpreted function symbols;
◦ checks whether a given formula Φ  is valid in the
built-in theories under a given set Γ of
assumptions Technical Seminar : EMPD in Java 05/22/09 11
ï½ Jpred is successfully implemented on Polygot-extensilbe
compiler framework for Java base compiler being Java 1.5
ï½ Typechecking
◦ Local check – performed using existing typechecking
pass.
â—¦ Exhaustive and ambiguity check are made using the
algorithm previously discussed
ï½ Code Generation
â—¦ Jpred code in .pj file is generated in two phases
 Conversion of Jpred’s Abstract syntax tree(AST) to
Java’s AST
ï‚– Resulting in .java compiled and executed05/22/09standard
Technical Seminar : EMPD in Java by 12
Merits Demerits
ï½ Quantitative results have ï½ Number of average sized
proved that Jpred methods has increased
required lesser number ï½ Additionally more
of Lines of Code (LOC) number of theorem
when compared with Java proving queries to solve
ï½ Jpred implementation predicates
has clearly eliminated ï½ Single Jpred method
manual dispatching logic requires tedious
ï½ Greatly reduces the processing under
typecasting business MultiJava environment
ï½ Compilation is bit greater
ï½ Ordered dispatch reduces Technical Seminar : EMPD in Java 05/22/09 13
ï½ Current Jpred build can be extended in many
ways
ï½ Further support for High-end Java technologies
like struts on Myeclipse, Hibernate, portlets
ï½ Predicate language currently supports literals of
integer and Boolean. Further, its useful to
support other Java literals with their associated
operation.
ï½ Support for Scala-style extractors making
predicate dispatch more expressive in the face of
Technical Seminar : EMPD in Java 05/22/09 14
ï½ Clear Contrast between Dynamic dispatch and
Predicate Dispatch
ï½ Need for predicate dispatch
ï½ Jpred
â—¦ Expressiveness
â—¦ Modular Typechecking strategies
ï½ Jpred – an example in EBS
ï½ Compilation strategy
Technical Seminar : EMPD in Java 05/22/09 15
[1] Eclipse 2007, Eclipse Home page
http://www.eclipse.org
[2] Authors site i.e., University of California
http://www.cs.ucla.edu/~todd/research/jpred.html
[3] Christopher Frost and Todd Millstein, “Modular
Typesafe Interface Dispatch in Jpred†at
FOOL/WOOD in 2006
[4] Todd Millstein, “Practical Predicate Dispatch†at
OOPSLA in 2004
Technical Seminar : EMPD in Java 05/22/09 16
0 comments
Post a comment