Formal Behavior Verification Made for Engineers Brian R Larson - - PowerPoint PPT Presentation

formal behavior verification made for engineers
SMART_READER_LITE
LIVE PREVIEW

Formal Behavior Verification Made for Engineers Brian R Larson - - PowerPoint PPT Presentation

Formal Behavior Verification Made for Engineers Brian R Larson brl@multitude.net Multitude Corporation October 28, 2019 Brian R Larson BLESS Language and Tools October 28, 2019 1 / 24 Model-Based Engineering Challenges AADL superbly models


slide-1
SLIDE 1

Formal Behavior Verification Made for Engineers

Brian R Larson brl@multitude.net Multitude Corporation October 28, 2019

Brian R Larson BLESS Language and Tools October 28, 2019 1 / 24

slide-2
SLIDE 2

Model-Based Engineering Challenges

AADL superbly models embedded system structure, interfaces, and non-functional properties for analysis. Can we ensure deployed systems (software) conform to their models, and function correctly?

Brian R Larson BLESS Language and Tools October 28, 2019 2 / 24

slide-3
SLIDE 3

Formal Methods Have Disappointed

Difficult to use; require PhD-level skills; don’t scale; don’t assure correctness. Absence of buffer overflow and conformance to security policy may be worth the cost and effort to formally verify, but the don’t begin to show systems with software perform as intended.

Brian R Larson BLESS Language and Tools October 28, 2019 3 / 24

slide-4
SLIDE 4

BLESS is Different

Behavior Language for Embedded Systems with Software (BLESS), and its verification tool, was specifically designed to verify cyber-physical system behavior conforms to its specification, by practicing engineers.

Brian R Larson BLESS Language and Tools October 28, 2019 4 / 24

slide-5
SLIDE 5

Architecture

AADL for System Structure

AADL structure

Brian R Larson BLESS Language and Tools October 28, 2019 5 / 24

slide-6
SLIDE 6

‘Model’ Behavior

Add Behavior Annex

AADL structure BA behavior

Brian R Larson BLESS Language and Tools October 28, 2019 6 / 24

slide-7
SLIDE 7

‘Program’ Behavior

BLESS is Superset of BA

AADL structure BLESS behavior

Brian R Larson BLESS Language and Tools October 28, 2019 7 / 24

slide-8
SLIDE 8

Exact (Formal) Specification

BLESS Assertion adds Declarative Specification

AADL structure BLESS behavior Assertion specification

Brian R Larson BLESS Language and Tools October 28, 2019 8 / 24

slide-9
SLIDE 9

Verification Beyond Testing

Formal Verification by Proof

AADL structure BLESS behavior Assertion specification Proof

Brian R Larson BLESS Language and Tools October 28, 2019 9 / 24

slide-10
SLIDE 10

Proof

Not Theorem Proving!

Extra information non-executed is interspersed throughout programs to for a “proof outline". The BLESS Proof Assistant transforms programs having proof outlines (with human guidance) into deductive proofs: a sequence of theorems, each of which is given or an axiom, or derived from prior theorems by a sound inference rule. BLESS proofs are human readable, use the same language as BLESS programs, and trace back to source code.

Brian R Larson BLESS Language and Tools October 28, 2019 10 / 24

slide-11
SLIDE 11

BLESS is AADL Annex Sublanguages Assertion

Temporal Logic

BLESS uses first-order predicate calculus, extended by simple temporal operators to declaratively specify behavior. Such temporal logic formulas are called BLESS assertions. p@t ≡ evaluate predicate p at time t.

✞ ☎

<<VP: : --cause ventricular pace (n or p)@(now-lrl)

  • -last beat occurred LRL interval ago,

and --not since then not (exists t:time

  • -there is no time

in now-lrl,,now

  • -since then, ",," means open interval

that (n or p)@t) >>

  • -with a beat

✝ ✆

Quantification over time together with simple temporal operators makes BLESS assertions uniquely capable of expressing timing of embedded systems.

Brian R Larson BLESS Language and Tools October 28, 2019 11 / 24

slide-12
SLIDE 12

BLESS is AADL Annex Sublanguages Assertion

Behavior Specification

BLESS::Assertion properties specify what is guaranteed about events issued by out ports, what is assumed about events received by in ports, and what is always true.

✞ ☎

thread VVI features s: in event port; --signal from analog front-end p: out event port --pace ventricle {BLESS::Assertion => "<<VP()>>";}; n: out event port --natural contraction {BLESS::Assertion => "<<(now=0) or VS()>>";}; lrl: in data port ms;

  • -lower rate limit interval

vrp: in data port ms;

  • -ventricular refractory period

properties Dispatch_Protocol => Aperiodic; BLESS::Invariant => "<<LRL(now)>>"; end VVI;

✝ ✆

Brian R Larson BLESS Language and Tools October 28, 2019 12 / 24

slide-13
SLIDE 13

BLESS is AADL Annex Sublanguages State-Transition Machine

State-Transition Machine

BLESS began as BA, adding assertions to express what is true about the system when a machine is in a particular state. Actions performed during transitions can also be augmented with assertions. BLESS defines formal semantics for every construct, adding a type system to be a programming language.

Brian R Larson BLESS Language and Tools October 28, 2019 13 / 24

slide-14
SLIDE 14

BLESS is AADL Annex Sublanguages State-Transition Machine

✞ ☎

variables last_beat : time

  • -the last pace or non-refractory sense occurred at last_beat

<<LAST: :(n or p)@last_beat>>; states power_on : initial state

  • -powered-up,

<<now=0>>;

  • -start with "sense"

pace : complete state

  • -a ventricular pace has occurred in the
  • -previous LRL-interval milliseconds

