+let pp_relation r =
+ match r with
+ | Eq i -> sprintf "= %d" i
+ | Ge i -> sprintf ">= %d" i
+ | Gt i -> sprintf "> %d" i
+ | Le i -> sprintf "<= %d" i
+ | Lt i -> sprintf "< %d" i
+
| `MainHypothesis None -> "MainHypothesis"
| `InConclusion -> "InConclusion"
| `InHypothesis -> "InHypothesis"
| `MainHypothesis None -> "MainHypothesis"
| `InConclusion -> "InConclusion"
| `InHypothesis -> "InHypothesis"
-let columns_of_position = function
- | `MainConclusion (Some d) -> `String mainconcl_pos, `Int d
+let columns_of_position pos =
+ match pos with
+ | `MainConclusion (Some (Eq d)) -> `String mainconcl_pos, `Int d
| `MainHypothesis None -> `String mainhyp_pos, `Null
| `InConclusion -> `String inconcl_pos, `Null
| `InHypothesis -> `String inhyp_pos, `Null
| `InBody -> `String inbody_pos, `Null
| `MainHypothesis None -> `String mainhyp_pos, `Null
| `InConclusion -> `String inconcl_pos, `Null
| `InHypothesis -> `String inhyp_pos, `Null
| `InBody -> `String inbody_pos, `Null
(*
let metadata_ns = "http://www.cs.unibo.it/helm/schemas/schema-helm"
let uri_of_pos pos = String.concat "#" [metadata_ns; pp_position pos]
*)
(*
let metadata_ns = "http://www.cs.unibo.it/helm/schemas/schema-helm"
let uri_of_pos pos = String.concat "#" [metadata_ns; pp_position pos]
*)
let source = `String about in
let occurrence u = `String u in
List.fold_left
(fun (sort_cols, rel_cols, obj_cols) metadata ->
match metadata with
| `Sort (s, p) ->
let source = `String about in
let occurrence u = `String u in
List.fold_left
(fun (sort_cols, rel_cols, obj_cols) metadata ->
match metadata with
| `Sort (s, p) ->
sort_cols, [source; p; d] :: rel_cols, obj_cols
| `Obj (o, p) ->
let (p, d) = columns_of_position p in
sort_cols, rel_cols,
[source; occurrence o; p; d] :: obj_cols)
sort_cols, [source; p; d] :: rel_cols, obj_cols
| `Obj (o, p) ->
let (p, d) = columns_of_position p in
sort_cols, rel_cols,
[source; occurrence o; p; d] :: obj_cols)
- (fun (sort_cols, rel_cols, obj_cols) (uri, _, metadatas) ->
- let (s, r, o) = columns_of_metadata ~about:uri metadatas in
+ (fun (sort_cols, rel_cols, obj_cols) (uri, _, metadata) ->
+ let (s, r, o) = columns_of_metadata_aux ~about:uri metadata in
+let pp_constr =
+ function
+ | `Sort (sort, p) ->
+ sprintf "Sort %s; [%s]"
+ (CicPp.ppsort sort) (String.concat ";" (List.map pp_position p))
+ | `Rel p -> sprintf "Rel [%s]" (String.concat ";" (List.map pp_position p))
+ | `Obj (uri, p) -> sprintf "Obj %s; [%s]"
+ uri (String.concat ";" (List.map pp_position p))
+