object
Built-in object providing message printing, debugging, library, source file, and hacking methods.
Paulo Moura
1.2
2015/8/26
static, built_in, context_switching_calls, threaded
(no dependencies on other files)
Prints a message of the given kind for the specified component.
static
print_message(Kind,Component,Message)
print_message(+nonvar,+nonvar,+nonvar) – one
Print the messages tokens to the given stream, prefixing each line with the specified atom.
static
print_message_tokens(Stream,Prefix,Tokens)
print_message_tokens(@stream_or_alias,+atom,@list(nonvar)) – one
User-defined hook predicate for printing a message token (at_same_line, nl, flush, Format-Arguments, term(Term,Options), ansi(Attributes,Format,Arguments), begin(Kind,Variable), and end(Variable)).
dynamic, multifile
print_message_token(Stream,Prefix,Token,Tokens)
print_message_token(@stream_or_alias,@atom,@nonvar,@list(nonvar)) – zero_or_one
User-defined hook grammar rule for converting a message into a list of tokens (at_same_line, nl, flush, Format-Arguments, term(Term,Options), ansi(Attributes,Format,Arguments), begin(Kind,Variable), and end(Variable)).
dynamic, multifile
message_tokens(Message,Component)
Message line prefix and output stream to be used when printing a message given its kind and component.
dynamic, multifile
message_prefix_stream(Kind,Component,Prefix,Stream)
message_prefix_stream(?nonvar,?nonvar,?atom,?stream_or_alias) – zero_or_more
User-defined hook predicate for intercepting message printing calls.
dynamic, multifile
message_hook(Message,Kind,Component,Tokens)
message_hook(+nonvar,+nonvar,+nonvar,+list(nonvar)) – zero_or_one
Asks a question and reads the answer until the check predicate is true.
static
ask_question(Kind,Component,Question,Check,Answer)
ask_question(*,*,*,1,*)
ask_question(+nonvar,+nonvar,+nonvar,+callable,-term) – one
User-defined hook predicate for intercepting question asking calls.
dynamic, multifile
question_hook(Question,Kind,Component,Tokens,Check,Answer)
question_hook(*,*,*,*,1,*)
question_hook(+nonvar,+nonvar,+nonvar,+list(nonvar),+callable,-term) – zero_or_one
Prompt and input stream to be used when asking a question given its kind and component.
dynamic, multifile
question_prompt_stream(Kind,Component,Prompt,Stream)
question_prompt_stream(?nonvar,?nonvar,?atom,?stream_or_alias) – zero_or_more
Trace event handler. The runtime calls all trace event handlers using a failure-driven loop before calling the debug event handler.
dynamic, multifile
trace_event(Event,ExecutionContext)
trace_event(@callable,@execution_context) – zero
Declares an object as the debug handler provider. There should be at most one debug handler provider loaded at any given moment.
static, multifile
debug_handler_provider(Provider)
debug_handler_provider(?object_identifier) – zero_or_one
Debug event handler. The defined events are unification events - fact(Entity,Fact,Clause,Line) and rule(Entity,Head,Clause,Line) - and goal events - top_goal(Goal,CompiledGoal) and goal(Goal,CompiledGoal).
static, multifile
debug_handler(Event,ExecutionContext)
debug_handler(?entity_identifier,?atom) – zero_or_more
Expands a library name into its full path. Uses a depth bound to prevent loops.
static
expand_library_path(Library,Path)
expand_library_path(+atom,?atom) – zero_or_one
Enumerates, by backtracking, all loaded files, returning their full paths.
static
loaded_file(Path)
loaded_file(?atom) – zero_or_more
Enumerates, by backtracking, all loaded file properties. Valid properties are: basename/1, directory/1, mode/1, flags/1, text_properties/1 (encoding/1 and bom/1), target/1, modified/1, parent/1, library/1, object/1, protocol/1, and category/1.
static
loaded_file_property(Path,Property)
loaded_file_property(?atom,?compound) – zero_or_more
Compiles a list of auxiliary clauses.
static
compile_aux_clauses(Clauses)
compile_aux_clauses(@list(clause)) – one
Converts between an entity identifier and the entity prefix that is used for its compiled code. When none of the arguments is instantiated, it returns the identifier and the prefix of the entity under compilation, if any.
static
entity_prefix(Entity,Prefix)
entity_prefix(?entity_identifier,?atom) – zero_or_one
Compiles clause heads. The heads are compiled in the context of the entity under compilation when the entity argument is not instantiated.
static
compile_predicate_heads(Heads,Entity,CompiledHeads,ExecutionContext)
compile_predicate_heads(@list(callable),?entity_identifier,-list(callable),@execution_context) – zero_or_one
compile_predicate_heads(@conjunction(callable),?entity_identifier,-conjunction(callable),@execution_context) – zero_or_one
compile_predicate_heads(@callable,?entity_identifier,-callable,@execution_context) – zero_or_one
Compiles predicate indicators. The predicate are compiled in the context of the entity under compilation when the entity argument is not instantiated.
static
compile_predicate_indicators(PredicateIndicators,Entity,CompiledPredicateIndicators)
compile_predicate_indicators(@list(predicate_indicator),?entity_identifier,-list(predicate_indicator)) – zero_or_one
compile_predicate_indicators(@conjunction(predicate_indicator),?entity_identifier,-conjunction(predicate_indicator)) – zero_or_one
compile_predicate_indicators(@predicate_indicator,?entity_identifier,-predicate_indicator) – zero_or_one
Decompiles clause heads. All compiled clause heads must belong to the same entity, which must be loaded.
static
decompile_predicate_heads(CompiledHeads,Entity,Type,Heads)
decompile_predicate_heads(@list(callable),-entity_identifier,-atom,-list(callable)) – zero_or_one
decompile_predicate_heads(@conjunction(callable),-entity_identifier,-atom,-conjunction(callable)) – zero_or_one
decompile_predicate_heads(@callable,-entity_identifier,-atom,-callable) – zero_or_one
Decompiles predicate indicators. All compiled predicate indicators must belong to the same entity, which must be loaded.
static
decompile_predicate_indicators(CompiledPredicateIndicators,Entity,Type,PredicateIndicators)
decompile_predicate_indicators(@list(predicate_indicator),-entity_identifier,-atom,-list(predicate_indicator)) – zero_or_one
decompile_predicate_indicators(@conjunction(predicate_indicator),-entity_identifier,-atom,-conjunction(predicate_indicator)) – zero_or_one
decompile_predicate_indicators(@predicate_indicator,-entity_identifier,-atom,-predicate_indicator) – zero_or_one
Execution context term data. Execution context terms should be considered opaque terms subject to change without notice.
static
execution_context(ExecutionContext,Entity,Sender,This,Self,MetaCallContext,Stack)
execution_context(?nonvar,?entity_identifier,?object_identifier,?object_identifier,?object_identifier,@list(callable),@list(callable)) – zero_or_one
(none)
(none)