<<PACE(now)>>; . . . check_pace_vrp : state

  • -execute state to check if s is in vrp after pace

<<s@now and PACE(now)>>; . . .

✝ ✆

Brian R Larson BLESS Language and Tools October 28, 2019 14 / 24

slide-15
SLIDE 15

BLESS is AADL Annex Sublanguages State-Transition Machine

✞ ☎

. . . T3_PACE_LRL_AFTER_VP: --pace when LRL times out pace -[on dispatch timeout (n or p) lrl ms]-> pace { <<VP()>> p! <<p@now>>

  • -cause pace when LRL times out

& last_beat:=now <<last_beat=now>>}; T4_VS_AFTER_VP: --sense after pace=>check if in VRP pace -[on dispatch s]-> check_pace_vrp{}; T5_VS_AFTER_VP_IN_VRP:

  • - s in VRP,

go back to "pace" state check_pace_vrp -[(now-last_beat)<vrp]-> pace{}; T6_VS_AFTER_VP_IS_NR: --s after VRP,

  • -go to "sense" state, send n!, reset timeouts

check_pace_vrp -[(now-last_beat)>=vrp]-> sense { <<VS()>> n! <<n@now>>

  • -send n! to reset timeouts

& last_beat:=now <<last_beat=now>>}; . . .

✝ ✆

Brian R Larson BLESS Language and Tools October 28, 2019 15 / 24

slide-16
SLIDE 16

BLESS is OSATE Plugin(s) Editor

Text Editor

The BLESS editor plugin to OSATE was created with Xtext to seamlessly add syntax coloring, grammar checking while typing, and error markers for BLESS annex subclauses, and Assertion annex libraries.

Brian R Larson BLESS Language and Tools October 28, 2019 16 / 24

slide-17
SLIDE 17

BLESS is OSATE Plugin(s) Proof Assistant

Proof Assistant

The BLESS proof assistant plugin to OSATE generates proofs1 that formally verifies that behavior implementations meet behavior specifications.

1with human guidance Brian R Larson BLESS Language and Tools October 28, 2019 17 / 24

slide-18
SLIDE 18

BLESS is a Formal Verification Method

Transform Proof Outlines to Deductive Proofs

BLESS assertions attached to states, and interspersed though actions performed when transitions occur form a proof outline. BLESS state machines are verified to uphold their specifications by transforming their proof outlines into deductive proofs.2 The last theorem in the proof says all verification conditions have been met.

2sequences of theorems, each of which is given or axiomatic, or derived from

prior theorems in the sequence by sound inference rules

Brian R Larson BLESS Language and Tools October 28, 2019 18 / 24

slide-19
SLIDE 19

BLESS is a Formal Verification Method

Composition Verification

BLESS allows composite components (having proved correct subcomponents) to be proved correct. Composition verification conditions:

  • ut port’s assertion implies connected in port’s assertion

(assume-guarantee) conjunction of subcomponents’ invariants implies containing component’s invariant

Brian R Larson BLESS Language and Tools October 28, 2019 19 / 24

slide-20
SLIDE 20

BLESS Generates Real Code for Real Embedded Systems Adventium Lab’s ISOSCELES

BLESS Generates C++

Kansas State University worked with Adventium Labs on Intrinsically-Secure, Open, and Safe Cyber-physically Enabled Life-critical Essential Services (ISOSCELES) for the Department of Homeland Security to develop a platform for secure medical devices. Proof-of-concept C++ code auto-generated from BLESS using AADL runtime services implemented for ISOSCELES.

Brian R Larson BLESS Language and Tools October 28, 2019 20 / 24

slide-21
SLIDE 21

BLESS Generates Real Code for Real Embedded Systems Kansas State University’s Slang

BLESS Generates Slang

Alternatively, proof-of-concept Slang3 can be generated from BLESS. This enables BLESS to take advantage of the Slang development and simulation environment and its translation backends.

3KSU-developed dialect of Scala Brian R Larson BLESS Language and Tools October 28, 2019 21 / 24

slide-22
SLIDE 22

Summary

AADL+BLESS unifies specification, programming, and verification with architecture (SSoT). BLESS treats programs, specifications, and executions as mathematical objects; deductive proofs argue that every execution conforms to specification. BLESS was created to be used by practicing engineers. BLESS correctness proofs can be read, understood, and checked. BLESS generates proof-of-concept executable code through two, different, compilation tool chains. Together with architecture-centric virtual integration, BLESS may reduce costs and duration of development as tests confirm correctness rather than finding errors.

Brian R Larson BLESS Language and Tools October 28, 2019 22 / 24

slide-23
SLIDE 23

Summary

Kansas State Videos featuring BLESS

GUMBO: https://drive.google.com/file/d/14Ar0xyBMxAP_ C6buGgdmyz0EPwOBNhnO/view BLESS State Visualizer: https://drive.google.com/file/d/ 1urXNPS3-jv-MAFexsFIRu0RgMQgqBUg2/view

Brian R Larson BLESS Language and Tools October 28, 2019 23 / 24

slide-24
SLIDE 24

Demonstration

Please stop by my table to see dozens of threads with BLESS behaviors and proofs, and try BLESS yourself. To try BLESS yourself, in OSATE, under the Help menu, select Add Additional Software; click the Add button; enter "https://www.multitude.net/update" (call it BLESS); select the BLESS plugins, install, restart. Alternatively, under the Help menu, select Install Additional OSATE Components; find Non SEI Components; check the box next to the praying hands for BLESS Annex Support; click the Finish button.

Brian R Larson BLESS Language and Tools October 28, 2019 24 / 24