Skip to content

Commit 99ac018

Browse files
Adding a concept-based spec of Wyvern's lexical analyzer
1 parent f2e47db commit 99ac018

File tree

2 files changed

+513
-0
lines changed

2 files changed

+513
-0
lines changed

spec/rationale/math-cmds.sty

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
% Commands for typesetting mathematics.
2+
3+
\NeedsTeXFormat{LaTeX2e}
4+
\ProvidesPackage{math-cmds}
5+
\RequirePackage{amssymb}
6+
7+
%\newcommand{\eqdef}{\stackrel{{\rm def}}{=}}
8+
\newcommand{\eqdef}{\mathrel{\colon=}}
9+
\newcommand{\is}{\equiv}
10+
11+
% arrows of various kinds
12+
\newcommand{\pto}{\rightharpoonup} % partial function
13+
\newcommand{\fto}{\pto_{\it fin}} % finite partial function
14+
\newcommand{\inclu}{\hookrightarrow} % inclusion
15+
\newcommand{\mono}{\rightarrowtail} % monomorphism
16+
\newcommand{\epi}{\twoheadrightarrow} % epimorphism
17+
%\newcommand{\leadsto}{\rightsquigarrow} % leads to
18+
\newcommand{\iso}{\cong} % isomorphism
19+
20+
\newcommand{\id}{\mathop{\it id}\nolimits} % identity function
21+
22+
% set braces
23+
\newcommand{\set}[2]{\{\,#1\,\mid\,#2\,\}}
24+
\newcommand{\singleton}[1]{\{\,{#1}\,\}}
25+
26+
% families
27+
\newcommand{\family}[2]{\langle\,#1\,\rangle_{#2}}
28+
29+
% set operations and relations
30+
\newcommand{\cross}{\times} % cartesian doubts
31+
\newcommand{\union}{\cup}
32+
\newcommand{\intersect}{\cap}
33+
\newcommand{\subs}{\subseteq}
34+
\newcommand{\el}{\in}
35+
\newcommand{\nel}{\notin}
36+
\newcommand{\Dmn}{\mathop{\rm dom}}
37+
\newcommand{\Rng}{\mathop{\rm rng}}
38+
\newcommand{\Pow}{\mathop{\mathcal{P}}}
39+
\newcommand{\Img}{\mathop{\rm img}\nolimits}
40+
41+
% turnstiles
42+
%\newcommand{\ts}{\vdash}
43+
\newcommand{\dts}{\models}
44+
45+
% least and greatest elements
46+
\newcommand{\bottom}{\bot}
47+
%\newcommand{\top}{\top}
48+
49+
% connectives
50+
\newcommand{\fa}{\forall}
51+
\newcommand{\te}{\exists}
52+
%\newcommand{\implies}{\mathrel\supset}
53+
54+
% meaning function
55+
\newcommand{\dlb}{\lbrack\!\lbrack}
56+
\newcommand{\ldb}{\dlb}
57+
\newcommand{\drb}{\rbrack\!\rbrack}
58+
\newcommand{\rdb}{\drb}
59+
\newcommand{\mean}[1]{\mathop{\dlb #1\drb}\nolimits}
60+
61+
% sequence of #1's, numbered up to #2 (e.g., seq{x}{n} for x1 ... xn )
62+
\newcommand{\seq}[2]{#1_{1} \ldots #1_{#2}}
63+
64+
% comma--separated sequence
65+
\newcommand{\cseq}[2]{#1_{1},\ldots,#1_{#2}}
66+
67+
% free variables
68+
\newcommand{\FV}{\mathop{\rm FV}\nolimits}
69+
70+
% syntactic substitution of #1 for #2 in #3
71+
\newcommand{\subst}[3]{[#1/#2]#3}
72+
73+
% context-free grammars
74+
\newcommand{\bnfdef}{::=}
75+
%\mathrel{\colon\colon\mathord{=}}}
76+
\newcommand{\bnfalt}{\mathrel{\mid}}
77+
\newcommand{\bnfas}{\bnfdef}

0 commit comments

Comments
 (0)