## Overview of scriptable tools

This page provides an overview of the CIF tools that are available in the `cif` library that is registered with ToolDef by CIF.

### Tools

The following table shows the relation between the names of the ToolDef tools in the library and the tools of the CIF tool set:

ToolDef tool name | CIF tool
--- | ---
`cif2yed` | CIF to yEd transformer
`cifdatasynth` | Data-based supervisory controller synthesis
`cifmultilevel` | CIF multi-level splitter
`cifcontrollercheck` | Controller properties checker
`cif2supremica` | CIF to Supremica transformer
`cifsim` | CIF simulator
`cif2mcrl2` | CIF to mCRL2 transformer
`cif2uppaal` | CIF to UPPAAL transformer
`cifcodegen` | CIF code generator
`cif2plc` | CIF PLC code generator (deprecated)
`cifplcgen` | CIF PLC code generator (stable)
`cif2cif` | CIF to CIF transformer
`cifmerge` | CIF merger
`cifevtdis` | CIF event disabler
`cifexplorer` | CIF explorer
`cifprod` | Event-based synchronous product
`cifsupsynth` | Event-based supervisor synthesis
`cifsynthanalys` | Event-based synthesis analysis
`cifncchk` | Event-based nonconflicting check
`cifctrlchk` | Event-based controllability check
`ciflngeqv` | Event-based language equivalence check
`cifnfadfa` | Event-based NFA to DFA automaton conversion
`cifdfamin` | Event-based DFA minimization
`cifproj` | Event-based automaton projection
`cifobschk` | Event-based observer check
`cifabstr` | Event-based automaton abstraction
`ciftrimchk` | Event-based trim check
`ciftrim` | Event-based trim

### Parameters

For every CIF tool, two ToolDef tool variants are available in the `cif` ToolDef library. All the CIF tools in the `cif` ToolDef library have the same tool signatures, including the same parameters. Only their names differ. Below the tool signatures for the two variants are listed, with `toolname` instead of the actual tool name (e.g. `cifsim`):

    tool int toolname(
                string... args,
                string stdin = "-",
                string stdout = "-",
                string stderr = "-",
                bool appendOut = false,
                bool appendErr = false,
                bool errToOut = false,
                bool ignoreNonZeroExitCode = false
    )

    tool int toolname(
                list string args = [],
                string stdin = "-",
                string stdout = "-",
                string stderr = "-",
                bool appendOut = false,
                bool appendErr = false,
                bool errToOut = false,
                bool ignoreNonZeroExitCode = false
    )

The meaning of each of the parameters is as follows:

args

  The command line arguments of the application. Each argument string is parsed to zero or more actual arguments. It is possible to use a single string with all arguments (where the arguments themselves are separated by spaces), comma separated strings for each of the arguments (each string has one argument), or a mix of those.

  In argument strings, individual arguments are separated by whitespace (spaces, tabs, new lines, etc). The whitespace itself is ignored, and only serves as separation. To include whitespace in an argument, the argument (or a part of it), may be quoted, by putting it between double quotes (`"`) or single quotes (`'`). Characters may be escaped by prefixing them with a backslash (`\`). This is particularly useful for single/double quotes, and escape characters, and can also be used to escape spaces. Escapes work the same inside of quoted parts as they do outside of quoted parts.

stdin

  Specify whether to have a standard input (stdin) stream and where the input comes from. Use `""` to not have a stdin stream, "-" to use the stdin stream of the ToolDef interpreter, or otherwise an absolute or relative local file system path of the file from which to read the standard input. May contain both `\` and `/` as file separators.

stdout

  Specify whether to have a standard output (stdout) stream and where to write the standard output. Use `""` to not have a stdout stream, `"-"` to use the stdout stream of the ToolDef interpreter, or otherwise an absolute or relative local file system path of the file to which to write the standard output. May contain both `\` and `/` as file separators.

stderr

  Specify whether to have a standard error (stderr) stream and where to write the standard error output. Use `""` to not have a stderr stream, `"-"` to use the stderr stream of the ToolDef interpreter, or otherwise an absolute or relative local file system path of the file to which to write the standard error output. May contain both `\` and `/` as file separators. Is ignored when the standard error stream is redirected to the standard output stream.

appendOut

  Whether to append to the stdout file (`true`) or overwrite it (`false`). Is ignored when standard output is not written to a file.

appendErr

  Whether to append to the stderr file (`true`) or overwrite it (`false`). Is ignored if standard error output is not written to a file. Is also ignored when standard error stream is redirected to the standard output stream.

errToOut

  Whether to redirect the standard error stream to the standard output stream (`true`) or use separate streams (`false`).

ignoreNonZeroExitCode

  Whether to ignore non-zero exit codes (`true`) or consider them as errors (`false`).

### Return value

All the tools return an integer value. This value is the exit code of the application. A zero (`0`) exit code means the application terminated without any errors. A non-zero exit code means the application terminated with an error.

### Implementation

All the tools are internally implemented using the ToolDef `app` tool.