Did you know ... Search Documentation:
Pack trill -- prolog/trill.pl
PublicShow source

This module performs reasoning over probabilistic description logic knowledge bases. It reads probabilistic knowledge bases in RDF format or in Prolog format, a functional-like sintax based on definitions of Thea library, and answers queries by finding the set of explanations or computing the probability.

[1] http://vangelisv.github.io/thea/

See https://github.com/rzese/trill/blob/master/doc/manual.pdf or http://ds.ing.unife.it/~rzese/software/trill/manual.html for details.

author
- Riccardo Zese
version
- 6.0.2
license
- Artistic License 2.0
 load_kb(++FileName:kb_file_name) is det
The predicate loads the knowledge base contained in the given file. The knowledge base must be defined in TRILL format, to use also OWL/RDF format use the predicate owl_rdf/1.
 load_owl_kb(++FileName:kb_file_name) is det
The predicate loads the knowledge base contained in the given file. The knowledge base must be defined in pure OWL/RDF format.
 load_owl_kb_from_string(++KB:string) is det
The predicate loads the knowledge base contained in the given string. The knowledge base must be defined in pure OWL/RDF format.
 add_kb_prefix(:ShortPref:string, ++LongPref:string) is det[multifile]
This predicate registers the alias ShortPref for the prefix defined in LongPref. The empty string '' can be defined as alias.
 add_kb_prefixes(:Prefixes:list) is det[multifile]
This predicate registers all the alias prefixes contained in Prefixes. The input list must contain pairs alias=prefix, i.e., [('foo'='http://example.foo#')]. The empty string '' can be defined as alias.
 add_axiom(:Axiom:axiom) is det[multifile]
This predicate adds the given axiom to the knowledge base. The axiom must be defined following the TRILL syntax.
 add_axioms(:Axioms:list) is det[multifile]
This predicate adds the axioms of the list to the knowledge base. The axioms must be defined following the TRILL syntax.
 remove_kb_prefix(:ShortPref:string, ++LongPref:string) is det[multifile]
This predicate removes from the registered aliases the one given in input.
 remove_kb_prefix(:Name:string) is det[multifile]
This predicate takes as input a string that can be an alias or a prefix and removes the pair containing the string from the registered aliases.
 remove_axiom(:Axiom:axiom) is det[multifile]
This predicate removes the given axiom from the knowledge base. The axiom must be defined following the TRILL syntax.
 remove_axioms(++Axioms:list) is det[multifile]
This predicate removes the axioms of the list from the knowledge base. The axioms must be defined following the TRILL syntax.
 axiom(:Axiom:axiom) is det[multifile]
This predicate searches in the loaded knowledge base axioms that unify with Axiom.
 set_tableau_expansion_rules(:DetRules:list, ++NondetRules:list) is det
This predicate set the rules as taken in input, maintaining order and number of rules. DetRules is the list of deterministic rules, NondetRules the list of non-deterministic ones.
 instanceOf(:Class:concept_description, ++Ind:individual_name)
This predicate takes as input the name or the full URI of a class or the definition of a complex concept as a ground term and name or the full URI of an individual and returns one explanation for the instantiation of the individual to the given class. The returning explanation is a set of axioms. The predicate fails if the individual does not belong to the class.
 instanceOf(:Class:concept_description, ++Ind:individual_name) is det
This predicate takes as input the name or the full URI of a class or the definition of a complex concept as a ground term and name or the full URI of an individual and returns true if the individual belongs to the class, false otherwise.
 property_value(:Prop:property_name, ++Ind1:individual_name, ++Ind2:individual_name, -Expl:list, ++Opt:list)
This predicate takes as input the name or the full URI of a property and of two individuals and returns one explanation for the fact Ind1 is related with Ind2 via Prop. The returning explanation is a set of axioms. The predicate fails if the two individual are not Prop-related. * Opt is a list containing options for the execution of the query. Options can be:
  • assert_abox(Boolean) if Boolean is set to true the list of aboxes is asserted with the predicate final_abox/1.
  • compute_prob(mode,Prob) if mode is query trill is forced to find all the explanations, and compute the probability of the query is computed and unified with Prob (same as using prob_<query> but it also returns the set of justifications); if mode is expl trill will compute the probability of each single explanation.
  • max_expl(Value) to limit the maximum number of explanations to find. Value must be an integer. The predicate will return a list containing at most Value different explanations.
  • time_limit(Value) to limit the time for the inference. The predicate will return the explanations found in the time allowed. Value is the number of seconds allowed for the search of explanations.
 property_value(:Prop:property_name, ++Ind1:individual_name, ++Ind2:individual_name, -Expl:list)
This predicate takes as input the name or the full URI of a property and of two individuals and returns one explanation for the fact Ind1 is related with Ind2 via Prop. The returning explanation is a set of axioms. The predicate fails if the two individual are not Prop-related.
 all_property_value(:Prop:property_name, ++Ind1:individual_name, ++Ind2:individual_name, -Expl:list)
