feat(formal): add types for aircraft and checklist

This commit is contained in:
Anthony 2024-02-27 12:41:04 +00:00
parent ad0c70db56
commit bc70a4c7a5

View File

@ -5,6 +5,8 @@ definitions
values values
types types
String = seq of char;
-- Aircraft -- Aircraft
-- Switches -- Switches
@ -24,21 +26,39 @@ types
states : seq of int states : seq of int
inv k == k.position <= len k.states; inv k == k.position <= len k.states;
Throttle = int Lever = nat
inv t == t >= -100 and t <= 100; inv t == t <= 100;
Throttle ::
thrust: Lever
reverser: Lever
inv t ==
if t.thrust > 0 then
t.reverser = 0
else
t.reverser >= 0;
String = seq of char; --@doc The type that the action of the button is
ItemType = <SWITCH> | <KNOB> | <BUTTON>;
-- Item of a checklist, e.g. Landing gear down --@doc Item of a checklist, e.g. Landing gear down
Item :: Item ::
todo : String name : String
checked : bool; type : ItemType
object : Switch | Knob | Throttle;
-- A section of a checklist, e.g. Landing Checklist -- Checklist
Section = seq of Item;
-- Full checklist, e.g. Startup, Descent, Landing Checklist --@doc Item of a checklist, e.g. Landing gear down
ChecklistItem ::
procedure : String
item : Item
checked : bool;
--@doc A section of a checklist, e.g. Landing Checklist
Section = seq of ChecklistItem;
--@doc Full checklist, e.g. Startup, Descent, Landing Checklist
Checklist = seq of Section; Checklist = seq of Section;
functions functions