Running SpaceEx from the terminal

The necessary steps are as follows.

Set up Virtual Machine

(Non-Windows users should proceed to the next step).

Note that it is not possible to directly run the executable file in Windows. The executables are created for Linux and macOS. It might be possible with cygwin but not advised. On the contrary, the recommended way would be to create a new Virtual Machine and install Linux (also possible with macOS).

  • Download OS. The first step is to download a 32- or 64-bit Linux distribution (e.g. Ubuntu or Debian. We recommend the 64-bit version as it supports the latest SpaceEx version.

  • Download VM. There are several options, notably Oracle VirtualBox (1st option for Windows host) or VMmare Player. Our recommendation would be the former.

  • Set up new VM. Once the VM application is downloaded, a new VM should be created and set up. For VirtualBox, simply open the application, navigate to option New (on top-left), select Linux and version (e.g. 64-debian), memory size (over 2 GB is typically enough), Create a virtual machine now, VDI, dynamically allocated and size over 8GB.
  • Install OS. Now, a new virtual machine should be created (appears on the left) and you shall select start. The option Select Start-up disk pops up and you should add the location of the downloaded ISO file (64-bit Linux). Now, it is possible to install Linux. There will be several questions similar to a Windows installation.
  • Set up Linux. There are numerous tutorials on the basic Linux commands. The necessary actions to setup your Linux for SpaceEx use follow.

    • Open terminal (Ubuntu: press Dash, Debian: press Activities, and then search for Terminal).
    • Gain root access by $ su
      ($ is used for clarity, it should not be added in the terminal) and insert your password.

    • $ apt-get install sudo

    • $ sudo apt-get install build-essential
    • $ sudo apt-get update

Download SpaceEx

Depending on the OS you have downloaded, select the corresponding executable file from SpaceEx website. That is SpaceEx command line executable v0.9.8f for 64 bit Linux or SpaceEx command line executable v0.9.8e (64 bit Mac OS X).

Run SpaceEx

  • use command cd to change directory (to the folder you saved the spaceex files). For example, $ cd /home/user/Downloads/spaceex_exe. If you cannot cd with root privilege, press exit (to leave root) and then write the aforementioned command.

  • until you get familiar with paths and directories, save your xml and cfg files in /home/user/Downloads/spaceex_exe

  • now, you are ready to run spaceex by writing in the terminal: ./spaceex -g config.cfg -m model.xml -o output

  • Spaceex will run, show the steps on the terminal screen and save the results in the output file. The results could be numbers (representing the vertices of the reachable sets) or text. More information can be found at the FAQ.

SpaceEx Options

  • All the options can be found by writing the command $ ./spaceex --help on the terminal.

  • Plotting; there are different ways to plot the reachable sets. For MATLAB users, it is possible to save the 2D results in GEN format and use the Matlab script for visualization (i.e. plot_2d_vertices).

  • To obtain the flattened/composed hybrid automaton in XML format, you can add the argument --output-system-file new_name