This predicate takes as input the name or the full URI of a property and of two individuals and returns all the explanations for the fact Ind1 is related with Ind2 via Prop. The returning explanations are in the form if a list (set) of set of axioms. The predicate fails if the individual does not belong to the class.
 property_value(:Prop:property_name, ++Ind1:individual_name, ++Ind2:individual_name) is det
This predicate takes as input the name or the full URI of a property and of two individuals and returns true if the two individual are Prop-related, false otherwise.
 sub_class(:Class:concept_description, ++SupClass:concept_description, -Expl:list, ++Opt:list)
This predicate takes as input two concepts which can be given by the name or the full URI of two a simple concept or the definition of a complex concept as a ground term and returns one explanation for the subclass relation between Class and SupClass. The returning explanation is a set of axioms. The predicate fails if there is not a subclass relation between the two classes. Opt is a list containing options for the execution of the query. Options can be:
  • assert_abox(Boolean) if Boolean is set to true the list of aboxes is asserted with the predicate final_abox/1.
  • compute_prob(mode,Prob) if mode is query trill is forced to find all the explanations, and compute the probability of the query is computed and unified with Prob (same as using prob_<query> but it also returns the set of justifications); if mode is expl trill will compute the probability of each single explanation.
  • max_expl(Value) to limit the maximum number of explanations to find. Value must be an integer. The predicate will return a list containing at most Value different explanations.
  • time_limit(Value) to limit the time for the inference. The predicate will return the explanations found in the time allowed. Value is the number of seconds allowed for the search of explanations.
 sub_class(:Class:concept_description, ++SupClass:concept_description, -Expl:list)
This predicate takes as input two concepts which can be given by the name or the full URI of two a simple concept or the definition of a complex concept as a ground term and returns one explanation for the subclass relation between Class and SupClass. The returning explanation is a set of axioms. The predicate fails if there is not a subclass relation between the two classes.
 all_sub_class(:Class:concept_description, ++SupClass:concept_description, -Expl:list)
This predicate takes as input two concepts which can be given by the name or the full URI of two a simple concept or the definition of a complex concept as a ground term and returns all the explanations for the subclass relation between Class and SupClass. The returning explanations are in the form if a list (set) of set of axioms. The predicate fails if Class is not subclass of SupClass.
 sub_class(:Class:concept_description, ++SupClass:concept_description) is det
This predicate takes as input two concepts which can be given by the name or the full URI of two a simple concept or the definition of a complex concept as a ground term and returns true if Class is a subclass of SupClass, and false otherwise.
 unsat(:Concept:concept_description, -Expl:list, ++Opt:list)
This predicate takes as input the name or the full URI of a class or the definition of a complex concept as a ground term and returns one explanation for the unsatisfiability of the concept. The returning explanation is a set of axioms. The predicate fails if the concept is satisfiable. Opt is a list containing options for the execution of the query. Options can be:
  • assert_abox(Boolean) if Boolean is set to true the list of aboxes is asserted with the predicate final_abox/1.
  • compute_prob(mode,Prob) if mode is query trill is forced to find all the explanations, and compute the probability of the query is computed and unified with Prob (same as using prob_<query> but it also returns the set of justifications); if mode is expl trill will compute the probability of each single explanation.
  • max_expl(Value) to limit the maximum number of explanations to find. Value must be an integer. The predicate will return a list containing at most Value different explanations.
  • time_limit(Value) to limit the time for the inference. The predicate will return the explanations found in the time allowed. Value is the number of seconds allowed for the search of explanations.
 unsat(:Concept:concept_description, -Expl:list)
This predicate takes as input the name or the full URI of a class or the definition of a complex concept as a ground term and returns one explanation for the unsatisfiability of the concept. The returning explanation is a set of axioms. The predicate fails if the concept is satisfiable.
 all_unsat(:Concept:concept_description, -Expl:list)
This predicate takes as input the name or the full URI of a class or the definition of a complex concept as a ground term and returns all the explanations for the unsatisfiability of the concept. The returning explanations are in the form if a list (set) of set of axioms. The predicate fails if the individual does not belong to the class.
 unsat(:Concept:concept_description) is det
This predicate takes as input the name or the full URI of a class or the definition of a complex concept as a ground term and returns true if the concept is unsatisfiable, false otherwise.
 inconsistent_theory(:Expl:list, ++Opt:list)
This predicate returns one explanation for the inconsistency of the loaded knowledge base. Opt is a list containing options for the execution of the query. Options can be:
  • assert_abox(Boolean) if Boolean is set to true the list of aboxes is asserted with the predicate final_abox/1.
  • compute_prob(mode,Prob) if mode is query trill is forced to find all the explanations, and compute the probability of the query is computed and unified with Prob (same as using prob_<query> but it also returns the set of justifications); if mode is expl trill will compute the probability of each single explanation.
  • max_expl(Value) to limit the maximum number of explanations to find. Value must be an integer. The predicate will return a list containing at most Value different explanations.
  • time_limit(Value) to limit the time for the inference. The predicate will return the explanations found in the time allowed. Value is the number of seconds allowed for the search of explanations.
 inconsistent_theory(:Expl:list)
This predicate returns one explanation for the inconsistency of the loaded knowledge base.
 all_inconsistent_theory(:Expl:list)
This predicate returns all the explanations for the inconsistency of the loaded knowledge base. The returning explanations are in the form if a list (set) of set of axioms. The predicate fails if the individual does not belong to the class.
 inconsistent_theory
This predicate returns true if the loaded knowledge base is inconsistent, otherwise it fails.
 prob_instanceOf(:Class:concept_description, ++Ind:individual_name, --Prob:double) is det
This predicate takes as input the name or the full URI of a class or the definition of a complex concept as a ground term and name or the full URI of an individual and returns the probability of the instantiation of the individual to the given class.
 prob_property_value(:Prop:property_name, ++Ind1:individual_name, ++Ind2:individual_name, --Prob:double) is det
This predicate takes as input the name or the full URI of a property and of two individuals and returns the probability of the fact Ind1 is related with Ind2 via Prop.
 prob_sub_class(:Class:concept_description, ++SupClass:class_name, --Prob:double) is det
This predicate takes as input two concepts which can be given by the name or the full URI of two a simple concept or the definition of a complex concept as a ground term and returns the probability of the subclass relation between Class and SupClass.
 prob_unsat(:Concept:concept_description, --Prob:double) is det
This predicate takes as input the name or the full URI of a class or the definition of a complex concept as a ground term and returns the probability of the unsatisfiability of the concept.
 prob_inconsistent_theory(:Prob:double) is det
If the knowledge base is inconsistent, this predicate returns the probability of the inconsistency.
 resume_query(:Expl:list) is det
Continues with the search for new justifications for the previous query if a previous query is open. It only works returning justifications one by one.
 compute_query_prob(:Prob:double) is det
Computes the probability of the previous query if there is one open.
 reset_query is det
Closes the open query and reset the reasoner status to prepare it for a new query.
 init_trill(++Alg:reasoner)
It initializes the algorithms Alg

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 instanceOf(Arg1, Arg2, Arg3)
 instanceOf(Arg1, Arg2, Arg3, Arg4)
 all_instanceOf(Arg1, Arg2, Arg3)
 kb_prefixes(Arg1)
 init_em(Arg1)
 init_ex(Arg1, Arg2)
 init(Arg1)
 end_em(Arg1)
 end_ex(Arg1)
 end(Arg1)
 one(Arg1, Arg2)
 zero(Arg1, Arg2)
 and(Arg1, Arg2, Arg3, Arg4)
 or(Arg1, Arg2, Arg3, Arg4)
 bdd_not(Arg1, Arg2, Arg3)
 ret_prob(Arg1, Arg2, Arg3)
 equality(Arg1, Arg2, Arg3, Arg4)
 add_var(Arg1, Arg2, Arg3, Arg4)
 add_abd_var(Arg1, Arg2, Arg3, Arg4)
 ret_abd_prob(Arg1, Arg2, Arg3, Arg4)
 add_query_var(Arg1, Arg2, Arg3, Arg4)
 ret_map_prob(Arg1, Arg2, Arg3, Arg4)
 onec(Arg1, Arg2)
 zeroc(Arg1, Arg2)
 andc(Arg1, Arg2, Arg3, Arg4)
 andcnf(Arg1, Arg2, Arg3, Arg4)
 bdd_notc(Arg1, Arg2, Arg3)
 orc(Arg1, Arg2, Arg3)
 ret_probc(Arg1, Arg2, Arg3)
 equalityc(Arg1, Arg2, Arg3, Arg4)
 or_list(Arg1, Arg2, Arg3)
 or_listc(Arg1, Arg2, Arg3)
 make_query_var(Arg1, Arg2, Arg3)
 create_dot(Arg1, Arg2, Arg3)
 create_dot_string(Arg1, Arg2, Arg3)
 em(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9)
 rand_seed(Arg1)
 gamma_sample(Arg1, Arg2, Arg3)
 gauss_sample(Arg1, Arg2, Arg3)
 uniform_sample(Arg1)
 dirichlet_sample(Arg1, Arg2)
 symmetric_dirichlet_sample(Arg1, Arg2, Arg3)
 discrete_sample(Arg1, Arg2)
 initial_values(Arg1, Arg2)
 add_decision_var(Arg1, Arg2, Arg3)
 probability_dd(Arg1, Arg2, Arg3)
 add_prod(Arg1, Arg2, Arg3, Arg4)
 add_sum(Arg1, Arg2, Arg3, Arg4)
 ret_strategy(Arg1, Arg2, Arg3, Arg4)
 debug_cudd_var(Arg1, Arg2)