Commit e6f52504 authored by François Bobot's avatar François Bobot

session pairing: simplify and move session pairing.

  session pairing doesn't compute anymore the shape of the goal, it is
 done before. It was able to compute the shape only when the checksum
 of the task was different, but computing the checksum of the task is
 way more time consuming than computing the shape of the goal (and
 include it).

 So this commit simplify greatly the function and theoretically
 augment just a little the time spent. Experimentaly it's the inverse
 on max_matrix. Until "update_session: done" with or without modifying
 the checksums:

            before     |   after
without : 0.21-0.22 s  | 0.16-0.17 s
with    : 0.23-0.26 s  | 0.18-0.20 s
parent 59762d5e
This diff is collapsed.
...@@ -69,8 +69,8 @@ type 'a goal = private ...@@ -69,8 +69,8 @@ type 'a goal = private
goal_name : Ident.ident; (** The ident of the task *) goal_name : Ident.ident; (** The ident of the task *)
goal_expl : expl; goal_expl : expl;
goal_parent : 'a goal_parent; goal_parent : 'a goal_parent;
mutable goal_checksum : string; (** checksum of the task *) mutable goal_checksum : Termcode.checksum; (** checksum of the task *)
mutable goal_shape : string; (** shape are produced by the module Termcode *) mutable goal_shape : Termcode.shape; (** shape of the task *)
mutable goal_verified : bool; mutable goal_verified : bool;
goal_task: task_option; goal_task: task_option;
mutable goal_expanded : bool; mutable goal_expanded : bool;
......
This diff is collapsed.
...@@ -20,6 +20,16 @@ ...@@ -20,6 +20,16 @@
val current_shape_version : int val current_shape_version : int
type checksum
val print_checksum: Format.formatter -> checksum -> unit
val string_of_checksum: checksum -> string
val checksum_of_string: string -> checksum
type shape
val print_shape: Format.formatter -> shape -> unit
val string_of_shape: shape -> string
val shape_of_string: string -> shape
(* (*
val t_dist : term -> term -> float val t_dist : term -> term -> float
(** returns an heuristic distance between the two given terms. The (** returns an heuristic distance between the two given terms. The
...@@ -38,7 +48,7 @@ val t_dist : term -> term -> float ...@@ -38,7 +48,7 @@ val t_dist : term -> term -> float
*) *)
val t_shape_buf : ?version:int -> Term.term -> string val t_shape_buf : ?version:int -> Term.term -> shape
(** returns a shape of the given term *) (** returns a shape of the given term *)
(* (*
...@@ -48,4 +58,25 @@ val t_shape_list : Term.term -> string list ...@@ -48,4 +58,25 @@ val t_shape_list : Term.term -> string list
val pr_shape_list : Format.formatter -> Term.term -> unit val pr_shape_list : Format.formatter -> Term.term -> unit
*) *)
val task_checksum : ?version:int -> Task.task -> string val task_checksum : ?version:int -> Task.task -> checksum
(** Pairing using shape and checksum *)
module type S = sig
type t
val checksum : t -> checksum
val shape : t -> shape
val name : t -> Ident.ident
end
module AssoMake (Old : S) (New : S) : sig
val associate : Old.t list -> New.t list -> (New.t * Old.t option *bool) list
(** associate the new things {New.t} to old things {Old.t}.
(n,o,b) means if [o,b] is:
- [Some o, true] the old thing [o] have the same checksum that the new
thing [n].
- [Some o, false] no old things have the same checksum
than [n]. The new thing [o] has a shape similar to [n]
- [None] no old thing were similar enough. *)
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment