Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Z specifications in LaTeX

Is there any package for LaTeX which will support writing Z specifications? I am interested in both horizontal and vertical formats for schemas.

like image 528
Gabriel Ščerbák Avatar asked Jun 19 '10 19:06

Gabriel Ščerbák


3 Answers

There is a package, it is called zed-csp. Here's a reference on how to use it.

Here's an example schema:

\begin{schema}{InitJunction1}
\Delta Sys\\
junc?: JUNCTION\\
road1?: ROAD\\
road2?: ROAD
\where
road1? \neq road2?\\
junc? \notin juncList\\
\forall j: juncList @ \neg ((road1? \in roadsInJunc(j)) \land (road2? \in roadsInJunc(j))\\
roadsInJunc' = roadsInJunc \cup \{junc? \mapsto \{road1,road2\}\}\\
juncList' = juncList \cup \{junc?\}
\end{schema}

See my question and answer on the subject: Zed Notation in LyX

like image 145
Amir Rachum Avatar answered Nov 18 '22 22:11

Amir Rachum


There are quite a few packages which offer support for writing Z specification in LaTeX. Although many have very similar syntax and some offer extra functions.

  • Cadiz.sty: https://www.cs.york.ac.uk/hise/cadiz/latexmarkuptut.html
  • oz.sty: https://www.ctan.org/tex-archive/macros/latex/contrib/objectz?lang=en
  • fuzz.sty: https://www.cs.cmu.edu/afs/cs/academic/class/15671-f95/ftp/fuzz.sty
  • zed.sty: http://tug.ctan.org/macros/latex209/contrib/zed/zed.sty
  • zeves.sty: http://www.informatik.uni-bremen.de/agbkb/lehre/ss12/foma/Z/z-eves.sty
  • zed-csp.sty: http://ctan.mackichan.com/macros/latex/contrib/zed-csp/zed-csp.sty

More information on these packages can be found here: http://czt.sourceforge.net/latex/

It explains that was the fuzz.sty was the first and contains important macros yet is not compatible with ISO-Z Standard, zed.sty and zed-csp.sty were an Oxford version that improved on fuzz.sty etc

like image 39
lburski Avatar answered Nov 18 '22 20:11

lburski


This is what my Software Engineering Professor used for the LaTeX-formatting when creating the Z-Schemas and Operations:

\usepackage{oz, amsfonts}
...
\begin{schema}{MusicStore}
member: \pset NAME\\
orders: \pset (NAME\times ALBUM)\\
owns: \pset (NAME\times ALBUM)
\ST
{\bf dom}\mbox{ } orders \subseteq member\\
{\bf dom}\mbox{ } owns \subseteq member\\
\forall (m, a)\in orders.(m, a)\notin owns
\end{schema}

I hope it's helpful.

like image 1
Dimitar Avatar answered Nov 18 '22 22:11

Dimitar