File assert.hh

Assertion utilities for Mata.

This file provides macros for assertions with helpful error messages.

Defines

MATA_ASSERT(cond, ...)

Assert that a condition is true, and if not, print an error message and abort the program.

Usage:

MATA_ASSERT(state < num_states, "state={}, num_states={}", state, num_states);
MATA_ASSERT(state < num_states);
In release builds (when NDEBUG is defined), the assertions are disabled and have no effect.

Parameters:
  • cond – The condition to assert.

  • ... – Optional format string and arguments for the error message.

namespace mata

Main namespace including structs and algorithms for all automata.

In particular, this includes:

  1. Alphabets,

  2. Formula graphs and nodes,

  3. Mintermization,

  4. Closed sets.

namespace internal

Functions

inline void assert_fail(const char *expr, const char *file, int line, const char *func, const std::string &msg)