Built with Alectryon, running Coq+SerAPI v8.20.0+0.20.0. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use ⌘ instead of Ctrl.
[Loading ML file ring_plugin.cmxs (using legacy method) ... done]
[Loading ML file ssrmatching_plugin.cmxs (using legacy method) ... done]
[Loading ML file ssreflect_plugin.cmxs (using legacy method) ... done]
Serlib plugin: coq-elpi.elpi is not available: serlib support is missing.
Incremental checking for commands in this plugin will be impacted.
[Loading ML file coq-elpi.elpi ... done]
[Loading ML file zify_plugin.cmxs (using legacy method) ... done]
[Loading ML file micromega_core_plugin.cmxs (using legacy method) ... done]
[Loading ML file micromega_plugin.cmxs (using legacy method) ... done]
[Loading ML file btauto_plugin.cmxs (using legacy method) ... done]
Notation"_ + _" was already used in scope nat_scope.
[notation-overridden,parsing,default]
Notation"_ - _" was already used in scope nat_scope.
[notation-overridden,parsing,default]
Notation"_ <= _" was already used in scope nat_scope.
[notation-overridden,parsing,default]
Notation"_ < _" was already used in scope nat_scope.
[notation-overridden,parsing,default]
Notation"_ >= _" was already used in scope nat_scope.
[notation-overridden,parsing,default]
Notation"_ > _" was already used in scope nat_scope.
[notation-overridden,parsing,default]
Notation"_ <= _ <= _" was already used in scope
nat_scope. [notation-overridden,parsing,default]
Notation"_ < _ <= _" was already used in scope
nat_scope. [notation-overridden,parsing,default]
Notation"_ <= _ < _" was already used in scope
nat_scope. [notation-overridden,parsing,default]
Notation"_ < _ < _" was already used in scope
nat_scope. [notation-overridden,parsing,default]
Notation"_ * _" was already used in scope nat_scope.
[notation-overridden,parsing,default]
(** In the following, we define a processor state model for an ideal-uniprocessor system with jobs possibly exhibiting exceedance. *)SectionState.(** For a give type of jobs ...*)Context `{Job : JobType}.(** ... the exceedance processor state is defined as follows. Here, the [NominalExecution] processor state refers to the state of the processor when it is executing some job [j]. [ExceedanceExecution] also refers to the state of the processor when a job is executing in addition to its nominal execution time. Finally, [Idle] refers to the state of the processor when no job is executing. *)Inductiveexceedance_processor_state :=
| NominalExecution (j : Job)
| ExceedanceExecution (j : Job)
| Idle.(** To efficiently use the processor state in our mechanization, we need to define an [eqType] for the processor state. First, we define an inequality on the processor state as follows. *)Definitionexceedance_processor_state_eqdef (p1p2 : exceedance_processor_state) : bool :=
match p1, p2 with
| NominalExecution j1, NominalExecution j2 => j1 == j2
| ExceedanceExecution j1, ExceedanceExecution j2 => j1 == j2
| Idle, Idle => true
| _, _ => false
end.(** Next, we prove that the defined notion of equality is in fact an equality. *)
bydestruct s1; destruct s2 => //=; inversion EQ1; subst.Qed.(** Finally, we register the processor state as an [eqType]. *)HB.instance Definition_ := hasDecEq.Build exceedance_processor_state eqn_exceedance_processor_state.(** Next, we need to define the notions of service and supply for the processor state under consideration. *)SectionExceedanceService.(** Consider any job [j]. *)Variablej : Job.(** [j] is considered to be "scheduled" if the processor state is either [NominalExecution j] or [ExceedanceExecution j] *)Definitionexceedance_scheduled_on (proc_state : exceedance_processor_state) (_ : unit)
: bool :=
match proc_state with
| NominalExecution j'
| ExceedanceExecution j' => j' == j
| _ => false
end.(** Next, we need to define in which states the processor is offering supply. This is required to specify in which states a processor can offer productive work to a job. Note that when analysing a schedule of the [exceedance_processor_state], we want to model all instances of [ExceedanceExecution] as blackouts w.r.t. to nominal service and, therefore, the supply in this processor state is defined to be [0]. *)Definitionexceedance_supply_on (proc_state : exceedance_processor_state)
(_ : unit) : work :=
match proc_state with
| NominalExecution _ => 1
| ExceedanceExecution _ => 0
| Idle => 1end.(** Finally we need to define in which states a job actually receives nominal service. In our case, a job [j] receives nominal service only when the system is in the [NominalExecution j] state. *)Definitionexceedance_service_on (proc_state : exceedance_processor_state) (_ : unit) : work :=
match proc_state with
| NominalExecution j' => j' == j
| ExceedanceExecution _ => 0
| Idle => 0end.EndExceedanceService.(** Finally we can declare our processor state as an instance of the [ProcessorState] typeclass. *)Global Program Instanceexceedance_proc_state : ProcessorState Job :=
{|
State := exceedance_processor_state;
scheduled_on := exceedance_scheduled_on;
supply_on := exceedance_supply_on;
service_on := exceedance_service_on
|}.
Job: JobType
forall (j : Job) (s : exceedance_processor_state)
(r : Datatypes_unit__canonical__fintype_Finite),
exceedance_service_on j s r <=
exceedance_supply_on s r
bymove => j [] // s [] /=; case: eqP; lia.Qed.
Job: JobType
forall (j : Job) (s : exceedance_processor_state)
(r : Datatypes_unit__canonical__fintype_Finite),
~~ exceedance_scheduled_on j s r ->
exceedance_service_on j s r = 0