Commit 3869c2a7 authored by Felipe Cerqueira's avatar Felipe Cerqueira
Browse files

Port development to Coq 8.5

parent d5cf8f9d
......@@ -2,3 +2,4 @@
*.glob
*.vo
*.html
*.aux
......@@ -2,7 +2,7 @@
## v # The Coq Proof Assistant ##
## <O___,, # INRIA - CNRS - LIX - LRI - PPS ##
## \VV/ # ##
## // # Makefile automagically generated by coq_makefile V8.4pl4 ##
## // # Makefile automagically generated by coq_makefile V8.5pl1 ##
#############################################################################
# WARNING
......@@ -14,14 +14,15 @@
#
# This Makefile was generated by the command line :
# coq_makefile -R . rt ./util/fixedpoint.v ./util/ssromega.v ./util/bigcat.v ./util/nat.v ./util/notation.v ./util/list.v ./util/powerset.v ./util/all.v ./util/sorting.v ./util/tactics.v ./util/bigord.v ./util/exists.v ./util/induction.v ./util/sum.v ./util/divround.v ./util/counting.v ./implementation/basic/bertogna_edf_example.v ./implementation/basic/task.v ./implementation/basic/schedule.v ./implementation/basic/job.v ./implementation/basic/arrival_sequence.v ./implementation/jitter/bertogna_edf_example.v ./implementation/jitter/task.v ./implementation/jitter/schedule.v ./implementation/jitter/job.v ./implementation/jitter/arrival_sequence.v ./analysis/basic/bertogna_fp_theory.v ./analysis/basic/interference_bound_edf.v ./analysis/basic/interference_bound_fp.v ./analysis/basic/interference_bound.v ./analysis/basic/bertogna_edf_comp.v ./analysis/basic/bertogna_fp_comp.v ./analysis/basic/bertogna_edf_theory.v ./analysis/basic/workload_bound.v ./analysis/parallel/bertogna_fp_theory.v ./analysis/parallel/interference_bound_edf.v ./analysis/parallel/interference_bound_fp.v ./analysis/parallel/interference_bound.v ./analysis/parallel/bertogna_edf_comp.v ./analysis/parallel/bertogna_fp_comp.v ./analysis/parallel/bertogna_edf_theory.v ./analysis/parallel/workload_bound.v ./analysis/jitter/bertogna_fp_theory.v ./analysis/jitter/interference_bound_edf.v ./analysis/jitter/interference_bound_fp.v ./analysis/jitter/interference_bound.v ./analysis/jitter/bertogna_edf_comp.v ./analysis/jitter/bertogna_fp_comp.v ./analysis/jitter/bertogna_edf_theory.v ./analysis/jitter/workload_bound.v ./model/basic/time.v ./model/basic/schedulability.v ./model/basic/task.v ./model/basic/task_arrival.v ./model/basic/platform.v ./model/basic/schedule.v ./model/basic/priority.v ./model/basic/interference_edf.v ./model/basic/interference.v ./model/basic/workload.v ./model/basic/job.v ./model/basic/arrival_sequence.v ./model/basic/response_time.v ./model/basic/platform_fp.v ./model/jitter/time.v ./model/jitter/schedulability.v ./model/jitter/task.v ./model/jitter/task_arrival.v ./model/jitter/platform.v ./model/jitter/schedule.v ./model/jitter/priority.v ./model/jitter/interference_edf.v ./model/jitter/interference.v ./model/jitter/workload.v ./model/jitter/job.v ./model/jitter/arrival_sequence.v ./model/jitter/response_time.v ./model/jitter/platform_fp.v -o Makefile
# coq_makefile -f _CoqProject ./util/fixedpoint.v ./util/ssromega.v ./util/bigcat.v ./util/nat.v ./util/notation.v ./util/list.v ./util/powerset.v ./util/all.v ./util/sorting.v ./util/tactics.v ./util/bigord.v ./util/exists.v ./util/induction.v ./util/sum.v ./util/divround.v ./util/counting.v ./implementation/basic/bertogna_edf_example.v ./implementation/basic/task.v ./implementation/basic/schedule.v ./implementation/basic/job.v ./implementation/basic/arrival_sequence.v ./implementation/jitter/bertogna_edf_example.v ./implementation/jitter/task.v ./implementation/jitter/schedule.v ./implementation/jitter/job.v ./implementation/jitter/arrival_sequence.v ./analysis/basic/bertogna_fp_theory.v ./analysis/basic/interference_bound_edf.v ./analysis/basic/interference_bound_fp.v ./analysis/basic/interference_bound.v ./analysis/basic/bertogna_edf_comp.v ./analysis/basic/bertogna_fp_comp.v ./analysis/basic/bertogna_edf_theory.v ./analysis/basic/workload_bound.v ./analysis/parallel/bertogna_fp_theory.v ./analysis/parallel/interference_bound_edf.v ./analysis/parallel/interference_bound_fp.v ./analysis/parallel/interference_bound.v ./analysis/parallel/bertogna_edf_comp.v ./analysis/parallel/bertogna_fp_comp.v ./analysis/parallel/bertogna_edf_theory.v ./analysis/parallel/workload_bound.v ./analysis/jitter/bertogna_fp_theory.v ./analysis/jitter/interference_bound_edf.v ./analysis/jitter/interference_bound_fp.v ./analysis/jitter/interference_bound.v ./analysis/jitter/bertogna_edf_comp.v ./analysis/jitter/bertogna_fp_comp.v ./analysis/jitter/bertogna_edf_theory.v ./analysis/jitter/workload_bound.v ./model/basic/time.v ./model/basic/schedulability.v ./model/basic/task.v ./model/basic/task_arrival.v ./model/basic/platform.v ./model/basic/schedule.v ./model/basic/priority.v ./model/basic/interference_edf.v ./model/basic/interference.v ./model/basic/workload.v ./model/basic/job.v ./model/basic/arrival_sequence.v ./model/basic/response_time.v ./model/basic/platform_fp.v ./model/jitter/time.v ./model/jitter/schedulability.v ./model/jitter/task.v ./model/jitter/task_arrival.v ./model/jitter/platform.v ./model/jitter/schedule.v ./model/jitter/priority.v ./model/jitter/interference_edf.v ./model/jitter/interference.v ./model/jitter/workload.v ./model/jitter/job.v ./model/jitter/arrival_sequence.v ./model/jitter/response_time.v ./model/jitter/platform_fp.v -o Makefile
#
.DEFAULT_GOAL := all
#
# This Makefile may take arguments passed as environment variables:
# COQBIN to specify the directory where Coq binaries resides;
# TIMECMD set a command to log .v compilation time;
# TIMED if non empty, use the default time command as TIMECMD;
# ZDEBUG/COQDEBUG to specify debug flags for ocamlc&ocamlopt/coqc;
# DSTROOT to specify a prefix to install path.
......@@ -33,14 +34,25 @@ endef
includecmdwithout@ = $(eval $(subst @,$(donewline),$(shell { $(1) | tr -d '\r' | tr '\n' '@'; })))
$(call includecmdwithout@,$(COQBIN)coqtop -config)
TIMED=
TIMECMD=
STDTIME?=/usr/bin/time -f "$* (user: %U mem: %M ko)"
TIMER=$(if $(TIMED), $(STDTIME), $(TIMECMD))
vo_to_obj = $(addsuffix .o,\
$(filter-out Warning: Error:,\
$(shell $(COQBIN)coqtop -q -noinit -batch -quiet -print-mod-uid $(1))))
##########################
# #
# Libraries definitions. #
# #
##########################
COQLIBS?= -R . rt
COQDOCLIBS?=-R . rt
COQLIBS?=\
-R "." rt
COQDOCLIBS?=\
-R "." rt
##########################
# #
......@@ -50,14 +62,15 @@ COQDOCLIBS?=-R . rt
OPT?=
COQDEP?=$(COQBIN)coqdep -c
COQDEP?="$(COQBIN)coqdep" -c
COQFLAGS?=-q $(OPT) $(COQLIBS) $(OTHERFLAGS) $(COQ_XML)
COQCHKFLAGS?=-silent -o
COQDOCFLAGS?=-interpolate -utf8
COQC?=$(COQBIN)coqc
GALLINA?=$(COQBIN)gallina
COQDOC?=$(COQBIN)coqdoc
COQCHK?=$(COQBIN)coqchk
COQC?=$(TIMER) "$(COQBIN)coqc"
GALLINA?="$(COQBIN)gallina"
COQDOC?="$(COQBIN)coqdoc"
COQCHK?="$(COQBIN)coqchk"
COQMKTOP?="$(COQBIN)coqmktop"
##################
# #
......@@ -66,12 +79,13 @@ COQCHK?=$(COQBIN)coqchk
##################
ifdef USERINSTALL
XDG_DATA_HOME?=$(HOME)/.local/share
XDG_DATA_HOME?="$(HOME)/.local/share"
COQLIBINSTALL=$(XDG_DATA_HOME)/coq
COQDOCINSTALL=$(XDG_DATA_HOME)/doc/coq
else
COQLIBINSTALL=${COQLIB}user-contrib
COQDOCINSTALL=${DOCDIR}user-contrib
COQLIBINSTALL="${COQLIB}user-contrib"
COQDOCINSTALL="${DOCDIR}user-contrib"
COQTOPINSTALL="${COQLIB}toploop"
endif
######################
......@@ -159,15 +173,25 @@ VFILES:=util/fixedpoint.v\
model/jitter/response_time.v\
model/jitter/platform_fp.v
ifneq ($(filter-out archclean clean cleanall printenv,$(MAKECMDGOALS)),)
-include $(addsuffix .d,$(VFILES))
else
ifeq ($(MAKECMDGOALS),)
-include $(addsuffix .d,$(VFILES))
endif
endif
.SECONDARY: $(addsuffix .d,$(VFILES))
VOFILES:=$(VFILES:.v=.vo)
VO=vo
VOFILES:=$(VFILES:.v=.$(VO))
GLOBFILES:=$(VFILES:.v=.glob)
VIFILES:=$(VFILES:.v=.vi)
GFILES:=$(VFILES:.v=.g)
HTMLFILES:=$(VFILES:.v=.html)
GHTMLFILES:=$(VFILES:.v=.g.html)
OBJFILES=$(call vo_to_obj,$(VOFILES))
ALLNATIVEFILES=$(OBJFILES:.o=.cmi) $(OBJFILES:.o=.cmo) $(OBJFILES:.o=.cmx) $(OBJFILES:.o=.cmxs)
NATIVEFILES=$(foreach f, $(ALLNATIVEFILES), $(wildcard $f))
ifeq '$(HASNATDYNLINK)' 'true'
HASNATDYNLINK_OR_EMPTY := yes
else
......@@ -182,8 +206,12 @@ endif
all: $(VOFILES)
spec: $(VIFILES)
quick: $(VOFILES:.vo=.vio)
vio2vo:
$(COQC) $(COQDEBUG) $(COQFLAGS) -schedule-vio2vo $(J) $(VOFILES:%.vo=%.vio)
checkproofs:
$(COQC) $(COQDEBUG) $(COQFLAGS) -schedule-vio-checking $(J) $(VOFILES:%.vo=%.vio)
gallina: $(GFILES)
html: $(GLOBFILES) $(VFILES)
......@@ -214,7 +242,7 @@ beautify: $(VFILES:=.beautified)
@echo 'Do not do "make clean" until you are sure that everything went well!'
@echo 'If there were a problem, execute "for file in $$(find . -name \*.v.old -print); do mv $${file} $${file%.old}; done" in your shell/'
.PHONY: all opt byte archclean clean install userinstall depend html validate
.PHONY: all archclean beautify byte clean cleanall gallina gallinahtml html install install-doc install-natdynlink install-toploop opt printenv quick uninstall userinstall validate vio2vo
####################
# #
......@@ -232,33 +260,72 @@ userinstall:
+$(MAKE) USERINSTALL=true install
install:
for i in $(VOFILES); do \
install -d `dirname $(DSTROOT)$(COQLIBINSTALL)/rt/$$i`; \
install -m 0644 $$i $(DSTROOT)$(COQLIBINSTALL)/rt/$$i; \
cd "." && for i in $(VOFILES) $(VFILES) $(GLOBFILES) $(NATIVEFILES) $(CMOFILES) $(CMIFILES) $(CMAFILES); do \
install -d "`dirname "$(DSTROOT)"$(COQLIBINSTALL)/rt/$$i`"; \
install -m 0644 $$i "$(DSTROOT)"$(COQLIBINSTALL)/rt/$$i; \
done
install-doc:
install -d $(DSTROOT)$(COQDOCINSTALL)/rt/html
install -d "$(DSTROOT)"$(COQDOCINSTALL)/rt/html
for i in html/*; do \
install -m 0644 $$i $(DSTROOT)$(COQDOCINSTALL)/rt/$$i;\
install -m 0644 $$i "$(DSTROOT)"$(COQDOCINSTALL)/rt/$$i;\
done
clean:
rm -f $(VOFILES) $(VIFILES) $(GFILES) $(VFILES:.v=.v.d) $(VFILES:=.beautified) $(VFILES:=.old)
uninstall_me.sh: Makefile
echo '#!/bin/sh' > $@
printf 'cd "$${DSTROOT}"$(COQLIBINSTALL)/rt && rm -f $(VOFILES) $(VFILES) $(GLOBFILES) $(NATIVEFILES) $(CMOFILES) $(CMIFILES) $(CMAFILES) && find . -type d -and -empty -delete\ncd "$${DSTROOT}"$(COQLIBINSTALL) && find "rt" -maxdepth 0 -and -empty -exec rmdir -p \{\} \;\n' >> "$@"
printf 'cd "$${DSTROOT}"$(COQDOCINSTALL)/rt \\\n' >> "$@"
printf '&& rm -f $(shell find "html" -maxdepth 1 -and -type f -print)\n' >> "$@"
printf 'cd "$${DSTROOT}"$(COQDOCINSTALL) && find rt/html -maxdepth 0 -and -empty -exec rmdir -p \{\} \;\n' >> "$@"
chmod +x $@
uninstall: uninstall_me.sh
sh $<
.merlin:
@echo 'FLG -rectypes' > .merlin
@echo "B $(COQLIB) kernel" >> .merlin
@echo "B $(COQLIB) lib" >> .merlin
@echo "B $(COQLIB) library" >> .merlin
@echo "B $(COQLIB) parsing" >> .merlin
@echo "B $(COQLIB) pretyping" >> .merlin
@echo "B $(COQLIB) interp" >> .merlin
@echo "B $(COQLIB) printing" >> .merlin
@echo "B $(COQLIB) intf" >> .merlin
@echo "B $(COQLIB) proofs" >> .merlin
@echo "B $(COQLIB) tactics" >> .merlin
@echo "B $(COQLIB) tools" >> .merlin
@echo "B $(COQLIB) toplevel" >> .merlin
@echo "B $(COQLIB) stm" >> .merlin
@echo "B $(COQLIB) grammar" >> .merlin
@echo "B $(COQLIB) config" >> .merlin
clean::
rm -f $(OBJFILES) $(OBJFILES:.o=.native) $(NATIVEFILES)
find . -name .coq-native -type d -empty -delete
rm -f $(VOFILES) $(VOFILES:.vo=.vio) $(GFILES) $(VFILES:.v=.v.d) $(VFILES:=.beautified) $(VFILES:=.old)
rm -f all.ps all-gal.ps all.pdf all-gal.pdf all.glob $(VFILES:.v=.glob) $(VFILES:.v=.tex) $(VFILES:.v=.g.tex) all-mli.tex
- rm -rf html mlihtml
- rm -rf html mlihtml uninstall_me.sh
cleanall:: clean
rm -f $(patsubst %.v,.%.aux,$(VFILES))
archclean:
archclean::
rm -f *.cmx *.o
printenv:
@$(COQBIN)coqtop -config
@echo CAMLC = $(CAMLC)
@echo CAMLOPTC = $(CAMLOPTC)
@echo PP = $(PP)
@echo COQFLAGS = $(COQFLAGS)
@echo COQLIBINSTALL = $(COQLIBINSTALL)
@echo COQDOCINSTALL = $(COQDOCINSTALL)
@"$(COQBIN)coqtop" -config
@echo 'CAMLC = $(CAMLC)'
@echo 'CAMLOPTC = $(CAMLOPTC)'
@echo 'PP = $(PP)'
@echo 'COQFLAGS = $(COQFLAGS)'
@echo 'COQLIBINSTALL = $(COQLIBINSTALL)'
@echo 'COQDOCINSTALL = $(COQDOCINSTALL)'
Makefile: _CoqProject
mv -f $@ $@.bak
"$(COQBIN)coq_makefile" -f $< -o $@
###################
# #
......@@ -266,31 +333,34 @@ printenv:
# #
###################
%.vo %.glob: %.v
$(VOFILES): %.vo: %.v
$(COQC) $(COQDEBUG) $(COQFLAGS) $*
$(GLOBFILES): %.glob: %.v
$(COQC) $(COQDEBUG) $(COQFLAGS) $*
%.vi: %.v
$(COQC) -i $(COQDEBUG) $(COQFLAGS) $*
$(VFILES:.v=.vio): %.vio: %.v
$(COQC) -quick $(COQDEBUG) $(COQFLAGS) $*
%.g: %.v
$(GFILES): %.g: %.v
$(GALLINA) $<
%.tex: %.v
$(VFILES:.v=.tex): %.tex: %.v
$(COQDOC) $(COQDOCFLAGS) -latex $< -o $@
%.html: %.v %.glob
$(HTMLFILES): %.html: %.v %.glob
$(COQDOC) $(COQDOCFLAGS) -html $< -o $@
%.g.tex: %.v
$(VFILES:.v=.g.tex): %.g.tex: %.v
$(COQDOC) $(COQDOCFLAGS) -latex -g $< -o $@
%.g.html: %.v %.glob
$(COQDOC)$(COQDOCFLAGS) -html -g $< -o $@
$(GHTMLFILES): %.g.html: %.v %.glob
$(COQDOC) $(COQDOCFLAGS) -html -g $< -o $@
%.v.d: %.v
$(COQDEP) -slash $(COQLIBS) "$<" > "$@" || ( RV=$$?; rm -f "$@"; exit $${RV} )
$(addsuffix .d,$(VFILES)): %.v.d: %.v
$(COQDEP) $(COQLIBS) "$<" > "$@" || ( RV=$$?; rm -f "$@"; exit $${RV} )
%.v.beautified:
$(addsuffix .beautified,$(VFILES)): %.v.beautified:
$(COQC) $(COQDEBUG) $(COQFLAGS) -beautify $*
# WARNING
......
-R . rt
\ No newline at end of file
Add LoadPath "../.." as rt.
Require Import rt.util.all.
Require Import rt.analysis.basic.bertogna_edf_theory.
Require Import ssreflect ssrbool eqtype ssrnat seq fintype bigop div path.
From mathcomp Require Import ssreflect ssrbool eqtype ssrnat seq fintype bigop div path.
Module ResponseTimeIterationEDF.
......@@ -238,7 +237,7 @@ Module ResponseTimeIterationEDF.
Proof.
intros l; unfold all_le; rewrite eq_refl andTb.
destruct l; first by done.
by apply/(zipP (fun x y => snd x <= snd y)).
by apply/(zipP t (fun x y => snd x <= snd y)).
Qed.
(* ... and transitive. *)
......@@ -247,8 +246,8 @@ Module ResponseTimeIterationEDF.
unfold transitive, all_le.
move => y x z /andP [/eqP ZIPxy LExy] /andP [/eqP ZIPyz LEyz].
apply/andP; split; first by rewrite ZIPxy -ZIPyz.
move: LExy => /(zipP (fun x y => snd x <= snd y)) LExy.
move: LEyz => /(zipP (fun x y => snd x <= snd y)) LEyz.
move: LExy => /(zipP _ (fun x y => snd x <= snd y)) LExy.
move: LEyz => /(zipP _ (fun x y => snd x <= snd y)) LEyz.
assert (SIZExy: size (unzip1 x) = size (unzip1 y)).
by rewrite ZIPxy.
assert (SIZEyz: size (unzip1 y) = size (unzip1 z)).
......@@ -259,21 +258,22 @@ Module ResponseTimeIterationEDF.
apply size0nil in SIZExy; symmetry in SIZEyz.
by apply size0nil in SIZEyz; subst.
}
apply/(zipP (fun x y => snd x <= snd y));
[by apply (t, 0) | by rewrite SIZExy -SIZEyz|].
rewrite -SIZExy in SIZEyz.
have ZIP := zipP t (fun x y => snd x <= snd y) _ _ SIZEyz.
apply/ZIP.
intros i LTi.
specialize (LExy t); specialize (LEyz t).
exploit LExy; first by rewrite SIZExy.
{
rewrite size_zip -SIZEyz -SIZExy minnn in LTi.
by rewrite size_zip -SIZExy minnn; apply LTi.
rewrite size_zip -SIZExy minnn.
rewrite size_zip -SIZEyz minnn in LTi; apply LTi.
}
instantiate (1 := t); intro LE.
exploit LEyz; first by apply SIZEyz.
intro LE.
exploit LEyz; first by rewrite -SIZExy.
{
rewrite size_zip SIZExy SIZEyz minnn in LTi.
by rewrite size_zip SIZEyz minnn; apply LTi.
by rewrite size_zip -SIZExy -size_zip; apply LTi.
}
by instantiate (1 := t); intro LE'; apply (leq_trans LE).
by intro LE'; apply (leq_trans LE).
Qed.
(* At any step of the iteration, the corresponding list
......@@ -294,8 +294,8 @@ Module ResponseTimeIterationEDF.
by rewrite iterSr IHstep.
}
apply/(zipP (fun x y => snd x <= snd y));
[by apply (tsk0,0)|by rewrite edf_claimed_bounds_size size_map |].
apply/(zipP (tsk0,0) (fun x y => snd x <= snd y));
first by rewrite edf_claimed_bounds_size size_map.
intros i LTi; rewrite iterS; unfold edf_rta_iteration at 1.
have MAP := @nth_map _ (tsk0,0) _ (tsk0,0).
......@@ -349,10 +349,9 @@ Module ResponseTimeIterationEDF.
apply f_equal with (B := nat) (f := fun x => size x) in UNZIP'.
rename UNZIP' into SIZE.
rewrite size_map [size (unzip1 _)]size_map in SIZE.
move: LE => /(zipP (fun x y => snd x <= snd y)) LE.
move: LE => /(zipP _ (fun x y => snd x <= snd y)) LE.
destruct x1 as [| p0 x1'], x2 as [| p0' x2']; try (by ins).
apply/(zipP (fun x y => snd x <= snd y));
[by apply (p0,0) | by done |].
apply/(zipP p0 (fun x y => snd x <= snd y)); first by done.
intros i LTi.
exploit LE; first by rewrite 2!size_map in SIZE.
......@@ -420,7 +419,7 @@ Module ResponseTimeIterationEDF.
assert (GE_COST: all (fun p => task_cost (fst p) <= snd p) ((tsk0, R0) :: x1')).
{
clear LE; move: LEinit => /andP [/eqP UNZIP' LE].
move: LE => /(zipP (fun x y => snd x <= snd y)) LE.
move: LE => /(zipP _ (fun x y => snd x <= snd y)) LE.
specialize (LE (tsk0, R0)).
apply/(all_nthP (tsk0,R0)).
intros j LTj; generalize UNZIP'; simpl; intro SIZE'.
......@@ -614,6 +613,8 @@ Module ResponseTimeIterationEDF.
k <= max_steps ts ->
\sum_((tsk, R) <- f k) (R - task_cost tsk) + 1 > k.
Proof.
have INC := bertogna_edf_comp_f_increases.
have MONO := bertogna_edf_comp_iteration_monotonic.
rename H_at_least_one_task into NONEMPTY.
unfold valid_sporadic_taskset, is_valid_sporadic_task in *.
rename H_valid_task_parameters into VALID.
......@@ -661,12 +662,12 @@ Module ResponseTimeIterationEDF.
}
rewrite -2!big_seq_cond.
have LT := bertogna_edf_comp_f_increases step (ltnW LE).
have MONO := bertogna_edf_comp_iteration_monotonic step.
have LT := INC step (ltnW LE).
specialize (MONO step).
move: LT => /andP [_ LT]; move: LT => /hasP LT.
destruct LT as [[x1 x2] INzip LT]; simpl in *.
move: MONO => /andP [_ /(zipP (fun x y => snd x <= snd y)) MONO].
move: MONO => /andP [_ /(zipP _ (fun x y => snd x <= snd y)) MONO].
rewrite 2!(big_nth (elem, 0)).
apply mem_zip_exists with (elem := (elem, 0)) (elem' := (elem, 0)) in INzip; des;
last by rewrite size_map.
......@@ -940,6 +941,9 @@ Module ResponseTimeIterationEDF.
Theorem taskset_schedulable_by_edf_rta :
forall tsk, tsk \in ts -> no_deadline_missed_by_task tsk.
Proof.
have RLIST := (edf_analysis_yields_response_time_bounds).
have DL := (edf_claimed_bounds_le_deadline ts).
have HAS := (edf_claimed_bounds_has_R_for_every_task ts).
unfold no_deadline_missed_by_task, task_misses_no_deadline,
job_misses_no_deadline, completed,
edf_schedulable,
......@@ -953,10 +957,6 @@ Module ResponseTimeIterationEDF.
H_test_succeeds into TEST.
move => tsk INtsk j JOBtsk.
have RLIST := (edf_analysis_yields_response_time_bounds).
have DL := (edf_claimed_bounds_le_deadline ts).
have HAS := (edf_claimed_bounds_has_R_for_every_task ts).
destruct (edf_claimed_bounds ts) as [rt_bounds |] eqn:SOME; last by ins.
exploit (HAS rt_bounds tsk); [by ins | by ins | clear HAS; intro HAS; des].
have COMPLETED := RLIST tsk R HAS j JOBtsk.
......
Add LoadPath "../.." as rt.
Require Import rt.util.all.
Require Import rt.model.basic.task rt.model.basic.job rt.model.basic.task_arrival
rt.model.basic.schedule rt.model.basic.platform rt.model.basic.interference
rt.model.basic.workload rt.model.basic.schedulability rt.model.basic.priority
rt.model.basic.platform rt.model.basic.response_time.
Require Import rt.analysis.basic.workload_bound rt.analysis.basic.interference_bound_edf.
Require Import ssreflect ssrbool eqtype ssrnat seq fintype bigop div path.
From mathcomp Require Import ssreflect ssrbool eqtype ssrnat seq fintype bigop div path.
Module ResponseTimeAnalysisEDF.
......@@ -284,8 +283,8 @@ Module ResponseTimeAnalysisEDF.
| by apply JOBtsk | by apply BACK | ].
{
intros j0 tsk0 TSK0 LE.
cut (tsk0 \in unzip1 rt_bounds); [intro IN | by rewrite UNZIP -TSK0 FROMTS].
move: IN => /mapP [p IN EQ]; destruct p as [tsk' R0]; simpl in *; subst tsk'.
cut (tsk0 \in unzip1 rt_bounds = true); last by rewrite UNZIP -TSK0 FROMTS.
move => /mapP [p IN EQ]; destruct p as [tsk' R0]; simpl in *; subst tsk'.
apply completion_monotonic with (t0 := job_arrival j0 + R0); try (by done).
{
rewrite leq_add2l TSK0.
......@@ -362,6 +361,7 @@ Module ResponseTimeAnalysisEDF.
Lemma bertogna_edf_all_cpus_busy :
\sum_(tsk_k <- ts_interf) x tsk_k = X * num_cpus.
Proof.
have DIFFTASK := bertogna_edf_interference_by_different_tasks.
rename H_all_jobs_from_taskset into FROMTS,
H_valid_task_parameters into PARAMS,
H_job_of_tsk into JOBtsk, H_sporadic_tasks into SPO,
......@@ -397,7 +397,7 @@ Module ResponseTimeAnalysisEDF.
}
rewrite mem_filter; apply/andP; split; last by apply FROMTS.
unfold jldp_can_interfere_with.
apply bertogna_edf_interference_by_different_tasks with (t := t); [by auto | by done |].
apply DIFFTASK with (t := t); [by auto | by done |].
by apply/existsP; exists cpu; apply/eqP.
Qed.
......@@ -416,8 +416,8 @@ Module ResponseTimeAnalysisEDF.
H_all_jobs_from_taskset into FROMTS,
H_all_previous_jobs_completed_on_time into BEFOREok.
intros t j0 LEt LE.
cut ((job_task j0) \in unzip1 rt_bounds); [intro IN | by rewrite UNZIP FROMTS].
move: IN => /mapP [p IN EQ]; destruct p as [tsk' R0]; simpl in *; subst tsk'.
cut ((job_task j0) \in unzip1 rt_bounds = true); last by rewrite UNZIP FROMTS.
move => /mapP [p IN EQ]; destruct p as [tsk' R0]; simpl in *; subst tsk'.
apply completion_monotonic with (t0 := job_arrival j0 + R0); first by done.
{
rewrite leq_add2l; apply leq_trans with (n := task_deadline (job_task j0));
......@@ -442,6 +442,8 @@ Module ResponseTimeAnalysisEDF.
0 < cardGE delta < num_cpus ->
\sum_(i <- ts_interf | x i < delta) x i >= delta * (num_cpus - cardGE delta).
Proof.
have COMP := bertogna_edf_all_previous_jobs_complete_by_their_period.
have INV := bertogna_edf_scheduling_invariant.
rename H_all_jobs_from_taskset into FROMTS,
H_valid_task_parameters into PARAMS,
H_job_of_tsk into JOBtsk,
......@@ -515,7 +517,7 @@ Module ResponseTimeAnalysisEDF.
(job_cost0 := job_cost) (job_task0 := job_task) (sched0 := sched) (j0 := j) (t0 := t);
rewrite ?JOBtsk ?SAMEtsk //; first by apply PARAMS; rewrite -JOBtsk FROMTS.
intros j0 tsk0 TSK0 LE.
by apply (bertogna_edf_all_previous_jobs_complete_by_their_period t); rewrite ?TSK0.
by apply (COMP t); rewrite ?TSK0.
}
by subst j2; apply SEQ with (j := j1) (t := t).
}
......@@ -549,9 +551,8 @@ Module ResponseTimeAnalysisEDF.
eapply leq_trans with (n := count (predC (fun tsk => delta <= x tsk)) _);
last by apply eq_leq, eq_in_count; red; ins; rewrite ltnNge.
rewrite leq_subLR count_predC size_filter.
apply leq_trans with (n := count (scheduled_task_other_than_tsk t) ts);
first by rewrite bertogna_edf_scheduling_invariant.
by rewrite count_filter.
by apply leq_trans with (n := count (scheduled_task_other_than_tsk t) ts);
[by rewrite INV | by rewrite count_filter].
}
{
unfold x at 2, total_interference_B.
......@@ -624,9 +625,12 @@ Module ResponseTimeAnalysisEDF.
\sum_((tsk_other, R_other) <- rt_bounds | jldp_can_interfere_with tsk tsk_other)
minn (x tsk_other) (R - task_cost tsk + 1) > I tsk R.
Proof.
have GE_COST := bertogna_edf_R_other_ge_cost.
have EXCEEDS := bertogna_edf_minimum_exceeds_interference.
have ALLBUSY := bertogna_edf_all_cpus_busy.
have TOOMUCH := bertogna_edf_too_much_interference.
rename H_rt_bounds_contains_all_tasks into UNZIP,
H_response_time_is_fixed_point into REC.
have GE_COST := bertogna_edf_R_other_ge_cost.
apply leq_trans with (n := \sum_(tsk_other <- ts_interf) minn (x tsk_other) (R - task_cost tsk + 1));
last first.
{
......@@ -654,11 +658,10 @@ Module ResponseTimeAnalysisEDF.
rewrite -addn1 -leq_subLR.
rewrite -[R + 1 - _]subh1; last by apply GE_COST.
rewrite leq_divRL; last by apply H_at_least_one_cpu.
apply bertogna_edf_minimum_exceeds_interference.
apply EXCEEDS.
apply leq_trans with (n := X * num_cpus);
last by rewrite bertogna_edf_all_cpus_busy.
rewrite leq_mul2r; apply/orP; right.
by apply bertogna_edf_too_much_interference.
last by rewrite ALLBUSY.
by rewrite leq_mul2r; apply/orP; right; apply TOOMUCH.
Qed.
(* 8) After concluding that the sum of the minimum exceeds (R - e_i + 1),
......@@ -669,6 +672,9 @@ Module ResponseTimeAnalysisEDF.
(tsk_other, R_other) \in rt_bounds /\
(minn (x tsk_other) (R - task_cost tsk + 1) > interference_bound tsk_other R_other).
Proof.
have SUM := bertogna_edf_sum_exceeds_total_interference.
have BOUND := bertogna_edf_workload_bounds_interference.
have EDFBOUND := bertogna_edf_specific_bound_holds.
rename H_rt_bounds_contains_all_tasks into UNZIP.
assert (HAS: has (fun tup : task_with_response_time =>
let (tsk_other, R_other) := tup in
......@@ -679,7 +685,6 @@ Module ResponseTimeAnalysisEDF.
{
apply/negP; unfold not; intro NOTHAS.
move: NOTHAS => /negP /hasPn ALL.
have SUM := bertogna_edf_sum_exceeds_total_interference.
rewrite -[_ < _]negbK in SUM.
move: SUM => /negP SUM; apply SUM; rewrite -leqNgt.
unfold I, total_interference_bound_edf.
......@@ -692,11 +697,11 @@ Module ResponseTimeAnalysisEDF.
unfold interference_bound; rewrite leq_min; apply/andP; split;
last by rewrite geq_minr.
apply leq_trans with (n := x tsk_k); first by rewrite geq_minl.
by apply bertogna_edf_workload_bounds_interference.
by apply BOUND.
}
{
apply leq_trans with (n := x tsk_k); first by rewrite geq_minl.
by apply bertogna_edf_specific_bound_holds.
by apply EDFBOUND.
}
}
move: HAS => /hasP HAS; destruct HAS as [[tsk_k R_k] HPk MIN].
......
Add LoadPath "../../" as rt.
Require Import rt.util.all.
Require Import rt.analysis.basic.bertogna_fp_theory.
Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq fintype bigop div path.
From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq fintype bigop div path.
Module ResponseTimeIterationFP.
......@@ -444,6 +443,7 @@ Module ResponseTimeIterationFP.
k <= max_steps tsk ->
f k > k + task_cost tsk - 1.
Proof.
have INC := bertogna_fp_comp_f_increases.
rename H_valid_task_parameters into TASK_PARAMS.
unfold valid_sporadic_taskset, is_valid_sporadic_task in *; des.