Emacs package for writing VDM specifications using VDM-SL, VDM++ and VDM-RT.
vdm-mode currently supports the following features:
- Syntax highlighting and editing
- Replacement of ASCII syntax (e.g.
lambda) with more aesthetically looking symbols (e.g.
- On the fly syntax checking using Flycheck
- VDM YASnippets
Installation and configuration
The features described above are packaged separately as
flycheck-vdm. The last two packages are optional
but necessary to use the VDM snippets and enable syntax checking.
Installation using MELPA (recommended)
All three packages are available via MELPA and can be installed by executing the following commands:
package-install RET vdm-mode RET package-install RET flycheck-vdm RET package-install RET vdm-snippets RET
Finally, add the following to your Emacs configuration:
(require 'vdm-mode) (setq flycheck-vdm-tool-jar-path "/path/to/vdm-tool-jar") (vdm-mode-setup)
Download the files from this repository and add the following to your Emacs configuration:
(add-to-list 'load-path "/folder/where/vdm-mode/is/") (require 'vdm-mode) (setq flycheck-vdm-tool-jar-path "/path/to/vdm-tool-jar") (vdm-mode-setup)
Recognised file extensions
The following file extensions are recognised as VDM files:
vdm-mode offers several VDM YASnippets to improve the editing
yas-insert-snippet is a useful way to obtain an
overview of the different snippets currently offered by
vdm-mode only performs syntax checking of the current
buffer. However, for large models,
vdm-mode uses a special file
.vdm-project to group files into VDM projects or multi-file
models. As an example, consider the VDM project structure below, which
lists three VDM files.
project-root-folder | +-- .vdm-project +-- A.vdmsl +-- B.vdmsl +-- sub-folder +-- C.vdmsl
Every time syntax checking is triggered
vdm-mode locates the root of
the project (if it exists) and recursively finds all VDM files
associated with that project. These files are then passed as
arguments to the underlying VDM tool, which performs the syntax
check. A VDM project may be created using the
Below is a list of features that I’m considering adding to
- Interpreter integration (model execution)
- VDM libraries import
- Jump to definition
If you have any ideas for how to improve
vdm-mode feel free to
create an issue or submit a pull request.