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 -> context
val from_file : string ->
config -> statistic -> state -> context
from_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 : element
val assert_element : element
Term.assert_literal
, always valid choice point.val plus_v_element : element
Term.plus_v
, always valid choice point.val minus_v_element : element
Term.minus_v
, always valid choice point.val add : context -> literal -> int -> bool -> element
add context literal generation is_fd_incomplete
adds a new literal
to the context
,
for generation
see Context.element
.val is_universal : context -> bool
val element_equal : element -> element -> bool
val element_for_literal : context -> literal -> element option
val most_recent_element : context -> element
Not_found
if the context is empty.val is_more_recent : element -> element -> bool
val iter : (element -> unit) -> context -> unit
val fold : ('a -> element -> 'a) -> 'a -> context -> 'a
val check_contradictory : context -> literal -> element option
check_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 option
check_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 option
check_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 -> bool
val find_all_unifiable : context -> literal -> element list
find_all_unifiable context literal
returns all (also compacted) context elements that unify with literal
val find_all_subsuming : context -> literal -> element list
find_all_subsuming context literal
returns all (also compacted) context elements that (p-preservingly) subsume literal
val element_to_string : element -> string
val print_context : context -> Pervasives.out_channel -> unit
val print_DIG : context -> Pervasives.out_channel -> problem -> unit
print_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 -> unit
Print.print_label
).val backtrack : context -> unit
DEPENDENCY: State_backtrack
must have been executed before.