fadoss / maude-bindings

Language bindings for Maude

Home Page:https://fadoss.github.io/maude-bindings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Language bindings for Maude

Language bindings for the Maude specification language using SWIG. They make use of a modified version of Maude extended with a model checker for system controlled by strategies, which is also accessible through the bindings.

The Python package is available at PyPI. After installing it using pip install maude, it can be directly used since Maude is embedded in the package:

import maude
maude.init()
nat = maude.getModule('NAT')
t = nat.parseTerm('1 + 2')
t.reduce()
print(t)

Bindings for other languages supported by SWIG can be built from this repository, but they have not been given specific support and testing. Specific instructions for some of them are available here.

Building

This repository includes the extended version of Maude as a submodule, which has to be cloned first with git submodule update --init or an equivalent Git command. To build the Python package, scikit-build is used:

python setup.py bdist_wheel

This will cause Maude to be built in the subprojects directory, for which the Meson build system, Ninja, and various external libraries and tools are required, as described in its repository. Alternatively, compiled versions of Maude as a library can be downloaded from its releases section and placed in their expected locations:

  • subprojects/maudesmc/installdir/lib for the libraries, and
  • subprojects/maudesmc/build for the config.h header file.

In this case or when building Maude directly from its subdirectory, -- -DBUILD_LIBMAUDE=OFF should be added to the previous command.

Bindings for other languages can also be build using CMake directly, where srcdir is the directory where the repository has been cloned, and language is one of the languages supported by SWIG:

cmake <srcdir> -DLANGUAGE=<language>
cmake --build .

For some language targets this will be enough, but additional steps could be expected for others.

Documentation

Documentation for the Python package is available here, which can be largely extrapolated to other target languages. Javadoc-generated documentation is also available. In addition to these, the examples in the repository can be used as a reference for various topics:

  • Loading files, parsing terms, reducing, rewriting, rewriting with strategies, and searching in test.py.
  • Matching in match.py.
  • Applying rules selectively in apply.py.
  • Unification in unify.py.
  • Manipulating the rewrite graph in graph.py.
  • Model checking in modelcheck.py.
  • Narrowing in vunarrow.py.
  • Variant generation in variants.py.
  • Iterating over the arguments of a term in gui.py.
  • Building terms from symbols in buildTerm.py.
  • Inspecting modules in maudedoc.py.
  • Loading files and input raw text in loading.py.
  • Metalevel manipulations in metalevel.py.
  • Custom special operators in hooks.py.

Moreover, a tutorial on the library is available in the article Maude as a library: an efficient all-purpose programming interface, along with a description of its design and implementation.

About

Language bindings for Maude

https://fadoss.github.io/maude-bindings

License:GNU General Public License v2.0


Languages

Language:SWIG 41.8%Language:C++ 29.5%Language:Python 19.5%Language:CMake 3.1%Language:Shell 1.9%Language:Java 1.6%Language:PowerShell 1.4%Language:JavaScript 1.2%