-
Notifications
You must be signed in to change notification settings - Fork 2
/
progproving.sty
97 lines (78 loc) · 2.79 KB
/
progproving.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
%--------------------------------------------------------------------%
% %
% IDENTIFICATION %
% %
%--------------------------------------------------------------------%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{progproving}[2022/08/26 ProgProving]
%--------------------------------------------------------------------%
% %
% PACKAGES %
% %
%--------------------------------------------------------------------%
\RequirePackage{amsmath}
%--------------------------------------------------------------------%
% %
% OPTIONS %
% %
%--------------------------------------------------------------------%
\DeclareOption*{\PackageWarning{progproving}{Unknown ‘\CurrentOption’}}
\ProcessOptions\relax
%--------------------------------------------------------------------%
% %
% BODY %
% %
%--------------------------------------------------------------------%
% ProgProving State
% Usage: \state{<constraints>}
% Requires Math mode
\newcommand*{\state}[1] {
\left\{
\begin{aligned}
#1
\end{aligned}
\right\}
}
% ProgProving Sequence of Instructions
% Usage: \seq{<instructions>}
% Requires Math mode
\newcommand*{\seq}[1] {
\begin{aligned}
#1
\end{aligned}
}
% ProgProving sp
% Usage: \ppsp{<instruction>}{<state>}
% Requires Math mode
\newcommand*{\ppsp}[2] {sp\left(#1,#2\right)}
% ProgProving wp
% Usage: \ppwp{<instruction>}{<state>}
% Requires Math mode
\newcommand*{\ppwp}[2] {wp\left(#1,#2\right)}
% ProgProving Precondition
% Usage: \pre
\newcommand{\pre} {P}
% ProgProving Postcondition
% Usage: \post
\newcommand{\post} {Q}
% ProgProving Invariant
% Usage: \inv
\newcommand{\inv} {I}
% ProgProving Loop Condition
% Usage: \cond
\newcommand{\cond} {B}
% ProgProving Loop Precondition
% Usage: \lpre
\newcommand{\lpre} {R}
% ProgProving Loop Postcondition
% Usage: \lpost
\newcommand{\lpost} {T}
% ProgProving Loop Initialisation
% Usage: \init
\newcommand{\init} {INIT}
% ProgProving Loop Iteration
% Usage: \iter
\newcommand{\iter} {ITER}
% ProgProving Loop Termination
% Usage: \term
\newcommand{\term} {TERM}