2018-11-13 09:54:04 +03:00
|
|
|
\documentclass{article}
|
|
|
|
|
|
|
|
|
|
\usepackage{amssymb, amsmath}
|
|
|
|
|
\usepackage{alltt}
|
|
|
|
|
\usepackage{pslatex}
|
|
|
|
|
\usepackage{epigraph}
|
|
|
|
|
\usepackage{verbatim}
|
|
|
|
|
\usepackage{latexsym}
|
|
|
|
|
\usepackage{array}
|
|
|
|
|
\usepackage{comment}
|
|
|
|
|
\usepackage{makeidx}
|
|
|
|
|
\usepackage{listings}
|
|
|
|
|
\usepackage{indentfirst}
|
|
|
|
|
\usepackage{verbatim}
|
|
|
|
|
\usepackage{color}
|
|
|
|
|
\usepackage{url}
|
|
|
|
|
\usepackage{xspace}
|
|
|
|
|
\usepackage{hyperref}
|
|
|
|
|
\usepackage{stmaryrd}
|
|
|
|
|
\usepackage{amsmath, amsthm, amssymb}
|
|
|
|
|
\usepackage{graphicx}
|
|
|
|
|
\usepackage{euscript}
|
|
|
|
|
\usepackage{mathtools}
|
|
|
|
|
\usepackage{mathrsfs}
|
|
|
|
|
\usepackage{multirow,bigdelim}
|
|
|
|
|
\usepackage{subcaption}
|
|
|
|
|
\usepackage{placeins}
|
2019-11-24 02:30:32 +03:00
|
|
|
\usepackage{xspace}
|
2018-11-13 09:54:04 +03:00
|
|
|
|
|
|
|
|
\makeatletter
|
|
|
|
|
|
|
|
|
|
\makeatother
|
|
|
|
|
|
|
|
|
|
\definecolor{shadecolor}{gray}{1.00}
|
|
|
|
|
\definecolor{darkgray}{gray}{0.30}
|
|
|
|
|
|
|
|
|
|
\def\transarrow{\xrightarrow}
|
|
|
|
|
\newcommand{\setarrow}[1]{\def\transarrow{#1}}
|
|
|
|
|
|
|
|
|
|
\def\padding{\phantom{X}}
|
|
|
|
|
\newcommand{\setpadding}[1]{\def\padding{#1}}
|
|
|
|
|
|
|
|
|
|
\def\subarrow{}
|
|
|
|
|
\newcommand{\setsubarrow}[1]{\def\subarrow{#1}}
|
|
|
|
|
|
|
|
|
|
\newcommand{\trule}[2]{\frac{#1}{#2}}
|
|
|
|
|
\newcommand{\crule}[3]{\frac{#1}{#2},\;{#3}}
|
|
|
|
|
\newcommand{\withenv}[2]{{#1}\vdash{#2}}
|
2018-11-19 00:20:43 +03:00
|
|
|
\newcommand{\trans}[3]{{#1}\transarrow{\padding{\textstyle #2}\padding}\subarrow{#3}}
|
2018-11-13 09:54:04 +03:00
|
|
|
\newcommand{\ctrans}[4]{{#1}\transarrow{\padding#2\padding}\subarrow{#3},\;{#4}}
|
|
|
|
|
\newcommand{\llang}[1]{\mbox{\lstinline[mathescape]|#1|}}
|
|
|
|
|
\newcommand{\pair}[2]{\inbr{{#1}\mid{#2}}}
|
|
|
|
|
\newcommand{\inbr}[1]{\left<{#1}\right>}
|
|
|
|
|
\newcommand{\highlight}[1]{\color{red}{#1}}
|
|
|
|
|
\newcommand{\ruleno}[1]{\eqno[\scriptsize\textsc{#1}]}
|
|
|
|
|
\newcommand{\rulename}[1]{\textsc{#1}}
|
|
|
|
|
\newcommand{\inmath}[1]{\mbox{$#1$}}
|
|
|
|
|
\newcommand{\lfp}[1]{fix_{#1}}
|
|
|
|
|
\newcommand{\gfp}[1]{Fix_{#1}}
|
|
|
|
|
\newcommand{\vsep}{\vspace{-2mm}}
|
|
|
|
|
\newcommand{\supp}[1]{\scriptsize{#1}}
|
|
|
|
|
\newcommand{\sembr}[1]{\llbracket{#1}\rrbracket}
|
|
|
|
|
\newcommand{\cd}[1]{\texttt{#1}}
|
|
|
|
|
\newcommand{\free}[1]{\boxed{#1}}
|
|
|
|
|
\newcommand{\binds}{\;\mapsto\;}
|
|
|
|
|
\newcommand{\dbi}[1]{\mbox{\bf{#1}}}
|
|
|
|
|
\newcommand{\sv}[1]{\mbox{\textbf{#1}}}
|
|
|
|
|
\newcommand{\bnd}[2]{{#1}\mkern-9mu\binds\mkern-9mu{#2}}
|
|
|
|
|
\newtheorem{lemma}{Lemma}
|
|
|
|
|
\newtheorem{theorem}{Theorem}
|
|
|
|
|
\newcommand{\meta}[1]{{\mathcal{#1}}}
|
|
|
|
|
\renewcommand{\emptyset}{\varnothing}
|
|
|
|
|
\newcommand{\dom}[1]{\mathtt{dom}\;{#1}}
|
2018-11-19 00:20:43 +03:00
|
|
|
\newcommand{\primi}[2]{\mathbf{#1}\;{#2}}
|
2020-01-20 07:41:43 +03:00
|
|
|
\newcommand{\lama}{$\lambda\mbox{\textsc{Algol}}$\xspace}
|
|
|
|
|
%\newcommand{\sial}{S\textit{\lower -.5ex\hbox{I}\kern -.1667em\lower .5ex\hbox {A}}\kern -.125emL\@\xspace}
|
2018-11-13 09:54:04 +03:00
|
|
|
\definecolor{light-gray}{gray}{0.90}
|
|
|
|
|
\newcommand{\graybox}[1]{\colorbox{light-gray}{#1}}
|
|
|
|
|
|
2020-01-20 07:41:43 +03:00
|
|
|
\lstdefinelanguage{lama}{
|
2019-11-24 02:30:32 +03:00
|
|
|
keywords={fun, case, esac, do, od, if, then, else, elif, fi, skip, repeat, until, for, local},
|
2018-11-13 09:54:04 +03:00
|
|
|
sensitive=true,
|
|
|
|
|
%basicstyle=\small,
|
|
|
|
|
commentstyle=\scriptsize\rmfamily,
|
|
|
|
|
keywordstyle=\ttfamily\bfseries,
|
|
|
|
|
identifierstyle=\ttfamily,
|
|
|
|
|
basewidth={0.5em,0.5em},
|
|
|
|
|
columns=fixed,
|
|
|
|
|
fontadjust=true,
|
2019-11-24 02:30:32 +03:00
|
|
|
literate={->}{{$\to$}}3,
|
2018-11-13 09:54:04 +03:00
|
|
|
morecomment=[s]{(*}{*)}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
\lstset{
|
|
|
|
|
mathescape=true,
|
|
|
|
|
%basicstyle=\small,
|
|
|
|
|
identifierstyle=\ttfamily,
|
|
|
|
|
keywordstyle=\bfseries,
|
|
|
|
|
commentstyle=\scriptsize\rmfamily,
|
|
|
|
|
basewidth={0.5em,0.5em},
|
|
|
|
|
fontadjust=true,
|
|
|
|
|
escapechar=!,
|
2020-01-20 07:41:43 +03:00
|
|
|
language=lama
|
2018-11-13 09:54:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
\sloppy
|
|
|
|
|
|
2020-01-20 07:41:43 +03:00
|
|
|
\title{\lama Language Definition}
|
2018-11-13 09:54:04 +03:00
|
|
|
|
|
|
|
|
\author{Dmitry Boulytchev}
|
|
|
|
|
|
|
|
|
|
\begin{document}
|
|
|
|
|
|
|
|
|
|
\maketitle
|
|
|
|
|
|
2019-11-24 02:30:32 +03:00
|
|
|
\input{01.general_characteristic}
|
|
|
|
|
\input{02.notation}
|
|
|
|
|
\input{03.values}
|
2018-11-13 09:54:04 +03:00
|
|
|
|
|
|
|
|
\end{document}
|