Commits

Sébastien Ferré committed 471a07f

Cleaning comments out.

Comments (0)

Files changed (2)

 module AST = Lisql_ast
 (*module Syntax1 = Lisql_syntax1 (* old-version parsing *)*)
 module Syntax = Lisql_syntax (* current-version parsing and printing *)
-(*module Pretty = Lisql_pretty*)
 module Display = Lisql_display
 module Semantics = Lisql_semantics
 module Transf = Lisql_transf
 	  ([],[]) blank2cpt in
       b2v in
     description_unblank_s1 blank2var np
-(*	    
-    let np', _vars, _blank2var = description_vars_s1 (np,[],[]) in
-    np'
-*)
 and description_aux ~obs store path backrole_opt n =
   let path1 = n::path in
   let d_n = store#get_description n in
   | And l ->
       And (List.map (fun f -> description_unblank_p1 blank2var f) l)
   | f -> f
-(*
-and description_vars (d,vars,blank2var) =
-  match d with
-  | Role (r, np) ->
-      let np',vars',blank2var' = description_vars_s1 (np,vars,blank2var) in
-      Role (r,np'), vars', blank2var'
-  | Struct (funct, args) ->
-      let args' = Array.copy args in
-      let vars', blank2var' =
-	Common.fold_for
-	  (fun i (vars',blank2var') -> 
-	    let arg',vars'',blank2var'' = description_vars_s1 (args.(i-1),vars',blank2var') in
-	    args'.(i-1) <- arg';
-	    vars'',blank2var'')
-	  1 (Array.length args)
-	  (vars,blank2var) in
-      Struct (funct, args'), vars', blank2var'
-  | Arg (funct,i,args,st) ->
-      let args' = Array.copy args in
-      let vars', blank2var' =
-	Common.fold_for
-	  (fun i (vars',blank2var') ->
-	    let arg',vars'',blank2var'' = description_vars_s1 (args.(i-1),vars',blank2var') in
-	    args'.(i-1) <- arg';
-	    vars'',blank2var'')
-	  1 (Array.length args)
-	  (vars,blank2var) in
-      let st', vars'', blank2var'' = description_vars_s1 (st,vars',blank2var') in
-      Arg (funct,i,args',st'), vars'', blank2var''
-  | And l ->
-      let l', vars', blank2var' =
-	List.fold_left
-	  (fun (l',vars',blank2var') d ->
-	    let d', vars'', blank2var'' = description_vars (d,vars',blank2var') in
-	    d'::l',vars'',blank2var'')
-	  ([],vars,blank2var) l in
-      And (List.rev l'), vars', blank2var'
-  | _ -> d, vars, blank2var
-and description_vars_s1 (np,vars,blank2var) =
-  match np with
-  | Det (Name (Rdf.Blank _ as n), f) ->
-      let f, vars, blank2var = description_vars (f,vars,blank2var) in
-      (try
-	let v = List.assoc n blank2var in
-	Det (Ref v, f), vars, blank2var
-      with _ ->
-	let v = get_new_var vars in
-	Det (Qu (An, Some v), f), v::vars, (n,v)::blank2var)
-  | Det (Qu (An,v_opt), f) ->
-      let f', vars',blank2var' = description_vars (f,vars,blank2var) in
-      Det (Qu (An,v_opt), f'), vars', blank2var'
-  | _ -> np, vars, blank2var
-*)
 
 (* answers *)
 
 		      else Display.display_name_no_blank ~obs:Tarpit.blind_observer store (store#get_name o) in
 		    d_o @ `Space :: d_c)
 		  sorted_l_index)]
-(*
-      ( match sorted_l_index with
-      | [] -> None
-      | item::items ->
-	  let buf = Buffer.create 500 in
-	  let add_item (c,o) =
-	    Buffer.add_string buf
-	      (if o = 0
-	      then Printf.sprintf "- (%d)" c
-	      else Printf.sprintf "%s (%d)"
-		  (Display.string_of_name ~obs store (store#get_name o))
-		  c) in
-	  add_item item;
-	  List.iter (fun item -> Buffer.add_char buf '\n'; add_item item) items;
-	  Some (Name.typed_literal (Buffer.contents buf) Xsd.uri_string))
-*)
   | `DISTINCT_COUNT ->
       Display.display_name ~obs store (Name.typed_literal (string_of_int (Intmap.cardinal index)) Xsd.uri_integer)
   | `SUM ->

src/lisql_transf.ml

   | _ -> vopt2
 
 
-(*
-let rec focus_up_and foc =
-  match foc with
-  | AtS (s, k) -> let s, k = focus_up_and_s (s, k) in AtS (s, k)
-  | AtS1 (np, k) -> let np, k = focus_up_and_s1 (np, k) in AtS1 (np,k)
-  | AtS2 (det, k) -> foc (* no coordination on S2 *)
-  | AtP1 (f, k) -> let f, k = focus_up_and_p1 (f, k) in AtP1 (f,k)
-  | AtP2 (r, k) -> let r, k = focus_up_and_p2 (r, k) in AtP2 (r,k)
-and focus_up_and_s (s,k) =
-  match k with
-  | SAndN (n,l,k') ->
-      SAnd (Common.list_set_nth l n s), k'
-  | k -> s, k
-and focus_up_and_s1 (np,k) =
-  match k with
-  | NAndN (n,l,k') ->
-      NAnd (Common.list_set_nth l n np), k'
-  | k -> np, k
-and focus_up_and_p1 (f,k) =
-  match k with
-  | AndN (n,l,k') ->
-      And (Common.list_set_nth l n f), k'
-  | k -> f, k
-and focus_up_and_p2 (r,k) =
-  match k with
-  | RAndN (n,l,k') ->
-      RAnd (Common.list_set_nth l n r), k'
-  | k -> r, k
-*)
-
 let focus_up_and foc =
   match foc with
   | AtS (_, SAndN _)
 
 let focus_and_maybe : transf = focus_and >> focus_maybe
 
-(*
-let focus_union x : transf = function
-  | AtP1 (f,k) ->
-      let f, k =
-	match k with
-	| OrN (n,l,k') -> Or (Common.list_set_nth l n f), k'
-	| _ -> f, k in
-      ( match f with
-      | Thing -> Some (AtP1 (x, k))
-      | Or l -> Some (AtP1 (x, OrN (List.length l, l@[x], k)))
-      | _ -> Some (AtP1 (x, OrN (1, [f; x], k))))
-  | AtS1 (np,k) ->
-      let np, k =
-	match k with
-	| NOrN (n,l,k') -> NOr (Common.list_set_nth l n np), k'
-	| _ -> np, k in
-      let npx = an x in
-      ( match np with
-      | Det (Qu (An, _), Thing) -> Some (AtS1 (npx, k))
-      | NOr l -> Some (AtS1 (npx, NOrN (List.length l, l@[npx], k)))
-      | _ -> Some (AtS1 (npx, NOrN (1, [np; npx], k))))
-  | _ -> assert false
-
-let focus_minus x : transf =
-  fun foc ->
-    match focus_up_and foc with
-    | AtP1 (f,k) ->
-	( match f with
-	| Thing -> Some (AtP1 (x, Not0 (x, k)))
-	| And l -> Some (AtP1 (x, Not0 (x, AndN (List.length l, l@[Not x], k))))
-	| _ -> Some (AtP1 (x, Not0 (x, AndN (1, [f; Not x], k)))))
-    | AtS1 (np,k) ->
-	let npx = an x in
-	( match np with
-	| Det (Qu (An, _), Thing) -> Some (AtS1 (npx, NNot0 (npx, k)))
-	| NAnd l -> Some (AtS1 (npx, NNot0 (npx, NAndN (List.length l, l @ [NNot npx], k))))
-	| _ -> Some (AtS1 (npx, NNot0 (npx, NAndN (1, [np; NNot npx], k)))))
-    | _ -> assert false
-
-let focus_inter_smart_list store xs foc =
-  List.fold_left
-    (fun res x ->
-      match res with
-      | None -> None
-      | Some foc -> focus_inter_smart store x foc)
-    (Some foc) xs
-
-let focus_union_list store xs foc =
-  match xs with
-  | [] -> None
-  | x::xs1 ->
-      List.fold_left
-	(fun res x ->
-	  match res with
-	  | None -> None
-	  | Some foc -> focus_union x foc)
-	(focus_inter_smart store x foc) xs1
-
-let focus_minus_list xs foc =
-  List.fold_left
-    (fun res x ->
-      match res with
-      | None -> None
-      | Some foc ->
-	  match focus_minus x foc with
-	  | None -> None
-	  | Some foc -> focus_up foc)
-    (Some foc) xs
-*)
-
 let focus_quantifier (qu : qu) : transf = function
   | AtS1 (Det (Qu (_,v_opt),f), k) ->
       Some (AtS1 (Det (Qu (qu,v_opt),f),k))