Скачать презентацию Analysis of Safety-Critical Mission-Critical Systems Using ASIS Скачать презентацию Analysis of Safety-Critical Mission-Critical Systems Using ASIS

7e29df6538d2090d395598e09b625d3e.ppt

  • Количество слайдов: 49

Analysis of Safety-Critical & Mission-Critical Systems Using ASIS An Interface to the Ada 95 Analysis of Safety-Critical & Mission-Critical Systems Using ASIS An Interface to the Ada 95 Compilation Environment Mr. Currie Colket Chair, ACM/SIGAda/ASIS Working Group (ASISWG) Chair, ISO/IEC JTC 1/SC 22 WG 9 ASIS Rapporteur Group (ASISRG) Phone: (703) 883 -7381; Email: colket@mitre. org, colket@acm. org Dr. Bill Thomas Vice Chair, ASISWG for Publicity/Meetings Phone: (703) 883 -6159; Email: bthomas@mitre. org 4 May 1999 STC’ 99 Electronic Copy on ASIS Home Page => http: //www. acm. org/sigada/WG/asiswg

Overview An Interface to the Ada 95 Compilation Environment • Why Code Analysis for Overview An Interface to the Ada 95 Compilation Environment • Why Code Analysis for Safety/Mission-Critical Systems • What is ASIS? - Syntactic & Semantic Queries - Examples of Tools Built on ASIS • ASIS Architecture • Template for ASIS Analysis • Examples of Safety/Mission-Critical Analysis of Code • ASIS is now ISO Standard • Summary 4 May 1999 ASIS 2

Why Code Analysis for Mission-Critical Systems ity al u /Q rns y et nce Why Code Analysis for Mission-Critical Systems ity al u /Q rns y et nce f Sa Co e nc a m rns r rfo nce Pe Co g rin s e ne ern i ng onc E C • Safety and security verification • Quality assessment metrics • Test-case generation and coverage analysis • Coding style and standards compliance • Timing and sizing estimation • Dependency trees and impact analysis • Data flow analysis and usage metrics • Invocation (call) trees and cross-reference • Usage counts of language constructs • Code browsing and navigation • Documentation generation • Reverse engineering and re-engineering • Language translation and code restructuring Addressing these concerns results in higher quality systems 4 May 1999 ASIS 3

