(** attempts to prove goal with the given prover. This function adds
a new corresponding attempt for that goal, sets its current
status to Running, launches the prover in a separate process and
returns immediately.
Upon termination of the external process, the prover's answer is
retrieved and database is updated. The [proved] field of the
database is updated, and also these of any goal affected, according
to invariant above. Goal observers are notified of any change
of goal statuses.
@param timelimit CPU time limit given for that attempt, must be positive
@raise AlreadyAttempted if there already exists a non-obsolete
external proof attempt with the same driver and time limit, or
with a different time limit and a result different from Timeout
*)
valadd_transformation:goal->transf->unit
(** adds a transformation on the goal. This function adds a new
corresponding attempt for that goal, computes the subgoals and
and them in the database. In the case where no subgoal is
genereated, the [proved] field is updated, and those of parent
goals.
if this transformation has already been attempted but is markes
as obsolete, it is retried, and the new lists of goals is
carefully matched with the older subgoals, so that if some
subgoals are identical to older ones, then the proof is kept.
Notice that no old proof attempts should be lost in this
process, e.g if the old trans formation produced 3 subgoals
A,B,C, C was proved interactively, and the new transformations
produces only 2 goals, the interactive proof of C is keep in an
extra dummy goal "true"
@raise AlreadyAttempted if this transformation has already been attempted
and is not obsolete
*)
(** TODO: removal of attempts *)
(* {2 goal updates} *)
valadd_or_replace_goal:goal->unit
(** updates the database with the new goal. If a goal with the same
origin already exists, it is checked whether the task to
prove is different or not. If it is the same, proof attempts are
preserved. If not the same, former proof attempts are marked as
obsolete.
IMPORTANT: this kills every running prover tasks
(* autogenerated by sql_orm *)
(** Use the [[Init]] module to open a new database handle. Each object type has its own module with functions to create, modify, save and destroy objects of that type into the SQLite database
*)
(** TODO: full update, removing goals that are not pertinent anymore *)
(** [t db_name] open a Sqlite3 database with filename [db_name] and create any tables if they are missing. @return a database handle which can be used to create and retrieve objects in the database.
@raise Sql_error if a database error is encountered
*)
valdb:t->Sqlite3.db
(** [db handle] @return the underlying Sqlite3 database handle for the connection, for advanced queries.
*)
end
moduleChallenge:sig
typet=<
id:int64option;
set_id:int64option->unit;
log:int64;
set_log:int64->unit;
input:string;
set_input:string->unit;
answer:stringoption;
set_answer:stringoption->unit;
time:float;
set_time:float->unit;
correct:int64;
set_correct:int64->unit;
save:int64;delete:unit
>
(** An object which can be stored in the database with the [save] method call, or removed by calling [delete]. Fields can be accessed via the approriate named method and set via the [set_] methods. Changes are not committed to the database until [save] is invoked.
*)
valt:
?id:int64option->
log:int64->
input:string->
?answer:stringoption->
time:float->
correct:int64->
Init.t->t
(** Can be used to construct a new object. If [id] is not specified, it will be automatically assigned the first time [save] is called on the object. The object is not committed to the database until [save] is invoked. The [save] method will also return the [id] assigned to the object.
@raise Sql_error if a database error is encountered
(** Used to retrieve objects from the database. If an argument is specified, it is included in the search criteria (all fields are ANDed together).
@raise Sql_error if a database error is encountered
*)
end
moduleLog_entry:sig
typet=<
id:int64option;
set_id:int64option->unit;
attempt:int64;
set_attempt:int64->unit;
successful:int64;
set_successful:int64->unit;
starting_date:float;
set_starting_date:float->unit;
end_date:float;
set_end_date:float->unit;
challenges:Challenge.tlist;
set_challenges:Challenge.tlist->unit;
save:int64;delete:unit
>
(** An object which can be stored in the database with the [save] method call, or removed by calling [delete]. Fields can be accessed via the approriate named method and set via the [set_] methods. Changes are not committed to the database until [save] is invoked.
*)
valt:
?id:int64option->
attempt:int64->
successful:int64->
starting_date:float->
end_date:float->
challenges:Challenge.tlist->
Init.t->t
(** Can be used to construct a new object. If [id] is not specified, it will be automatically assigned the first time [save] is called on the object. The object is not committed to the database until [save] is invoked. The [save] method will also return the [id] assigned to the object.
@raise Sql_error if a database error is encountered
(** Used to retrieve objects from the database. If an argument is specified, it is included in the search criteria (all fields are ANDed together).
@raise Sql_error if a database error is encountered
*)
end
moduleAttempts:sig
typet=<
id:int64option;
set_id:int64option->unit;
solution:int64;
set_solution:int64->unit;
log_entries:Log_entry.tlist;
set_log_entries:Log_entry.tlist->unit;
save:int64;delete:unit
>
(** An object which can be stored in the database with the [save] method call, or removed by calling [delete]. Fields can be accessed via the approriate named method and set via the [set_] methods. Changes are not committed to the database until [save] is invoked.
*)
valt:
?id:int64option->
solution:int64->
log_entries:Log_entry.tlist->
Init.t->t
(** Can be used to construct a new object. If [id] is not specified, it will be automatically assigned the first time [save] is called on the object. The object is not committed to the database until [save] is invoked. The [save] method will also return the [id] assigned to the object.
@raise Sql_error if a database error is encountered
(** Used to retrieve objects from the database. If an argument is specified, it is included in the search criteria (all fields are ANDed together).
@raise Sql_error if a database error is encountered
*)
end
moduleSolution:sig
typet=<
id:int64option;
set_id:int64option->unit;
user:string;
set_user:string->unit;
problem_id:int64;
set_problem_id:int64->unit;
solved:int64;
set_solved:int64->unit;
attempts:Attempts.tlist;
set_attempts:Attempts.tlist->unit;
save:int64;delete:unit
>
(** An object which can be stored in the database with the [save] method call, or removed by calling [delete]. Fields can be accessed via the approriate named method and set via the [set_] methods. Changes are not committed to the database until [save] is invoked.
*)
valt:
?id:int64option->
user:string->
problem_id:int64->
solved:int64->
attempts:Attempts.tlist->
Init.t->t
(** Can be used to construct a new object. If [id] is not specified, it will be automatically assigned the first time [save] is called on the object. The object is not committed to the database until [save] is invoked. The [save] method will also return the [id] assigned to the object.
@raise Sql_error if a database error is encountered
(** Used to retrieve objects from the database. If an argument is specified, it is included in the search criteria (all fields are ANDed together).
@raise Sql_error if a database error is encountered
*)
end
moduleProblems:sig
typet=<
id:int64option;
set_id:int64option->unit;
number:int64;
set_number:int64->unit;
short_descr:string;
set_short_descr:string->unit;
description:string;
set_description:string->unit;
solved_by:int64;
set_solved_by:int64->unit;
save:int64;delete:unit
>
(** An object which can be stored in the database with the [save] method call, or removed by calling [delete]. Fields can be accessed via the approriate named method and set via the [set_] methods. Changes are not committed to the database until [save] is invoked.
*)
valt:
?id:int64option->
number:int64->
short_descr:string->
description:string->
solved_by:int64->
Init.t->t
(** Can be used to construct a new object. If [id] is not specified, it will be automatically assigned the first time [save] is called on the object. The object is not committed to the database until [save] is invoked. The [save] method will also return the [id] assigned to the object.
@raise Sql_error if a database error is encountered
(** Used to retrieve objects from the database. If an argument is specified, it is included in the search criteria (all fields are ANDed together).
@raise Sql_error if a database error is encountered
*)
end
moduleUser:sig
typet=<
id:int64option;
set_id:int64option->unit;
username:string;
set_username:string->unit;
password:string;
set_password:string->unit;
email:string;
set_email:string->unit;
allow_contact:int64;
set_allow_contact:int64->unit;
nationality:stringoption;
set_nationality:stringoption->unit;
preferred_language:stringoption;
set_preferred_language:stringoption->unit;
score:int64;
set_score:int64->unit;
solutions:Solution.tlist;
set_solutions:Solution.tlist->unit;
save:int64;delete:unit
>
(** An object which can be stored in the database with the [save] method call, or removed by calling [delete]. Fields can be accessed via the approriate named method and set via the [set_] methods. Changes are not committed to the database until [save] is invoked.
*)
valt:
?id:int64option->
username:string->
password:string->
email:string->
allow_contact:int64->
?nationality:stringoption->
?preferred_language:stringoption->
score:int64->
solutions:Solution.tlist->
Init.t->t
(** Can be used to construct a new object. If [id] is not specified, it will be automatically assigned the first time [save] is called on the object. The object is not committed to the database until [save] is invoked. The [save] method will also return the [id] assigned to the object.
@raise Sql_error if a database error is encountered
(** Use the [[Init]] module to open a new database handle. Each object type has its own module with functions to create, modify, save and destroy objects of that type into the SQLite database
(** [t db_name] open a Sqlite3 database with filename [db_name] and create any tables if they are missing. @return a database handle which can be used to create and retrieve objects in the database.
@raise Sql_error if a database error is encountered
*)
valdb:t->Sqlite3.db
(** [db handle] @return the underlying Sqlite3 database handle for the connection, for advanced queries.
*)
end
moduleChallenge:sig
typet=<
id:int64option;
set_id:int64option->unit;
log:int64;
set_log:int64->unit;
input:string;
set_input:string->unit;
answer:stringoption;
set_answer:stringoption->unit;
time:float;
set_time:float->unit;
correct:int64;
set_correct:int64->unit;
save:int64;delete:unit
>
(** An object which can be stored in the database with the [save] method call, or removed by calling [delete]. Fields can be accessed via the approriate named method and set via the [set_] methods. Changes are not committed to the database until [save] is invoked.
*)
valt:
?id:int64option->
log:int64->
input:string->
?answer:stringoption->
time:float->
correct:int64->
Init.t->t
(** Can be used to construct a new object. If [id] is not specified, it will be automatically assigned the first time [save] is called on the object. The object is not committed to the database until [save] is invoked. The [save] method will also return the [id] assigned to the object.
@raise Sql_error if a database error is encountered
(** Used to retrieve objects from the database. If an argument is specified, it is included in the search criteria (all fields are ANDed together).
@raise Sql_error if a database error is encountered
*)
end
moduleLog_entry:sig
typet=<
id:int64option;
set_id:int64option->unit;
attempt:int64;
set_attempt:int64->unit;
successful:int64;
set_successful:int64->unit;
starting_date:float;
set_starting_date:float->unit;
end_date:float;
set_end_date:float->unit;
challenges:Challenge.tlist;
set_challenges:Challenge.tlist->unit;
save:int64;delete:unit
>
(** An object which can be stored in the database with the [save] method call, or removed by calling [delete]. Fields can be accessed via the approriate named method and set via the [set_] methods. Changes are not committed to the database until [save] is invoked.
*)
valt:
?id:int64option->
attempt:int64->
successful:int64->
starting_date:float->
end_date:float->
challenges:Challenge.tlist->
Init.t->t
(** Can be used to construct a new object. If [id] is not specified, it will be automatically assigned the first time [save] is called on the object. The object is not committed to the database until [save] is invoked. The [save] method will also return the [id] assigned to the object.
@raise Sql_error if a database error is encountered