-
Notifications
You must be signed in to change notification settings - Fork 0
/
buzzproof.sty
131 lines (123 loc) · 2.72 KB
/
buzzproof.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
%
% Commands for presenting natural deduction proofs similar to
% way found in COMP1120 at UoM
%
% Joss Moffatt 2021
%
\usepackage{amsmath,environ}
%
% Functions relevant to Natural Deduction Systems
%
%
% Base Function used as a base rule for rules with no premises
%
\newcommand{\baseRuleWithNoPremises}[3]{
\incLineCtrAndShow)&& #1 &\vdash #2 && #3\\
}
%
% Base Function for rules with premises
%
\newcommand{\baseRuleWithPremises}[4]{
\incLineCtrAndShow)&& #1 &\vdash #2 && #3,\;#4\\
}
%
% Wrapper function for rules that are classed as introduction rules
%
\newcommand{\introductionRule}[4]{
\baseRuleWithPremises{#1}{#2}{#3}{I_{#4}}
}
%
% Wrapper function for rules that are classed as elimination rules
%
\newcommand{\eliminationRule}[4]{
\baseRuleWithPremises{#1}{#2}{#3}{E_{#4}}
}
%
% Wrapper function for the axiom rule
%
\newcommand{\axiom}[2]{
\baseRuleWithNoPremises{#1}{#2}{\text{Axiom}}
}
%
% Wrapper function for the weakening rule
%
\newcommand{\weakening}[3]{
\baseRuleWithPremises{#1}{#2}{#3}{\text{Weakening}}
}
%
% Wrapper function for the conjunction introduction rule
%
\newcommand{\conjunctionintro}[3]{
\introductionRule{#1}{#2}{#3}{\land}
}
%
% Wrapper function for the disjunction introduction rule
%
\newcommand{\disjunctionintro}[3]{
\introductionRule{#1}{#2}{#3}{\lor}
}
%
% Wrapper function for the implication introduction rule
%
\newcommand{\implicationintro}[3]{
\introductionRule{#1}{#2}{#3}{\rightarrow}
}
%
% Wrapper function for the negation introduction rule
%
\newcommand{\negationintro}[3]{
\introductionRule{#1}{#2}{#3}{\neg}
}
%
% Wrapper function for the double negation introduction rule
%
\newcommand{\doublenegationintro}[3]{
\introductionRule{#1}{#2}{#3}{\neg\neg}
}
%
% Wrapper function for the conjunction elimination rule
%
\newcommand{\conjunctionelim}[3]{
\eliminationRule{#1}{#2}{#3}{\land}
}
%
% Wrapper function for the disjunction elimination rule
%
\newcommand{\disjunctionelim}[3]{
\eliminationRule{#1}{#2}{#3}{\lor}
}
%
% Wrapper function for the implication elimination rule
%
\newcommand{\implicationelim}[3]{
\eliminationRule{#1}{#2}{#3}{\rightarrow}
}
%
% Wrapper function for the negation elimination rule
%
\newcommand{\negationelim}[3]{
\eliminationRule{#1}{#2}{#3}{\neg}
}
%
% Wrapper function for the double negation elimination rule
%
\newcommand{\doublenegationelim}[3]{
\eliminationRule{#1}{#2}{#3}{\neg\neg}
}
%
% Counter to automatically track lines in the enviroment
%
\newcounter{linectr}
\NewEnviron{linearproof}{%
\setcounter{linectr}{0}%
\begin{align*}
\BODY
\end{align*}
}
%
% Function to update line number and display it
%
\newcommand*\incLineCtrAndShow{%
\refstepcounter{linectr}%
\arabic{linectr}%
}