Skip to content

Commit 98c2889

Browse files
committed
lib: A tutorial and some 'modify' monad rules for Lib.EquivValid
Thanks to Toby Murray (@tobycmurray) for early feedback. Signed-off-by: Robert Sison <robert.sison@unimelb.edu.au>
1 parent 7d998ac commit 98c2889

File tree

9 files changed

+840
-2
lines changed

9 files changed

+840
-2
lines changed

.github/workflows/proof.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
with:
5252
L4V_ARCH: ${{ matrix.arch }}
5353
isa_branch: ts-2020
54-
session: ExecSpec ASpec AInvs
54+
session: ExecSpec ASpec AInvs EVTutorial
5555

5656
refine:
5757
name: Refine

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ order).
6868
* Thomas Sewell, Data61, NICTA & UNSW
6969
* Michael Sproul, Data61
7070
* Rupert Shuttleworth, NICTA
71+
* Robert Sison, The University of Melbourne
7172
* Miki Tanaka, Data61, NICTA
7273
* Vernon Tang, NICTA
7374
* Sophie Taylor, Data61, NICTA

ROOTS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ camkes
88
sys-init
99
lib
1010
lib/Word_Lib
11-
lib/sep_algebra
11+
lib/sep_algebra
12+
lib/EVTutorial

lib/EVTutorial/EquivValidTutorial.thy

Lines changed: 717 additions & 0 deletions
Large diffs are not rendered by default.

lib/EVTutorial/ROOT

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(*
2+
* Copyright 2020, The University of Melbourne (ABN 84 002 705 224)
3+
*
4+
* SPDX-License-Identifier: BSD-2-Clause
5+
*)
6+
7+
chapter Lib
8+
9+
session EVTutorial = Lib +
10+
options [document = pdf]
11+
theories
12+
EquivValidTutorial
13+
document_files
14+
"root.bib"
15+
"root.tex"

lib/EVTutorial/document/root.bib

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright 2020, The University of Melbourne (ABN 84 002 705 224)
2+
#
3+
# SPDX-License-Identifier: CC-BY-SA-4.0
4+
#
5+
6+
@inproceedings{Murray_MBGK_12,
7+
author = {Murray, Toby and Matichuk, Daniel and Brassil, Matthew and Gammie, Peter and Klein, Gerwin},
8+
editor = {{Chris Hawblitzel and Dale Miller}},
9+
month = dec,
10+
year = {2012},
11+
keywords = {information flow, refinement, scheduling, state monads},
12+
address = {Kyoto, Japan},
13+
title = {Noninterference for Operating System Kernels},
14+
pages = {126--142},
15+
booktitle = {International Conference on Certified Programs and Proofs},
16+
paperurl = {https://ts.data61.csiro.au/publications/nicta_full_text/6004.pdf},
17+
publisher = {Springer},
18+
isbn = {978-3-642-35307-9}
19+
}
20+
21+
@INPROCEEDINGS{Goguen_Meseguer_84,
22+
author={J. A. {Goguen} and J. {Meseguer}},
23+
booktitle={1984 IEEE Symposium on Security and Privacy},
24+
title={Unwinding and Inference Control},
25+
year={1984},
26+
volume={},
27+
number={},
28+
pages={75--87},
29+
publisher = {{IEEE} Computer Society},
30+
}

lib/EVTutorial/document/root.tex

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
%
2+
% Copyright 2020, The University of Melbourne (ABN 84 002 705 224)
3+
%
4+
% SPDX-License-Identifier: CC-BY-SA-4.0
5+
%
6+
7+
\documentclass[11pt,a4paper]{article}
8+
\usepackage{isabelle,isabellesym}
9+
10+
% Ensure words with ligatures like 'fi' are searchable in pdf
11+
% https://tex.stackexchange.com/a/57867
12+
\input{glyphtounicode}
13+
\pdfgentounicode=1
14+
15+
% this should be the last package used
16+
\usepackage{pdfsetup}
17+
18+
% urls in roman style, theory text in math-similar italics
19+
\urlstyle{rm}
20+
\isabellestyle{it}
21+
22+
23+
\begin{document}
24+
25+
\title{EquivValid Tutorial\thanks{\copyright~The University of Melbourne (ABN 84 002 705 224); licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)}}
26+
% Remove footnote mark for copyright notice.
27+
% https://tex.stackexchange.com/a/14866
28+
\renewcommand\footnotemark{}
29+
\author{Robert Sison}
30+
\maketitle
31+
32+
\tableofcontents
33+
34+
% sane default for proof documents
35+
\parindent 0pt\parskip 0.5ex
36+
37+
% generated text of all theories
38+
\input{session}
39+
40+
% optional bibliography
41+
\bibliographystyle{alpha}
42+
\bibliography{root}
43+
44+
\end{document}
45+
46+
%%% Local Variables:
47+
%%% mode: latex
48+
%%% TeX-master: t
49+
%%% End:

lib/EquivValid.thy

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,30 @@ lemma modify_ev2:
267267
apply(clarsimp simp: equiv_valid_2_def in_monad)
268268
using assms by auto
269269

270+
lemma modify_ev:
271+
"equiv_valid I A B
272+
(\<lambda> s. \<forall> s t. I s t \<and> A s t \<longrightarrow> I (f s) (f t) \<and> B (f s) (f t))
273+
(modify f)"
274+
apply(clarsimp simp:equiv_valid_def2)
275+
apply(rule modify_ev2)
276+
by auto
277+
278+
lemma modify_ev':
279+
"equiv_valid I A B
280+
(\<lambda> s. \<forall> t. I s t \<and> A s t \<longrightarrow> I (f s) (f t) \<and> B (f s) (f t))
281+
(modify f)"
282+
apply(clarsimp simp:equiv_valid_def2)
283+
apply(rule modify_ev2)
284+
by auto
285+
286+
lemma modify_ev'':
287+
assumes "\<And> s t. \<lbrakk>I s t; A s t; P s; P t\<rbrakk> \<Longrightarrow> I (f s) (f t) \<and> B (f s) (f t)"
288+
shows "equiv_valid I A B P (modify f)"
289+
apply(clarsimp simp:equiv_valid_def2)
290+
apply(rule modify_ev2)
291+
using assms by auto
292+
293+
270294
lemma put_ev2:
271295
assumes "\<And> s t. \<lbrakk>I s t; A s t; P s; P' t\<rbrakk> \<Longrightarrow> R () () \<and> I x x' \<and> B x x'"
272296
shows

lib/tests.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<test name="Concurrency" depends="Lib">../isabelle/bin/isabelle build -v -d .. Concurrency</test>
2121
<test name="CLib" depends="Lib CParser">../isabelle/bin/isabelle build -v -d .. CLib</test>
2222
<test name="LibTest" depends="Lib CParser Refine" cpu-timeout="1800">../isabelle/bin/isabelle build -v -d .. LibTest</test>
23+
<test name="EVTutorial" depends="Lib">../isabelle/bin/isabelle build -v -d .. EVTutorial</test>
2324
</set>
2425

2526
</testsuite>

0 commit comments

Comments
 (0)