Spin Model Checker

1. Installation

What follows are copy-pasteable commands to make spin and ispin valid commands. To copy and paste: highlight the commands, middle click in a terminal, and hit enter so the last command is executed too.

Download, build, and set up spin, do the following. (Change pkg=spin645.tar.gz to reflect the current version number.)

mkdir -p "$HOME/bin"
mkdir -p "/tmp/ccspin-$USER"
cd "/tmp/ccspin-$USER"
wget http://spinroot.com/spin/Src/$pkg
tar xf $pkg
cd Spin/Src*
cp -f spin "$HOME/bin/spin"
cp -f ../iSpin/ispin.tcl "$HOME/bin/ispin"
cd "$HOME/bin"
rm -r "/tmp/ccspin-$USER"
chmod +x spin ispin
mkdir -p spinshare
curl 'https://raw.githubusercontent.com/grencez/protocon/master/s/{spinsafe,spinlive,spinltl,spinplay,spinshare/spinclude.sh}' -o '#1'
chmod +x spinsafe spinlive spinltl spinplay

2. Path Setup

Finally, you might need to set up your path to include ~/bin/. Run the following:

echo "${PATH}" | grep -o -e "$HOME/bin" | sed -e 's/^.*$/All is well!/'

If it prints All is well!, then your installation is finished. Otherwise, continue reading.

If you use the bash shell run the following:

echo 'export PATH=$HOME/bin:$PATH' >> $HOME/.bashrc

If you use the tcsh shell or don't know (it's the default shell at Michigan Tech), run the following:

echo 'setenv PATH "${HOME}/bin:${PATH}"' >> $HOME/.cshrc

The changes may not take effect unless you log out and log in again. But after that, the commands spin, ispin, spinsafe, spinlive, and spinltl should work!

3. Vim Settings

If you use Vim, the following will set up indentation and syntax.

mkdir -p ~/.vim
cd ~/.vim
mkdir -p indent syntax
wget cs.mtu.edu/~apklinkh/drop/vim-promela.tar.gz
tar xf vim-promela.tar.gz
rm vim-promela.tar.gz
cp -t indent vim-promela/indent/promela.vim
cp -t syntax vim-promela/syntax/promela.vim
rm -r vim-promela
echo 'autocmd BufNewFile,BufRead *.pml set ft=promela sw=2 ts=2' >> filetype.vim

If you don't have a ~/.vimrc already, this will make it:

cd "$HOME"
echo 'set nocompatible' >> .vimrc
echo 'filetype on' >> .vimrc
echo 'filetype plugin indent on' >> .vimrc
echo 'syntax enable' >> .vimrc

If you have no idea what's going on with this editor: