protocol
asp_protocol
Protocol for process-backed ASP solving, source generation, and result inspection.
logtalk_load(asp(loader))staticPublic predicates
solve/2
Solves a source with default options using the external Clingo CLI and returns a collected result after cleanup. Valid sources are object(Object), terms(Statements), codes(Codes), and file(Path).
staticsolve(Source,Result)solve(+compound,-compound) - one_or_errorSource is not a ground term:instantiation_errorSource is ground but not a supported source, or is object(Object) where Object does not implement asp_problem_protocol:domain_error(asp_source,Source)Statements is ground but not a list:type_error(list,Statements)domain_error(asp_statement,Statement)domain_error(asp_origins,Origins)Codes is ground but not a list of character codes:type_error(codes,Codes)Code of the list Codes is ground but not an integer:type_error(integer,Code)Code of the list Codes is an integer but not a valid character code:domain_error(character_code,Code)Path is ground but not an atom:type_error(atom,Path)Path does not exist:existence_error(source_sink,Path)Path cannot be opened for reading:permission_error(open,source_sink,Path)domain_error(asp_shell_argument,Argument)existence_error(command,Command)existence_error(directory,Directory)permission_error(delete,source_sink,Path)representation_error(utf_8)asp_transport(Stage,Status,Details)asp_solver_error(Formal,Status,Diagnostics,SourceMap)solve/3
Solves a source using solver selection, executable, enumeration, optimization, resource, and statistics options. Repeated options use the first occurrence. Valid sources are object(Object), terms(Statements), codes(Codes), and file(Path).
staticsolve(Source,Result,Options)solve(+compound,-compound,+list(compound)) - one_or_errorSource is not a ground term:instantiation_errorSource is ground but not a supported source, or is object(Object) where Object does not implement asp_problem_protocol:domain_error(asp_source,Source)Statements is ground but not a list:type_error(list,Statements)domain_error(asp_statement,Statement)domain_error(asp_origins,Origins)Codes is ground but not a list of character codes:type_error(codes,Codes)Code of the list Codes is ground but not an integer:type_error(integer,Code)Code of the list Codes is an integer but not a valid character code:domain_error(character_code,Code)Path is ground but not an atom:type_error(atom,Path)Path does not exist:existence_error(source_sink,Path)Path cannot be opened for reading:permission_error(open,source_sink,Path)Options is a variable:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is a variable:instantiation_errorOption of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)domain_error(asp_solver_option,Solver-Option)domain_error(asp_shell_argument,Argument)existence_error(command,Command)existence_error(directory,Directory)permission_error(delete,source_sink,Path)representation_error(utf_8)asp_transport(Stage,Status,Details)asp_solver_error(Formal,Status,Diagnostics,SourceMap)program/1
Generates and prints ASP source to the current output, equivalent to program/2 followed by print_program/1, without invoking Clingo.
staticprogram(Source)program(+compound) - one_or_errorSource is not a ground term:instantiation_errorSource is ground but not a supported source, or is object(Object) where Object does not implement asp_problem_protocol:domain_error(asp_source,Source)Statements is ground but not a list:type_error(list,Statements)domain_error(asp_statement,Statement)domain_error(asp_origins,Origins)Codes is ground but not a list of character codes:type_error(codes,Codes)Code of the list Codes is ground but not an integer:type_error(integer,Code)Code of the list Codes is an integer but not a valid character code:domain_error(character_code,Code)Path is ground but not an atom:type_error(atom,Path)Path does not exist:existence_error(source_sink,Path)Path cannot be opened for reading:permission_error(open,source_sink,Path)permission_error(output,stream,Stream)program/2
Returns ASP source codes from object(Object), terms(Statements), codes(Codes), or file(Path) without invoking Clingo.
staticprogram(Source,Codes)program(+compound,-list(integer)) - one_or_errorSource is not a ground term:instantiation_errorSource is ground but not a supported source, or is object(Object) where Object does not implement asp_problem_protocol:domain_error(asp_source,Source)Statements is ground but not a list:type_error(list,Statements)domain_error(asp_statement,Statement)domain_error(asp_origins,Origins)Codes is ground but not a list of character codes:type_error(codes,Codes)Code of the list Codes is ground but not an integer:type_error(integer,Code)Code of the list Codes is an integer but not a valid character code:domain_error(character_code,Code)Path is ground but not an atom:type_error(atom,Path)Path does not exist:existence_error(source_sink,Path)Path cannot be opened for reading:permission_error(open,source_sink,Path)print_program/1
Prints ASP character codes to the current output without adding a newline or invoking Clingo.
staticprint_program(Codes)print_program(+list(integer)) - one_or_errorCodes is not a ground term:instantiation_errorCodes is ground but not a list of character codes:type_error(codes,Codes)Code of the list Codes is ground but not an integer:type_error(integer,Code)Code of the list Codes is an integer but not a valid character code:domain_error(character_code,Code)permission_error(output,stream,Stream)model/2
Enumerates, by backtracking, collected model(Symbols, Costs, RawValues) records without starting a process.
staticmodel(Result,Model)model(+compound,-compound) - zero_or_moreResult is not a ground term:instantiation_errorResult is not a valid collected Clingo result:domain_error(asp_result,Result)result_property/2
Enumerates, by backtracking, status(Status) and the stored result properties.
staticresult_property(Result,Property)result_property(+compound,?compound) - zero_or_moreResult is not a ground term:instantiation_errorResult is not a valid collected Clingo result:domain_error(asp_result,Result)print_result/1
Prints collected answers, optimization costs, solver status, and summary metadata to the current output using Clingo-style labels, without invoking the solver.
staticprint_result(Result)print_result(+compound) - one_or_errorResult is not a ground term:instantiation_errorResult is not a valid collected Clingo result:domain_error(asp_result,Result)permission_error(output,stream,Stream)Protected predicates
(none)
Private predicates
(none)
Operators
(none)