Skip to content

Helpers

The engines' license

license

The license intrepid's engines run under.

The engines (BMC and k-induction, backward reachability, PDR) need a valid license; building circuits, simulating them, exporting them do not. intrepid looks for the license in this order:

  1. the one given with :func:set_license or :func:set_license_file;
  2. the INTREPID_LICENSE environment variable: the path of the license's file, or its JSON itself;
  3. ~/.intrepid/license.json (%APPDATA%\intrepid\license.json on Windows);
  4. license.json next to the intrepid library: the wheels of intrepyd on PyPI carry there a noncommercial license, valid for a year from the release, for the noncommercial use the license of intrepyd allows (see LICENSE.md). A commercial use needs a commercial license, given in one of the ways above.

One given with :func:set_license or :func:set_license_file is the one used. Otherwise the first valid one is, and those before it are passed over (skipped in :func:license_info): a license for another build of intrepid, or one expired, does not hide the wheel's.

Without a valid license, making an engine raises RuntimeError saying why: no license found (and where it was looked for), a signature that is not valid, a license that expired, or one that does not cover this release of intrepid.

set_license

set_license(text)

Run the engines under this license, given as its JSON text. It is also put in INTREPID_LICENSE, so that the processes the portfolio starts run under it too. Raises RuntimeError if it is not valid.

set_license_file

set_license_file(path)

As :func:set_license, with the license read from a file.

require_license

require_license()

Raises RuntimeError, saying why, if the engines have no valid license (nothing for an intrepid library that needs none).

license_info

license_info()

The license the engines run under: its fields (but its signature), valid, error when it is not valid or none was found, source (where it was found), skipped (those passed over before it, each with its source and error, when there are any), key and release (the key this intrepid checks licenses with, and its release date). None for an intrepid library older than 1.7, which needs no license.

SCR requirements

mk_scr

mk_scr(ctx, name, inputs, past_inputs, modes, past_mode)

Makes an SCR requirement

Pseudo-boolean constraints

pseudoboolean

Routines for pseudo-boolean functions

mk_at_least_one

mk_at_least_one(ctx, nets)

Computes "at least one net is true"

Args: ctx: the context to use nets: the nets to use

mk_at_most_one

mk_at_most_one(ctx, nets)

Computes "at most one net is true"

Args: ctx: the context to use nets: the nets to use

mk_exactly_one

mk_exactly_one(ctx, nets, name)

Computes the pseudo-boolean constraint "exactly one is true". Uses the "commander variable" encoding described in "Efficient CNF Encoding for Selecting 1 from N Objects" by Will Klieber and Gihwon Kwon.

Args: ctx: the context to use nets: the list of (Boolean) nets

Returns: a net expressing the constraint "exactly one is true"

Plotting

plots

Implementation of plotting services for traces

plot_trace_dictionary

plot_trace_dictionary(net_dict, only_key=None, height=5)

Draws one step plot per each signal in the trace.

Args: net_dict (Dictionary): the dictionary of the trace, as Trace.get_as_net_dictionary gives it: name -> [value@0, ...] only_key: the names to draw, all of them by default height: the height of the figure