protocol

problog_protocol

Process-backed ProbLog exact inference, source generation, and collected query probabilities.

Availability:
logtalk_load(problog(loader))
Author: Paulo Moura
Version: 1:0:0
Date: 2026-11-14
Compilation flags:
static
Dependencies:
(none)
Remarks:
(none)
Inherited public predicates:
(none)

Public predicates

solve/2

Runs exact inference with default options. Valid sources are object(Object), terms(Statements), codes(Codes), and file(Path). Returns a ground collected result after cleanup.

Compilation flags:
static
Template:
solve(Source,Result)
Mode and number of proofs:
solve(+compound,-compound) - one_or_error
Exceptions:
Source is not ground:
instantiation_error
Source is ground but invalid:
domain_error(problog_source,Source)
An executable cannot be resolved:
existence_error(command,Command)
A transport operation fails:
problog_transport(Stage,Status,Details)
Inference fails or produces invalid output:
problog_solver_error(Formal,Status,Diagnostics,SourceMap)

solve/3

Runs exact inference with the given options options. Repeated options use the first occurrence.

Compilation flags:
static
Template:
solve(Source,Result,Options)
Mode and number of proofs:
solve(+compound,-compound,+list(compound)) - one_or_error
Exceptions:
Source is not ground:
instantiation_error
Source is ground but invalid:
domain_error(problog_source,Source)
Options is a variable:
instantiation_error
Options is neither a variable nor a list:
type_error(list,Options)
An element Option of the list Options is a variable:
instantiation_error
An element Option of the list Options is neither a variable nor a compound term:
type_error(compound,Option)
An element Option of the list Options is a compound term but not a valid option:
domain_error(option,Option)
An executable cannot be resolved:
existence_error(command,Command)
A transport operation fails:
problog_transport(Stage,Status,Details)
Inference fails or produces invalid output:
problog_solver_error(Formal,Status,Diagnostics,SourceMap)

program/1

Prints source to the current output without invoking ProbLog.

Compilation flags:
static
Template:
program(Source)
Mode and number of proofs:
program(+compound) - one_or_error
Exceptions:
Source is not ground:
instantiation_error
Source is ground but invalid:
domain_error(problog_source,Source)

program/2

Returns source character codes without invoking ProbLog. Native file and codes sources are not parsed.

Compilation flags:
static
Template:
program(Source,Codes)
Mode and number of proofs:
program(+compound,-list(integer)) - one_or_error
Exceptions:
Source is not ground:
instantiation_error
Source is ground but invalid:
domain_error(problog_source,Source)

probability/3

Enumerates ground query terms and numeric probabilities in a collected result. Query order follows the CLI, not a sorting contract.

Compilation flags:
static
Template:
probability(Result,Query,Probability)
Mode and number of proofs:
probability(+compound,?callable,?number) - zero_or_more
Exceptions:
Result is not ground:
instantiation_error
Result is ground but invalid:
domain_error(problog_result,Result)

result_property/2

Enumerates raw_status/1, process_status/1, and diagnostics/1 properties. Diagnostics are captured stderr character codes.

Compilation flags:
static
Template:
result_property(Result,Property)
Mode and number of proofs:
result_property(+compound,?compound) - zero_or_more


Protected predicates

(none)

Private predicates

(none)

Operators

(none)