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:
- the one given with :func:
set_licenseor :func:set_license_file; - the
INTREPID_LICENSEenvironment variable: the path of the license's file, or its JSON itself; ~/.intrepid/license.json(%APPDATA%\intrepid\license.jsonon Windows);license.jsonnext 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 ¶
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.
require_license ¶
Raises RuntimeError, saying why, if the engines have no valid license (nothing for an intrepid library that needs none).
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¶
Pseudo-boolean constraints¶
pseudoboolean ¶
Routines for pseudo-boolean functions
mk_at_least_one ¶
Computes "at least one net is true"
Args: ctx: the context to use nets: the nets to use
mk_at_most_one ¶
Computes "at most one net is true"
Args: ctx: the context to use nets: the nets to use
mk_exactly_one ¶
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 ¶
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