module DiscreteRule:sig..end
val approximate_monotonic : bool Pervasives.reftrue, ignore what happens on RHSes of rules when assessing
if fluents are positive / negative (only check whether their
LHS+precondition occurrences are negative/positive).val prune_indef_vars : bool Pervasives.reftypematching =(string * int) list
typematchings =Assignments.assignment_set
type struc_rule = {
|
lhs_struc : |
|||
|
rhs_struc : |
(* | optional tuples in _opt_R-relations | *) |
|
emb_rels : |
(* | tau_e-relations, other tau_h | *) |
|
rule_s : |
(* | map of rhs elements to lhs elems | *) |
|
pre : |
(* | precondition | *) |
rhs_struc must have all emb_rels in its signature.typevar_tuples =string array list
type rule = {
|
struc_rule : |
(* | The original rule specification, if any. | *) |
|
lhs_vars : |
(* | Free variables of the condition. | *) |
|
match_formula : |
(* | gets instantiated in the model | *) |
|
rhs_vars : |
(* | replace the matched variables | *) |
|
add_tuples : |
(* | gets added | *) |
|
del_tuples : |
(* | gets removed | *) |
|
rlmap : |
(* | rule_s on variables; None means that the correspondence is 1-1
without renaming. | *) |
val empty_rule : ruleval fluents : rule list -> Aux.Strings.t * Aux.Strings.t * Aux.Strings.tHeuristic.val fluents_make : ?only_pos:bool -> (string -> int -> 'a) -> rule -> 'a listval fluent_preconds : rule list ->
(string -> int) ->
Aux.Strings.t ->
Aux.Strings.t ->
Aux.Strings.t -> (string * (string list * Formula.formula)) listval map_to_formulas : (Formula.formula -> Formula.formula) ->
rule -> rulelhs_vars denoting variables of a rule matching, are not
affected.val fold_over_formulas : (Formula.formula -> 'a -> 'a) -> rule -> 'a -> 'aval map_to_structures : (Structure.structure -> Structure.structure) ->
rule -> ruleval orig_rel_of : string -> stringval special_rel_of : string -> string optionval find_matchings : Structure.structure -> rule -> matchingsval choose_match : Structure.structure ->
rule -> matchings -> matchingDiscreteRule.find_matchings for the same structure and rewrite
rule. Does not guarantee that rewriting the matching will
succeed. Raises Not_found for the empty matchings set.val enumerate_matchings : Structure.structure ->
rule -> matchings -> matching listDiscreteRule.find_matchings for the same
structure and rewrite rule.val rewrite_single : Structure.structure ->
matching -> rule -> Structure.structureRewriting introduces the following form of trace:
_new_R(tup) = +R(tup) = R(tup) and not R_old(tup)
_del_R(tup) = -R(tup) = not R(tup) and R_old(tup)
_right_e(embe)
where embe is the model element corresponding to a RHS
rule element e, or, when LHS and RHS structures have the same
number of elements, e is a LHS structure element due to rule
optimization during rule compilation.
val compile_rule : (string * int) list ->
(string * (string list * Formula.formula)) list ->
struc_rule -> rule
Translate a formula-based rule specification into a processed form.
val compile_formula_rule : (string * int) list ->
(string * (string list * Formula.formula)) list ->
Formula.formula ->
(string list * (string * string list) list) option ->
((string * string option) list * (string * string list) list) option ->
(Formula.formula * (string * bool) list) option -> ruleval changeable_rels : rule list -> string listval translate_from_precond : precond:Formula.formula ->
add:(string * string array) list ->
?del:(string * string array) list ->
nondistinct:string array list ->
emb_rels:string list ->
signat:(string * int) list ->
struc_elems:string list -> struc_rulestruc_vars variables. Only and all the emb_rels
relations are embedded (usually the fluents). (Not all rules can be
generated using this function.) Caution: simplifies the
precondition.
The partition of embedded relations into positive and negative tuples (literals) is extracted from the precondition. If the partition does not cover all tuples, fail.
nondistinct_pairs connects elements that are potentially not
distinct, thus weakening the "embedding" requirement into
"homomorphism" requirement for matching a rule.
val matching_str : matching -> stringval rule_str : rule -> stringval rule_obj_str : rule -> stringval fprint_full : bool -> Format.formatter -> rule -> unitval fprint_rule : Format.formatter -> rule -> unitval fprint_rule : Format.formatter -> rule -> unitval print_rule : rule -> unitval sprint_rule : rule -> stringval is_alpha_identity : struc_rule -> boolval build_rule_s : ?rule_s:(string * string) list ->
Structure.structure -> Structure.structure -> (int * int) listval compare_diff : ?cmp_funs:(float -> float -> bool) ->
struc_rule -> struc_rule -> bool * string