140 likes | 287 Views
Lee McCluskey, room 2/07 Email lee@hud.ac.uk. Formal Aspects of Computer Science - Week11 Real Application of Logic. Formal Methods - an approach to reducing the instance of software bugs in complex systems.
E N D
Lee McCluskey, room 2/07 Email lee@hud.ac.uk Formal Aspects of Computer Science - Week11Real Application of Logic
Formal Methods - an approach to reducing the instance of software bugs in complex systems Encode system requirements in an application-oriented formal language - the encoding is called a “formal specification” Thoroughly validate the specification because bugs that remain in a requirements specification turn out to be the most costly Rigorously Transform the specification into software
Creating a Formal Specification of Software Requirements: A Real Life Case Study
FAROAS - A Case Study involving Aircraft Separation Criteria segment2 segment1 Shanwick Oceanic Area
The FAROAS Project contract research from NATS Ltd: encoded part of the requirements of a system that is to maintain separation between aircraft over the Atlantic Ocean in an expressive, structured logic The kernel of this specification was written in about 500 logic axioms and is called the CPS A validation environment was built around the CPS and helped “debug” it
Knowledge Sources Training Manuals Operational Manuals Existing software tools Existing Software Documentation ATC personnel
Example of Separation Requirement Paragraph 3.6.4.1 of the Manual of Air Traffic Services, Part 2, Section 3 - separation standards states: “For subsonic aircraft, the minimum longitudinal separation between turbojet aircraft, meeting the MNPS, and operating wholly or partly in MNPS airspace, shall 10 minutes, provided that …….ETC”
Requirements / Benefits Creating a Formal Specification of ATC conceptualisation => Precise, Unambiguous representation of Safety Related concepts Strong basis for future software contracts Strong basis for prototype software tools
Specification vs Program Code [(one_or_both_of Segment1 and Segment2 are_flown_at_subsonic_speed) & ( the_Aircraft_on(Segment1) and the_Aircraft_on(Segment2) meet_mnps) & ( the_Aircraft_on(Segment1) and the_Aircraft_on(Segment2) are_jets & (the_Profile_containing(Segment1) & the_Profile_containing(Segment2) are_wholly_or_partly_in_the_ mnps_airspace) ] => [(the_basic_min_longitudinal_sep _Val_in_mins_required_for Segment1 and Segment2) = 10 <=> …. ETC while (res != EOF) { res = fscanf(mfd, "%s %s %c %s\n", temp->part_no, temp->drawing_no, &temp->loc_code, temp->revision); if (res != EOF) { temp->left = NULL; temp->right = NULL; root = insert(temp,root); } }
CPS Auto-generated CPSlp [(one_or_both_of Segment1 and Segment2 are_flown_at_subsonic_speed) & ( the_Aircraft_on(Segment1) and the_Aircraft_on(Segment2) meet_mnps) & ( the_Aircraft_on(Segment1) and the_Aircraft_on(Segment2) are_jets & (the_Profile_containing(Segment1) & the_Profile_containing(Segment2) are_wholly_or_partly_in_the_ mnps_airspace) ] => [(the_basic_min_longitudinal_sep _Val_in_mins_required_for Segment1 and Segment2) = 10 <=> …. ETC the_basic_min_longitudinal_sep_Val_in_mins_required_for(Segment1,Segment2,10):- are_subject_to_oceanic_cpr(Segment1,Segment2), both_are_flown_at_supersonic_speed(Segment1,Segment2), (both_are_flown_at_the_same_mach_number_in_level_flight(Segment1,Segment2) ; the_Aircraft_on_segment(Segment1,Aircraft1), the_Type_of(Aircraft1,Type1), the_Aircraft_on_segment(Segment2,Aircraft2), the_Type_of(Aircraft2,Type2), Type1=Type2, are_cruise_climbed(Segment1,Segment2) ), .. ETC
Goal: Improve Software Quality FAROAS Improve Accuracy and Completeness of Statement of Requirements Improve Software Development Process Rigorously Transform Requirements into Software Build an Effective Requirements Validation Tools Environment Produce Formal Statement of Requirements Goal-Oriented Quality Tree
Opportunities for bug detection in a Formal Model Expert Visual Inspection Automated Syntax Checking CPS -an ATC requirements statement DETECT BUGS Automated Reasoning Automated Translation to Executable Software Batch Testing Simulation
CPS: Many-Sorted Logic Specification + tests html THE STUDENT CPS CPS Grammar PARSER + TRANSLATORS Envelope Tests in Prolog CPS -structured English CPS -logic program Enveloped Logic Program and Tests Theory Revision Test Harness Oracle TEST RESULTS CPS Refinements
Major Outcome of FAROAS Validation and Maintenance of Complex Models (Ontologies? Domain theories? Formal Specifications? KBs?) require automated tool support to identify bugs and help remove them. Such “models” are not written like programs to allow systematic testing but are designed to decrease the semantic gap between model and what is modelled. See http://scom.hud.ac.uk/scomtlm/faroas.html