Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit bc0cad76 authored by POGODALLA Sylvain's avatar POGODALLA Sylvain
Browse files

Fix warning issues in test executables

parent dfa5b26a
......@@ -74,7 +74,7 @@ let () =
let () = print_newline()
let () =
let () = UtilsLib.Log.set_level "test" Logs.Debug in
let () = UtilsLib.Log.set_level ~app:"test" Logs.Debug in
OddIntArray.collect_results
(fun _ res -> Printf.printf "State: %s\n%!" (string_of_res res))
()
......
......@@ -22,9 +22,9 @@ struct
let rec comp_list l1 l2 =
(match (l1,l2) with
([],[]) -> 0
| (true::ll1,false::ll2) -> 1
| (true::_ll1,false::_ll2) -> 1
| (true::ll1,true::ll2) -> comp_list ll1 ll2
| (false::ll1,true::ll2) -> -1
| (false::_ll1,true::_ll2) -> -1
| (false::ll1,false::ll2) -> comp_list ll1 ll2
|_ -> failwith "comp_list: lists do not have the same length"
)
......@@ -109,7 +109,7 @@ struct
let add_some_var_to_set prop =
function Ad(p,ad_var) ->
function Ad(_p,ad_var) ->
function var_set ->
List.fold_left
(function s ->
......@@ -197,8 +197,8 @@ struct
let init_clause_context prog_context clause ad_pred=
let Prog_context
(has_changed,
program,
initial_interesting_adornments,
_program,
_initial_interesting_adornments,
interesting_adornments,
is_impermissible,
impermissible_adornment,
......@@ -358,7 +358,7 @@ struct
let update_prog_context ad_pred prog_context =
let Prog_context
(has_changed,
(_has_changed,
program,
initial_interesting_adornments,
interesting_adornments,
......@@ -416,7 +416,7 @@ let reset_prog_context prog_context =
let rec process_prog_context prog_context =
match prog_context with
Prog_context(false,_,_,interesting_adornments,_,impermissible_adornments,_) ->
Prog_context(false,_,_,_interesting_adornments,_,_impermissible_adornments,_) ->
prog_context
| Prog_context(_,_,_,interesting_adornments,_,_,_) ->
let prog_context =
......@@ -467,7 +467,7 @@ let reset_prog_context prog_context =
is_impermissible,
impermissible_adornments,
compare_adornments,
new_clauses) =
_new_clauses) =
prog_context
in
let AdP(_,adornment) = ad_pred in
......@@ -655,11 +655,11 @@ let reset_prog_context prog_context =
let compare_adornments ad1 ad2=
match (ad1,ad2) with
(Ad(k1,ad_vars1),Ad(k2,ad_vars2)) ->
(Ad(_k1,ad_vars1),Ad(_k2,ad_vars2)) ->
let count_bound_free_vars =
List.fold_left
(function (free, bound) ->
function (v,bool) ->
function (_v,bool) ->
if bool
then (free,bound+1)
else (free+1,bound))
......@@ -717,11 +717,11 @@ let reset_prog_context prog_context =
let compare_adornments2 ad1 ad2=
match (ad1,ad2) with
(Ad(k1,ad_vars1),Ad(k2,ad_vars2)) ->
(Ad(_k1,ad_vars1),Ad(_k2,ad_vars2)) ->
let count_bound_free_vars =
List.fold_left
(function (free, bound,fb,parity,last) ->
function (v,bool) ->
function (_v,bool) ->
let (free, bound)=
if bool
then (free,bound+1)
......@@ -795,7 +795,7 @@ let reset_prog_context prog_context =
let compare_adornments3 neq ad1 ad2=
match (ad1,ad2) with
(Ad(k1,ad_vars1),Ad(k2,ad_vars2)) ->
(Ad(k1,ad_vars1),Ad(_k2,ad_vars2)) ->
(if Some(k1)=neq
then
(match ad_vars1 with
......@@ -810,7 +810,7 @@ let reset_prog_context prog_context =
let count_bound_free_vars =
List.fold_left
(function (free, bound) ->
function (v,bool) ->
function (_v,bool) ->
if bool
then (free,bound+1)
else (free+1,bound))
......
......@@ -53,7 +53,7 @@ module Datalog_signature =
(List.length l, S(l@[(arity,name)],eq,neq))
let get_identifier_of_name name =
function S (l,eq,neq) ->
function S (l,_eq,_neq) ->
let rec get_place_name l n =
match l with
[] -> raise Undefined_predicate
......@@ -94,7 +94,7 @@ module Datalog_signature =
let add_eq =
function S(l,eq,neq) as sign ->
match eq with
Some(n) -> sign
Some(_n) -> sign
| None ->
let n = List.length l in
S(l@[(2,"=")], Some n,neq)
......@@ -110,7 +110,7 @@ module Datalog_signature =
let add_neq =
function S(l,eq,neq) as sign ->
match neq with
Some(n) -> sign
Some(_n) -> sign
| None ->
let n = List.length l in
S(l@[(2,"~=")], eq, Some n)
......
......@@ -95,13 +95,13 @@ struct
module Ordered_items =
struct
type t = item
let compare k1 k2 = Pervasives.compare k1 k2
let compare k1 k2 = Stdlib.compare k1 k2
end
module Ordered_eval_rules =
struct
type t = eval_rule
let compare k1 k2 = Pervasives.compare k1 k2
let compare k1 k2 = Stdlib.compare k1 k2
end
module Item_set = Set.Make(Ordered_items)
......@@ -193,7 +193,7 @@ struct
)
else failwith "extend_eval_rule: trying to extend a rule with a rong item.")
let rec process_item (It(pred,_) as item) (M(_,_,ev_rules,_,_,_,_,_) as mem) =
let process_item (It(pred,_) as item) (M(_,_,ev_rules,_,_,_,_,_) as mem) =
let pred_ev_rules = Array.get ev_rules pred in
let (M(sign,chart,ev_rules,agenda,facts,step,eq,neq)) =
ER_set.fold
......@@ -222,7 +222,7 @@ struct
M(sign,chart,ev_rules,Item_set.add fact agenda,remaining_facts,step+1,eq,neq)
)
let rec naive_solve (M(sign,chart,ev_rules,agenda,facts,step,eq,neq) as mem)=
let rec naive_solve (M(_sign,_chart,_ev_rules,agenda,facts,_step,_eq,_neq) as mem)=
if(Item_set.is_empty agenda)
then
(if facts=[]
......@@ -244,7 +244,7 @@ struct
let _ =
List.fold_left
(function () ->
function Program1.Cl(pred,(Program1.Pred(k,args) as fst)::rem) ->
function Program1.Cl(pred,(Program1.Pred(k,_args) as fst)::rem) ->
let ev_rule = ER(pred,fst,rem,Int_map.empty) in
Array.set ev_rules k (ER_set.add ev_rule (Array.get ev_rules k))
|_ -> failwith "init_solver: the program contains a clause with no rhs."
......
......@@ -2,6 +2,7 @@
(test
(name test)
(flags (:standard -w -27))
(libraries
utilsLib
logic))
......
module Int_map = Map.Make(
struct
type t=int
let compare = Pervasives.compare
let compare = Stdlib.compare
end
)
......@@ -4,7 +4,7 @@ struct
(* copied from genlex.ml*)
(* let initial_buffer = String.create 32 *)
let initial_buffer = String.make 32 ' '
let initial_buffer = Bytes.make 32 ' '
let buffer = ref initial_buffer
let bufpos = ref 0
......@@ -12,17 +12,19 @@ struct
let reset_buffer () = buffer := initial_buffer; bufpos := 0
let store c =
if !bufpos >= String.length !buffer then
if !bufpos >= Bytes.length !buffer then
begin
let newbuffer = String.make (2 * !bufpos) ' ' in
String.blit !buffer 0 newbuffer 0 !bufpos;
let newbuffer = Bytes.make (2 * !bufpos) ' ' in
Bytes.blit !buffer 0 newbuffer 0 !bufpos;
buffer := newbuffer
end;
String.set !buffer !bufpos c;
Bytes.set !buffer !bufpos c;
incr bufpos
let get_string () =
let s = String.sub !buffer 0 !bufpos in buffer := initial_buffer; s
let s = Bytes.sub !buffer 0 !bufpos in
let () = buffer := initial_buffer in
Bytes.to_string s
(*The lexer*)
......@@ -46,7 +48,7 @@ struct
let col pos = let P(line,col) = pos in P(line,col+1)
let line pos = let P(line,col) = pos in P(line+1,0)
let line pos = let P(line,_col) = pos in P(line+1,0)
let print_pos pos =
let P(line,col) = pos in
......@@ -153,7 +155,7 @@ struct
Some '*' -> Stream .junk stream ; maybe_end_comment stream (col pos)
| Some ('\n') ->
Stream.junk stream; comment stream (line pos)
| Some (c) ->
| Some (_c) ->
Stream.junk stream; comment stream (col pos)
|_ -> raise Stream.Failure
and
......@@ -161,7 +163,7 @@ struct
match Stream.peek stream with
Some ')' -> Stream.junk stream ; (col pos)
| Some '*' -> Stream.junk stream ; maybe_end_comment stream (col pos)
| Some (c) -> Stream.junk stream ; comment stream (col pos)
| Some (_c) -> Stream.junk stream ; comment stream (col pos)
|_ -> raise Stream.Failure
end
......@@ -136,7 +136,7 @@ struct
is_intensional (mark_intensionality ad_program) k
)
in
let Adornment.AProg(sign,interesting_adornments,ad_clauses) = ad_program in
let Adornment.AProg(sign,interesting_adornments,_ad_clauses) = ad_program in
let Datalog_signature.S(_,eq,neq) = sign in
let ad_list = Adornment.Adorned_predicate_set.elements interesting_adornments in
let (_,l,map,_,new_eq,new_neq) =
......
open Pmcfg
open Datalog_signature
open String_map
open Int_map
open Program
module Oriented_pmcfg =
......@@ -21,7 +18,7 @@ module Oriented_pmcfg =
(Ord_cat(k1,arg_ord_1),Ord_cat(k2,arg_ord_2)) ->
if k1=k2
then
Pervasives.compare arg_ord_1 arg_ord_2
Stdlib.compare arg_ord_1 arg_ord_2
else
(if k1>k2
then 1
......
......@@ -24,7 +24,7 @@ struct
let program_of_pmcfg_gen grammar is_naive =
match grammar with
Grammar (sign,rules,init) ->
Grammar (sign,rules,_init) ->
let new_sign =
(match sign with
Datalog_signature.S(l,_,_) ->
......@@ -95,7 +95,7 @@ struct
in
let eq_pred ranges =
Int_map.fold
(function i ->
(function _i ->
function ((i,j),eq_list) ->
function eq_pred_list ->
eq_pred_list @
......@@ -112,7 +112,7 @@ struct
let clause_of_rule grule string_predicates sign =
(match grule with
R(Lhs_cat(id,args),rhs) ->
let (vars,i,ranges,ext_pred,string_predicates,sign) =
let (vars,_i,ranges,ext_pred,string_predicates,sign) =
List.fold_left
(
function (vars,i,ranges,ext_pred,string_predicates,sign) ->
......@@ -137,7 +137,7 @@ struct
(Program.Cl(Program.Pred(rg_eq,[0;1;2;3]),[Program.Pred(eq,[0;1]); Program.Pred(eq,[2;3])]))
::
(String_map.fold
(function s ->
(function _s ->
function id ->
function rules ->
(if is_naive
......
......@@ -169,6 +169,7 @@ open Lexicalizer.Lexicalizer
else parse_error pos ("The variable "^name^" is used in the left hand side of the rule but is not declared in the right hand side.")
)
variables
()
in
match lhs with
Some lhs_cat ->
......
......@@ -11,7 +11,7 @@ struct
module Ordered_int_pair =
struct
type t=int*int
let compare p1 p2 = Pervasives.compare p1 p2
let compare p1 p2 = Stdlib.compare p1 p2
end
module Pair_map = Map.Make(Ordered_int_pair)
......
......@@ -202,11 +202,11 @@ struct
added_predicates,
new_clauses,
n,
used_vars,
_used_vars,
new_rhs,
remaining_lhs,
remaining_vars,
remaining_preds
_remaining_vars,
_remaining_preds
)= clause_context
in
let clause = Program.Cl(new_rhs,remaining_lhs) in
......
......@@ -61,7 +61,7 @@ module Program =
List.filter (is_p_predicate_of_clause p) cls
let add_pred_var_to_set =
function Pred(p,vars) ->
function Pred(_p,vars) ->
function var_set ->
List.fold_left
(function s ->
......@@ -72,7 +72,7 @@ module Program =
vars
let add_some_var_to_set prop=
function Pred(p,vars) ->
function Pred(_p,vars) ->
function var_set ->
List.fold_left
(function s ->
......
......@@ -5,7 +5,7 @@ module Program_printer =
struct
open Program
let rec print_signature s =
let print_signature s =
let rec aux = function
| [] -> ""
| (a,n)::q -> (Printf.sprintf "%s (arité %d)\n" n a)^(aux q) in
......@@ -27,7 +27,7 @@ module Program_printer =
let print_pred sign=
function Pred(k,var) ->
let name = try Datalog_signature.get_name k sign with Failure "nth" -> Printf.sprintf "Erreur : %d" k
let name = try Datalog_signature.get_name k sign with Failure msg -> Printf.sprintf "Erreur (%s) : %d" msg k
in name^(print_arg var)
let print_clause sign =
......
module String_map = Map.Make(
struct
type t=string
let compare =Pervasives.compare
let compare =Stdlib.compare
end
)
......@@ -51,6 +51,6 @@ let term_list =
(*let () = test (LAbs ("o",(LAbs ("s",(App ((App ((Const 1),(LVar 0))),(App ((App ((Const 1),(Const 5))),(LVar 1))))))))) *)
let () = Log.set_level Logs.Debug
let () = Log.set_level ~app: "typeInference_test" Logs.Debug
let () = List.iter test term_list
......@@ -5,7 +5,7 @@ module Manager =
UtilsLib.DependencyManager.Make(struct
type t = char
let compare=compare
let to_string=to_string
let _to_string=to_string
end)
let manager = Manager.empty
......@@ -40,7 +40,7 @@ let manager =
let test elt =
let () = UtilsLib.Log.set_level Logs.Warning in
let () = UtilsLib.Log.set_level ~app:"test_dependencyManager" Logs.Warning in
let lst = Manager.dependencies elt manager in
let () = Logs.app (fun m -> m "An appropriate dependency list from %c is:" elt) in
let () = Logs.app (fun m -> m "%s" (UtilsLib.Utils.string_of_list " " to_string lst)) in
......
......@@ -160,7 +160,7 @@ let rec ask_for_next_parse ?(interactive = true) f param =
| false -> ()
let () =
let () = UtilsLib.Log.set_level Logs.Warning in
let () = UtilsLib.Log.set_level ~app:"test_Sharedforest" Logs.Warning in
let resume = init tree1 in
let () = Logs.app (fun m -> m "**********************************") in
ask_for_next_parse ~interactive:false
......
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