module Context:context with operationssig..end
Internally applies the Compact rule of the model evolution calculus.
As only order preserving (chronological, backjumping) backtracking is used, the context can be seen as a stack of literals, backtracking always removes the last elements that were added.
Each context literal has its unique non-negative id,
which is strictly increasing within the literal stack,
i.e. the oldest context literal has the lowest id,
and the most recent added context literal has the highest id.
typeconfig =Config.config
typestatistic =Statistic.statistic
typecounter =Counter.counter
typevar =Var.var
typesymbol =Symbol.symbol
typeterm =Term.term
typeliteral =Term.literal
typeclause =Term.clause
typechoice_point =State.choice_point
typestate =State.state
typeproblem =Problem.problem
typebound =Bound.bound
typefinite_domain =Finite_domain.finite_domain
type element = private {
|
el_id : |
(* | unique id per context literal. | *) |
|
el_literal : |
(* | the context literal. | *) |
|
el_choice_point : |
(* | the choice point in which the context literal was added. | *) |
|
el_pars : |
(* | the parameters of the context literal. | *) |
|
el_generation : |
(* | depth of the tree of context literals needed to compute this context literal. | *) |
|
el_is_fd_incomplete : |
(* | Config.finite_domain mode is active,
and iff true then this context literal depends on the totality axioms.
That is, a refutation depends on the domain size,
and is not a refutation of the original problem. | *) |
|
mutable el_compacted : |
(* | compacted by the context literal with the given id, or none if id = -1 | *) |
type context
val create : config -> statistic -> state -> contextval from_file : string ->
config -> statistic -> state -> contextfrom_file file_name
creates a context from a file.
The file should contain one literal per line, readable by Read_tme.Sys_error on file access failure.Failure if the file contains invalid input.val null_element : elementval assert_element : elementTerm.assert_literal, always valid choice point.val plus_v_element : elementTerm.plus_v, always valid choice point.val minus_v_element : elementTerm.minus_v, always valid choice point.val add : context -> literal -> int -> bool -> elementadd context literal generation is_fd_incomplete
adds a new literal to the context,
for generation see Context.element.val is_universal : context -> boolval element_equal : element -> element -> boolval element_for_literal : context -> literal -> element optionval most_recent_element : context -> elementNot_found if the context is empty.val is_more_recent : element -> element -> boolval iter : (element -> unit) -> context -> unitval fold : ('a -> element -> 'a) -> 'a -> context -> 'aval check_contradictory : context -> literal -> element optioncheck_contradictory context literal
checks if literal is contradictory with the context.
Returns a contradictory context element, if one exists.val check_subsumed : context -> literal -> element optioncheck_subsumed context literal
checks if literal is (p-preservingly) subsumed by the context.
Returns a subsuming context element, if one exists.val check_productive : context ->
literal -> literal -> element optioncheck_productive context producer produced
checks if producer is producing the negation of produced in the context
(that is producer is the context literal and produced the remainder literal
of the context unifier to check).
Returns a shielding context element, if one exists.val is_true : context -> literal -> boolval find_all_unifiable : context -> literal -> element listfind_all_unifiable context literal
returns all (also compacted) context elements that unify with literalval find_all_subsuming : context -> literal -> element listfind_all_subsuming context literal
returns all (also compacted) context elements that (p-preservingly) subsume literalval element_to_string : element -> stringval print_context : context -> Pervasives.out_channel -> unitval print_DIG : context -> Pervasives.out_channel -> problem -> unitprint_DIG context out problem
prints the context in the DIG model representation,
i.e. as a disjunction of implicit generalizations.
an implicit generalization is an atom paired with a set of exception atoms,
A \ {B_0, ..., B_n} ,
with the semantics that all ground instances of A
except for all ground instances of any B_i are true in the described model.
problem must contain the input problem.
does only print non-compacted literals defined over the input signature,
like Context.print_context show_model.
val print_tptp_model : context ->
Pervasives.out_channel ->
problem -> finite_domain option -> bound -> unit
in finite domain mode the finite domain must be given,
and the bound is needed to get the current domain size.
val print_multiplication_tables : context ->
Pervasives.out_channel -> problem -> bound -> unit
if tptp is true, then the
TPTP format is used,
otherwise a more concise and easier human-readable notation.
val print_max_size : context -> unitPrint.print_label).val backtrack : context -> unit
DEPENDENCY: State_backtrack must have been executed before.