SofCheck Software Analysis and erification Ada 200Y -- What and Why SIGAda 02 December 2002 S. Tucker Taft President SofCheck, Inc.

Slides:



Advertisements
Similar presentations
Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Advertisements

Chapter 10: Designing Databases
Programming Paradigms and languages
Programming Languages and Paradigms
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Portability and Safety Mahdi Milani Fard Dec, 2006 Java.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Object Oriented Programming in Java George Mason University Fall 2011
 Both System.out and System.err are streams—a sequence of bytes.  System.out (the standard output stream) displays output  System.err (the standard.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Fall 2007CS 2251 Inheritance and Class Hierarchies Chapter 3.
Introduction to Fortran Fortran Evolution Drawbacks of FORTRAN 77 Fortran 90 New features Advantages of Additions.
Trey Mack James Moore Osa Osar-Emokpae
Chapter 10 Classes Continued
Abstract Data Types and Encapsulation Concepts
1 Exception and Event Handling (Based on:Concepts of Programming Languages, 8 th edition, by Robert W. Sebesta, 2007)
Unit Testing & Defensive Programming. F-22 Raptor Fighter.
Language Evaluation Criteria
1 Chapter 5: Names, Bindings and Scopes Lionel Williams Jr. and Victoria Yan CSci 210, Advanced Software Paradigms September 26, 2010.
Java and C++, The Difference An introduction Unit - 00.
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Names Variables Type Checking Strong Typing Type Compatibility 1.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
Slide: 1 Copyright © AdaCore Subprograms Presented by Quentin Ochem university.adacore.com.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
1 SystemVerilog Enhancement Requests Daniel Schostak Principal Engineer February 26 th 2010.
Directions for the Next Generation of Ada Randall Brukardt, ARG Editor AXE Consultants.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
The Evolution of Programming Languages Day 2 Lecturer: Xiao Jia The Evolution of PLs1.
 All calls to method toString and earnings are resolved at execution time, based on the type of the object to which currentEmployee refers.  Known as.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Java Basics Opening Discussion zWhat did we talk about last class? zWhat are the basic constructs in the programming languages you are familiar.
Object-Oriented Programming Chapter Chapter
MT311 Java Application Development and Programming Languages Li Tak Sing ( 李德成 )
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Lecture Videos will no longer be posted. Assignment 3 is due Sunday, the 8 th, 7pm. Today: –System Design,
(1) ICS 313: Programming Language Theory Chapter 11: Abstract Data Types (Data Abstraction)
COM S 228 Introduction to Data Structures Instructor: Ying Cai Department of Computer Science Iowa State University Office: Atanasoff.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
Chapter 11: Advanced Inheritance Concepts. Objectives Create and use abstract classes Use dynamic method binding Create arrays of subclass objects Use.
Programming in java Packages Access Protection Importing packages Java program structure Interfaces Why interface Defining interface Accessing impln thru.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Programming & Debugging. Key Programming Issues Modularity Modifiability Ease of Use Fail-safe programming Style Debugging.
3/12/2013Computer Engg, IIT(BHU)1 OpenMP-1. OpenMP is a portable, multiprocessing API for shared memory computers OpenMP is not a “language” Instead,
© 2006 Pearson Addison-Wesley. All rights reserved 1-1 Chapter 1 Review of Java Fundamentals.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Ada, Scheme, R Emory Wingard. Ada History Department of Defense in search of high level language around Requirements drafted for the language.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
COMPOSITE PATTERN NOTES. The Composite pattern l Intent Compose objects into tree structures to represent whole-part hierarchies. Composite lets clients.
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
ISBN Chapter 12 Support for Object-Oriented Programming.
Dr. M. Al-Mulhem Introduction 1 Chapter 6 Type Systems.
Design issues for Object-Oriented Languages
Object Oriented Programming in
Using Ada-C/C++ Changer as a Converter Automatically convert to C/C++ to reuse or redeploy your Ada code Eliminate the need for a costly and.
Data Types In Text: Chapter 6.
Type Checking, and Scopes
Java Primer 1: Types, Classes and Operators
Computer Engg, IIT(BHU)
Functional Programming with Java
Java Programming Language
More Object-Oriented Programming
Programming Languages 2nd edition Tucker and Noonan
Names and Binding In Text: Chapter 5.
Computer Science 340 Software Design & Testing
Presentation transcript:

SofCheck Software Analysis and erification Ada 200Y -- What and Why SIGAda 02 December 2002 S. Tucker Taft President SofCheck, Inc.

Ada is Alive and Evolving Ada 83 Mantra: No Subsets, No Supersets Ada 95 Mantra: Portable Power to the Programmer Internet, especially Comp.Lang.Ada, Team- Ada fosters... –Active interplay between users, vendors, and language lawyers –Open discussion of new ideas and possible language enhancements Availability of open-source GNAT fosters… –Grass roots interest in Ada –Additional open-source contributions to compiler and library –Experiments with new syntax and semantics

ISO WG9 and Ada Rapporteur Group Stewards of Adas Standardization and Evolution Includes users, vendors, and language lawyers First Official Corrigendum Released 9/2000 Now Focusing on Language Amendments So Which Way do we Go?

Overall Goals for Language Evolution Enhance Adas Position as a: –Safe –High Performance –Flexible –Portable –Accessible –Distributed, Concurrent, Real-Time, Object- Oriented Programming Language Finish the job of integrating object- oriented concepts into Ada Ada

Safety Is Our Most Important Product Ada is the premier language for safety critical software Adas safety features are critical to making Ada such a high-productivity language in all domains Amendments to Ada should not open any new safety holes Amendments should provide even more safety, more opportunities for catching mistakes at compile-time. Safety Certified

Disclaimer! Not all of these proposals are going to make it into 200Y Users need to get involved to set priorities, help refine proposals –Please participate actively today and in Thursday workshop ISO WG9/ARG will be publicizing efforts more during the coming year –Starting with this conference! Big issues: –Who are the real/important users and what do they need/want? –How can we keep complexity of understanding and implementation manageable? –Upward Compatibility? Upward Consistency? What is obscure?

Possible Safety Amendments Pragma to prevent unintentional overriding or non-overriding of primitive operations –Catch spelling errors, parameter profile mismatches, maintenance confusion (ARG Approved) Standardized Assert Pragma –plus other Pre_Assert/Post_Assert/Invariant Pragmas associated with Subprogs, Pkgs, or Types (work item) Pragma/Attributes for specifying physical units associated with particular subtypes –Catch unit inconsistencies in complex computations Configuration Pragma to require initialization of local variables on all paths prior to a use –Match requirements of Java Virtual Machine byte- code verifier; catch a common cause of errors

Why use Pragmas for Safety checks? Pragmas are a natural way to add safety checks The only effect of an additional safety check is to reject an otherwise legal program No effect on semantics of programs that survive the check Pragmas can be associated with: –A single declaration –A point in the execution sequence –A declarative region –A source file or an entire library (configuration pragma)

Dealing with Todays Reality Todays Reality: –The rise in importance of the Java Virtual machine and.Net common runtime –Increasingly complex APIs; API Wars –Component based systems –Multilingual Systems –Dynamically Bound Systems Cyclic Dependence between types is the norm in complex O-O systems Emergence of Notion of Interface that can have multiple implementations (CORBA, Java, C#, COM) Amendments to Ada may help address this reality

Enhancing Interoperability with Todays Reality Support Cyclic Dependence Between Types in Different Packages –Various alternatives considered –Current approach: type T is [tagged] separate in P; –Also related to anonymous access type proposal Support Notion of Interface as used in Java, CORBA, C#, etc. –Already supported by Ada->JVM compilers somehow E.g. Pragma Convention(Java_Interface, T); Plus some magic Compiler-provided bodies for primitives that call same-named op of encloser –Proposal for abstract interface types

Example based on type stub Proposal package Employees is type Employee is private; type Department is separate in Departments; procedure Assign_Employee(E : access Employee; D : access Department);... type Dept_Ptr is access all Department; function Current_Department(D : access constant Employee) return Dept_Ptr; end Employees; package Departments is type Department is private; type Employee is separate in Employees; procedure Choose_Manager(D : access Department; Manager : access Employee);... end Departments;

Proposed Abstract Interface Amendment Type NT is new T with Int1 and Int2 and record … end record; Int1 and Int2 are Interfaces –Declared as: Type Int1 is interface; –Similar to abstract tagged null record (no data) –All primitives must be abstract or null NT must provide primitives that match all primitives of Int1 and Int2 –In other words, NT implements Int1 and Int2. NT is implicitly convertible to Int1Class and Int2Class, and explicitly convertible back –and as part of dispatching, of course Membership test can be used to check before converting back (narrowing)

Example of Abstract Interface package Observers is -- Observer pattern type Observer is interface; type Observer_Ptr is access all ObserverClass; type Observed_Obj is tagged separate in Observed_Objects; procedure Notify(O : in out Observer; Obj : access Observed_ObjClass) is abstract; procedure Set_Next(O : in out Observer; Next : Observer_Ptr) is abstract; function Next(O : Observer) return Observer_Ptr is abstract; type Observer_List is private; procedure Add_Observer(List : in out Observer_List; O : Observer_Ptr); procedure Remove_Observer(List : in out Observer_List; O : Observer_Ptr); function First_Observer(List : in Observer_List) return Observer_Ptr;

Portability Enhancements Ada provides excellent support for building portable code Ada library still relatively slim; Amendments to define additional standard libraries could enhance portability Focus should particularly be on ensuring portability for server-side Ada, E. g.: –Files and Directories –Sockets –HTTP/CGI Servlet interfaces –Timezones –Environment variables –ODBC/JDBC equivalent Based on Posix or Win32, but simplified and made O/S independent

Enhancing Accessibility to Ada Address Ease of Transition to Ada No Mandate from Top anymore => –Ada must be able to infiltrate from bottom or side of organization –Need to look at increasingly popular paradigms and frameworks JVM, J2EE, EJB Microsoft COM and.Net XML/XSL ODBC/JDBC HTTP/Servlet UML-ish Modeling Increasingly Popular –Needs to be easy to go between UML and Ada Full integration of Object Oriented concepts

Possible Accessibility Amendments Cyclic dependence (type stub) amendment Multiple Interface concept Object.Operation(…) syntax for calling user- defined primitives; e.g.: Generalized use of anonymous access types Extensible Protected types package P is type T is tagged private; procedure Update( X : in out T; Y : Whatever); end P; A : P.T; … P.Update(A, What); => A.Update(What);

Object.Operation syntax (contd) More familiar to users of other object-oriented languages Reduces need for extensive use of use clause Allows for uniform reference to dispatching operations and class-wide operations, on ptrs or objects; e.g.: package Windows is type Root_Window is tagged private; procedure Notify_Observers(Win : Root_WindowClass); procedure Display(Win : Root_Window) is abstract;... end Windows; package Borders is type Bordered_Window is new Windows.Root_Window with private; procedure Display(Win : Bordered_Window) is abstract;... BW: access Bordered_WindowClass; BW.Display; BW.Notify_Observers; -- both of these work

Generalized use of Anonymous Access types Two kinds of generalization –Allow access parameters for access-to-constant and access-to- subprogram cases –Allow use of anonymous access types in components and stand- alone variables Should help reduce noise associated with unnecessary explicit conversions of access values Also allow optional specification of not null constraint on access subtypes, and anonymous access type specifications –E.g.: type String_Ref is access all String not null; –Improves safety, efficiency, and documentation by pushing check for null to caller or assigner rather than ultimate point of use.

SofCheck Software Analysis and erification Other Ada 200Y Amendments Under Consideration

Extensible Protected types This was considered during Ada 9X –Felt to be too risky given that both tagged types and protected types were new concepts Time may be right to integrate the two capabilities, e.g.: protected type Sem_With_Caution_Period is new Semaphore with function Is_In_Caution_Period return Boolean; procedure Release_With_Caution; private In_Caution_period : Boolean := False; end Sem_With_Caution_Period;

Generalize Formal Package Parameters Allow partial specification of actual parameters –Currently it is all or nothing –Important when there are two formal package parameters that need to be linked partially through their actual parameters Example generic with package I1 is new G1(<>); with package I2 is new G2( Element => I1.Element, others => <>); package New_Abstraction is...

Make Limited Types Less Limited Easier: Allow use of explicitly initialized limited objects, where initial value is an aggregate. –Aggregate is built in place (as it is now for controlled types) –Define new syntax to represent implement by default Use <> for this, corresponds to notion of unspecified –Still no copying allowed, and no assignment statements –Aggregates can be used as initial expression for declaration, as expression for initialized allocator, and as actual parameter value Harder: Allow functions to return limited objects –Return statement must return an aggregate or function call –Function call can be used where aggregate is proposed to be allowed above –Must give up on return-by-reference of Ada 95?

Other Possible Goodies... Pragma Pure_Function (from GNAT) Nonreserved Keywords (e.g. Interface) Controlling Read/Write of Tags Additional Standard Restrictions and a Standard Profile for Ravenscar private with A.B; -- A.B only visible in private part Downward closures -- local subprograms can be passed as parameters to global subprograms –Uses anonymous access-to-subprogram types for parameters. Task termination handlers –especially for termination due to unhandled exceptions

Which Way Do We Want to Go? Should learn from new languages and other programming paradigm developments –No good model for multiple inheritance during Ada 9x process, but now multiple interface inheritance has emerged as good compromise –UML establishing OO at design-time as well as at code time –Useful Concurrent and Distributed OO models beginning to emerge Should not ignore marketing and transition issues –E.g. Object.Operation(…) syntax might help preserve OO view Should keep our core values in mind –Safety, High Performance, Portability

What can we afford? From an implementation point of view –Minimize syntax changes Standardize packages, attributes, and pragmas –Keep semantics straightforward –Do trial implementations E.g. 127 lines to support Object.Op in GNAT for tagged types (according to Martin Carlisle) From a language complexity point of view –Try to enhance by simplifying –Remove unnecessary restrictions –Support natural extensions –Use paradigms familiar from and well tested in other languages

ARG is looking for well-formed proposals Packages worth standardizing –Two groups already working on this => join in Pragmas/Attributes worth standardizing –Identify existing compiler-specific features that should be more portable Elimination of unnecessary restrictions, implementation dependencies, and inappropriate erroneous or bounded error situations, etc. Write to Participate in Thursday workshop. Speak up now!

Two Discussion Groups ALIOOOP Group –Ada Linguists Interested Only in OOP Type Stub Interfaces Object.Operation Anonymous Access Types; not null access types Limited Less Limited Relaxing Freezing in Generics Partially Parameterized Formal Packages Asserts/Pre/Post/Invariants IRONMASCC Task –I Really Only Need Mission And Safety Critical Computing Returning to our roots; MASC issues Ravenscar Profile and associated Restrictions and Policies Task Termination Handling Extensible Protected Types Future of Distribution Annex Other High Integ/Real-Time Asserts/Pre/Post/Invariants