metaSMT git
Classes | Namespaces | Typedefs | Functions

Assertion Groups API

API

assertion groups. More...

Classes

struct  metaSMT::Group_Context< Solver >

Namespaces

namespace  metaSMT::features

Typedefs

typedef unsigned metaSMT::guard_type

Functions

template<typename Context >
guard_type metaSMT::create_group (Context &ctx)
 create a new constraint group
template<typename Context >
void metaSMT::delete_group (Context &ctx, guard_type guard)
 delete a constraint group
template<typename Context >
void metaSMT::change_group (Context &ctx, guard_type guard)
 change the current constraint group
template<typename Context >
guard_type metaSMT::current_group (Context &ctx)
 get the current group guard

Detailed Description

assertion groups.

An API that allows grouping of constraints. groups can be freely created and destroyed. The assertions and assumptions are automatically added to the currently selected group. Changing group is possible at any time.

Groups are created by adding a guard variable (implication) to each expression.

  // enable Group API for ctx
  DirectSolver_Context< Group_Context<Context> > ctx;
  guard_type main = current_group(ctx);

  // create and select a group
  guard_type g1 = create_group(ctx);
  // add assertions and solve
  assertion( equal(True, False);
  solve(ctx);

  // UNSAT, remove the Group
  change_group(ctx, main);
  delete_group(ctx, g1);

Note that the current group can not be deleted because the current group would be undefined or non-deterministic.


Typedef Documentation

typedef unsigned metaSMT::guard_type

Definition at line 21 of file Group_Context.hpp.


Function Documentation

template<typename Context >
void metaSMT::change_group ( Context &  ctx,
guard_type  guard 
)

change the current constraint group

Parameters:
ctxThe context to work on
guardThe group to change to
Returns:
void

Definition at line 211 of file Group_Context.hpp.

template<typename Context >
guard_type metaSMT::create_group ( Context &  ctx)

create a new constraint group

Parameters:
ctxThe context to work on
Returns:
a handle that identifies the group

Definition at line 175 of file Group_Context.hpp.

template<typename Context >
guard_type metaSMT::current_group ( Context &  ctx)

get the current group guard

Parameters:
ctxThe context to work on
Returns:
The handle for the current constraint group

Definition at line 226 of file Group_Context.hpp.

template<typename Context >
void metaSMT::delete_group ( Context &  ctx,
guard_type  guard 
)

delete a constraint group

Parameters:
ctxThe context to work on
guardThe group to delete
Returns:
void

Behaviour is undefined if the current group is deleted. Call change_group before deleting the current group.

Definition at line 194 of file Group_Context.hpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines