module GDL:sig..end
val playout_fixpoint : bool Pervasives.refval set_timeout : (unit -> bool) -> unittype term =
| |
Const of |
| |
Var of |
| |
Func of |
typerel_atom =string * term array
type atom =
| |
Distinct of |
| |
Rel of |
| |
Role of |
| |
True of |
| |
Does of |
type literal =
| |
Pos of |
| |
Neg of |
| |
Disj of |
typegdl_rule =rel_atom * rel_atom list * rel_atom list
Collect rules by relations.
typedef_branch =term array * rel_atom list * rel_atom list
typegdl_defs =(string * def_branch list) list
typeclause =rel_atom * literal list
typepath =(string * int) list
type path_set
type request =
| |
Start of |
(* | prepare game: match id, role, game, startclock, playclock | *) |
| |
Play of |
(* | request a move: match id, actions on previous step | *) |
| |
Stop of |
(* | game ends here: match id, actions on previous step | *) |
module Terms:Set.Swith type elt = term
val add_terms : term list -> Terms.t -> Terms.tval terms_of_list : term list -> Terms.tval atoms_of_body : literal list -> atom listval rel_of_atom : atom -> rel_atomval term_vars : term -> Aux.Strings.tval terms_vars : term array -> Aux.Strings.tval clause_vars : clause -> Aux.Strings.tval clauses_vars : clause list -> Aux.Strings.tval literals_vars : literal list -> Aux.Strings.tval defs_of_rules : gdl_rule list -> gdl_defsval rules_of_clause : clause -> gdl_rule listval nnf_dnf : literal list -> literal list listtypesubstitution =(string * term) list
val unify : substitution -> term list -> term list -> substitutionval unify_args : ?sb:substitution -> term array -> term array -> substitutionConst "_BLANK_" on the right.val match_nonblank : substitution -> term list -> term list -> substitutionval mask_blank : term list -> term list -> boolval unify_all : substitution -> term list -> substitutionval unify_rels : ?sb:substitution -> rel_atom -> rel_atom -> substitutionval rels_unify : rel_atom -> rel_atom -> boolval subst : substitution -> term -> termval subst_consts : substitution -> term -> termval subst_rel : substitution -> rel_atom -> rel_atomval subst_rels : substitution -> rel_atom list -> rel_atom listval subst_literal : substitution -> literal -> literalval subst_literals : substitution -> literal list -> literal listval subst_clause : substitution -> clause -> clauseval subst_consts_literals : substitution -> literal list -> literal listval subst_consts_clause : substitution -> clause -> clausemodule Tuples:Set.Swith type elt = term array
typegraph =Tuples.t Aux.StrMap.t
val graph_mem : string -> term array -> graph -> boolval merge_graphs : graph -> graph -> graphval build_graph : rel_atom list -> graphval graph_to_atoms : graph -> rel_atom listval gdl_rel_graph : string -> graph -> term array listval saturate : graph -> gdl_rule list -> graphval run_prolog_aggregate : bool Pervasives.refval reorder_clauses : bool Pervasives.reftype prolog_program
val preprocess_program : clause list -> prolog_programval restore_program : ?t_cls:clause list ->
?d_cls:clause list -> prolog_program -> prolog_programval run_prolog_atom : rel_atom -> prolog_program -> rel_atom list
Compute all variable substitutions that satisfy the given
conjunction of literals. The substitutions are not unique (there
is as many of them as there are different proofs of the goal).
val run_prolog_goal : literal list -> prolog_program -> substitution listrun_prolog_goal result.val run_prolog_check_atom : rel_atom -> prolog_program -> boolval run_prolog_check_goal : literal list -> prolog_program -> boolval optimize_goal : testground:prolog_program ->
?head_sb:substitution -> literal list -> literal listval optimize_program : testground:prolog_program -> prolog_program -> prolog_programval expand_definitions : gdl_defs -> def_branch list -> def_branch listval atom_of_rel : rel_atom -> atomrel_of_atom inverts polarity of "distinct" --
invert back after using atom_of_rel if needed.val negate_bodies : literal list list -> (substitution * literal list) listval rename_clauses : clause list -> Aux.Strings.t Pervasives.ref * clause listval func_graph : string -> term list -> term array listval elim_pattern_args : string list -> clause list -> string list * clause listval elim_ground_distinct : clause list -> clause listval state_cls : term list -> clause listval blank : termval counter_n : stringval term_str : term -> stringval terms_str : term array -> stringval term_to_name : ?nested:bool -> term -> stringval state_terms : literal list -> term listval pos_state_terms : literal list -> term listval term_arities : term -> (string * int) listval atom_str : atom -> stringval rel_atom_str : rel_atom -> stringval rel_atoms_str : rel_atom list -> stringval gdl_rule_str : gdl_rule -> stringval gdl_rules_str : gdl_rule list -> stringval def_str : string * def_branch list -> stringval literal_str : literal -> stringval literals_str : literal list -> stringval clause_str : clause -> stringval clauses_str : clause list -> stringval sb_str : (string * term) list -> stringval program_clauses : prolog_program -> clause listval topsort_callgraph : clause list -> string list
Aggregate and random playout, player-denoting variable elimination.
val static_rels : gdl_defs -> string list * string listval playout_satur : aggregate:bool ->
term array ->
int ->
gdl_rule list ->
gdl_rule list * gdl_rule list * graph * term list *
(term array list list * term list list * term list)
When aggregate_drop_negative is true, to keep monotonicity,
besides removing negative literals from "legal" clauses, we also
add old terms to the state. (Only when ~aggregate:true.)
~aggregate:true performs an aggregate ply, ~aggregate:false
performs a random ply. Aggregate playouts are "deprecated",
especially for uses other than generating all possible state
terms.
val playout_prolog : aggregate:bool ->
term array ->
int ->
prolog_program ->
term array list list * term list list * term listval find_cycle : term option list -> term option listval expand_players : clause list -> clause listval simult_subst : path_set -> term -> term -> termsimult_subst ps s t substitutes s at all t paths that belong
to the set ps, returns $tps \ot s$.val map_paths : (path -> term -> 'a) -> path_set -> term -> 'a listval rel_on_paths : string -> path list -> stringval pred_on_path_subterm : path -> term -> stringval term_paths : ?prefix_only:bool -> (term -> bool) -> term -> path_set~prefix_only:true, paths that contain a path
that has been included, are not included.val at_path : term -> path -> termNot_found; at_path p t is $t \tpos p$.val merge_terms : term -> term -> path_set * int * intval at_paths : ?fail_at_missing:bool -> path_set -> term -> term list~fail_at_missing:false,
raise Not_found if ~fail_at_missing:true.val empty_path_set : path_setval eps_path_set : path_setval add_path : (string -> int) -> path -> path_set -> path_setval paths_union : path_set -> path_set -> path_setval paths_intersect : path_set -> path_set -> path_setval paths_to_list : path_set -> path listval path_str : path -> stringval ground_vars_at_paths : (clause -> literal list) ->
(path * term list) list -> clause list -> clause listground_vars_at_paths prepare_lits ps_sterms clauses expands
subterms that have occurrences at paths in ps_sterms in some
state term of a clause (from which pre-processed literals are
extracted by prepare_lits), by substituting their variables with
corresponding subterms of terms provided in ps_sterms.val blank_outside_subterm : (string * int) list -> path -> term -> termval blank_outside_subterms : (string * int) list -> (path * term) list -> termval refine_leaf_paths : path_set -> term list -> path_setval refine_paths_avoiding : path_set ->
(term -> bool) -> (term -> bool) -> term list -> path_setrefine_paths_avoiding paths avoid_later avoid_now terms splits
paths in the set until, if possible, none of subterms at the paths
meets the predicate avoid_later; it does not descend subterms
for which avoid_now holds. Also removes paths not present
in terms.typeargpaths =(path * int) list list
val find_rel_arg : term list -> term array -> (path * int) list -> termval complete_paths_for : path_set -> argpaths -> bool