Maj terminée. Pour consulter la release notes associée voici le lien :
https://about.gitlab.com/releases/2021/07/07/critical-security-release-gitlab-14-0-4-released/

Commit 02876411 authored by MARCHE Claude's avatar MARCHE Claude
Browse files

use of GTree row_reference in new interface

parent 4faeadaf
...@@ -41,9 +41,9 @@ module Array ...@@ -41,9 +41,9 @@ module Array
parameter length : a:array 'a -> {} int reads a { result = length a } parameter length : a:array 'a -> {} int reads a { result = length a }
parameter make : n:int -> v:'a -> parameter make : n:int -> v:'a ->
{} {}
array 'a array 'a
{ length result = n and forall i:int. 0 <= i < n -> result[i] = v} { length result = n and forall i:int. 0 <= i < n -> result[i] = v}
parameter append : a1:array 'a -> a2:array 'a -> parameter append : a1:array 'a -> a2:array 'a ->
...@@ -59,38 +59,38 @@ module Array ...@@ -59,38 +59,38 @@ module Array
{ length result = len and { length result = len and
forall i:int. 0 <= i < len -> result[i] = a[ofs + i] } forall i:int. 0 <= i < len -> result[i] = a[ofs + i] }
parameter copy : a:array 'a -> parameter copy : a:array 'a ->
{} {}
array 'a array 'a
{ length result = length a and { length result = length a and
forall i:int. 0 <= i < length result -> result[i] = a[i] } forall i:int. 0 <= i < length result -> result[i] = a[i] }
parameter fill : a:array 'a -> ofs:int -> len:int -> v:'a -> parameter fill : a:array 'a -> ofs:int -> len:int -> v:'a ->
{ 0 <= ofs and ofs + len <= length a } { 0 <= ofs and ofs + len <= length a }
unit unit
writes a writes a
{ (forall i:int. { (forall i:int.
(0 <= i < ofs or ofs + len <= i < length a) -> a[i] = (old a)[i]) (0 <= i < ofs or ofs + len <= i < length a) -> a[i] = (old a)[i])
and and
(forall i:int. (forall i:int.
ofs <= i < ofs + len -> a[i] = v) } ofs <= i < ofs + len -> a[i] = v) }
parameter blit : parameter blit :
a1:array 'a -> ofs1:int -> a2:array 'a -> ofs2:int -> len:int -> a1:array 'a -> ofs1:int -> a2:array 'a -> ofs2:int -> len:int ->
{ 0 <= ofs1 and ofs1 + len <= length a1 and { 0 <= ofs1 and ofs1 + len <= length a1 and
0 <= ofs2 and ofs2 + len <= length a2 } 0 <= ofs2 and ofs2 + len <= length a2 }
unit unit
writes a2 writes a2
{ (forall i:int. { (forall i:int.
(0 <= i < ofs2 or ofs2 + len <= i < length a2) -> a2[i] = (old a2)[i]) (0 <= i < ofs2 or ofs2 + len <= i < length a2) -> a2[i] = (old a2)[i])
and and
(forall i:int. (forall i:int.
ofs2 <= i < ofs2 + len -> a2[i] = a1[ofs1 + i - ofs2]) } ofs2 <= i < ofs2 + len -> a2[i] = a1[ofs1 + i - ofs2]) }
(* TODO? (* TODO?
- concat : 'a array list -> 'a array - concat : 'a array list -> 'a array
- to_list - to_list
- of_list - of_list
*) *)
end end
...@@ -131,7 +131,7 @@ module TestArray ...@@ -131,7 +131,7 @@ module TestArray
end end
(* (*
Local Variables: Local Variables:
compile-command: "unset LANG; make -C .. modules/stdlib" compile-command: "unset LANG; make -C .. modules/stdlib"
End: End:
*) *)
...@@ -359,12 +359,19 @@ let image_of_result ~obsolete result = ...@@ -359,12 +359,19 @@ let image_of_result ~obsolete result =
module M = Session.Make module M = Session.Make
(struct (struct
type key = Gtk.tree_iter type key = GTree.row_reference
let create ?parent () =
let parent = match parent with
| None -> None
| Some r -> Some r#iter
in
let iter = goals_model#append ?parent () in
goals_model#get_row_reference (goals_model#get_path iter)
let create ?parent () = goals_model#append ?parent ()
let remove row = let remove row =
let (_:bool) = goals_model#remove row in () let (_:bool) = goals_model#remove row#iter in ()
let idle f = let idle f =
let (_ : GMain.Idle.id) = GMain.Idle.add f in () let (_ : GMain.Idle.id) = GMain.Idle.add f in ()
...@@ -378,18 +385,18 @@ module M = Session.Make ...@@ -378,18 +385,18 @@ module M = Session.Make
let set_row_status row b = let set_row_status row b =
if b then if b then
begin begin
goals_view#collapse_row (goals_model#get_path row); goals_view#collapse_row row#path;
goals_model#set ~row ~column:status_column !image_yes; goals_model#set ~row:row#iter ~column:status_column !image_yes;
end end
else else
begin begin
goals_model#set ~row ~column:status_column !image_unknown; goals_model#set ~row:row#iter ~column:status_column !image_unknown;
end end
let set_proof_state ~obsolete a = let set_proof_state ~obsolete a =
let row = a.M.proof_key in let row = a.M.proof_key in
let res = a.M.proof_state in let res = a.M.proof_state in
goals_model#set ~row ~column:status_column goals_model#set ~row:row#iter ~column:status_column
(image_of_result ~obsolete res); (image_of_result ~obsolete res);
let t = match res with let t = match res with
| Session.Done { Call_provers.pr_time = time } -> | Session.Done { Call_provers.pr_time = time } ->
...@@ -397,7 +404,7 @@ let set_proof_state ~obsolete a = ...@@ -397,7 +404,7 @@ let set_proof_state ~obsolete a =
| _ -> "" | _ -> ""
in in
let t = if obsolete then t ^ " (obsolete)" else t in let t = if obsolete then t ^ " (obsolete)" else t in
goals_model#set ~row ~column:time_column t goals_model#set ~row:row#iter ~column:time_column t
let model_index = Hashtbl.create 17 let model_index = Hashtbl.create 17
...@@ -413,15 +420,15 @@ let init = ...@@ -413,15 +420,15 @@ let init =
fun row any -> fun row any ->
incr cpt; incr cpt;
Hashtbl.add model_index !cpt any; Hashtbl.add model_index !cpt any;
goals_model#set ~row ~column:index_column !cpt; goals_model#set ~row:row#iter ~column:index_column !cpt;
goals_model#set ~row ~column:icon_column goals_model#set ~row:row#iter ~column:icon_column
(match any with (match any with
| M.Goal _ -> !image_file | M.Goal _ -> !image_file
| M.Theory _ | M.Theory _
| M.File _ -> !image_directory | M.File _ -> !image_directory
| M.Proof_attempt _ -> !image_prover | M.Proof_attempt _ -> !image_prover
| M.Transformation _ -> !image_transf); | M.Transformation _ -> !image_transf);
goals_model#set ~row ~column:name_column goals_model#set ~row:row#iter ~column:name_column
(match any with (match any with
| M.Goal g -> M.goal_expl g | M.Goal g -> M.goal_expl g
| M.Theory th -> M.theory_name th | M.Theory th -> M.theory_name th
...@@ -711,7 +718,7 @@ let rec collapse_proved_goal g = ...@@ -711,7 +718,7 @@ let rec collapse_proved_goal g =
if M.goal_proved g then if M.goal_proved g then
begin begin
let row = M.goal_key g in let row = M.goal_key g in
goals_view#collapse_row (goals_model#get_path row); goals_view#collapse_row row#path;
end end
else else
Hashtbl.iter Hashtbl.iter
...@@ -722,7 +729,7 @@ let collapse_verified_theory th = ...@@ -722,7 +729,7 @@ let collapse_verified_theory th =
if M.verified th then if M.verified th then
begin begin
let row = M.theory_key th in let row = M.theory_key th in
goals_view#collapse_row (goals_model#get_path row); goals_view#collapse_row row#path;
end end
else else
List.iter collapse_proved_goal (M.goals th) List.iter collapse_proved_goal (M.goals th)
...@@ -731,7 +738,7 @@ let collapse_verified_file f = ...@@ -731,7 +738,7 @@ let collapse_verified_file f =
if f.M.file_verified then if f.M.file_verified then
begin begin
let row = f.M.file_key in let row = f.M.file_key in
goals_view#collapse_row (goals_model#get_path row); goals_view#collapse_row row#path;
end end
else else
List.iter collapse_verified_theory f.M.theories List.iter collapse_verified_theory f.M.theories
......
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