| |
- object
-
- Assignment
- Backend
- Configuration
- Control
- Model
- ProgramBuilder
- PropagateControl
- PropagateInit
- SolveControl
- SolveFuture
- SolveIter
- SolveResult
- Symbol
- SymbolType
- SymbolicAtom
- SymbolicAtomIter
- SymbolicAtoms
- TheoryAtom
- TheoryAtomIter
- TheoryElement
- TheoryTerm
- TheoryTermType
class Assignment(object) |
|
Object to inspect the (parital) assignment of an associated solver.
Assigns truth values to solver literals. Each solver literal is either true,
false, or undefined, represented by the python constants True, False, or None,
respectively. |
|
Methods defined here:
- decision(...)
- decision(self, level) -> int
Return the decision literal of the given level.
- has_literal(...)
- has_literal(self, lit) -> bool
Determine if the literal is valid in this solver.
- is_false(...)
- is_false(self, lit) -> bool
Determine if the literal is false.
- is_fixed(...)
- is_fixed(self, lit) -> bool
Determine if the literal is assigned on the top level.
- is_true(...)
- is_true(self, lit) -> bool
Determine if the literal is true.
- level(...)
- level(self, lit) -> int
The decision level of the given literal.
Note that the returned value is only meaningful if the literal is assigned -
i.e., value(lit) is not None.
- value(...)
- value(self, lit) -> bool or None
The truth value of the given literal or None if it has none.
Data descriptors defined here:
- decision_level
- The current decision level.
- has_conflict
- True if the current assignment is conflicting.
|
class Backend(object) |
|
Backend object providing a low level interface to extend a logic program."
This class provides an interface that allows for adding statements in ASPIF
format. |
|
Methods defined here:
- add_atom(...)
- add_atom(self) -> Int
Return a fresh program atom.
- add_rule(...)
- add_rule(self, head, body, choice) -> None
Add a disjuntive or choice rule to the program.
Arguments:
head -- list of program atoms
Keyword Arguments:
body -- list of program literals (Default: [])
choice -- whether to add a disjunctive or choice rule (Default: False)
Integrity constraints and normal rules can be added by using an empty or
singleton head list, respectively.
- add_weight_rule(...)
- add_weight_rule(self, head, lower, body, choice) -> None
Add a disjuntive or choice rule with one weight constraint with a lower bound
in the body to the program.
Arguments:
head -- list of program atoms
lower -- integer for the lower bound
body -- list of pairs of program literals and weights
Keyword Arguments:
choice -- whether to add a disjunctive or choice rule (Default: False)
|
class Configuration(object) |
|
Allows for changing the configuration of the underlying solver.
Options are organized hierarchically. To change and inspect an option use:
config.group.subgroup.option = "value"
value = config.group.subgroup.option
There are also arrays of option groups that can be accessed using integer
indices:
config.group.subgroup[0].option = "value1"
config.group.subgroup[1].option = "value2"
To list the subgroups of an option group, use the keys member. Array option
groups, like solver, have a non-negative length and can be iterated.
Furthermore, there are meta options having key "configuration". Assigning a
meta option sets a number of related options. To get further information about
an option or option group <opt>, use property __desc_<opt> to retrieve a
description.
Example:
#script (python)
import clingo
def main(prg):
prg.conf.solve.models = 0
prg.ground([("base", [])])
prg.solve()
#end.
{a; c}.
Expected Answer Sets:
{ {}, {a}, {c}, {a,c} } |
|
Methods defined here:
- __delattr__(...)
- x.__delattr__('name') <==> del x.name
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __len__(...)
- x.__len__() <==> len(x)
- __setattr__(...)
- x.__setattr__('name', value) <==> x.name = value
Data descriptors defined here:
- keys
- The list of names of sub-option groups or options.
The list is None if the current object is not an option group.
|
class Control(object) |
|
Control(arguments) -> Control
Control object for the grounding/solving process.
Arguments:
arguments -- optional arguments to the grounder and solver (default: []).
Note that only gringo options (without --text) and clasp's search options are
supported. Furthermore, a Control object is blocked while a search call is
active; you must not call any member function during search. |
|
Methods defined here:
- __init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- add(...)
- add(self, name, params, program) -> None
Extend the logic program with the given non-ground logic program in string form.
Arguments:
name -- name of program block to add
params -- parameters of program block
program -- non-ground program as string
Example:
#script (python)
import clingo
def main(prg):
prg.add("p", ["t"], "q(t).")
prg.ground([("p", [2])])
prg.solve()
#end.
Expected Answer Set:
q(2)
- assign_external(...)
- assign_external(self, external, truth) -> None
Assign a truth value to an external atom (represented as a function symbol).
It is possible to assign a Boolean or None. A Boolean fixes the external to the
respective truth value; and None leaves its truth value open.
The truth value of an external atom can be changed before each solve call. An
atom is treated as external if it has been declared using an #external
directive, and has not been forgotten by calling release_external() or defined
in a logic program with some rule. If the given atom is not external, then the
function has no effect.
Arguments:
external -- symbol representing the external atom
truth -- bool or None indicating the truth value
To determine whether an atom a is external, inspect the symbolic_atoms using
SolveControl.symbolic_atoms[a].is_external. See release_external() for an
example.
- builder(...)
- builder(self) -> ProgramBuilder
Return a builder to construct non-ground logic programs.
Example:
#script (python)
import clingo
def main(prg):
s = "a."
with prg.builder() as b:
clingo.parse_program(s, lambda stm: b.add(stm))
prg.ground([("base", [])])
prg.solve()
#end.
- cleanup(...)
- cleanup(self) -> None
Cleanup the domain used for grounding by incorporating information from the
solver.
This function cleans up the domain used for grounding. This is done by first
simplifying the current program representation (falsifying released external
atoms). Afterwards, the top-level implications are used to either remove atoms
from the domain or mark them as facts.
Note that any atoms falsified are completely removed from the logic program.
Hence, a definition for such an atom in a successive step introduces a fresh atom.
- get_const(...)
- get_const(self, name) -> Symbol
Return the symbol for a constant definition of form: #const name = symbol.
- ground(...)
- ground(self, parts, context) -> None
Ground the given list of program parts specified by tuples of names and arguments.
Keyword Arguments:
parts -- list of tuples of program names and program arguments to ground
context -- context object whose methods are called during grounding using
the @-syntax (if ommitted methods from the main module are used)
Note that parts of a logic program without an explicit #program specification
are by default put into a program called base without arguments.
Example:
#script (python)
import clingo
def main(prg):
parts = []
parts.append(("p", [1]))
parts.append(("p", [2]))
prg.ground(parts)
prg.solve()
#end.
#program p(t).
q(t).
Expected Answer Set:
q(1) q(2)
- interrupt(...)
- interrupt(self) -> None
Interrupt the active solve call.
This function is thread-safe and can be called from a signal handler. If no
search is active the subsequent call to solve(), solve_async(), or solve_iter()
is interrupted. The SolveResult of the above solving methods can be used to
query if the search was interrupted.
- load(...)
- load(self, path) -> None
Extend the logic program with a (non-ground) logic program in a file.
Arguments:
path -- path to program
- register_propagator(...)
- register_propagator(self, propagator) -> None
Registers the given propagator with all solvers.
Arguments:
propagator -- the propagator to register
A propagator should be a class of the form below. Not all functions have to be
implemented and can be ommited if not needed.
class Propagator(object)
init(self, init) -> None
This function is called once before each solving step. It is used to
map relevant program literals to solver literals, add watches for
solver literals, and initialize the data structures used during
propagation.
Arguments:
init -- PropagateInit object
Note that this is the last point to access theory atoms. Once the
search has started, they are no longer accessible.
propagate(self, control, changes) -> None
Can be used to propagate solver literals given a partial assignment.
Arguments:
control -- PropagateControl object
changes -- list of watched solver literals assigned to true
Usage:
Called during propagation with a non-empty list of watched solver
literals that have been assigned to true since the last call to either
propagate, undo, (or the start of the search) - the change set. Only
watched solver literals are contained in the change set. Each literal
in the change set is true w.r.t. the current Assignment.
PropagateControl.add_clause can be used to add clauses. If a clause is
unit resulting, it can be propagated using
PropagateControl.propagate(). If either of the two methods returns
False, the propagate function must return immediately.
c = ...
if not control.add_clause(c) or not control.propagate(c):
return
Note that this function can be called from different solving threads.
Each thread has its own assignment and id, which can be obtained using
PropagateControl.id().
undo(self, thread_id, assign, changes) -> None
Called whenever a solver with the given id undos assignments to watched
solver literals.
Arguments:
thread_id -- the solver thread id
changes -- list of watched solver literals whose assignment is undone
This function is meant to update assignment dependend state in a
propagator.
check(self, control) -> None
This function is similar to propagate but is only called on total
assignments without a change set.
Arguments:
control -- PropagateControl object
This function is called even if no watches have been added.
- release_external(...)
- release_external(self, symbol) -> None
Release an external atom represented by the given symbol.
This function causes the corresponding atom to become permanently false if
there is no definition for the atom in the program. Otherwise, the function has
no effect.
Example:
#script (python)
from clingo import function
def main(prg):
prg.ground([("base", [])])
prg.assign_external(Function("b"), True)
prg.solve()
prg.release_external(Function("b"))
prg.solve()
#end.
a.
#external b.
Expected Answer Sets:
a b
a
- solve(...)
- solve(self, on_model, assumptions) -> SolveResult
Start a search process and return a SolveResult.
Keyword Arguments:
on_model -- optional callback for intercepting models
a Model object is passed to the callback
assumptions -- a list of (atom, boolean) tuples that serve as assumptions for
the solve call, e.g. - solving under assumptions [(Function("a"),
True)] only admits answer sets that contain atom a
Note that in gringo or in clingo with lparse or text output enabled this
function just grounds and returns a SolveResult where
SolveResult.satisfiability() is None. Furthermore, you might want to start
clingo using the --outf=3 option to disable all output from clingo.
This function releases the GIL but it is not thread-safe.
Take a look at Control.solve_async for an example on how to use the model
callback.
- solve_async(...)
- solve_async(self, on_model, on_finish, assumptions) -> SolveFuture
Start a search process in the background and return a SolveFuture object.
Keyword Arguments:
on_model -- optional callback for intercepting models
a Model object is passed to the callback
on_finish -- optional callback called once search has finished
a SolveResult and a Boolean indicating whether the solve call
has been canceled is passed to the callback
assumptions -- list of (atom, boolean) tuples that serve as assumptions for
the solve call, e.g. - solving under assumptions [(Function("a"),
True)] only admits answer sets that contain atom a
Note that this function is only available in clingo with thread support
enabled. Both the on_model and the on_finish callbacks are called from another
thread. To ensure that the methods can be called, make sure to not use any
functions that block the GIL indefinitely. Furthermore, you might want to start
clingo using the --outf=3 option to disable all output from clingo.
Example:
#script (python)
import clingo
def on_model(model):
print model
def on_finish(res, canceled):
print res, canceled
def main(prg):
prg.ground([("base", [])])
f = prg.solve_async(on_model, on_finish)
f.wait()
#end.
q.
Expected Output:
q
SAT False
- solve_iter(...)
- solve_iter(self, assumptions) -> SolveIter
Return a SolveIter object, which can be used to iterate over models.
Keyword Arguments:
assumptions -- a list of (atom, boolean) tuples that serve as assumptions for
the solve call, e.g. - solving under assumptions [(Function("a"),
True)] only admits answer sets that contain atom a
Example:
#script (python)
import clingo
def main(prg):
prg.add("p", "{a;b;c}.")
prg.ground([("p", [])])
with prg.solve_iter() as it:
for m in it: print m
#end.
Data descriptors defined here:
- backend
- A Backend object providing a low level interface to extend a logic program.
- configuration
- Configuration object to change the configuration.
- statistics
- A dictionary containing solve statistics of the last solve call.
Contains the statistics of the last solve(), solve_async(), or solve_iter()
call. The statistics correspond to the --stats output of clingo. The detail of
the statistics depends on what level is requested on the command line.
Furthermore, you might want to start clingo using the --outf=3 option to
disable all output from clingo.
Note that this (read-only) property is only available in clingo.
Example:
import json
json.dumps(prg.statistics, sort_keys=True, indent=4, separators=(',', ': '))
- symbolic_atoms
- SymbolicAtoms object to inspect the symbolic atoms.
- theory_atoms
- A TheoryAtomIter object, which can be used to iterate over the theory atoms.
- use_enum_assumption
- Boolean determining how learnt information from enumeration modes is treated.
If the enumeration assumption is enabled, then all information learnt from
clasp's various enumeration modes is removed after a solve call. This includes
enumeration of cautious or brave consequences, enumeration of answer sets with
or without projection, or finding optimal models; as well as clauses/nogoods
added with Model.add_clause()/Model.add_nogood().
Note that initially the enumeration assumption is enabled.
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class Model(object) |
|
Provides access to a model during a solve call.
The string representation of a model object is similar to the output of models
by clingo using the default output.
Note that model objects cannot be constructed from python. Instead they are
passed as argument to a model callback (see Control.solve() and
Control.solve_async()). Furthermore, the lifetime of a model object is limited
to the scope of the callback. They must not be stored for later use in other
places like - e.g., the main function. |
|
Methods defined here:
- __repr__(...)
- x.__repr__() <==> repr(x)
- __str__(...)
- x.__str__() <==> str(x)
- atoms(...)
- atoms(self, atoms, terms, shown, csp, comp)
-> list of terms
Return the list of atoms, terms, or CSP assignments in the model.
Keyword Arguments:
atoms -- select all atoms in the model (independent of #show statements)
(Default: False)
terms -- select all terms displayed with #show statements in the model
(Default: False)
shown -- select all atoms and terms as outputted by clingo
(Default: False)
csp -- select all csp assignments (independent of #show statements)
(Default: False)
extra -- select terms added by clingo extensions
(Default: False)
comp -- return the complement of the answer set w.r.t. to the Herbrand
base accumulated so far (does not affect csp assignments)
(Default: False)
Note that atoms are represented using functions (Symbol objects), and that CSP
assignments are represented using functions with name "$" where the first
argument is the name of the CSP variable and the second its value.
- contains(...)
- contains(self, a) -> bool
Check if an atom a is contained in the model.
The atom must be represented using a function symbol.
Data descriptors defined here:
- context
- SolveControl object that allows for controlling the running search.
- cost
- Return the list of integer cost values of the model.
The return values correspond to clasp's cost output.
|
class ProgramBuilder(object) |
|
Object to build non-ground programs. |
|
Methods defined here:
- __enter__(...)
- __enter__(self) -> ProgramBuilder
Begin building a program.
Must be called before adding statements.
- __exit__(...)
- __exit__(self, type, value, traceback) -> bool
Finish building a program.
Follows python __exit__ conventions. Does not suppress exceptions.
- add(...)
- add(self, statement) -> None
Adds a statement in form of an ast.AST node to the program.
|
class PropagateControl(object) |
|
This object can be used to add clauses and propagate literals. |
|
Methods defined here:
- add_clause(...)
- add_clause(self, clause, tag, lock) -> bool
Add the given clause to the solver.
This method returns False if the current propagation must be stopped.
Arguments:
clause -- sequence of solver literals
Keyword Arguments:
tag -- clause applies only in the current solving step
(Default: False)
lock -- exclude clause from the solver's regular clause deletion policy
(Default: False)
- add_nogood(...)
- add_nogood(self, clause, tag, lock) -> bool
Equivalent to add_clause([-lit for lit in clause], tag, lock).
- propagate(...)
- propagate(self) -> bool
Propagate implied literals.
Data descriptors defined here:
- assignment
- The partial assignment of the current solver thread.
- thread_id
- The numeric id of the current solver thread.
|
class PropagateInit(object) |
|
Object that is used to initialize a propagator before each solving step.
Each symbolic or theory atom is uniquely associated with a positive program
atom in form of a positive integer. Program literals additionally have a sign
to represent default negation. Furthermore, there are non-zero integer solver
literals. There is a surjective mapping from program atoms to solver literals.
All methods called during propagation use solver literals whereas
SymbolicAtom.literal() and TheoryAtom.literal() return program literals. The
function PropagateInit.solver_literal() can be used to map program literals or
condition ids to solver literals. |
|
Methods defined here:
- add_watch(...)
- add_watch(self, lit) -> None
Add a watch for the solver literal in the given phase.
- solver_literal(...)
- solver_literal(self, lit) -> int
Map the given program literal or condition id to its solver literal.
Data descriptors defined here:
- number_of_threads
- The number of solver threads used in the corresponding solve call.
- symbolic_atoms
- The symbolic atoms captured by a SymbolicAtoms object.
- theory_atoms
- A TheoryAtomIter object to iterate over all theory atoms.
|
class SolveControl(object) |
|
Object that allows for controlling a running search.
Note that SolveControl objects cannot be constructed from python. Instead
they are available as properties of Model objects. |
|
Methods defined here:
- add_clause(...)
- add_clause(self, lits) -> None
Add a clause that applies to the current solving step during the search.
Arguments:
lits -- list of literals represented as pairs of atoms and Booleans
Note that this function can only be called in the model callback (or while
iterating when using a SolveIter).
- add_nogood(...)
- add_nogood(self, lits) -> None
Equivalent to add_clause with the literals inverted.
Arguments:
lits -- list of pairs of Booleans and atoms representing the nogood
|
class SolveFuture(object) |
|
Handle for asynchronous solve calls.
SolveFuture objects cannot be created from python. Instead they are returned by
Control.solve_async, which performs a search in the background. A SolveFuture
object can be used to wait for such a background search or cancel it.
Functions in this object release the GIL. They are not thread-safe though.
See Control.solve_async for an example. |
|
Methods defined here:
- cancel(...)
- cancel(self) -> None
Cancel the running search.
See Control.interrupt() for a thread-safe alternative.
- get(...)
- get(self) -> SolveResult
Get the result of an solve_async call.
If the search is not completed yet, the function blocks until the result is
ready.
- wait(...)
- wait(self, timeout) -> None or bool
Wait for solve_async call to finish with an optional timeout.
If a timeout is given, the function waits at most timeout seconds and returns a
Boolean indicating whether the search has finished. Otherwise, the function
blocks until the search is finished and returns nothing.
Arguments:
timeout -- optional timeout in seconds
(permits floating point values)
|
class SolveIter(object) |
|
Object to conveniently iterate over all models.
During solving the GIL is released. The functions in this object are not
thread-safe though. |
|
Methods defined here:
- __enter__(...)
- __enter__(self) -> SolveIter
Returns self.
- __exit__(...)
- __exit__(self, type, value, traceback) -> bool
Follows python __exit__ conventions. Does not suppress exceptions.
Stops the current search. It is necessary to call this method after each search.
- __iter__(...)
- x.__iter__() <==> iter(x)
- get(...)
- get(self) -> SolveResult
Return the result of the search.
Note that this function might start a search for the next model and then return
a result accordingly. The function might be called after iteration to check if
the search has been interrupted.
- next(...)
- x.next() -> the next value, or raise StopIteration
|
class SolveResult(object) |
|
Captures the result of a solve call.
SolveResult objects cannot be constructed from python. Instead they
are returned by the solve methods of the Control object. |
|
Methods defined here:
- __repr__(...)
- x.__repr__() <==> repr(x)
- __str__(...)
- x.__str__() <==> str(x)
Data descriptors defined here:
- exhausted
- True if the search space was exhausted.
- interrupted
- True if the search was interrupted.
- satisfiable
- True if the problem is satisfiable, False if the problem is
unsatisfiable, or None if the satisfiablity is not known.
- unknown
- True if the satisfiablity is not known.
This is equivalent to satisfiable is None.
- unsatisfiable
- True if the problem is unsatisfiable, False if the problem is
satisfiable, or None if the satisfiablity is not known.
This is equivalent to None if satisfiable is None else not satisfiable.
|
class Symbol(object) |
|
Represents a gringo symbol.
This includes numbers, strings, functions (including constants with
len(arguments) == 0 and tuples with len(name) == 0), #inf and #sup. Symbol
objects are ordered like in gringo and their string representation corresponds
to their gringo representation.
Note that this class does not have a constructor. Instead there are the
functions Number(), String(), and Function() to construct symbol objects or the
preconstructed symbols Infimum and Supremum. |
|
Methods defined here:
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __gt__(...)
- x.__gt__(y) <==> x>y
- __hash__(...)
- x.__hash__() <==> hash(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __lt__(...)
- x.__lt__(y) <==> x<y
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __repr__(...)
- x.__repr__() <==> repr(x)
- __str__(...)
- x.__str__() <==> str(x)
Data descriptors defined here:
- arguments
- The arguments of a function.
- name
- The name of a function.
- negative
- The sign of a function.
- number
- The value of a number.
- positive
- The sign of a function.
- string
- The value of a string.
- type
- The type of the symbol.
|
class SymbolicAtom(object) |
|
Captures a symbolic atom and provides properties to inspect its state. |
|
Data descriptors defined here:
- is_external
- Wheather the atom is an external atom.
- is_fact
- Wheather the atom is a is_fact.
- literal
- The program literal associated with the atom.
- symbol
- The representation of the atom in form of a symbol (Symbol object).
|
class SymbolicAtoms(object) |
|
This class provides read-only access to the symbolic atoms of the grounder
(the Herbrand base).
Example:
p(1).
{ p(3) }.
#external p(1..3).
q(X) :- p(X).
#script (python)
import clingo
def main(prg):
prg.ground([("base", [])])
print "universe:", len(prg.symbolic_atoms)
for x in prg.symbolic_atoms:
print x.atom, x.is_fact, x.is_external
print "p(2) is in domain:", prg.symbolic_atoms[clingo.Function("p", [3])] is not None
print "p(4) is in domain:", prg.symbolic_atoms[clingo.Function("p", [6])] is not None
print "domain of p/1:"
for x in prg.symbolic_atoms.by_signature(("p", 1)):
print x.atom, x.is_fact, x.is_external
print "signatures:", prg.symbolic_atoms.signatures
#end.
Expected Output:
universe: 6
p(1) True False
p(3) False False
p(2) False True
q(1) True False
q(3) False False
q(2) False False
p(2) is in domain: True
p(4) is in domain: False
domain of p/1:
p(1) True False
p(3) False False
p(2) False True
signatures: [('p', 1), ('q', 1)] |
|
Methods defined here:
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __iter__(...)
- x.__iter__() <==> iter(x)
- __len__(...)
- x.__len__() <==> len(x)
- by_signature(...)
- by_signature(self, name, arity, positive) -> SymbolicAtomIter
Return an iterator over the symbolic atoms with the given signature.
Arguments:
name -- the name of the signature
arity -- the arity of the signature
positive -- the sign of the signature
Data descriptors defined here:
- signatures
- The list of predicate signatures (triples of names, arities, and Booleans)
occurring in the program. A true Boolean stands for a positive signature.
|
class TheoryAtom(object) |
|
TheoryAtom objects represent theory atoms. |
|
Methods defined here:
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __gt__(...)
- x.__gt__(y) <==> x>y
- __hash__(...)
- x.__hash__() <==> hash(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __lt__(...)
- x.__lt__(y) <==> x<y
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __repr__(...)
- x.__repr__() <==> repr(x)
- __str__(...)
- x.__str__() <==> str(x)
Data descriptors defined here:
- elements
- elements -> [TheoryElement]
The theory elements of the theory atom.
- guard
- guard -> (str, TheoryTerm)
The guard of the theory atom or None if the atom has no guard.
- literal
- literal -> int
The program literal associated with the theory atom.
- term
- term -> TheoryTerm
The term of the theory atom.
|
class TheoryElement(object) |
|
TheoryElement objects represent theory elements which consist of a tuple of
terms and a set of literals. |
|
Methods defined here:
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __gt__(...)
- x.__gt__(y) <==> x>y
- __hash__(...)
- x.__hash__() <==> hash(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __lt__(...)
- x.__lt__(y) <==> x<y
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __repr__(...)
- x.__repr__() <==> repr(x)
- __str__(...)
- x.__str__() <==> str(x)
Data descriptors defined here:
- condition
- condition -> [TheoryTerm]
The conditon of the element.
- condition_id
- condition_id -> int
Each condition has an id. This id can be passed to PropagateInit.solver_literal
to obtain a solver literal equivalent to the condition.
- terms
- terms -> [TheoryTerm]
The tuple of the element.
|
class TheoryTerm(object) |
|
TheoryTerm objects represent theory terms.
This are read-only objects, which can be obtained from theory atoms and
elements. |
|
Methods defined here:
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __gt__(...)
- x.__gt__(y) <==> x>y
- __hash__(...)
- x.__hash__() <==> hash(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __lt__(...)
- x.__lt__(y) <==> x<y
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __repr__(...)
- x.__repr__() <==> repr(x)
- __str__(...)
- x.__str__() <==> str(x)
Data descriptors defined here:
- arguments
- arguments -> [Symbol]
The arguments of the TheoryTerm (for functions, tuples, list, and sets).
- name
- name -> str
The name of the TheoryTerm\n(for symbols and functions).
- number
- number -> integer
The numeric representation of the TheoryTerm (for numbers).
- type
- type -> TheoryTermType
The type of the theory term.
|
|