it.unibo.tuprolog.solve

package it.unibo.tuprolog.solve

Classes

Name Description
abstract class AbstractWrapper<Wrapped> : Any

Signature to Wrapped type, abstract wrapper class

interface ExecutionContext: ExecutionContextAware, Any

An interface representing the Solver execution context, containing important information that determines its behaviour

interface ExecutionContextAware: Any

Base type for all entities which must be aware of the current state of a solver

interface MutableSolver: Solver, Any

General type for mutable logic Solvers. MutableSolvers differ from Solvers in that they expose public methods for letting clients affect the state of the solver -- e.g. affecting the KB -- while no resolution process is ongoing.

data class Signature: TermConvertible, Any

The signature of a query Struct or a Primitive

sealed interface Solution: Any

A type representing a solution to a goal

interface SolutionFormatter: Formatter<Solution>, Any
interface SolveOptions: Any
interface Solver: ExecutionContextAware, Any

General type for logic solvers, i.e. any entity capable of solving some logic query -- provided as a Struct -- according to some logic, implementing one or more inference rule, via some resolution strategy.

Solvers are not immutable entities. Their state may mutate as an effect of solving queries.

interface SolverFactory: Any
class TimeInstant

This type represents how the solver will see time instants

class TimeDuration

This type represents how the solver will see time duration

data class JsClassName: Any

Typealiases

Name Description
typealias TimeInstant = Long

This type represents how the solver will see time instants

typealias TimeDuration = Long

This type represents how the solver will see time duration

Methods

extractSignature

fun Struct.extractSignature(): Signature

Extracts this Struct indicator and converts it to Signature

Receiver

Name Description
Struct

ReturnValue

Name Description
Signature

solve

fun Solver.solve(maxDuration: TimeDuration, scopedContext: Scope.()->Struct): Sequence<Solution>

Receiver

Name Description
Solver

Parameters

Name Description
maxDuration: TimeDuration
scopedContext: Scope.()->Struct

ReturnValue

Name Description
Sequence<Solution>

classicSolverFactory

expect fun classicSolverFactory(): SolverFactory

ReturnValue

Name Description
SolverFactory

streamsSolverFactory

expect fun streamsSolverFactory(): SolverFactory

ReturnValue

Name Description
SolverFactory

problogSolverFactory

expect fun problogSolverFactory(): SolverFactory

ReturnValue

Name Description
SolverFactory

currentTimeInstant

expect fun currentTimeInstant(): TimeInstant

A function returning current Time instant

ReturnValue

Name Description
TimeInstant

forEachWithLookahead

inline fun <T> Sequence<T>.forEachWithLookahead(action: (T, Boolean)->Unit): inline

Performs the given action on each element, giving a lookahead hint (i.e. if there's another element to process after).

Receiver

Name Description
Sequence<T>

Parameters

Name Description
action: (T, Boolean)->Unit

ReturnValue

Name Description
inline

getAllOperators

fun Library.getAllOperators(): Sequence<Operator>

Receiver

Name Description
Library

ReturnValue

Name Description
Sequence<Operator>

getAllOperators

fun Libraries.getAllOperators(): Sequence<Operator>

Receiver

Name Description
Libraries

ReturnValue

Name Description
Sequence<Operator>

getAllOperators

fun getAllOperators(libraries: Libraries, vararg theories: Theory): Sequence<Operator>

Parameters

Name Description
libraries: Libraries
vararg theories: Theory

ReturnValue

Name Description
Sequence<Operator>

toOperatorSet

fun Sequence<Operator>.toOperatorSet(): OperatorSet

Receiver

Name Description
Sequence<Operator>

ReturnValue

Name Description
OperatorSet

forEachWithLookahead

inline fun <T> Iterator<T>.forEachWithLookahead(action: (T, Boolean)->Unit)

Performs the given action on each element, giving a lookahead hint (i.e. if there's another element to process after).

Receiver

Name Description
Iterator<T>

Parameters

Name Description
action: (T, Boolean)->Unit

ReturnValue

Name Description
Unit

forEachWithLookahead

inline fun <T> Iterable<T>.forEachWithLookahead(action: (T, Boolean)->Unit)

Performs the given action on each element, giving a lookahead hint (i.e. if there's another element to process after).

Receiver

Name Description
Iterable<T>

Parameters

Name Description
action: (T, Boolean)->Unit

ReturnValue

Name Description
Unit

getAllOperators

fun Iterable<Clause>.getAllOperators(): Sequence<Operator>

Receiver

Name Description
Iterable<Clause>

ReturnValue

Name Description
Sequence<Operator>