Why Code Analysis for Safety-Critical Systems • International Generic Safety Application Standard: [IEC-61508] (Part Why Code Analysis for Safety-Critical Systems • International Generic Safety Application Standard: [IEC-61508] (Part 3 concerns software) • Sector specific guidance and standards: • Airborne civil avionics [DO-178 B] Four Approaches required • Nuclear power plants [IEC 880] by standards to support the • Medical Systems [IEC 601 -4] verification of software: • Pharmaceutical [GAMP] • Traceability • National/regional guidance and standards • Reviews • UK Defence [DS 00 -55] • Analysis • European rail [EN 50128] • Testing • European security [ITSEC] • US Nuclear [NRC] • UK Automotive [MISRA] • US medical [FDA] • US Space [NASA] • Guidance for the use of the Ada Programming Language in High Integrity Systems [Draft ISO/IEC TR 15942] 4 May 1999 ASIS 4

Analysis for Verification of Software Analysis methods, required in different combinations by various standards: Analysis for Verification of Software Analysis methods, required in different combinations by various standards: • • • 4 May 1999 Control Flow Data Flow Information Flow Formal Code Verification Range Checking Symbolic Execution Stack Usage Timing Analysis Other Memory Usage Object Code Analysis ASIS directly supports these analysis methods ASIS can indirectly support some of remaining analysis methods ASIS 5

What is ASIS? Ada Environment Ada Source Code Compile Link ASIS Interface proprietary interface What is ASIS? Ada Environment Ada Source Code Compile Link ASIS Interface proprietary interface standard interface A P P L I C A T I O N S Y S T E M CASE Tool or Application 4 May 1999 Provides Syntactic and Semantic Information from Ada Environment using a standard interface ASIS 6

Syntactic Information Ada syntax is summarized in Ada 95 RM, Annex P as variant Syntactic Information Ada syntax is summarized in Ada 95 RM, Annex P as variant of Backus-Naur Form For example: object_declaration : : == defining_identifier_list : [aliased] [constant] subtype_indication [: = expression]; |. . . For the Ada object declaration => Syntactic Element Tree Representation => A B List of Identifiers A, B: Latitude : = 0. 0; Object : Object Declaration Latitude Subtype Indication : = 0. 0 Initial Expression ASIS can extract desired syntactic information for every syntactic category Of the 367 ASIS Queries, most support syntactic tree analysis 4 May 1999 ASIS 7

Semantic Information Ada semantics are provided via mechanisms such as Corresponding_: Full Type Declaration Semantic Information Ada semantics are provided via mechanisms such as Corresponding_: Full Type Declaration Type Definition Real Type Definition Floating Point Definition Digits Corresponding_Type_Declaration, Corresponding_Name_Definition, Corresponding_Called_Function, Corresponding_Called_Entity, Corresponding_Type, Corresponding_Body, Corresponding_Entry, etc. 8 Latitude Defining Identifier Range Static Expression Corresponding_Expression_Type Real Range Specification -90. 0 Corresponding_ Name_Declaration Object +90. 0 Static Simple Expressions Object Declaration Corresponding_Name_Declaration A : = A + B; A B List of Identifiers 4 May 1999 : Latitude Subtype Indication 0. 0 : = Initial Expression These mechanisms allow ASIS to traverse the syntactic tree like Hypertext allows one to traverse a document ASIS 8

Operations on Elements Element. A common abstraction used by ASIS to denote the syntax Operations on Elements Element. A common abstraction used by ASIS to denote the syntax components (both explicit and implicit) of ASIS compilation units. ASIS Element Queries Enclosing Element Enclosing Compilation Unit Related Elements Element Text Span Text Image Kind Component Elements 4 May 1999 ASIS 9

Examples of Tools Built on ASIS Ada Environment ASIS Interface Tools portable to Ada Examples of Tools Built on ASIS Ada Environment ASIS Interface Tools portable to Ada environments supporting ASIS Interface 4 May 1999 Code Restructuring Tools Code Browsing and Navigation Tools Coding Style and Standards Compliance Tools Cross Reference Tools Data Flow Analysis Tools Dependency Tree Analysis Tools Design Tools Document Generation Tools Invocation (Call) Tree Analysis Tools Language-sensitive Editing and Prettyprinting Tools Language Translation Tools Quality Assessment Tools Reverse Engineering Tools Re-Engineering Tools Safety & Security Compliance Tools Static Correctness Verifiers Tasking Analysis Tools Test-case Generation & Coverage Analysis Tools Usage, Quality, & Complexity Metrics Tools ASIS 10

ASIS Lets Client Tools ASIS Lets Client Tools "Snap On" to Compilation Systems etc. Client Tools ASIS Client Tools Implementation. Tools ASIS Client Layer Implementation Layer ASIS Implementation Layer Lockheed-Martin Tools ASIS Boeing, MITRE Tools Implementation Layer ASIS Magnavox, MARK V Tools Implementation Layer ASIS Little Tree, Sof. Tools Implementation Tools ASIS CCI Gmb. H, Sema Group Layer Implementation Layer ASIS Implementation Layer Aonix Ada Environment DDC-I Ada Environment GNAT Ada Environment Rational Ada Environment 4 May 1999 etc. Ada Program Library Ada Environment ASIS 11

ASIS Usage Compiler Implementers: Ada 95 ACT Aonix Ada 95 Concurrent DDC-I Ada 95 ASIS Usage Compiler Implementers: Ada 95 ACT Aonix Ada 95 Concurrent DDC-I Ada 95 Green Hills Intermetrics OC Systems Rational Ada 95 (very soon) Tool Vendors: Aonix CCI Gmb. H DRC GRC Little Tree Consulting Mark V Ada 95 ORA Corp Rational Simulog Sof. Tools Ada 95 Swiss Federal Ada 95 Institute of Tech End Users: Air Force Boeing FAA IBM Lockheed-Martin Logicon Loral Magnavox MITRE Navy Sema Group Unisys WPL Labs + HRG * Usage not known, but voted approval for ASIS CD Final on ISO/IEC JTC 1/SC 22 Ballot 4 May 1999 Countries: Australia Belgium * Canada China Czech Republic * Denmark Egypt * Finland * France Germany Ireland * Japan Netherlands * Norway * Russian Federation Sweden Switzerland Ukraine * United Kingdom United States. ASIS 12

ASIS Abstractions - Package ASIS Ada Semantic Interface Specification (ASIS) Package Asis provides: Common ASIS Abstractions - Package ASIS Ada Semantic Interface Specification (ASIS) Package Asis provides: Common types: ASIS_Integer, ASIS_Natural, ASIS_Positive, List_Index, Context, Element_List, Element Subtypes, Element Kinds (collection of enumeration types), Compilation_Units, Compilation_Unit_List, Unit Kinds (collection of enumeration types), Traverse_Control, and Program_Text (subtype of Wide_String) Queries via 20 visible child packages Ada Exceptions for errors with Status & Diagnostic information Asis and child packages encapsulate vendor dependencies 4 May 1999 Designed to be portable for all implementations ASIS 13

ASIS Context can be all compilation units in the active partition, a subset, or ASIS Context can be all compilation units in the active partition, a subset, or any set to which analysis is desired 4 May 1999 ASIS 14

ASIS Package Architecture Tool or Application using ASIS Ada_Environments Compilation_Units Containers Times Relations Elements ASIS Package Architecture Tool or Application using ASIS Ada_Environments Compilation_Units Containers Times Relations Elements Iterator Implementation Permissions Text Data_Decomposition (optional) Statements Clauses Declarations Expressions Portable_Transfer Portable_Constrained_Subtype Definitions Portable_Unconstrained_Record_Type Portable_Array_Type_1 Exceptions Errors Portable_Array_Type_2 4 May 1999 Portable_Array_Type_3 Ids ASIS 15

ASIS Abstractions - Ada_Environments Ada Semantic Interface Specification (ASIS) ASIS. Ada_Environments Associate Dissociate ASIS ASIS Abstractions - Ada_Environments Ada Semantic Interface Specification (ASIS) ASIS. Ada_Environments Associate Dissociate ASIS Context identifies an Ada Environment as defined by ISO/IEC 8652: 1995 [Ada 95] which allows implementations to define methods to enter Compilation Units into the environment Has_Associations Environment Model: Open Close Associates name and parameters Open, Query, and Close Provides analysis free of vendor details and assumptions Is_Equal Exists Is_Open Name Default_Name Parameters Default_Parameter Is_Identical 4 May 1999 . . . ASIS 16

ASIS Abstractions - Compilation Units Ada Semantic Interface Specification (ASIS) ASIS. Compilation_Units Unit_Kind Unit_Origin ASIS Abstractions - Compilation Units Ada Semantic Interface Specification (ASIS) ASIS. Compilation_Units Unit_Kind Unit_Origin Corresponding_Body Corresponding_Children Is_Equal Attribute_Values Has_Attribute Exists Can_Be_Main_Program Subunits “Times” 4 May 1999 “Relations”. . . Provides external “Black Box” view Attributes: Date compiled, Text File, Compilation Options, Optimizations, Can Be a Main Program Relationships: Ancestors, Descendants, Supporters, Dependents, Family, Needed_Units Compilation Unit Model Fetch by name Query of attributes & relationships Gateway to internal view using Elements ASIS 17

ASIS Abstractions - Elements Ada Semantic Interface Specification (ASIS). . . Asis. Elements. . ASIS Abstractions - Elements Ada Semantic Interface Specification (ASIS). . . Asis. Elements. . . Asis. Clauses. . . Asis. Declarations. . . Asis. Definitions. . . Asis. Expressions. . . Asis. Statements. . . Asis. Exceptions. . . Asis. Iterator. . Provides internal “White Box” view Logical handle to Ada elements: Declarations, Statements, Expressions, Type Definitions, With Clauses. . . Element Model Element kinds Syntactical queries to classify and decompose syntactic elements Semantic queries Elements know their enclosing Compilation Unit & Context Element. A common abstraction used by ASIS to denote the syntax components 4 May 1999 ASIS 18 (both explicit and implicit) of ASIS compilation units.

ASIS Abstractions - Implementation Ada Semantic Interface Specification (ASIS) ASIS. Implementation Initialize Using ASIS: ASIS Abstractions - Implementation Ada Semantic Interface Specification (ASIS) ASIS. Implementation Initialize Using ASIS: Asis. Implementation. Initialize; -- To setup environment. . . -- Determine ASIS implementation permissions Finalize Is_Initialized Is_Finalized Status Set_Status Diagnosis “Permissions”. . . 4 May 1999 P : = Asis. Implementation. Permissions. Is_Line_Number_Supported; . . . Asis. Ada_Environments. Associate (. . . ); -- To name Ada context Asis. Ada_Environments. Open (. . . ); -- To gain (library) access. . . -- Use various ASIS interfaces. . . Asis. Ada_Environments. Close (. . . ); -- To close (library) access Asis. Ada_Environments. Disassociate (. . . ); -- To release context Asis. Implementation. Finalize; -- To release all resources ASIS 19

Analysis Characteristics of Mission-Critical Systems Typical Analysis Characteristics: – – – Large-Scale Software Systems Analysis Characteristics of Mission-Critical Systems Typical Analysis Characteristics: – – – Large-Scale Software Systems Analyses performed throughout the product lifecycle Often unique, application or domain analyses Inconsistent/Incomplete Documentation Wide variety of compilation platforms Development and analysis platforms often are different We cannot depend on commercial products to support these requirements We need the ability to develop, enhance and maintain custom software analysis applications ASIS provides strong support for the development of such new analyses 4 May 1999 ASIS 20

Sample Asis-based Application for Code Analysis Examples of Code Analysis: 1. Identification of Declarations Sample Asis-based Application for Code Analysis Examples of Code Analysis: 1. Identification of Declarations for Information Flow Analysis 2. Call Tree for Control Flow Analysis 3. Restrictions Checker for Formal Code Verification - Reports the violation and the line number of violation But first an application template for ASIS-based Analysis - Useful for most ASIS-based Analysis - Examines all compilation units in an Ada Environment 4 May 1999 ASIS 21

ASIS Application Template (1 of 5) with Asis; Asis. Implementation; Asis. Ada_Environments; Asis. Compilation_Units; ASIS Application Template (1 of 5) with Asis; Asis. Implementation; Asis. Ada_Environments; Asis. Compilation_Units; -- other ASIS packages, as required with Check_Compilation_Unit; procedure My_Application is My_Context : Asis. Context; begin Asis. Implementation. Initialize; Asis. Ada_Environments. Associate (My_Context, ""); Asis. Ada_Environments. Open (My_Context); << ASIS Application Processing >> Asis. Ada_Environments. Close (My_Context); Asis. Ada_Environments. Dissociate (My_Context); Asis. Implementation. Finalize; end My_Application; 4 May 1999 ASIS 22

ASIS Application Template (2 of 5) << ASIS Application Processing >> declare Unit_List : ASIS Application Template (2 of 5) << ASIS Application Processing >> declare Unit_List : constant Asis. Compilation_Unit_List : = Asis. Compilation_Units (My_Context); begin for I in Unit_List'Range loop case Asis. Compilation_Units. Unit_Origin (Unit_List (I)) is when Asis. An_Application_Unit => Check_Compilation_Unit. Perform_ASIS_Analysis (Unit_List (I)); when others => null; end case; end loop; end; 4 May 1999 ASIS 23

ASIS Application Template (3 of 5) Package Check_Compilation_Unit with Asis; package Check_Compilation_Unit is procedure ASIS Application Template (3 of 5) Package Check_Compilation_Unit with Asis; package Check_Compilation_Unit is procedure Perform_ASIS_Analysis (CU : in Asis. Compilation_Unit); end Check_Compilation_Unit; 4 May 1999 ASIS 24

ASIS Application Template (4 of 5) Package Body with Asis; with Asis. Elements; with ASIS Application Template (4 of 5) Package Body with Asis; with Asis. Elements; with Asis. Iterator; with with Ada. Wide_Text_Io; use Ada. Wide_Text_Io; package body Check_Compilation_Unit is procedure Process_Element (An_Element : in Asis. Element; Control : in out Asis. Traverse_Control; Dummy : in out boolean); See Next Page procedure No_Op (An_Element : in Asis. Element; Control : in out Asis. Traverse_Control; Dummy : in out boolean); Body of No_Op is null procedure Analyze_Unit is new Asis. Iterator. Traverse_Element (boolean, Process_Element, No_Op); Procedure Perform_ASIS_Analysis (CU : Asis. Compilation_Unit) is Control : Asis. Traverse_Control : = Asis. Continue; Dummy : boolean; begin Put_Line ("Processing Unit: " & Asis. Unit_Kinds’Wide_Image (Asis. Compilation_Units. Unit_Kind(CU)) & ": " & (Asis. Compilation_Units. Unit_Full_Name(CU))); Analyze_Unit (Asis. Elements. Unit_Declaration (CU), Control, Dummy); New_Line; end Perform_ASIS_Analysis; end 1999 4 May Check_Compilation_Unit; ASIS 25

ASIS Application Template (5 of 5) Process_Element procedure Process_Element (An_Element : in Asis. Element; ASIS Application Template (5 of 5) Process_Element procedure Process_Element (An_Element : in Asis. Element; Control : in out Asis. Traverse_Control; Dummy : in out boolean) is begin -- Perform_Information_Flow_Analysis_ Identify_Declarations (An_Element); -- Example 1. . . -- Perform Control_Flow_Analysis_ Generate_Call_Tree (An_Element); -- Example 2. . . -- Perform Formal_Code_Verification_Restrictions_Checks_ Check_Library_Level_Task(An_Element); -- Example 3. . . -- Perform Metrics Analysis. . . end Process_Element; 4 May 1999 Note: this approach is valuable if a report is to be produced for each analysis. In the simple example provided, the printed output would be interleaved. ASIS 26

Example 1 : Identify Declarations for Information Flow Analysis - 1 procedure Identify_Declarations (An_Element Example 1 : Identify Declarations for Information Flow Analysis - 1 procedure Identify_Declarations (An_Element : in Asis. Element) is package Kind_Io is new Ada. Wide_Text_Io. Enumeration_Io (Asis. Declaration_Kinds); Decl_Kind : Asis. Declaration_Kinds : = Asis. Elements. Declaration_Kind (An_Element); begin case Decl_Kind is when Asis. Not_A_Declaration => null; when others => declare For => package Asis_Test is type T is ( A, B, C); S : integer : = T'BASE'SIZE ; end Asis_Test ; Name_List : Asis. Defining_Name_List : = Asis. Declarations. Names (An_Element); begin for I in Name_List'Range loop Put (Asis. Declarations. Defining_Name_Image (Name_List (I))); Put (" (is kind) "); Kind_Io. Put (Decl_Kind); New_Line; Result => end loop; Processing Unit: Asis_Test end; end case; end Identify_Declarations; 4 May 1999 Asis_Test (is kind) A_PACKAGE_DECLARATION T (is kind) AN_ORDINARY_TYPE_DECLARATION A (is kind) AN_ENUMERATION_LITERAL_SPECIFICATION B (is kind) AN_ENUMERATION_LITERAL_SPECIFICATION C (is kind) AN_ENUMERATION_LITERAL_SPECIFICATION S (is kind) A_VARIABLE_DECLARATION ASIS 27

Other Analysis Alternatives Decl_Kind from example is of type Declaration_Kinds defined in Subclause 3. Other Analysis Alternatives Decl_Kind from example is of type Declaration_Kinds defined in Subclause 3. 9. 4 Queries on Declaration_Kinds are found in Asis. Declarations (Clause 15) General Element processing queries in Asis. Elements (Clause 13) Similar syntactic processing can be performed on other Element Kinds defined in 3. 9: Declaration_Kinds Asis. Declarations (Clause 15) Clause_Kinds Defining_Name_Kinds Asis. Clauses (Clause 19) Asis. Declarations (Clause 15) Element Kinds Asis. Elements (Clause 13) Definition_Kinds Statement_Kinds Asis. Definitions (Clause 16) Asis. Statements (Clause 18) Expression_Kinds Asis. Expressions (Clause 17) 4 May 1999 ASIS 28

Example 1 : Identify Declarations for Information Flow Analysis - 2 Notes for extending Example 1 : Identify Declarations for Information Flow Analysis - 2 Notes for extending capability for analysis of when objects are read and set: 1. ASIS has capability to hyperlink to original declaration (unwinding through renamings through a number of different packages may be required) My_Object_Declaration : = Asis. Expressions. Corresponding_Name_Declaration (My_Object)); 2. ASIS has capability to compare elements to see if they are identical Asis. Elements. Is_Identical (My_Object_Declaration, Variable_Declaration(I)) 3. ASIS has capability for unique, persistent ids, valid until active partition is recompiled (Useful for sharing information between tools) Unique_Persistent_ID : = Asis. Ids. Create_Id (An_Element); 4. ASIS can easily obtain line numbers or textual span of elements Line_Number : = Asis. Text. First_Line_Number (My_Object); Span : = Asis. Text. Span (My_Object_Declaration); For example, span of Decl_Kind’s Object Declaration is logically: Decl_Kind : Asis. Declaration_Kinds : = Asis. Elements. Declaration_Kind (An_Element); 4 May 1999 ASIS 29

Example 2 : Generate_Call_Tree for Control Flow Analysis - 1 procedure Generate_Call_Tree (An_Element : Example 2 : Generate_Call_Tree for Control Flow Analysis - 1 procedure Generate_Call_Tree (An_Element : in Asis. Element) is Callee : Asis. Declaration; begin case Asis. Element_Kind (An_Element) is when Asis. An_Expression => case Asis. Elements. Expression_Kind (An_Element) is when Asis. A_Function_Call => Callee : = Asis. Expressions. Corresponding_Called_Function (An_Element); if not Asis. Elements. Is_Nil (Callee) then Output_Call (An_Element, Callee); -- See Next page end if; when others => null; end case; when Asis. A_Statement => case Asis. Elements. Statement_Kind (An_Element) is when Asis. A_Procedure_Call_Statement | Asis. An_Entry_Call_Statement => Callee : = Asis. Statements. Corresponding_Called_Entity (An_Element); if not Asis. Elements. Is_Nil (Callee) then Output_Call (An_Element, Callee); -- See Next page end if; when others => null; end case; end Generate_Call_Tree; 4 May 1999 ASIS 30

Example 2 : Generate_Call_Tree for Control Flow Analysis - 2 procedure Output_Call (Caller : Example 2 : Generate_Call_Tree for Control Flow Analysis - 2 procedure Output_Call (Caller : Asis. Element; Callee : Asis. Declaration) is Calling_Compilation_Unit : Asis. Compilation_Unit; begin -- Output_Calling_Compilation_Unit : = Asis. Elements. Enclosing_Compilation_Unit (Caller); if Asis. Compilation_Units. Is_Nil (Calling_Compilation_Unit) then Put ("An_Unknown_Unit"); else Put (Asis. Compilation_Units. Unit_Full_Name (Calling_Compilation_Unit)); end if; Put (" (calls) "); Put (Asis. Declarations. Defining_Name_Image(Asis. Declarations. Names(Callee) (1))); Put (" at line "); Put (Asis. Text. Line_Number'Wide_Image (Asis. Text. First_Line_Number (Caller))); New_Line; end Output_Call; P (calls) P 1 at line 7 4 May 1999 ASIS 31

Example 2 : Generate_Call_Tree for Control Flow Analysis - 3 For => 1 2 Example 2 : Generate_Call_Tree for Control Flow Analysis - 3 For => 1 2 3 package P is procedure P 1; procedure P 2; procedure P 3(X : integer); function F 1 return integer; end; 5 package body P is procedure P 1 is separate; procedure P 2 is separate; procedure P 3(X : integer) is separate; function F 1 return integer is separate; begin P 1; end; separate (P) function F 1 return integer is begin return 0; end; 4 4 May 1999 separate (P) procedure P 1 is x : integer : = F 1; begin P 2; P 3(x); end; 6 separate (P) procedure P 2 is begin P 3(F 1); end; Result => 1 Processing Unit: P 2 Processing Unit: P P (calls) P 1 at line 7 3 Processing Unit: P. F 1 4 Processing Unit: P. P 1 separate (P) procedure P 3(X : integer) is begin null; end; P. P 1 (calls) F 1 at line 3 P. P 1 (calls) P 2 at line 5 P. P 1 (calls) P 3 at line 6 5 Processing Unit: P. P 2 (calls) P 3 at line 4 P. P 2 (calls) F 1 at line 4 6 Processing Unit: P. P 3 ASIS 32

Example 3: Check_Library_Level_Task for Formal Code Verification Restrictions Checking procedure Check_Library_Level_Task (An_Element : Asis. Example 3: Check_Library_Level_Task for Formal Code Verification Restrictions Checking procedure Check_Library_Level_Task (An_Element : Asis. Element) is begin case Asis. Elements. Declaration_Kind (An_Element) is when Asis. A_Task_Type_Declaration | Asis. A_Protected_Type_Declaration | Asis. A_Single_Task_Declaration | Asis. A_Single_Protected_Declaration => If not Asis. Elements. Is_Equal (Asis. Elements. Enclosing_Element(An_Element), Asis. Elements. Unit_Declaration( Asis. Elements. Enclosing_Compilation_Unit(An_Element))) then Put_Line("Violation of Tasking Guideline: "); Put("-- Non-Library Level Task at Line: "); Put ( Asis. Text. Line_Number’Wide_Image (Asis. Text. First_Line_Number (An_Element))); New_Line; end if; Processing Unit: Tasking_Violation_Example when others => Violation of Tasking Guideline: null; -- Non-Library Level Task at Line: 47 end case; 4 May 1999 end Check_Library_Level_Task; ASIS 33

ASIS Secondary Layers CASE Tool or Application Secondary Layers ASIS Interface Ada Environment • ASIS Secondary Layers CASE Tool or Application Secondary Layers ASIS Interface Ada Environment • Widget -like layer of abstractions that model commonly used views of Ada program structure • Each view provided in set of packages with operations for constructing and querying views • Offer CASE tool builders same kind of benefits enjoyed by X-users: Productivity Consistent results Reliability Portability • ASIS 83 Secondary layers available: Scanners Namespace View Reference View Region View Control Flow View 4 May 1999 • Work is in progress for ASIS 95 ASIS 34

How to Get ASIS Artifacts ASIS tutorials, papers, examples, bibliography: ASIS Home Page => How to Get ASIS Artifacts ASIS tutorials, papers, examples, bibliography: ASIS Home Page => http: //www. acm. org/sigada/wg/asiswg The ASIS Specification: ISO/IEC 15291: 1999 Information technology -- Programming languages -Ada Semantic Interface Specification (ASIS) Via the ISO Catalogue => http: //www. iso. ch/infoe/catinfo. html 4 May 1999 ASIS 35

ASIS Schedule Dec 93 Mar 94 Jun 94 Nov 94 Mar 95 28 Apr ASIS Schedule Dec 93 Mar 94 Jun 94 Nov 94 Mar 95 28 Apr 95 Jun 95 Nov 95 2 Feb 96 Mar 96 Jun 96 Dec 96 1 Mar 97 1 May 97 2 Jun 97 Aug 97 9 Mar 98 31 Jul 98 8 Dec 98 4 May 1999 AJPO recommends ASIS V 1. 1. 0 (ASIS 83) be used as interface to Ada 83 Program Library Design Goals for ASIS 95 identified ASISWG finalizes ASIS 83 as V 1. 1. 1 with test suite Evaluate design approaches for ASIS 95 Finalize approach for ASIS 95 Skeleton ASIS 95 ASISRG created unanimously by ISO/IEC JTC 1/SC 22 WG 9 Skeleton ASIS 95; new library/environment model Public Review of ASIS 95 initiated (Version 2. 0. E) ISO/IEC JTC 1/SC 22 approved NWI ASIS available for GNAT Ada 95 Compiler ASISRG vote to submit ASIS 95 as ISO Working Draft ISO/IEC JTC 1 approval of NWI - ASIS assigned ISO number 15291 WG 9 ballot on ASIS 95 Working Draft commenced WG 9 ballot on ASIS completed (6 Affirmatives; 1 Abstain; 0 Negatives) Disposition of Comments delivered to WG 9 Disposition of Comments, ASIS to SC 22 for Balloting approved ASIS to SC 22 for Registration as ISO CD& CD Final Ballot ASIS approved by SC 22 for CD Registration & CD Final ASIS to SC 22 and in turn JTC 1 for FDIS Ballot ASIS approved by ISO as ISO Standard ASIS Available as ISO/IEC 15291: 1999 ASIS 36

Final Notes on ASIS - Interface for obtaining information from Ada environments • Provides Final Notes on ASIS - Interface for obtaining information from Ada environments • Provides both syntactic and semantic information • Supports building powerful and highly portable CASE tools • Supports many safety-critical & mission-critical requirements for code analysis • Used in approximately 10 countries • ASIS mature with 4 implementations today To get involved with ASISWG and/or ASISRG, send email to: sigada-asis-request@acm. org to join sigada-asis@acm. org sigada-asis-tech-request@acm. org to join sigada-asis-tech@acm. org or call Currie Colket @ +1 (703) 242 -4561 or Clyde Roby @ +1 (703) 845 -6666 4 May 1999 ASIS Home page => http: //www. acm. org/sigada/wg/asiswg ASIS 37

Restrictions Check Example: Short Circuit Operators procedure Check_Short_Circuit( An_Element : in Asis. Element) is Restrictions Check Example: Short Circuit Operators procedure Check_Short_Circuit( An_Element : in Asis. Element) is Op_Kind : Asis. Operator_Kinds : = Asis. Elements. Operator_Kind (An_Element); begin case Op_Kind is when Asis. An_And_Operator => Put_Line("Violation of Short Circuit Operator guideline: "); Put("-- Use of AND Operator at line "); Put ( Asis. Text. Line_Number’Wide_Image (Asis. Text. First_Line_Number (An_Element))); New_Line; when Asis. An_Or_Operator => Put_Line("Violation of Short Circuit Operator guideline: "); Put("-- Use of OR Operator at line "); Put ( Asis. Text. Line_Number’Wide_Image (Asis. Text. First_Line_Number (An_Element))); New_Line; when others => null; end case; end Check_Short_Circuit; 4 May 1999 ASIS 38

Ada Board Resolution About ASIS Motion at the Ada Board 10 -11 September 1992: Ada Board Resolution About ASIS Motion at the Ada Board 10 -11 September 1992: The Ada Board recognizes the potential benefits to the DOD Ada community of an ASIS standard and therefore it recommends that the AJPO director support by whatever means possible, the development of an ASIS standard and its submission to ISO/WG 9 for publication. Vote: Passed unanimously ACM ASIS Working Group established to develop ASIS for Ada 83 and Ada 95 with ISO WG 9 ASIS Rapporteur Group for standardization of ASIS for Ada 95 4 May 1999 ASIS 39

ACM’s SIGAda’s ASIS Working Group Charter The purpose of this working group is to ACM’s SIGAda’s ASIS Working Group Charter The purpose of this working group is to develop and participate in standardizing an implementation independent application programming interface to retrieve information from an Ada environment. The Ada Semantic Interface Specification (ASIS) is an interface between an Ada environment (as defined by ISO/IEC 8652: 1995) and any tool requiring information from it. An Ada environment includes valuable semantic and syntactic information. ASIS is an open and published callable interface which gives CASE tool and application developers access to this information. ASIS has been designed to be independent of underlying Ada environment implementations, thus supporting portability of software engineering tools while relieving tool developers from needing to understand the complexities of an Ada environment's proprietary internal representation. The working group is currently developing ASIS for Ada 95, and is working towards its adoption as an international standard. The working group successfully developed ASIS for Ada 83, which is now complete and in the public domain. Membership in the working group is open to any interested party. Members are responsible for their own expenses. Current members include representatives of Ada compiler implementors, CASE tool developers, application developers, and other interested users. Original February 8, 1993, Updated June 28, 1994, Updated November 7, 1995 4 May 1999 ASIS 40

ASISRG-1 ISO/IEC JTC 1/SC 22 WG 9 voted unanimously to create ASISRG on 28 ASISRG-1 ISO/IEC JTC 1/SC 22 WG 9 voted unanimously to create ASISRG on 28 April 1995 Scope Standardize the interface between an Ada 95 compilation environment and tools/applications requiring information from this environment. Purpose and Justification The Ada Semantic Interface Specification (ASIS) is an interface between an Ada environment as defined by ISO/IEC 8652 and any tool requiring information from this environment. An Ada environment includes valuable semantic and syntactic information. ASIS is an open and published callable interface which gives CASE tool and application developers access to this information. ASIS has been designed to be independent of underlying Ada environment implementations, thus supporting portability of software engineering tools while relieving tool developers from having to understand the complexities of an Ada environment’s proprietary internal representation. 4 May 1999 ASIS 41

ASISRG-2 Purpose and Justification (Continued) As an international standard, ASIS will benefit the Information ASISRG-2 Purpose and Justification (Continued) As an international standard, ASIS will benefit the Information Technology community by facilitating the development of powerful CASE tools portable amongst the various environments provided by Ada vendors. This portability can only be achieved through the standardization of ASIS at the international level. A standardized ASIS will promote the development of powerful tools for the software engineering environment by providing access to important semantic information otherwise available only through proprietary interfaces. Further, ASIS will benefit the Information Technology community as a valuable resource for application development (e. g. , decoupling system to system interfaces). The international standardization of ASIS will facilitate the use of this important capability in the development of system software applications. ISO/IEC JTC 1 assigned ASIS project number 15291 in May 1996 Successful Final Draft International Standard Ballot in Dec 1998 4 May 1999 ASIS 42

ASISWG/ASISRG Officers Chair ASISWG/ASISRG: Currie Colket (MITRE) Vice-chair ASISWG: Steve Blake (Aonix) Recorder ASISWG: ASISWG/ASISRG Officers Chair ASISWG/ASISRG: Currie Colket (MITRE) Vice-chair ASISWG: Steve Blake (Aonix) Recorder ASISWG: Clyde Roby (IDA) Vice-recorder ASISWG: Dan Cooper (Boeing) Publicity/Meetings ASISWG: Bill Thomas (MITRE) ASISRG Co-Project Editors: Steve Blake (Aonix) Clyde Roby (IDA) 4 May 1999 ASIS 43

ASIS Interface - Funding FY 88 & FY 89 Funding provided by STARS Later ASIS Interface - Funding FY 88 & FY 89 Funding provided by STARS Later in FY 89, STARS initiated a policy not to fund any standardization efforts and ASIS funding was halted along with all other standardization activities There has been no STARS, no AJPO, and no DOD funding for ASIS Standardization since FY 89 All post FY 89 ASIS standardization funding has resulted from industry investment - user community working closely with the compiler implementor community 4 May 1999 ASIS 44

Example of Application Built on ASIS-1 System 1 Byte stream of messages Problem How Example of Application Built on ASIS-1 System 1 Byte stream of messages Problem How do you delog data so an analyst can view data in a meaningful way? Log Messages Alternatives 1. Delog routine per message ID. Expensive, inflexible, must be constantly updated 2. Universal delogger, able to interpret any message ID. Effective, highly flexible, never needs updating 4 May 1999 Log Analysis Reports ASIS 45

Example of Application Built on ASIS-2 Before ASIS; delog routine per type System 1 Example of Application Built on ASIS-2 Before ASIS; delog routine per type System 1 Byte stream of messages Message Header identifies Ada Record Type Ada Program Library A S I S Log Messages Ada Record Type Analysis Program interpretation Log Analysis Reports With ASIS; universal delogger, able to interpret any type; Time reduced to build type dictionary from 704 hours to 2 hours 4 May 1999 ASIS 46

Example of Application Built on ASIS-3 System 1 Byte stream of messages Message Header Example of Application Built on ASIS-3 System 1 Byte stream of messages Message Header identifies Ada Record Type Header Byte_Stream (Array of Bytes) type message_1 is record field_1 : array_type; field_2 : record_type; field_3 : private_enumeration_type; end record; type message_2 (discrim_2: integer) is private; private subtype range_type is positive range 10. . 20; type varying_array_type is (integer range <> of float); type message_2 (discrim_2: integer); record field_1 : range_type; field_2 : varying_array_type (1. . discrim_2); end record; A S I S Log Messages Ada Record Type Analysis Program Log Analysis Reports interpretation ASIS provides ‘size, ‘position, ‘first_bit, ‘last_bit services Services index Byte_Stream to primitive types using Unchecked_Conversion Services return values for analysis as variant record discriminated by ASIS Type_Kind 4 May 1999 ASIS 47

ASIS Implementation Permissions Client Tool written in Ada 95 (Permission 3) Client Tool written ASIS Implementation Permissions Client Tool written in Ada 95 (Permission 3) Client Tool written in Java (Permission 2) Client Tool written in Smalltalk (Permission 2) Client Tool written in C++ (Permission 2) Client Tool written in Ada 95 (Permission 2) ASIS (this standard) Encapsulating ASIS Client as Java Source Code ASIS Client as Smalltalk Source Code ASIS Client as C++ Source Code ASIS Client as Ada 95 Source Code ASIS Client using IDL DII (Permission 4) Object Request Broker (ORB) Permissions: 1. Traditional approach 2. Client/Server approach 3. Distributed traditional approach 4. ASIS dynamic client approach ASIS Server as Ada 95 Specification Client Tool written in Ada 95 (Permission 1) Encapsulating 4 May 1999 ASIS (this standard) with body Provided by Implementor ASIS 48

Creating an ASIS IDL ASIS (this standard) Reengineer using automated tools ASIS in IDL Creating an ASIS IDL ASIS (this standard) Reengineer using automated tools ASIS in IDL Compile for Ada 95 as Server Compile for Ada 95 as Client Compile for Java as Client Compile for Smalltalk as Client Compile for C++ as Client ASIS CORBA Client as Ada 95 Specification ASIS CORBA Client as Java Specification ASIS CORBA Client as Smalltalk Specification ASIS CORBA Client as C++ Specification ASIS CORBA Server as Ada 95 Specification + + + Artifacts for Interface to ORB 4 May 1999 Registration of ASIS IDL as Server with ORB ASIS 49