Show / Hide Table of Contents

Interface IModelModule

Inspection of models and a high-level interface to add constraints during solving.

Namespace: ClingoSharp.CoreServices.Interfaces.Modules
Assembly: ClingoSharp.CoreServices.dll
Syntax
public interface IModelModule : IClingoModule

Methods

| Improve this Doc View Source

AddClause(SolveControl, Literal[])

Add a clause that applies to the current solving step during model enumeration.

Declaration
bool AddClause(SolveControl control, Literal[] clause)
Parameters
Type Name Description
SolveControl control

the target

Literal[] clause

array of literals representing the clause

Returns
Type Description
System.Boolean

true if the function is success, false otherwise

Remarks

The Theory Propagation module provides a more sophisticated interface to add clauses - even on partial assignments.

| Improve this Doc View Source

Contains(Model, Symbol, out Boolean)

Constant time lookup to test whether an atom is in a model.

Declaration
bool Contains(Model model, Symbol atom, out bool contained)
Parameters
Type Name Description
Model model

a model object

Symbol atom

the atom to lookup

System.Boolean contained

whether the atom is contained

Returns
Type Description
System.Boolean

true if the function is success, false otherwise

| Improve this Doc View Source

Extends(Model, Symbol[])

Add symbols to the model.

Declaration
bool Extends(Model model, Symbol[] atoms)
Parameters
Type Name Description
Model model

a model object

Symbol[] atoms

the symbols to add

Returns
Type Description
System.Boolean

true if the function is success, false otherwise

| Improve this Doc View Source

GetContext(Model, out SolveControl)

Get the associated solve control object of a model. This object allows for adding clauses during model enumeration.

Declaration
bool GetContext(Model model, out SolveControl context)
Parameters
Type Name Description
Model model

a model object

SolveControl context

the resulting solve control object

Returns
Type Description
System.Boolean

true if the function is success, false otherwise

| Improve this Doc View Source

GetCosts(Model, out Int64[])

Get the cost vector of a model

Declaration
bool GetCosts(Model model, out long[] costs)
Parameters
Type Name Description
Model model

a model object

System.Int64[] costs

the resulting costs

Returns
Type Description
System.Boolean

true if the function is success, false otherwise

| Improve this Doc View Source

GetNumber(Model, out UInt64)

Get the running number of the model.

Declaration
bool GetNumber(Model model, out ulong number)
Parameters
Type Name Description
Model model

a model object

System.UInt64 number

the number of the model

Returns
Type Description
System.Boolean

true if the function is success, false otherwise

| Improve this Doc View Source

GetSymbolicAtoms(SolveControl, out SymbolicAtoms)

Get an object to inspect the symbolic atoms.

Declaration
bool GetSymbolicAtoms(SolveControl control, out SymbolicAtoms atoms)
Parameters
Type Name Description
SolveControl control

the target

SymbolicAtoms atoms

the resulting object

Returns
Type Description
System.Boolean

true if the function is success, false otherwise

| Improve this Doc View Source

GetSymbols(Model, ShowType, out Symbol[])

Get the symbols of the selected types in the model.

Declaration
bool GetSymbols(Model model, ShowType showType, out Symbol[] symbols)
Parameters
Type Name Description
Model model

a model object

ShowType showType

which symbols to select

Symbol[] symbols

the resulting symbols

Returns
Type Description
System.Boolean

true if the function is success, false otherwise

Remarks

CSP assignments are represented using functions with name $ where the first argument is the name of the CSP variable and the second one its value.

| Improve this Doc View Source

GetThreadId(Model, out Id)

Get the id of the solver thread that found the model.

Declaration
bool GetThreadId(Model model, out Id id)
Parameters
Type Name Description
Model model

a model object

Id id

the resulting thread id

Returns
Type Description
System.Boolean

true if the function is success, false otherwise

| Improve this Doc View Source

GetType(Model, out ModelType)

Get the type of the model.

Declaration
bool GetType(Model model, out ModelType type)
Parameters
Type Name Description
Model model

a model object

ModelType type

the type of the model

Returns
Type Description
System.Boolean

true if the function is success, false otherwise

| Improve this Doc View Source

IsOptimalityProven(Model, out Boolean)

Whether the optimality of a model has been proven.

Declaration
bool IsOptimalityProven(Model model, out bool proven)
Parameters
Type Name Description
Model model

a model object

System.Boolean proven

whether the optimality has been proven

Returns
Type Description
System.Boolean

true if the function is success, false otherwise

| Improve this Doc View Source

IsTrue(Model, Literal, out Boolean)

Check if a program literal is true in a model.

Declaration
bool IsTrue(Model model, Literal literal, out bool result)
Parameters
Type Name Description
Model model

a model object

Literal literal

the literal to lookup

System.Boolean result

whether the literal is true

Returns
Type Description
System.Boolean

true if the function is success, false otherwise

  • Improve this Doc
  • View Source
Back to top Generated by DocFX