From 9aa151c4affdfd48b63ff6f09db84b2b01721259 Mon Sep 17 00:00:00 2001 From: rsp224 <118997996+rsp224@users.noreply.github.com> Date: Tue, 21 Mar 2023 19:52:11 -0400 Subject: [PATCH 01/24] Create cs3110project.yaml Added cs3110project.yaml --- cs3110project.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 cs3110project.yaml diff --git a/cs3110project.yaml b/cs3110project.yaml new file mode 100644 index 0000000..66630b6 --- /dev/null +++ b/cs3110project.yaml @@ -0,0 +1,28 @@ +--- +# Members of your group. +group: + - name: Thomas McFarland + netid: tfm62 + - name: JT Klenke + netid: jtk96 + - name: Raj Patel + netid: rsp224 +# Your PM. +pm: + name: Shashaank Aiyer + netid: saa244 +# Set to false if you don't want your gallery entry to be public. +publish: false +# Pithy title +title: "Strongly-typed Relational Database" +# OK if this is a Cornell Github link, but public gallery viewers won't be able to see it. +git-repo: "https://github.com/tf-mac/CS3110-Final-Project" +# If you have no demo screencast, replace the url string with an empty string "" +demo-video-url: "" +# Write a short, attention-grabbing description of your project. +desc: > + Our project is a relational database. We structure information in a table. + We can define custom types with OCaml primitives, assign them to + values, and display those types to the user. The user can access all the + functionality through a command line interface that allows interaction + with the database. From 27fbb5bfde4a314cc4f9e2e31d7db571c327efdc Mon Sep 17 00:00:00 2001 From: rsp224 <118997996+rsp224@users.noreply.github.com> Date: Tue, 21 Mar 2023 22:20:35 -0400 Subject: [PATCH 02/24] Create INSTALL.txt --- INSTALL.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 INSTALL.txt diff --git a/INSTALL.txt b/INSTALL.txt new file mode 100644 index 0000000..6cd5b39 --- /dev/null +++ b/INSTALL.txt @@ -0,0 +1,12 @@ +How to Install + +1. Unzip database.zip + +2. cd to the correct file path + +3. Run "dune build" in terminal + +4. In Terminal run the command "_build/default/bin/main.exe". This will open up +the CLI in which you will interact with to create a table where you can define +custom types and assign them values. There are instructions in the CLI that will +help you to understand how to use our code. From a648d9dcde32dd3c863a2c3e4204dd4421a4a2db Mon Sep 17 00:00:00 2001 From: rsp224 <118997996+rsp224@users.noreply.github.com> Date: Wed, 22 Mar 2023 17:59:24 -0400 Subject: [PATCH 03/24] Added Documentation to database.mli - Documented database.mli - Some functions are not properly documented --- database.mli | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 database.mli diff --git a/database.mli b/database.mli new file mode 100644 index 0000000..518b87a --- /dev/null +++ b/database.mli @@ -0,0 +1,99 @@ +module type Table = sig + + type t + (** [t] represents is a table that hold information *) + type value + (** [value] represents a key value associated with an index in a table *) + + val empty : value -> t + (** [empty ex] is the empty table associated with value [ex]*) + val insert : t -> value -> t + (** [insert t id] is the same table as [t] but with an additional entry with + value [id] + *) + val at : t -> value -> value + (** [at t id] is the value in [t] at index [id] + *) + val delete : t -> value -> t + (** [delete t id] deletes the value in [t] at index [id] + *) + val table_to_string : t -> string + (** [table_to_string t] gives the string represention of [t] in a tabular format + *) +end + +type entry = + | String of string + | Float of float + | Int of int + | Char of char + | Bool of bool + | Id of (string * entry) + | Type of (string * entry) +(** [entry] represents a type which can hold all OCaml primitives *) + +val entry_to_string : entry -> string +(** [entry_to_string ent] gives the string representation of [ent]*) + +module ListOfTupleTable : sig + type t = entry list list + (** [t] represents is a table that hold information *) + + type value = entry list + (** [value] represents a key value associated with an index in a table *) + + val empty : value -> t + (** [empty ex] is the empty table associated with value [ex]*) + val insert : t -> value -> t + (** [insert t id] is the same table as [t] but with an additional entry with + value [id]*) + val at : t -> value -> value + (** [at t id] is the value in [t] at index [id]*) + val delete : t -> value -> t + (** [delete t id] deletes the value in [t] at index [id] *) + val table_to_string : t -> string + (** [table_to_string t] gives the string represention of [t] in a + tabular format*) +end + +module Database : sig + exception NoEntry + (** Raised when an entry that does not exist is parsed. *) + exception WrongType + (** Raised when an entry with in incorrect type is parsed *) + + module T = ListOfTupleTable + + val empty : entry list + (** [empty] is a table containing no elements + *) + val add_table : (string *T.t) list -> entry list -> string -> (string *T.t) list + (** [add_table database id name] adds an empty table to [database] + Raises: [Bad] when the value associated with [name] does not have the + same type as [id] + *) + val drop_table : string -> (string * 'b) list -> (string * 'b) list + (** [drop_table name database] deletes a table with value [name] from [database] + *) + val get_table : string -> (string * 'b) list -> string * 'b + (** [get_table name database] is the tabe with value [name] in [database] + *) + val get_reference : entry -> (string *T.t) list -> T.value + (** [get_reference ent database] does not work as intended now + *) + val db_to_string : (string *T.t) list -> string + (** [db_to_string database] gives the string representation of [database] + *) + val check_value : (string *T.t) list -> string -> string -> string -> unit + (** [check_value database tn eid ev] checks whether [tn] [eid] [ev] exists in + [database] (this is totally wrong. We need to clean up this method) + *) + val add_entry : string -> string list -> (string *T.t) list -> (string *T.t) list + (** [add_entry table_name new_row database] is the same [database] with a new + entry [new_row] associated with value [table_name] + *) + val process_types : entry list -> string list -> entry list + (** [process_new_types types inputs] matches user string [inputs] with OCaml + primitive types [types] + *) +end From f3693616900fd15af678df0999e28c11814cbe74 Mon Sep 17 00:00:00 2001 From: rsp224 <118997996+rsp224@users.noreply.github.com> Date: Wed, 22 Mar 2023 20:02:28 -0400 Subject: [PATCH 04/24] Delete database.mli --- database.mli | 99 ---------------------------------------------------- 1 file changed, 99 deletions(-) delete mode 100644 database.mli diff --git a/database.mli b/database.mli deleted file mode 100644 index 518b87a..0000000 --- a/database.mli +++ /dev/null @@ -1,99 +0,0 @@ -module type Table = sig - - type t - (** [t] represents is a table that hold information *) - type value - (** [value] represents a key value associated with an index in a table *) - - val empty : value -> t - (** [empty ex] is the empty table associated with value [ex]*) - val insert : t -> value -> t - (** [insert t id] is the same table as [t] but with an additional entry with - value [id] - *) - val at : t -> value -> value - (** [at t id] is the value in [t] at index [id] - *) - val delete : t -> value -> t - (** [delete t id] deletes the value in [t] at index [id] - *) - val table_to_string : t -> string - (** [table_to_string t] gives the string represention of [t] in a tabular format - *) -end - -type entry = - | String of string - | Float of float - | Int of int - | Char of char - | Bool of bool - | Id of (string * entry) - | Type of (string * entry) -(** [entry] represents a type which can hold all OCaml primitives *) - -val entry_to_string : entry -> string -(** [entry_to_string ent] gives the string representation of [ent]*) - -module ListOfTupleTable : sig - type t = entry list list - (** [t] represents is a table that hold information *) - - type value = entry list - (** [value] represents a key value associated with an index in a table *) - - val empty : value -> t - (** [empty ex] is the empty table associated with value [ex]*) - val insert : t -> value -> t - (** [insert t id] is the same table as [t] but with an additional entry with - value [id]*) - val at : t -> value -> value - (** [at t id] is the value in [t] at index [id]*) - val delete : t -> value -> t - (** [delete t id] deletes the value in [t] at index [id] *) - val table_to_string : t -> string - (** [table_to_string t] gives the string represention of [t] in a - tabular format*) -end - -module Database : sig - exception NoEntry - (** Raised when an entry that does not exist is parsed. *) - exception WrongType - (** Raised when an entry with in incorrect type is parsed *) - - module T = ListOfTupleTable - - val empty : entry list - (** [empty] is a table containing no elements - *) - val add_table : (string *T.t) list -> entry list -> string -> (string *T.t) list - (** [add_table database id name] adds an empty table to [database] - Raises: [Bad] when the value associated with [name] does not have the - same type as [id] - *) - val drop_table : string -> (string * 'b) list -> (string * 'b) list - (** [drop_table name database] deletes a table with value [name] from [database] - *) - val get_table : string -> (string * 'b) list -> string * 'b - (** [get_table name database] is the tabe with value [name] in [database] - *) - val get_reference : entry -> (string *T.t) list -> T.value - (** [get_reference ent database] does not work as intended now - *) - val db_to_string : (string *T.t) list -> string - (** [db_to_string database] gives the string representation of [database] - *) - val check_value : (string *T.t) list -> string -> string -> string -> unit - (** [check_value database tn eid ev] checks whether [tn] [eid] [ev] exists in - [database] (this is totally wrong. We need to clean up this method) - *) - val add_entry : string -> string list -> (string *T.t) list -> (string *T.t) list - (** [add_entry table_name new_row database] is the same [database] with a new - entry [new_row] associated with value [table_name] - *) - val process_types : entry list -> string list -> entry list - (** [process_new_types types inputs] matches user string [inputs] with OCaml - primitive types [types] - *) -end From 8192629def7d63aadda31e1978d82540c56a1a98 Mon Sep 17 00:00:00 2001 From: rsp224 <118997996+rsp224@users.noreply.github.com> Date: Wed, 22 Mar 2023 20:04:27 -0400 Subject: [PATCH 05/24] Added Documentation to database.mli --- lib/database.mli | 68 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 59 insertions(+), 9 deletions(-) diff --git a/lib/database.mli b/lib/database.mli index 6a229ed..518b87a 100644 --- a/lib/database.mli +++ b/lib/database.mli @@ -1,12 +1,25 @@ module type Table = sig + type t + (** [t] represents is a table that hold information *) type value + (** [value] represents a key value associated with an index in a table *) val empty : value -> t + (** [empty ex] is the empty table associated with value [ex]*) val insert : t -> value -> t + (** [insert t id] is the same table as [t] but with an additional entry with + value [id] + *) val at : t -> value -> value + (** [at t id] is the value in [t] at index [id] + *) val delete : t -> value -> t + (** [delete t id] deletes the value in [t] at index [id] + *) val table_to_string : t -> string + (** [table_to_string t] gives the string represention of [t] in a tabular format + *) end type entry = @@ -17,33 +30,70 @@ type entry = | Bool of bool | Id of (string * entry) | Type of (string * entry) +(** [entry] represents a type which can hold all OCaml primitives *) val entry_to_string : entry -> string +(** [entry_to_string ent] gives the string representation of [ent]*) module ListOfTupleTable : sig type t = entry list list + (** [t] represents is a table that hold information *) + type value = entry list + (** [value] represents a key value associated with an index in a table *) val empty : value -> t + (** [empty ex] is the empty table associated with value [ex]*) val insert : t -> value -> t + (** [insert t id] is the same table as [t] but with an additional entry with + value [id]*) val at : t -> value -> value + (** [at t id] is the value in [t] at index [id]*) val delete : t -> value -> t + (** [delete t id] deletes the value in [t] at index [id] *) val table_to_string : t -> string + (** [table_to_string t] gives the string represention of [t] in a + tabular format*) end module Database : sig exception NoEntry + (** Raised when an entry that does not exist is parsed. *) exception WrongType + (** Raised when an entry with in incorrect type is parsed *) module T = ListOfTupleTable - val empty : 'a list - val add_table : ('a * T.t) list -> entry list -> 'a -> ('a * T.t) list - val drop_table : 'a -> ('a * 'b) list -> ('a * 'b) list - val get_table : 'a -> ('a * 'b) list -> 'a * 'b - val get_reference : entry -> (string * T.t) list -> T.value - val db_to_string : (string * T.t) list -> string - val check_value : (string * T.t) list -> string -> string -> string -> unit - val add_entry : string -> string list -> (string * T.t) list -> (string * T.t) list - val process_new_types : string list list -> entry list + val empty : entry list + (** [empty] is a table containing no elements + *) + val add_table : (string *T.t) list -> entry list -> string -> (string *T.t) list + (** [add_table database id name] adds an empty table to [database] + Raises: [Bad] when the value associated with [name] does not have the + same type as [id] + *) + val drop_table : string -> (string * 'b) list -> (string * 'b) list + (** [drop_table name database] deletes a table with value [name] from [database] + *) + val get_table : string -> (string * 'b) list -> string * 'b + (** [get_table name database] is the tabe with value [name] in [database] + *) + val get_reference : entry -> (string *T.t) list -> T.value + (** [get_reference ent database] does not work as intended now + *) + val db_to_string : (string *T.t) list -> string + (** [db_to_string database] gives the string representation of [database] + *) + val check_value : (string *T.t) list -> string -> string -> string -> unit + (** [check_value database tn eid ev] checks whether [tn] [eid] [ev] exists in + [database] (this is totally wrong. We need to clean up this method) + *) + val add_entry : string -> string list -> (string *T.t) list -> (string *T.t) list + (** [add_entry table_name new_row database] is the same [database] with a new + entry [new_row] associated with value [table_name] + *) + val process_types : entry list -> string list -> entry list + (** [process_new_types types inputs] matches user string [inputs] with OCaml + primitive types [types] + *) end From 0ff45f570663054de2826ea5cfb224bf573221a9 Mon Sep 17 00:00:00 2001 From: rsp224 <118997996+rsp224@users.noreply.github.com> Date: Wed, 22 Mar 2023 20:16:32 -0400 Subject: [PATCH 06/24] Minor fixes to database.mli --- lib/database.mli | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/database.mli b/lib/database.mli index 518b87a..fec1089 100644 --- a/lib/database.mli +++ b/lib/database.mli @@ -64,7 +64,7 @@ module Database : sig module T = ListOfTupleTable - val empty : entry list + val empty : 'a list (** [empty] is a table containing no elements *) val add_table : (string *T.t) list -> entry list -> string -> (string *T.t) list @@ -92,7 +92,7 @@ module Database : sig (** [add_entry table_name new_row database] is the same [database] with a new entry [new_row] associated with value [table_name] *) - val process_types : entry list -> string list -> entry list + val process_new_types : string list list -> entry list (** [process_new_types types inputs] matches user string [inputs] with OCaml primitive types [types] *) From 43685463845a579b908b9f9b6415d47ee7c29dc7 Mon Sep 17 00:00:00 2001 From: JT Klenke Date: Fri, 12 May 2023 21:31:42 -0400 Subject: [PATCH 07/24] Added support for find parsing - created the CLI for find expressions - used placeholder function on call --- data/responses.json | 20 ++++++--- lib/cli.ml | 98 +++++++++++++++++++++++++++++++++++++++------ lib/utils.ml | 1 + lib/utils.mli | 1 + test/main.ml | 20 +++++++-- 5 files changed, 118 insertions(+), 22 deletions(-) diff --git a/data/responses.json b/data/responses.json index d216733..c1e1fe0 100644 --- a/data/responses.json +++ b/data/responses.json @@ -3,16 +3,24 @@ "err_create_field_wrong_type": "That value does not match the type of the field\n| ", "err_create_empty_name": "Please enter a non-empty name\n| ", "err_create_field_no_value": "Please input a variable and a value\n| ", - "err_create_field_already_entered": "", - "err_assign_empty": "", - "err_assign_no_id": "", + "err_create_field_already_entered": "This field has already been entered\n| ", + "err_assign_empty": "Please input a type name and id\n|> ", + "err_assign_no_id": "Please input an id for this instance\n|> ", "err_assign_DNE": "That type does not exist\n|> ", "err_defn_needs_type_name": "Please enter a type name for the definition\n|> ", "err_defn_needs_ID_name": "Please enter a name for the ID of this type\n|> ", "err_defn_already_exists": "\n Type already defined\n|> ", "err_defn_no_name": "Please enter a name for this field\n| ", "err_defn_invalid_type": "Not a recognized type\n| ", - "err_unknown_command": "", - "err_at_no_id": "", - "help_message": "\nTo define a custom dataframe, type the following,\nall valueNames must be unique:\ndef TypeName IdName\n type valueName\n ...\n type valueName\n\n\nTo assign values to the custom types:\nassign TypeName IdValue\n valueName = value\n ...\n valueName = value\n\nTo save to a file, use 'save '\n\n|> " + "err_unknown_command": "Unknown command. Type help for a list of commands\n|> ", + "err_at_empty": "Please enter what the type and id of which to get an instance\n|> ", + "err_at_no_id": "Please enter an id of the instance you which to get\n|> ", + "err_at_invalid_type": "No type of that name", + "err_invalid_expr": "Invalid comparison expression", + "err_invalid_comparison": "Invalid comparison, use <> = > < >= <=", + "err_find_invalid_type": "Cannot find type of that name", + "help_message": "\nTo define a custom dataframe, type the following,\nall valueNames must be unique:\ndef TypeName IdName\n type valueName\n ...\n type valueName\n\n\nTo assign values to the custom types:\nassign TypeName IdValue\n valueName = value\n ...\n valueName = value\n\nTo save to a file, use 'save '\n\n|> ", + "indent_end": "| <|\n|> ", + "indent": "| ", + "default": "|> " } \ No newline at end of file diff --git a/lib/cli.ml b/lib/cli.ml index 9ef5de3..92c19f2 100644 --- a/lib/cli.ml +++ b/lib/cli.ml @@ -20,6 +20,8 @@ module CLI = struct | BuildType of (string * string * entry list) exception ParseError + exception InvalidExpr + exception InvalidComparison let current_state = ref Default @@ -39,8 +41,13 @@ module CLI = struct "err_defn_no_name"; "err_defn_invalid_type"; "err_unknown_command"; + "err_invalid_expr"; + "err_invalid_comparison"; "err_at_no_id"; "help_message"; + "indent_end"; + "indent"; + "default"; ] let get_json_item file entry = @@ -93,7 +100,7 @@ module CLI = struct | [] | [ "" ] -> DB.add_named_entry name vals !db; current_state := Default; - "| <|\n|> " + get_response "indent_end" (* "| <|\n|> " *) | "" :: tl -> current_state := BuildInstance (name, table, vals); get_response "err_create_empty_name" @@ -114,7 +121,7 @@ module CLI = struct match parse_value v t with | x -> current_state := BuildInstance (name, table, (n, x) :: vals); - "| " + get_response "indent" (* "| " *) | exception ParseError -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_wrong_type" @@ -122,12 +129,17 @@ module CLI = struct )) | Some _ -> current_state := BuildInstance (name, table, vals); - "This field has already been entered\n| ") + get_response "err_create_field_already_entered" + (* "This field has already been entered\n| " *)) let process_assign input = match input |> List.map String.trim |> List.filter (fun s -> s <> "") with - | [] | [ "" ] -> "Please input a type name and id\n|> " - | [ name ] -> "Please input an id for this instance\n|> " + | [] | [ "" ] -> + get_response "err_assign_empty" + (* "Please input a type name and id\n|> " *) + | [ name ] -> + get_response "err_assign_no_id" + (* "Please input an id for this instance\n|> " *) | name :: id :: tl -> ( match DB.get_table name !db with | Some t -> @@ -164,14 +176,14 @@ module CLI = struct | [] | [ "" ] -> db := DB.build_table !db (Type (id, Strings) :: types) name; current_state := Default; - "| <|\n|> " + get_response "indent_end" (* "| <|\n|> " *) | [ typ ] -> get_response "err_defn_no_name" (* "Please enter a name for this field\n| " *) | typ :: field_name :: tl -> ( match parse_type (typ, field_name) with | Type _ as t -> current_state := BuildType (name, id, types @ [ t ]); - "| " + get_response "indent" (* "| " *) | exception ParseError -> current_state := BuildType (name, id, types); get_response @@ -192,19 +204,78 @@ module CLI = struct (* "\n Type already defined\n|> " *) | None -> current_state := BuildType (name, id, []); - "| ") + get_response "indent" (* "| " *)) let process_at = function | [] | [ "" ] -> - "Please enter what the type and id of which to get an instance\n|> " - | [ name ] -> "Please enter an id of the instance you which to get\n|> " + get_response "err_at_empty" + (* "Please enter what the type and id of which to get an instance\n|> " *) + | [ name ] -> + get_response "err_at_no_id" + (* "Please enter an id of the instance you which to get\n|> " *) | name :: id :: tl -> ( match DB.get_table name !db with | Some x -> (x |> Tbl.header |> optionize |> build_row) ^ "\n" ^ (String id |> Tbl.at x |> build_row) - | None -> "No type of that name") + | None -> + get_response "err_at_invalid_type" (* "No type of that name" *)) + + let split_on_substring sub str = + let idxs = ref [ 0 ] in + let sub_len = String.length sub in + for i = 0 to String.length str - sub_len do + if String.sub str i sub_len = sub then + idxs := !idxs @ [ i; i + String.length sub ] + else () + done; + idxs := !idxs @ [ String.length str ]; + let rec create_lst idxs sub_len str = + match idxs with + | [] -> [] + | s :: e :: t -> String.sub str s (e - s) :: create_lst t sub_len str + | _ -> failwith "odd" + in + create_lst !idxs sub_len str + + let parse_compare_exp str = + let str_lst = String.split_on_char ' ' str in + if List.length str_lst <> 3 then raise InvalidExpr + else + match str_lst with + | [ var; compare; value ] -> + ( var, + (match compare with + | "=" -> Utils.EQ + | "<>" -> Utils.NEQ + | ">" -> Utils.GT + | "<" -> Utils.LT + | "<=" -> Utils.LTE + | ">=" -> Utils.GTE + | _ -> raise InvalidComparison), + value ) + | _ -> failwith "should be impossible" + + let placeholdertablehandler tn ls = "" + + let process_find lst = + let cleaned_lst = + lst |> List.map String.trim |> List.filter (fun s -> s <> "") + in + match DB.get_table (List.hd cleaned_lst) !db with + | None -> "" + | Some type_table -> ( + try + cleaned_lst + |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" + |> split_on_substring " and " |> List.map String.trim + |> List.filter (fun s -> s <> "") + |> List.map parse_compare_exp + |> placeholdertablehandler type_table + with + | InvalidExpr -> get_response "err_invalid_expr" + | InvalidComparison -> get_response "err_invalid_comparison") (** [parse_input input] takes in new input and determines the relevant command*) let parse_input input = @@ -219,7 +290,10 @@ module CLI = struct | "assign" :: tl -> process_assign tl | "print" :: tl -> DB.db_to_string !db ^ "\n|> " | "at" :: tl -> process_at tl ^ "\n|> " - | _ -> "Unknown command. Type help for a list of commands\n|> ") + | "find" :: tl -> process_find tl + | _ -> + get_response "err_unknown_command" + (* "Unknown command. Type help for a list of commands\n|> " *)) end (** [main ()] prompts for the script to start, then starts it. *) diff --git a/lib/utils.ml b/lib/utils.ml index 3fc252a..3b7c903 100644 --- a/lib/utils.ml +++ b/lib/utils.ml @@ -1,4 +1,5 @@ type types = Strings | Floats | Ints | Chars | Bools | Ids +type comparison = LT | LTE | EQ | NEQ | GT | GTE type entry = | String of string diff --git a/lib/utils.mli b/lib/utils.mli index fa2efe7..dc48c27 100644 --- a/lib/utils.mli +++ b/lib/utils.mli @@ -1,4 +1,5 @@ type types = Strings | Floats | Ints | Chars | Bools | Ids +type comparison = LT | LTE | EQ | NEQ | GT | GTE type entry = | String of string diff --git a/test/main.ml b/test/main.ml index 6fdc04c..035bcd2 100644 --- a/test/main.ml +++ b/test/main.ml @@ -49,15 +49,27 @@ let def_tests = "wrong type error", "flat float", get_response "err_defn_invalid_type" ); - (false, "wrong type error", "float ", get_response "err_defn_no_name"); + ( false, + "no name error when blank spaces", + "string ", + get_response "err_defn_no_name" ); ] ) let pre_defn_assign_tests = ( [ "def Person Name"; "int age"; "float bank"; ""; "assign Person John" ], [ - (true, "can define types out of order bank", "bank = 5.4", "| "); - (false, "can define types out of order age", "age = 23", "| "); - (false, "can define types out of order end", "", "| <|\n|> "); + ( true, + "can define types out of order bank", + "bank = 5.4", + get_response "indent" ); + ( false, + "can define types out of order age", + "age = 23", + get_response "indent" ); + ( false, + "can define types out of order empty end", + "", + get_response "indent_end" ); ( true, "entry doesnt exist error", "test = 5", From 0f5d775d65b41dd8429b9e4d49e3e9f9d2e6ed79 Mon Sep 17 00:00:00 2001 From: JT Klenke Date: Sat, 13 May 2023 14:28:02 -0400 Subject: [PATCH 08/24] Added CLI test cases - added CLI test cases to 75% bisect coverage - created makefile to run CLI interface and test cases --- Makefile | 28 +- _coverage/coverage.css | 500 +++++++++++++++++ _coverage/coverage.js | 164 ++++++ _coverage/highlight.pack.js | 2 + _coverage/index.html | 53 ++ _coverage/lib/cli.ml.html | 988 +++++++++++++++++++++++++++++++++ _coverage/lib/database.ml.html | 211 +++++++ _coverage/lib/tables.ml.html | 741 +++++++++++++++++++++++++ _coverage/lib/utils.ml.html | 229 ++++++++ bisect070345425.coverage | 1 + bisect115162322.coverage | 1 + bisect158168986.coverage | 1 + bisect220228091.coverage | 1 + bisect374128807.coverage | 1 + data/responses.json | 11 +- lib/cli.ml | 31 +- lib/cli2.ml | 157 ------ lib/cli2.mli | 1 - lib/dune | 4 +- test/main.ml | 94 +++- 20 files changed, 3034 insertions(+), 185 deletions(-) create mode 100644 _coverage/coverage.css create mode 100644 _coverage/coverage.js create mode 100644 _coverage/highlight.pack.js create mode 100644 _coverage/index.html create mode 100644 _coverage/lib/cli.ml.html create mode 100644 _coverage/lib/database.ml.html create mode 100644 _coverage/lib/tables.ml.html create mode 100644 _coverage/lib/utils.ml.html create mode 100644 bisect070345425.coverage create mode 100644 bisect115162322.coverage create mode 100644 bisect158168986.coverage create mode 100644 bisect220228091.coverage create mode 100644 bisect374128807.coverage delete mode 100644 lib/cli2.ml delete mode 100644 lib/cli2.mli diff --git a/Makefile b/Makefile index 8e5879c..798100d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,30 @@ -test: +build: + dune build lib + +code: + -dune build + code . + ! dune build --watch + +run: build + OCAMLRUNPARAM=b dune exec bin/main.exe + +test: build OCAMLRUNPARAM=b dune exec test/main.exe bisect: bisect-clean -dune exec --instrument-with bisect_ppx --force test/main.exe - bisect-ppx-report html \ No newline at end of file + bisect-ppx-report html + +bisect-clean: + rm -rf _coverage bisect*.coverage + +clean: bisect-clean + dune clean + rm -f search.zip + +doc: + dune build @doc + +opendoc: doc + @bash opendoc.sh \ No newline at end of file diff --git a/_coverage/coverage.css b/_coverage/coverage.css new file mode 100644 index 0000000..35bb22a --- /dev/null +++ b/_coverage/coverage.css @@ -0,0 +1,500 @@ +:root, .light:root { + --main-background: #fff; + --code-background: transparent; + --line-numbers-background: rgba(0, 0, 0, 0.025); + --navbar-background: #eee; + + --meter-unvisited-color: #f9c3c3; + --meter-visited-color: #9ed09f; + --meter-separator-color: white; + + --color: #000; + --dirname-color: #bbb; + --stats-color: #aaa; + --underline-color: #ddd; + --visited-color: #eaffea; + --visited-number-color: rgba(64, 192, 64, 0.2); + --unvisited-color: #ffecec; + --unvisited-number-color: rgba(255, 128, 128, 0.5); + --somevisited-color: #ffd; + --highlight-color: #a0fbff; + --line-number-color: rgba(0, 0, 0, 0.4); + --unvisited-margin-color: #d69e9e; + --border: #eee; + --navbar-border: #ddd; + --code-color: #000; + --hljs-link: #6a737d; + --hljs-keyword: #d73a49; + --hljs-regexp: #032f62; + --hljs-title: #900; + --hljs-type: #6f42c1; + --hljs-meta: #22863a; + --hljs-variable: #005cc5; +} + +.dark:root { + --main-background: #202020; + --code-background: #222; + --line-numbers-background: rgba(0, 0, 0, 0.125); + --navbar-background: #202020; + + --meter-unvisited-color: #622; + --meter-visited-color: #252; + --meter-separator-color: black; + + --color: #bebebe; + --dirname-color: #666; + --stats-color: #555; + --underline-color: #444; + --visited-color: #002800; + --visited-number-color: #252; + --unvisited-color: #380000; + --unvisited-number-color: #822; + --somevisited-color: #303000; + --highlight-color: #303e3f; + --line-number-color: rgba(230, 230, 230, 0.3); + --unvisited-margin-color: #622; + --border: #333; + --navbar-border: #333; + --code-color: #ccc; + --hljs-link: #999; + --hljs-keyword: #cda869; + --hljs-regexp: #f9ee98; + --hljs-title: #dcdcaa; + --hljs-type: #ac885b; + --hljs-meta: #82aaff; + --hljs-variable: #cf6a4c; +} + +@media (prefers-color-scheme: dark) { + :root { + --main-background: #202020; + --code-background: #222; + --line-numbers-background: rgba(0, 0, 0, 0.125); + --navbar-background: #202020; + + --meter-unvisited-color: #622; + --meter-visited-color: #252; + --meter-separator-color: black; + + --color: #bebebe; + --dirname-color: #666; + --underline-color: #444; + --visited-color: #002800; + --visited-number-color: #252; + --unvisited-color: #380000; + --unvisited-number-color: #822; + --somevisited-color: #303000; + --highlight-color: #303e3f; + --line-number-color: rgba(230, 230, 230, 0.3); + --unvisited-margin-color: #622; + --border: #333; + --navbar-border: #333; + --code-color: #ccc; + --hljs-link: #999; + --hljs-keyword: #cda869; + --hljs-regexp: #f9ee98; + --hljs-title: #dcdcaa; + --hljs-type: #ac885b; + --hljs-meta: #82aaff; + --hljs-variable: #cf6a4c; + } +} + +body { + margin: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 16px; + line-height: 1.5em; + background-color: var(--main-background); +} + +pre { + margin: 0; + font-family: "Fira Code", "Cascadia Code", Consolas, "Liberation Mono", Menlo, Courier, monospace; + font-size: 13px; + color: var(--code-color); + cursor: text; +} + +code { + font-family: inherit; +} + +a { + text-decoration: none; + color: inherit; +} + +a:visited { + color: inherit; +} + +#header { + color: var(--color); +} + +h1 { + display: inline-block; + margin: 1.5em 1.5em 0.75em 1.5em; +} + +.dirname { + color: var(--dirname-color); +} + +h2 { + display: inline-block; + position: relative; + top: -1px; +} + +#footer { + margin: 1em 0 1em 4em; + color: #aaa; + font-size: 12px; +} + +#footer a { + color: #666; + border-bottom: 1px solid #ccc; +} + +#footer a:visited { + color: #666; +} + +#navbar { + position: fixed; + top: 0; + left: 0; + width: 1em; + height: 100%; + background-color: var(--navbar-background); + border-right: 1px solid var(--navbar-border); + cursor: pointer; +} + +#navbar span { + display: block; + position: absolute; + width: 100%; + height: 5px; +} + +#navbar .unvisited, #navbar .some-visited { + background-color: var(--unvisited-margin-color); +} + +#report { + border-top: 1px solid var(--border); + border-bottom: 1px solid var(--border); + overflow: hidden; +} + +#lines-layer { + position: absolute; + z-index: -100; + width: 100%; + background-color: var(--code-background); +} + +#lines-layer span { + display: inline-block; + width: 100%; +} + +a[id] { + display: block; + position: relative; + top: -5.5em; +} + +#lines-layer .unvisited { + background-color: var(--unvisited-color); +} + +#lines-layer .visited { + background-color: var(--visited-color); +} + +#lines-layer .some-visited { + background-color: var(--somevisited-color); +} + +a[id]:target + span { + -webkit-animation: highlight-blank 0.5s; + -moz-animation: highlight-blank 0.5s; + -o-animation: highlight-blank 0.5s; + animation: highlight-blank 0.5s; +} + +a[id]:target + .unvisited { + -webkit-animation: highlight-unvisited 0.5s; + -moz-animation: highlight-unvisited 0.5s; + -o-animation: highlight-unvisited 0.5s; + animation: highlight-unvisited 0.5s; +} + +a[id]:target + .visited { + -webkit-animation: highlight-visited 0.5s; + -moz-animation: highlight-visited 0.5s; + -o-animation: highlight-visited 0.5s; + animation: highlight-visited 0.5s; +} + +a[id]:target + .some-visited { + -webkit-animation: highlight-some-visited 0.5s; + -moz-animation: highlight-some-visited 0.5s; + -o-animation: highlight-some-visited 0.5s; + animation: highlight-some-visited 0.5s; +} + +@-webkit-keyframes highlight-blank { + from { background-color: var(--highlight-color); } + to { background-color: transparent; } +} + +@-moz-keyframes highlight-blank { + from { background-color: var(--highlight-color); } + to { background-color: transparent; } +} + +@-o-keyframes highlight-blank { + from { background-color: var(--highlight-color); } + to { background-color: transparent; } +} + +@keyframes highlight-blank { + from { background-color: var(--highlight-color); } + to { background-color: transparent; } +} + +@-webkit-keyframes highlight-unvisited { + from { background-color: var(--highlight-color); } + to { background-color: var(--unvisited-color); } +} + +@-moz-keyframes highlight-unvisited { + from { background-color: var(--highlight-color); } + to { background-color: var(--unvisited-color); } +} + +@-o-keyframes highlight-unvisited { + from { background-color: var(--highlight-color); } + to { background-color: var(--unvisited-color); } +} + +@keyframes highlight-unvisited { + from { background-color: var(--highlight-color); } + to { background-color: var(--unvisited-color); } +} + +@-webkit-keyframes highlight-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--visited-color); } +} + +@-moz-keyframes highlight-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--visited-color); } +} + +@-o-keyframes highlight-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--visited-color); } +} + +@keyframes highlight-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--visited-color); } +} + +@-webkit-keyframes highlight-some-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--somevisited-color); } +} + +@-moz-keyframes highlight-some-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--somevisited-color); } +} + +@-o-keyframes highlight-some-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--somevisited-color); } +} + +@keyframes highlight-some-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--somevisited-color); } +} + +#line-numbers { + float: left; + border-right: 1px solid var(--border); + margin-right: 1em; + color: var(--line-number-color); + background-color: var(--line-numbers-background); + text-align: right; +} + +#line-numbers a { + display: inline-block; + padding-left: 2.35em; + padding-right: 1em; + text-decoration: none; + color: var(--line-number-color); +} + +#line-numbers .unvisited { + background-color: var(--unvisted-number-color); +} + +#line-numbers .visited { + background-color: var(--visted-number-color); +} + +code span[data-count] { + background-color: var(--visited-number-color); +} + +code span[data-count="0"] { + background-color: var(--unvisited-number-color); +} + +#tool-tip { + display: none; + position: fixed; + padding: 0 0.25em; + background-color: black; + color: white; +} + +#tool-tip.visible { + display: block; +} + +#files { + padding: 1.5em 4em; + background-color: var(--code-background); + border-top: 1px solid var(--border); + border-bottom: 1px solid var(--border); +} + +.meter { + display: inline-block; + position: relative; + top: 3px; + width: 5em; + height: 1em; + background-color: var(--meter-unvisited-color); +} + +.covered { + display: inline-block; + position: absolute; + width: 50%; + height: 100%; + background-color: var(--meter-visited-color); + border-right: 1px solid var(--meter-separator-color); +} + +#files div { + display: flex; +} + +summary { + cursor: pointer; + display: flex; +} + +.summary-indicator { + display: inline-block; + width: 1em; + color: var(--color); +} + +/* Adds indentation to the directory tree */ +details > details, details > div { + margin-left: 1em; +} + +details > summary > .summary-indicator { + text-align: center; + font-weight: bold; +} + +details > summary > .summary-indicator::before { + content: "+"; +} + +details[open] > summary > .summary-indicator::before { + content: "-"; +} + +.percentage { + display: inline-block; + min-width: 7.5em; + margin: 0 0.5em; + font-size: 90%; + color: var(--color); +} + +.stats { + display: inline-block; + font-size: 70%; + color: var(--stats-color); +} + +#files a { + text-decoration: none; + border-bottom: 1px solid var(--underline-color); + color: var(--color); +} + +.hljs-link, +.hljs-comment, +.hljs-quote { + color: var(--hljs-link); +} + +.hljs-built_in, +.hljs-builtin-name, +.hljs-keyword, +.hljs-selector-tag, +.hljs-subst { + color: var(--hljs-keyword); +} + +.hljs-number, +.hljs-literal, +.hljs-variable, +.hljs-template-variable, +.hljs-tag .hljs-attr { + color: var(--hljs-variable); +} + +.hljs-regexp, +.hljs-string, +.hljs-doctag { + color: var(--hljs-regexp); +} + +.hljs-title, +.hljs-section, +.hljs-selector-id { + color: var(--hljs-title); +} + +.hljs-type, +.hljs-class .hljs-title { + color: var(--hljs-type); +} + +.hljs-meta, +.hljs-tag, +.hljs-name, +.hljs-attribute { + color: var(--hljs-meta); +} diff --git a/_coverage/coverage.js b/_coverage/coverage.js new file mode 100644 index 0000000..ef27254 --- /dev/null +++ b/_coverage/coverage.js @@ -0,0 +1,164 @@ +function tool_tip_element() +{ + var element = document.querySelector("#tool-tip"); + if (element === null) { + element = document.createElement("div"); + element.id = "tool-tip"; + document.querySelector("body").appendChild(element); + } + + return element; +}; + +var tool_tip = tool_tip_element(); +var html = document.getElementsByTagName("html")[0]; + +function attach_tool_tip() +{ + document.querySelector("body").onmousemove = function (event) + { + var element = event.target; + if (element.dataset.count === undefined) + element = event.target.parentNode; + + if (element.dataset.count && element.dataset.count !== "0") { + tool_tip.textContent = element.dataset.count; + tool_tip.classList.add("visible"); + + if (event.clientY < html.clientHeight - 48) + tool_tip.style.top = event.clientY + 7 + "px"; + else + tool_tip.style.top = event.clientY - 32 + "px"; + + tool_tip.style.left = event.clientX + 7 + "px"; + } + else + tool_tip.classList.remove("visible"); + } +}; + +attach_tool_tip(); + +function move_line_to_cursor(cursor_y, line_number) +{ + var id = "L" + line_number; + + var line_anchor = + document.querySelector("a[id=" + id + "] + span"); + if (line_anchor === null) + return; + + var line_y = line_anchor.getBoundingClientRect().top + 18; + + var y = window.scrollY; + window.location = "#" + id; + window.scrollTo(0, y + line_y - cursor_y); +}; + +function handle_navbar_clicks() +{ + var line_count = document.querySelectorAll("a[id]").length; + var navbar = document.querySelector("#navbar"); + + if (navbar === null) + return; + + navbar.onclick = function (event) + { + event.preventDefault(); + + var line_number = + Math.floor(event.clientY / navbar.clientHeight * line_count + 1); + + move_line_to_cursor(event.clientY, line_number); + }; +}; + +handle_navbar_clicks(); + +function handle_line_number_clicks() +{ + document.querySelector("body").onclick = function (event) + { + if (event.target.tagName != "A") + return; + + var line_number_location = event.target.href.search(/#L[0-9]+\$/); + if (line_number_location === -1) + return; + + var anchor = event.target.href.slice(line_number_location); + + event.preventDefault(); + + var y = window.scrollY; + window.location = anchor; + window.scrollTo(0, y); + }; +}; + +handle_line_number_clicks(); + +function handle_collapsible_click() +{ + document.querySelectorAll("summary").forEach( + function (summary) + { + summary.onclick = function (event) + { + var details = summary.parentElement; + + var all_open = function (sub_details) { + var all_are_open = true; + for (let details of sub_details) { + all_are_open = + all_are_open && + details.hasAttribute('open'); + } + return all_are_open; + }; + + var all_toggle = function (sub_details, toggle) { + for (let details of sub_details) { + if (toggle) + details.removeAttribute('open'); + else + details.setAttribute('open', ''); + } + }; + + // ctrl-click toggles the state of the folder and all sub-folders, recursively: + // - if all sub-folders are opened, then all sub-folders are closed + // - if at least one sub-folder is closed (or the folder itself), + // then all sub-folders are opened + if (event.ctrlKey) { + var sub_details = Array.prototype.slice.call( + details.querySelectorAll("details") + ); + sub_details.push(details); + all_toggle(sub_details, all_open(sub_details)); + return false; + } + + // shift-click toggles the state of all immediate sub-folders: + // - if the folder is closed, just open it + // - if the folder is opened: + // - if all sub-folders are opened, then all sub-folders are closed + // - if at least one sub-folder is closed, then all sub-folders are opened + if (event.shiftKey && details.hasAttribute('open')) { + details.setAttribute('open', ''); + var sub_details = + Array.prototype.filter.call( + details.querySelectorAll("details"), + function (sub_details) { + return sub_details.parentNode === details; + } + ); + all_toggle(sub_details, all_open(sub_details)); + return false; + } + }; + }); +} + +handle_collapsible_click(); diff --git a/_coverage/highlight.pack.js b/_coverage/highlight.pack.js new file mode 100644 index 0000000..2e55d49 --- /dev/null +++ b/_coverage/highlight.pack.js @@ -0,0 +1,2 @@ +/*! highlight.js v9.15.8 | BSD3 License | git.io/hljslicense */ +!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(a){var f=[],u=Object.keys,N={},c={},n=/^(no-?highlight|plain|text)$/i,s=/\blang(?:uage)?-([\w-]+)\b/i,t=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,r={case_insensitive:"cI",lexemes:"l",contains:"c",keywords:"k",subLanguage:"sL",className:"cN",begin:"b",beginKeywords:"bK",end:"e",endsWithParent:"eW",illegal:"i",excludeBegin:"eB",excludeEnd:"eE",returnBegin:"rB",returnEnd:"rE",relevance:"r",variants:"v",IDENT_RE:"IR",UNDERSCORE_IDENT_RE:"UIR",NUMBER_RE:"NR",C_NUMBER_RE:"CNR",BINARY_NUMBER_RE:"BNR",RE_STARTERS_RE:"RSR",BACKSLASH_ESCAPE:"BE",APOS_STRING_MODE:"ASM",QUOTE_STRING_MODE:"QSM",PHRASAL_WORDS_MODE:"PWM",C_LINE_COMMENT_MODE:"CLCM",C_BLOCK_COMMENT_MODE:"CBCM",HASH_COMMENT_MODE:"HCM",NUMBER_MODE:"NM",C_NUMBER_MODE:"CNM",BINARY_NUMBER_MODE:"BNM",CSS_NUMBER_MODE:"CSSNM",REGEXP_MODE:"RM",TITLE_MODE:"TM",UNDERSCORE_TITLE_MODE:"UTM",COMMENT:"C",beginRe:"bR",endRe:"eR",illegalRe:"iR",lexemesRe:"lR",terminators:"t",terminator_end:"tE"},b="",h={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function _(e){return e.replace(/&/g,"&").replace(//g,">")}function E(e){return e.nodeName.toLowerCase()}function v(e,n){var t=e&&e.exec(n);return t&&0===t.index}function l(e){return n.test(e)}function g(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function R(e){var a=[];return function e(n,t){for(var r=n.firstChild;r;r=r.nextSibling)3===r.nodeType?t+=r.nodeValue.length:1===r.nodeType&&(a.push({event:"start",offset:t,node:r}),t=e(r,t),E(r).match(/br|hr|img|input/)||a.push({event:"stop",offset:t,node:r}));return t}(e,0),a}function i(e){if(r&&!e.langApiRestored){for(var n in e.langApiRestored=!0,r)e[n]&&(e[r[n]]=e[n]);(e.c||[]).concat(e.v||[]).forEach(i)}}function m(o){function s(e){return e&&e.source||e}function c(e,n){return new RegExp(s(e),"m"+(o.cI?"i":"")+(n?"g":""))}!function n(t,e){if(!t.compiled){if(t.compiled=!0,t.k=t.k||t.bK,t.k){function r(t,e){o.cI&&(e=e.toLowerCase()),e.split(" ").forEach(function(e){var n=e.split("|");a[n[0]]=[t,n[1]?Number(n[1]):1]})}var a={};"string"==typeof t.k?r("keyword",t.k):u(t.k).forEach(function(e){r(e,t.k[e])}),t.k=a}t.lR=c(t.l||/\w+/,!0),e&&(t.bK&&(t.b="\\b("+t.bK.split(" ").join("|")+")\\b"),t.b||(t.b=/\B|\b/),t.bR=c(t.b),t.endSameAsBegin&&(t.e=t.b),t.e||t.eW||(t.e=/\B|\b/),t.e&&(t.eR=c(t.e)),t.tE=s(t.e)||"",t.eW&&e.tE&&(t.tE+=(t.e?"|":"")+e.tE)),t.i&&(t.iR=c(t.i)),null==t.r&&(t.r=1),t.c||(t.c=[]),t.c=Array.prototype.concat.apply([],t.c.map(function(e){return function(n){return n.v&&!n.cached_variants&&(n.cached_variants=n.v.map(function(e){return g(n,{v:null},e)})),n.cached_variants||n.eW&&[g(n)]||[n]}("self"===e?t:e)})),t.c.forEach(function(e){n(e,t)}),t.starts&&n(t.starts,e);var i=t.c.map(function(e){return e.bK?"\\.?(?:"+e.b+")\\.?":e.b}).concat([t.tE,t.i]).map(s).filter(Boolean);t.t=i.length?c(function(e,n){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i')+n+(t?"":b):n}function o(){E+=null!=l.sL?function(){var e="string"==typeof l.sL;if(e&&!N[l.sL])return _(g);var n=e?C(l.sL,g,!0,f[l.sL]):O(g,l.sL.length?l.sL:void 0);return 0")+'"');return g+=n,n.length||1}var s=B(e);if(!s)throw new Error('Unknown language: "'+e+'"');m(s);var a,l=t||s,f={},E="";for(a=l;a!==s;a=a.parent)a.cN&&(E=c(a.cN,"",!0)+E);var g="",R=0;try{for(var d,p,M=0;l.t.lastIndex=M,d=l.t.exec(n);)p=r(n.substring(M,d.index),d[0]),M=d.index+p;for(r(n.substr(M)),a=l;a.parent;a=a.parent)a.cN&&(E+=b);return{r:R,value:E,language:e,top:l}}catch(e){if(e.message&&-1!==e.message.indexOf("Illegal"))return{r:0,value:_(n)};throw e}}function O(t,e){e=e||h.languages||u(N);var r={r:0,value:_(t)},a=r;return e.filter(B).filter(M).forEach(function(e){var n=C(e,t,!1);n.language=e,n.r>a.r&&(a=n),n.r>r.r&&(a=r,r=n)}),a.language&&(r.second_best=a),r}function d(e){return h.tabReplace||h.useBR?e.replace(t,function(e,n){return h.useBR&&"\n"===e?"
":h.tabReplace?n.replace(/\t/g,h.tabReplace):""}):e}function o(e){var n,t,r,a,i,o=function(e){var n,t,r,a,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=s.exec(i))return B(t[1])?t[1]:"no-highlight";for(n=0,r=(i=i.split(/\s+/)).length;n/g,"\n"):n=e,i=n.textContent,r=o?C(o,i,!0):O(i),(t=R(n)).length&&((a=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=r.value,r.value=function(e,n,t){var r=0,a="",i=[];function o(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function u(e){a+=""}function s(e){("start"===e.event?c:u)(e.node)}for(;e.length||n.length;){var l=o();if(a+=_(t.substring(r,l[0].offset)),r=l[0].offset,l===e){for(i.reverse().forEach(u);s(l.splice(0,1)[0]),(l=o())===e&&l.length&&l[0].offset===r;);i.reverse().forEach(c)}else"start"===l[0].event?i.push(l[0].node):i.pop(),s(l.splice(0,1)[0])}return a+_(t.substr(r))}(t,R(a),i)),r.value=d(r.value),e.innerHTML=r.value,e.className=function(e,n,t){var r=n?c[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}(e.className,o,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function p(){if(!p.called){p.called=!0;var e=document.querySelectorAll("pre code");f.forEach.call(e,o)}}function B(e){return e=(e||"").toLowerCase(),N[e]||N[c[e]]}function M(e){var n=B(e);return n&&!n.disableAutodetect}return a.highlight=C,a.highlightAuto=O,a.fixMarkup=d,a.highlightBlock=o,a.configure=function(e){h=g(h,e)},a.initHighlighting=p,a.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",p,!1),addEventListener("load",p,!1)},a.registerLanguage=function(n,e){var t=N[n]=e(a);i(t),t.aliases&&t.aliases.forEach(function(e){c[e]=n})},a.listLanguages=function(){return u(N)},a.getLanguage=B,a.autoDetection=M,a.inherit=g,a.IR=a.IDENT_RE="[a-zA-Z]\\w*",a.UIR=a.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",a.NR=a.NUMBER_RE="\\b\\d+(\\.\\d+)?",a.CNR=a.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",a.BNR=a.BINARY_NUMBER_RE="\\b(0b[01]+)",a.RSR=a.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",a.BE=a.BACKSLASH_ESCAPE={b:"\\\\[\\s\\S]",r:0},a.ASM=a.APOS_STRING_MODE={cN:"string",b:"'",e:"'",i:"\\n",c:[a.BE]},a.QSM=a.QUOTE_STRING_MODE={cN:"string",b:'"',e:'"',i:"\\n",c:[a.BE]},a.PWM=a.PHRASAL_WORDS_MODE={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},a.C=a.COMMENT=function(e,n,t){var r=a.inherit({cN:"comment",b:e,e:n,c:[]},t||{});return r.c.push(a.PWM),r.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),r},a.CLCM=a.C_LINE_COMMENT_MODE=a.C("//","$"),a.CBCM=a.C_BLOCK_COMMENT_MODE=a.C("/\\*","\\*/"),a.HCM=a.HASH_COMMENT_MODE=a.C("#","$"),a.NM=a.NUMBER_MODE={cN:"number",b:a.NR,r:0},a.CNM=a.C_NUMBER_MODE={cN:"number",b:a.CNR,r:0},a.BNM=a.BINARY_NUMBER_MODE={cN:"number",b:a.BNR,r:0},a.CSSNM=a.CSS_NUMBER_MODE={cN:"number",b:a.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},a.RM=a.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[a.BE,{b:/\[/,e:/\]/,r:0,c:[a.BE]}]},a.TM=a.TITLE_MODE={cN:"title",b:a.IR,r:0},a.UTM=a.UNDERSCORE_TITLE_MODE={cN:"title",b:a.UIR,r:0},a.METHOD_GUARD={b:"\\.\\s*"+a.UIR,r:0},a});hljs.registerLanguage("ocaml",function(e){return{aliases:["ml"],k:{keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref",literal:"true false"},i:/\/\/|>>/,l:"[a-z_]\\w*!?",c:[{cN:"literal",b:"\\[(\\|\\|)?\\]|\\(\\)",r:0},e.C("\\(\\*","\\*\\)",{c:["self"]}),{cN:"symbol",b:"'[A-Za-z_](?!')[\\w']*"},{cN:"type",b:"`[A-Z][\\w']*"},{cN:"type",b:"\\b[A-Z][\\w']*",r:0},{b:"[a-z_]\\w*'[\\w']*",r:0},e.inherit(e.ASM,{cN:"string",r:0}),e.inherit(e.QSM,{i:null}),{cN:"number",b:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",r:0},{b:/[-=]>/}]}});hljs.registerLanguage("reasonml",function(r){var e="~?[a-z$_][0-9a-zA-Z$_]*",a="`?[A-Z$_][0-9a-zA-Z$_]*",c="("+["||","&&","++","**","+.","*","/","*.","/.","...","|>"].map(function(r){return r.split("").map(function(r){return"\\"+r}).join("")}).join("|")+"|==|===)",n="\\s+"+c+"\\s+",t={keyword:"and as asr assert begin class constraint do done downto else end exception externalfor fun function functor if in include inherit initializerland lazy let lor lsl lsr lxor match method mod module mutable new nonrecobject of open or private rec sig struct then to try type val virtual when while with",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ",literal:"true false"},i="\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",s={cN:"number",r:0,v:[{b:i},{b:"\\(\\-"+i+"\\)"}]},b={cN:"operator",r:0,b:c},o=[{cN:"identifier",r:0,b:e},b,s],l=[r.QSM,b,{cN:"module",b:"\\b"+a,rB:!0,e:".",c:[{cN:"identifier",b:a,r:0}]}],u=[{cN:"module",b:"\\b"+a,rB:!0,e:".",r:0,c:[{cN:"identifier",b:a,r:0}]}],_={cN:"function",r:0,k:t,v:[{b:"\\s(\\(\\.?.*?\\)|"+e+")\\s*=>",e:"\\s*=>",rB:!0,r:0,c:[{cN:"params",v:[{b:e},{b:"~?[a-z$_][0-9a-zA-Z$_]*(s*:s*[a-z$_][0-9a-z$_]*((s*('?[a-z$_][0-9a-z$_]*s*(,'?[a-z$_][0-9a-z$_]*)*)?s*))?)?(s*:s*[a-z$_][0-9a-z$_]*((s*('?[a-z$_][0-9a-z$_]*s*(,'?[a-z$_][0-9a-z$_]*)*)?s*))?)?"},{b:/\(\s*\)/}]}]},{b:"\\s\\(\\.?[^;\\|]*\\)\\s*=>",e:"\\s=>",rB:!0,r:0,c:[{cN:"params",r:0,v:[{b:e,e:"(,|\\n|\\))",r:0,c:[b,{cN:"typing",b:":",e:"(,|\\n)",rB:!0,r:0,c:u}]}]}]},{b:"\\(\\.\\s"+e+"\\)\\s*=>"}]};l.push(_);var N={cN:"constructor",b:a+"\\(",e:"\\)",i:"\\n",k:t,c:[r.QSM,b,{cN:"params",b:"\\b"+e}]},d={cN:"pattern-match",b:"\\|",rB:!0,k:t,e:"=>",r:0,c:[N,b,{r:0,cN:"constructor",b:a}]},z={cN:"module-access",k:t,rB:!0,v:[{b:"\\b("+a+"\\.)+"+e},{b:"\\b("+a+"\\.)+\\(",e:"\\)",rB:!0,c:[_,{b:"\\(",e:"\\)",skip:!0}].concat(l)},{b:"\\b("+a+"\\.)+{",e:"}"}],c:l};return u.push(z),{aliases:["re"],k:t,i:"(:\\-|:=|\\${|\\+=)",c:[r.C("/\\*","\\*/",{i:"^(\\#,\\/\\/)"}),{cN:"character",b:"'(\\\\[^']+|[^'])'",i:"\\n",r:0},r.QSM,{cN:"literal",b:"\\(\\)",r:0},{cN:"literal",b:"\\[\\|",e:"\\|\\]",r:0,c:o},{cN:"literal",b:"\\[",e:"\\]",r:0,c:o},N,{cN:"operator",b:n,i:"\\-\\->",r:0},s,r.CLCM,d,_,{cN:"module-def",b:"\\bmodule\\s+"+e+"\\s+"+a+"\\s+=\\s+{",e:"}",rB:!0,k:t,r:0,c:[{cN:"module",r:0,b:a},{b:"{",e:"}",skip:!0}].concat(l)},z]}}); \ No newline at end of file diff --git a/_coverage/index.html b/_coverage/index.html new file mode 100644 index 0000000..d8981ff --- /dev/null +++ b/_coverage/index.html @@ -0,0 +1,53 @@ + + + + + Coverage report + + + + + +
+
+ + + + 75% (123 / 164) + + lib/cli.ml + +
+
+ + + + 27% (9 / 33) + + lib/database.ml + +
+
+ + + + 22% (37 / 165) + + lib/tables.ml + +
+
+ + + + 0% (0 / 44) + + lib/utils.ml + +
+
+ + diff --git a/_coverage/lib/cli.ml.html b/_coverage/lib/cli.ml.html new file mode 100644 index 0000000..7c2aa83 --- /dev/null +++ b/_coverage/lib/cli.ml.html @@ -0,0 +1,988 @@ + + + + + cli.ml — Coverage report + + + + + + + + +
+
+
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+
+
+
+
+  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+
+
module type CliHandler = sig
+  val parse_input : string -> string
+  val get_response : string -> string
+  val reset : unit -> unit
+end
+
+module CLI = struct
+  open Utils
+  open Database
+  open Tables
+  module Tbl = Tables.HashTable
+  module DB = Database (Tbl)
+  open Yojson.Basic.Util
+
+  let db = ref DB.empty
+
+  type state =
+    | Default
+    | BuildInstance of (string * Tbl.t * (string * entry) list)
+    | BuildType of (string * string * entry list)
+
+  exception ParseError
+  exception InvalidExpr
+  exception InvalidComparison
+
+  let current_state = ref Default
+
+  let response_names =
+    [
+      "err_create_field_DNE";
+      "err_create_field_wrong_type";
+      "err_create_field_no_value";
+      "err_create_field_already_entered";
+      "err_assign_empty";
+      "err_assign_no_id";
+      "err_assign_DNE";
+      "err_defn_needs_type_name";
+      "err_defn_needs_ID_name";
+      "err_defn_already_exists";
+      "err_defn_no_name";
+      "err_defn_invalid_type";
+      "err_unknown_command";
+      "err_find_invalid_expr";
+      "err_find_invalid_comparison";
+      "err_find_invalid_type";
+      "err_at_no_id";
+      "help_message";
+      "indent_end";
+      "indent";
+      "default";
+    ]
+
+  let get_json_item file entry =
+    file |> to_assoc |> List.assoc entry |> to_string
+
+  let file_name = "data/responses.json"
+
+  let rec build_response_assoc_list res_names res_assoc =
+    let file = Yojson.Basic.from_file file_name in
+    match res_names with
+    | [] -> res_assoc
+    | h :: t ->
+        (h, get_json_item file h) :: res_assoc |> build_response_assoc_list t
+
+  let responses = build_response_assoc_list response_names []
+
+  let rec find_response key lst =
+    match lst with
+    | [] -> failwith "response not found"
+    | (k, v) :: t -> if k = key then v else find_response key t
+
+  let get_response response = find_response response responses
+
+  let reset () =
+    current_state := Default;
+    db := DB.empty
+
+  let parse_value v = function
+    | Strings -> String v
+    | Ints -> (
+        match int_of_string_opt v with
+        | Some i -> Int i
+        | None -> raise ParseError)
+    | Floats -> (
+        match float_of_string_opt v with
+        | Some f -> Float f
+        | None -> raise ParseError)
+    | Bools -> (
+        match bool_of_string_opt v with
+        | Some b -> Bool b
+        | None -> raise ParseError)
+    | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError)
+    | Ids -> raise ParseError
+
+  let rec build_instance (name, table, vals) input =
+    match
+      input |> String.split_on_char '=' |> List.map String.trim
+      |> List.filter (fun s -> s <> "")
+    with
+    | [] ->
+        DB.add_named_entry name vals !db;
+        current_state := Default;
+        get_response "indent_end" (* "|    <|\n|> " *)
+    | [ n ] ->
+        current_state := BuildInstance (name, table, vals);
+        get_response "err_create_field_no_value"
+        (* "Please input a variable and a value\n|    " *)
+    | n :: v :: tl -> (
+        match List.assoc_opt n vals with
+        | None -> (
+            match Tbl.exists table n with
+            | exception TypeMismatch ->
+                current_state := BuildInstance (name, table, vals);
+                get_response "err_create_field_DNE"
+                (* "That field does not exist in this type\n|    " *)
+            | t -> (
+                match parse_value v t with
+                | x ->
+                    current_state := BuildInstance (name, table, (n, x) :: vals);
+                    get_response "indent" (* "|    " *)
+                | exception ParseError ->
+                    current_state := BuildInstance (name, table, vals);
+                    get_response "err_create_field_wrong_type"
+                    (* "That value does not match the type of the field\n|    " *)
+                ))
+        | Some _ ->
+            current_state := BuildInstance (name, table, vals);
+            get_response "err_create_field_already_entered"
+            (* "This field has already been entered\n|    " *))
+
+  let process_assign input =
+    match input |> List.map String.trim |> List.filter (fun s -> s <> "") with
+    | [] ->
+        get_response "err_assign_empty"
+        (* "Please input a type name and id\n|> " *)
+    | [ name ] ->
+        get_response "err_assign_no_id"
+        (* "Please input an id for this instance\n|> " *)
+    | name :: id :: tl -> (
+        match DB.get_table name !db with
+        | Some t ->
+            current_state :=
+              BuildInstance
+                ( name,
+                  t,
+                  [
+                    ( (match Tbl.header t with
+                      | Type (n, _) :: tl -> n
+                      | _ -> raise ParseError),
+                      String id );
+                  ] );
+            "|    "
+        | None -> get_response "err_assign_DNE")
+  (* "That type does not exist\n|> " *)
+
+  let parse_type (typ, name) =
+    match typ with
+    | "int" -> Type (name, Ints)
+    | "float" -> Type (name, Floats)
+    | "string" -> Type (name, Strings)
+    | "bool" -> Type (name, Bools)
+    | "char" -> Type (name, Chars)
+    | "id" -> Type (name, Ids)
+    | _ -> raise ParseError
+
+  let rec build_type (name, id, types) input =
+    match
+      String.split_on_char ' ' input
+      |> List.map String.trim
+      |> List.filter (fun s -> s <> "")
+    with
+    | [] ->
+        db := DB.build_table !db (Type (id, Strings) :: types) name;
+        current_state := Default;
+        get_response "indent_end" (* "|    <|\n|> " *)
+    | [ typ ] -> get_response "err_defn_no_name"
+    (* "Please enter a name for this field\n|    " *)
+    | typ :: field_name :: tl -> (
+        match parse_type (typ, field_name) with
+        | Type _ as t ->
+            current_state := BuildType (name, id, types @ [ t ]);
+            get_response "indent" (* "|    " *)
+        | exception ParseError ->
+            current_state := BuildType (name, id, types);
+            get_response
+              "err_defn_invalid_type" (* "Not a recognized type\n|    " *)
+        | _ -> raise (Failure "Should be impossible"))
+
+  let process_type input =
+    match List.filter (fun s -> s <> "") input with
+    | [] -> get_response "err_defn_needs_type_name"
+    (* "Please enter a type name for the definition\n|> " *)
+    | [ name ] ->
+        get_response "err_defn_needs_ID_name"
+        (* "Please enter a name for the ID of this type\n|> " *)
+    | name :: id :: tl -> (
+        match DB.get_table name !db with
+        | Some _ ->
+            get_response "err_defn_already_exists"
+            (* "\n Type already defined\n|> " *)
+        | None ->
+            current_state := BuildType (name, id, []);
+            get_response "indent" (* "|    " *))
+
+  let process_at = function
+    | [] | [ "" ] ->
+        get_response "err_at_empty"
+        (* "Please enter what the type and id of which to get an instance\n|> " *)
+    | [ name ] ->
+        get_response "err_at_no_id"
+        (* "Please enter an id of the instance you which to get\n|> " *)
+    | name :: id :: tl -> (
+        match DB.get_table name !db with
+        | Some x ->
+            (x |> Tbl.header |> optionize |> build_row)
+            ^ "\n"
+            ^ (String id |> Tbl.at x |> build_row)
+        | None ->
+            get_response "err_at_invalid_type" (* "No type of that name" *))
+
+  let split_on_substring sub str =
+    let idxs = ref [ 0 ] in
+    let sub_len = String.length sub in
+    for i = 0 to String.length str - sub_len do
+      if String.sub str i sub_len = sub then
+        idxs := !idxs @ [ i; i + String.length sub ]
+      else ()
+    done;
+    idxs := !idxs @ [ String.length str ];
+    let rec create_lst idxs sub_len str =
+      match idxs with
+      | [] -> []
+      | s :: e :: t -> String.sub str s (e - s) :: create_lst t sub_len str
+      | _ -> failwith "odd"
+    in
+    create_lst !idxs sub_len str
+
+  let parse_compare_exp str =
+    let str_lst = String.split_on_char ' ' str in
+    if List.length str_lst <> 3 then raise InvalidExpr
+    else
+      match str_lst with
+      | [ var; compare; value ] ->
+          ( var,
+            (match compare with
+            | "=" -> Utils.EQ
+            | "<>" -> Utils.NEQ
+            | ">" -> Utils.GT
+            | "<" -> Utils.LT
+            | "<=" -> Utils.LTE
+            | ">=" -> Utils.GTE
+            | _ -> raise InvalidComparison),
+            value )
+      | _ -> failwith "should be impossible"
+
+  let placeholdertablehandler tn ls = "placeholder table\n|> "
+
+  let process_find lst =
+    let cleaned_lst =
+      lst |> List.map String.trim |> List.filter (fun s -> s <> "")
+    in
+    match DB.get_table (List.hd cleaned_lst) !db with
+    | None -> get_response "err_find_invalid_type"
+    | Some type_table -> (
+        try
+          cleaned_lst |> List.tl
+          |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) ""
+          |> split_on_substring " and " |> List.map String.trim
+          |> List.filter (fun s -> s <> "")
+          |> (fun lst -> if lst = [] then raise InvalidExpr else lst)
+          |> List.map parse_compare_exp
+          |> placeholdertablehandler type_table
+        with
+        | InvalidExpr -> get_response "err_find_invalid_expr"
+        | InvalidComparison -> get_response "err_find_invalid_comparison")
+
+  (** [parse_input input] takes in new input and determines the relevant command*)
+  let parse_input input =
+    match !current_state with
+    | BuildInstance v -> build_instance v input
+    | BuildType v -> build_type v input
+    | Default -> (
+        match String.split_on_char ' ' input with
+        | "quit" :: tl -> exit 0
+        | "help" :: tl -> get_response "help_message"
+        | "def" :: tl -> process_type tl
+        | "assign" :: tl -> process_assign tl
+        | "print" :: tl -> DB.db_to_string !db ^ "\n|> "
+        | "at" :: tl -> process_at tl ^ "\n|> "
+        | "find" :: tl -> process_find tl
+        | _ ->
+            get_response "err_unknown_command"
+            (* "Unknown command. Type help for a list of commands\n|> " *))
+end
+
+(** [main ()] prompts for the script to start, then starts it. *)
+
+let main () =
+  print_string
+    "\n\n\
+     Welcome to the 3110 Database Command Line\n\
+     Please describe the data you want to store.\n\
+     Type 'quit' to quit, 'help' for help.\n\n";
+  print_string "|> ";
+  while true do
+    read_line () |> CLI.parse_input |> print_string
+  done
+
+
+
+ + + diff --git a/_coverage/lib/database.ml.html b/_coverage/lib/database.ml.html new file mode 100644 index 0000000..6d12a6c --- /dev/null +++ b/_coverage/lib/database.ml.html @@ -0,0 +1,211 @@ + + + + + database.ml — Coverage report + + + + + + + + +
+
+
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+
+
+
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
+
open Utils
+open Tables
+
+module Database (Table : Table) = struct
+  exception NoEntry
+  exception WrongType
+  exception TableExists
+
+  type table = Table.t
+  type database = (string * table ref) list
+
+  let empty = []
+
+  let add_table database table name : database =
+    match
+      List.find (fun a -> match a with tname, t -> name = tname) database
+    with
+    | exception Not_found -> (name, ref table) :: database
+    | _ -> raise TableExists
+
+  let build_table database table name =
+    match
+      List.find (fun a -> match a with tname, t -> name = tname) database
+    with
+    | exception Not_found -> (name, ref (Table.empty table)) :: database
+    | _ -> raise TableExists
+
+  let drop_table name database =
+    List.filter (fun a -> match a with tname, t -> name <> tname) database
+
+  let get_table name database =
+    match List.assoc_opt name database with Some x -> Some !x | None -> None
+
+  (*Currently doesn't work...*)
+  let get_reference ent database = raise (Failure "Unimplemented")
+
+  let rec db_to_string database =
+    match database with
+    | [] -> "\n"
+    | (name, x) :: xs ->
+        "Table: " ^ name ^ "\n\n" ^ Table.table_to_string !x ^ db_to_string xs
+
+  let rec add_entry table_name new_row database =
+    match database with
+    | [] -> raise Not_found
+    | (a, b) :: tl when a = table_name -> b := Table.insert !b new_row
+    | _ :: tl -> add_entry table_name new_row tl
+
+  let add_named_entry table_name new_row database =
+    match List.assoc_opt table_name database with
+    | None -> raise Not_found
+    | Some x -> x := Table.insert_named !x new_row
+end
+
+
+
+ + + diff --git a/_coverage/lib/tables.ml.html b/_coverage/lib/tables.ml.html new file mode 100644 index 0000000..da359ce --- /dev/null +++ b/_coverage/lib/tables.ml.html @@ -0,0 +1,741 @@ + + + + + tables.ml — Coverage report + + + + + + + + +
+
+
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+
+
+
+
+  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+
+
open Utils
+
+exception IndexExists
+exception TypeMismatch
+
+let rec assert_types header a =
+  match header with
+  | [] -> if a = [] then [] else raise TypeMismatch
+  | hd :: tl -> (
+      match a with
+      | [] -> raise TypeMismatch
+      | b :: c ->
+          (match hd with
+          | Some (Type (_, Strings)) -> (
+              match b with
+              | Some (String _) -> b
+              | None -> b
+              | _ -> raise TypeMismatch)
+          | Some (Type (_, Floats)) -> (
+              match b with
+              | Some (Float _) -> b
+              | None -> b
+              | _ -> raise TypeMismatch)
+          | Some (Type (_, Ints)) -> (
+              match b with
+              | Some (Int _) -> b
+              | None -> b
+              | _ -> raise TypeMismatch)
+          | Some (Type (_, Bools)) -> (
+              match b with
+              | Some (Bool _) -> b
+              | None -> b
+              | _ -> raise TypeMismatch)
+          | Some (Type (_, Chars)) -> (
+              match b with
+              | Some (Char _) -> b
+              | None -> b
+              | _ -> raise TypeMismatch)
+          | Some (Type (_, Ids)) -> (
+              match b with
+              | Some (Id _) -> b
+              | None -> b
+              | _ -> raise TypeMismatch)
+          | _ -> raise TypeMismatch)
+          :: assert_types tl c)
+
+let rec reorder_list (a : (string * entry) list) = function
+  | [] -> if a = [] then [] else raise TypeMismatch
+  | Some (Type (name, v)) :: tl ->
+      let vl, rest =
+        let rec extr_name acc = function
+          | [] -> (None, acc)
+          | (n, vr) :: rest ->
+              if n = name then (Some vr, acc @ rest)
+              else extr_name (acc @ [ (n, vr) ]) rest
+        in
+        extr_name [] a
+      in
+      vl :: reorder_list rest tl
+  | _ -> raise TypeMismatch
+
+module type Table = sig
+  type t
+
+  val empty : entry list -> t
+  val insert : t -> entry list -> t
+  val insert_named : t -> (string * entry) list -> t
+  val at : t -> entry -> entry option list
+  val delete : t -> entry -> t
+  val table_to_string : t -> string
+  val header : t -> entry list
+  val exists : t -> string -> types
+end
+
+module ListTable : Table = struct
+  type t = entry option list list
+
+  let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl
+  let empty (ex : entry list) = [ optionize ex ]
+
+  let insert (table : t) a =
+    match
+      List.find (fun b ->
+          match a with
+          | [] -> raise (Failure "Error")
+          | hd :: tl -> (
+              match b with
+              | [] -> raise (Failure "Error")
+              | hdb :: tlb -> hd = hdb))
+    with
+    | exception Not_found ->
+        table @ [ assert_types (List.hd table) (optionize a) ]
+    | x -> raise IndexExists
+
+  let insert_named table elist =
+    let name, value = List.hd elist in
+    match List.find (fun a -> List.hd a = Some value) table with
+    | x -> raise IndexExists
+    | exception Not_found -> table @ [ reorder_list elist (List.hd table) ]
+
+  let at (table : t) id =
+    List.find
+      (fun a ->
+        match a with
+        | [] -> raise (Failure "This shouldn't happen")
+        | hd :: tl -> ( match hd with Some x -> x = id | None -> false))
+      table
+
+  let delete (table : t) id =
+    List.filter
+      (fun a ->
+        match a with
+        | [] -> false
+        | a :: asd -> ( match a with Some x -> x = id | None -> false))
+      table
+
+  let rec table_to_string (table : t) =
+    match table with
+    | [] -> ""
+    | b :: xs -> build_row b ^ table_to_string xs ^ "\n"
+
+  let rec deoptionize = function
+    | [] -> []
+    | hd :: tl ->
+        (match hd with
+        | Some x -> x
+        | None -> raise (Failure "Deoptionize saw None"))
+        :: deoptionize tl
+
+  let header = function
+    | [] -> raise (Failure "RI Violated for tables")
+    | hd :: tl -> deoptionize hd
+
+  let exists table name =
+    let rec follow_header = function
+      | [] -> raise TypeMismatch
+      | Type (n, t) :: tl when n = name -> t
+      | _ :: tl -> follow_header tl
+    in
+    follow_header (header table)
+end
+
+module HashTable = struct
+  type t = HashTab of entry list * (entry, entry option list) Hashtbl.t
+
+  let rec deoptionize_list = function
+    | [] -> []
+    | Some x :: tl -> x :: deoptionize_list tl
+    | None :: tl -> failwith "Deoptionize on None"
+
+  let header = function HashTab (hd, _) -> hd
+  let hshtable = function HashTab (_, hsh) -> hsh
+
+  let deoptionize = function
+    | Some x -> x
+    | None -> raise (Failure "Deoptionize on none")
+
+  let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl
+  let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0)
+
+  let insert table entries =
+    match Hashtbl.find_opt (hshtable table) (List.hd entries) with
+    | Some x -> raise IndexExists
+    | None ->
+        let copy = Hashtbl.copy (hshtable table) in
+        let entrs =
+          assert_types (optionize (header table)) (optionize entries)
+        in
+        HashTab
+          ( header table,
+            (Hashtbl.add copy (List.hd entries) (List.tl entrs);
+             copy) )
+
+  let insert_named table entries =
+    let name, value = List.hd entries in
+    match Hashtbl.find_opt (hshtable table) value with
+    | Some x -> raise IndexExists
+    | None ->
+        let copy = Hashtbl.copy (hshtable table) in
+        let reordered = reorder_list entries (optionize (header table)) in
+        Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered);
+        HashTab (header table, copy)
+
+  let at table id = Some id :: Hashtbl.find (hshtable table) id
+
+  let delete table id =
+    let out = Hashtbl.copy (hshtable table) in
+    Hashtbl.remove (hshtable table) id;
+    HashTab (header table, out)
+
+  let rec table_to_string table =
+    Hashtbl.fold
+      (fun id ent acc -> acc ^ shorten (entry_to_string id) ^ build_row ent)
+      (hshtable table)
+      (build_row (optionize (header table)))
+
+  let exists table name =
+    let rec follow_header = function
+      | [] -> raise TypeMismatch
+      | Type (n, t) :: tl when n = name -> t
+      | _ :: tl -> follow_header tl
+    in
+    follow_header (header table)
+end
+
+
+
+ + + diff --git a/_coverage/lib/utils.ml.html b/_coverage/lib/utils.ml.html new file mode 100644 index 0000000..9e720e8 --- /dev/null +++ b/_coverage/lib/utils.ml.html @@ -0,0 +1,229 @@ + + + + + utils.ml — Coverage report + + + + + + + + +
+
+
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+
+
+
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+
+
type types = Strings | Floats | Ints | Chars | Bools | Ids
+type comparison = LT | LTE | EQ | NEQ | GT | GTE
+
+type entry =
+  | String of string
+  | Float of float
+  | Int of int
+  | Char of char
+  | Bool of bool
+  | Id of (string * entry)
+  | Type of (string * types)
+
+let name_map_entry t =
+  match t with
+  | String _ -> "string"
+  | Float _ -> "float"
+  | Int _ -> "int"
+  | Char _ -> "char"
+  | Bool _ -> "bool"
+  | Id _ -> "id"
+  | Type _ -> "type"
+
+let name_map_types t =
+  match t with
+  | Strings -> "string"
+  | Floats -> "float"
+  | Ints -> "int"
+  | Chars -> "char"
+  | Bools -> "bool"
+  | Ids -> "id"
+
+let rec entry_to_string ent =
+  match ent with
+  | String x -> x
+  | Float x -> string_of_float x
+  | Int x -> string_of_int x
+  | Char x -> String.make 1 x
+  | Bool x -> string_of_bool x
+  | Id (a, b) -> a ^ "@" ^ entry_to_string b
+  | Type (a, b) -> name_map_types b ^ " " ^ a
+
+let shorten inp =
+  let str = String.trim inp in
+  if String.length str < 8 then str ^ "\t\t"
+  else if String.length str < 16 then str ^ "\t"
+  else String.sub str 0 16
+
+let rec build_row entlist =
+  match entlist with
+  | [] -> "\n\n"
+  | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs
+  | None :: xs -> "\t\t" ^ build_row xs
+
+let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl
+
+
+
+ + + diff --git a/bisect070345425.coverage b/bisect070345425.coverage new file mode 100644 index 0000000..097a912 --- /dev/null +++ b/bisect070345425.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 15 15 0 0 0 15 0 0 0 20 17 37 0 0 0 0 0 0 0 0 0 0 0 0 7 0 7 7 12 lib/utils.ml 44 310 335 358 377 398 419 436 293 496 520 542 560 580 600 479 842 878 664 682 715 744 774 805 850 645 1043 1025 1009 994 974 959 944 913 1173 1156 1188 1228 1117 1134 1197 1094 1305 1263 1274 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 165 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 2318 2276 2287 2365 2355 2719 2737 2710 2658 2750 2572 2618 2473 2515 2448 2406 3005 2990 2917 2946 2882 2876 2850 2811 3188 3207 3104 3160 3081 3047 3378 3397 3329 3351 3306 3270 3527 3547 3493 3508 3470 3659 3681 3750 3599 3614 3786 3839 4075 3938 4006 3971 4016 3897 4283 4232 4247 4294 4364 4412 4472 4490 4610 4568 4579 4673 4647 5009 5055 5073 5096 4935 4927 4954 4984 4863 4883 4781 4815 4743 4759 4712 5513 5456 5447 5477 5499 5398 5390 5419 5324 5344 5242 5276 5216 5185 5144 5581 5571 5549 5723 5692 5709 5653 5669 5622 5843 5826 5859 5814 5880 5923 5915 5904 5776 6143 6006 6074 6039 6084 5965 165 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 45 45 92 39 6 131 7 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 14 7 0 45 7 45 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 7 7 7 7 7 7 7 7 7 0 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38 1 37 144 107 38 10 lib/cli.ml 164 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8169 8201 8231 8261 8293 8325 8049 8384 8022 7989 7969 7956 7906 8460 9134 9196 9018 8995 8978 8944 8827 8798 8858 8888 8922 8966 9036 9076 9098 8668 8719 8638 8592 8570 8612 8515 9773 9822 9568 9601 9655 9696 9742 9799 9847 9889 9407 9455 9495 9375 10338 10357 10368 10304 10282 10105 164 21 21 21 21 1 21 22 22 1 672 183 0 855 855 183 19 7 2 7 1 6 1 1 6 7 6 9 8 7 7 0 7 32 5 1 37 38 1 7 2 39 89 48 48 48 15 0 15 0 0 0 15 30 15 15 15 15 10 10 10 10 1 71 15 70 1 0 15 1 71 161 87 87 87 0 16 1 1 16 35 18 0 0 0 0 0 0 0 0 0 0 0 9 9 5 9 0 14 5 41 4 4 45 45 5 5 5 1 0 2 0 0 0 2 5 0 5 3 8 8 8 0 3 2 5 0 5 9 27 5 5 5 5 5 5 0 0 1 5 6 38 6 6 6 0 0 0 1 18 15 0 0 6 0 48 87 40 175 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect115162322.coverage b/bisect115162322.coverage new file mode 100644 index 0000000..097a912 --- /dev/null +++ b/bisect115162322.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 15 15 0 0 0 15 0 0 0 20 17 37 0 0 0 0 0 0 0 0 0 0 0 0 7 0 7 7 12 lib/utils.ml 44 310 335 358 377 398 419 436 293 496 520 542 560 580 600 479 842 878 664 682 715 744 774 805 850 645 1043 1025 1009 994 974 959 944 913 1173 1156 1188 1228 1117 1134 1197 1094 1305 1263 1274 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 165 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 2318 2276 2287 2365 2355 2719 2737 2710 2658 2750 2572 2618 2473 2515 2448 2406 3005 2990 2917 2946 2882 2876 2850 2811 3188 3207 3104 3160 3081 3047 3378 3397 3329 3351 3306 3270 3527 3547 3493 3508 3470 3659 3681 3750 3599 3614 3786 3839 4075 3938 4006 3971 4016 3897 4283 4232 4247 4294 4364 4412 4472 4490 4610 4568 4579 4673 4647 5009 5055 5073 5096 4935 4927 4954 4984 4863 4883 4781 4815 4743 4759 4712 5513 5456 5447 5477 5499 5398 5390 5419 5324 5344 5242 5276 5216 5185 5144 5581 5571 5549 5723 5692 5709 5653 5669 5622 5843 5826 5859 5814 5880 5923 5915 5904 5776 6143 6006 6074 6039 6084 5965 165 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 45 45 92 39 6 131 7 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 14 7 0 45 7 45 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 7 7 7 7 7 7 7 7 7 0 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38 1 37 144 107 38 10 lib/cli.ml 164 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8169 8201 8231 8261 8293 8325 8049 8384 8022 7989 7969 7956 7906 8460 9134 9196 9018 8995 8978 8944 8827 8798 8858 8888 8922 8966 9036 9076 9098 8668 8719 8638 8592 8570 8612 8515 9773 9822 9568 9601 9655 9696 9742 9799 9847 9889 9407 9455 9495 9375 10338 10357 10368 10304 10282 10105 164 21 21 21 21 1 21 22 22 1 672 183 0 855 855 183 19 7 2 7 1 6 1 1 6 7 6 9 8 7 7 0 7 32 5 1 37 38 1 7 2 39 89 48 48 48 15 0 15 0 0 0 15 30 15 15 15 15 10 10 10 10 1 71 15 70 1 0 15 1 71 161 87 87 87 0 16 1 1 16 35 18 0 0 0 0 0 0 0 0 0 0 0 9 9 5 9 0 14 5 41 4 4 45 45 5 5 5 1 0 2 0 0 0 2 5 0 5 3 8 8 8 0 3 2 5 0 5 9 27 5 5 5 5 5 5 0 0 1 5 6 38 6 6 6 0 0 0 1 18 15 0 0 6 0 48 87 40 175 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect158168986.coverage b/bisect158168986.coverage new file mode 100644 index 0000000..097a912 --- /dev/null +++ b/bisect158168986.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 15 15 0 0 0 15 0 0 0 20 17 37 0 0 0 0 0 0 0 0 0 0 0 0 7 0 7 7 12 lib/utils.ml 44 310 335 358 377 398 419 436 293 496 520 542 560 580 600 479 842 878 664 682 715 744 774 805 850 645 1043 1025 1009 994 974 959 944 913 1173 1156 1188 1228 1117 1134 1197 1094 1305 1263 1274 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 165 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 2318 2276 2287 2365 2355 2719 2737 2710 2658 2750 2572 2618 2473 2515 2448 2406 3005 2990 2917 2946 2882 2876 2850 2811 3188 3207 3104 3160 3081 3047 3378 3397 3329 3351 3306 3270 3527 3547 3493 3508 3470 3659 3681 3750 3599 3614 3786 3839 4075 3938 4006 3971 4016 3897 4283 4232 4247 4294 4364 4412 4472 4490 4610 4568 4579 4673 4647 5009 5055 5073 5096 4935 4927 4954 4984 4863 4883 4781 4815 4743 4759 4712 5513 5456 5447 5477 5499 5398 5390 5419 5324 5344 5242 5276 5216 5185 5144 5581 5571 5549 5723 5692 5709 5653 5669 5622 5843 5826 5859 5814 5880 5923 5915 5904 5776 6143 6006 6074 6039 6084 5965 165 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 45 45 92 39 6 131 7 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 14 7 0 45 7 45 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 7 7 7 7 7 7 7 7 7 0 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38 1 37 144 107 38 10 lib/cli.ml 164 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8169 8201 8231 8261 8293 8325 8049 8384 8022 7989 7969 7956 7906 8460 9134 9196 9018 8995 8978 8944 8827 8798 8858 8888 8922 8966 9036 9076 9098 8668 8719 8638 8592 8570 8612 8515 9773 9822 9568 9601 9655 9696 9742 9799 9847 9889 9407 9455 9495 9375 10338 10357 10368 10304 10282 10105 164 21 21 21 21 1 21 22 22 1 672 183 0 855 855 183 19 7 2 7 1 6 1 1 6 7 6 9 8 7 7 0 7 32 5 1 37 38 1 7 2 39 89 48 48 48 15 0 15 0 0 0 15 30 15 15 15 15 10 10 10 10 1 71 15 70 1 0 15 1 71 161 87 87 87 0 16 1 1 16 35 18 0 0 0 0 0 0 0 0 0 0 0 9 9 5 9 0 14 5 41 4 4 45 45 5 5 5 1 0 2 0 0 0 2 5 0 5 3 8 8 8 0 3 2 5 0 5 9 27 5 5 5 5 5 5 0 0 1 5 6 38 6 6 6 0 0 0 1 18 15 0 0 6 0 48 87 40 175 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect220228091.coverage b/bisect220228091.coverage new file mode 100644 index 0000000..097a912 --- /dev/null +++ b/bisect220228091.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 15 15 0 0 0 15 0 0 0 20 17 37 0 0 0 0 0 0 0 0 0 0 0 0 7 0 7 7 12 lib/utils.ml 44 310 335 358 377 398 419 436 293 496 520 542 560 580 600 479 842 878 664 682 715 744 774 805 850 645 1043 1025 1009 994 974 959 944 913 1173 1156 1188 1228 1117 1134 1197 1094 1305 1263 1274 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 165 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 2318 2276 2287 2365 2355 2719 2737 2710 2658 2750 2572 2618 2473 2515 2448 2406 3005 2990 2917 2946 2882 2876 2850 2811 3188 3207 3104 3160 3081 3047 3378 3397 3329 3351 3306 3270 3527 3547 3493 3508 3470 3659 3681 3750 3599 3614 3786 3839 4075 3938 4006 3971 4016 3897 4283 4232 4247 4294 4364 4412 4472 4490 4610 4568 4579 4673 4647 5009 5055 5073 5096 4935 4927 4954 4984 4863 4883 4781 4815 4743 4759 4712 5513 5456 5447 5477 5499 5398 5390 5419 5324 5344 5242 5276 5216 5185 5144 5581 5571 5549 5723 5692 5709 5653 5669 5622 5843 5826 5859 5814 5880 5923 5915 5904 5776 6143 6006 6074 6039 6084 5965 165 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 45 45 92 39 6 131 7 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 14 7 0 45 7 45 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 7 7 7 7 7 7 7 7 7 0 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38 1 37 144 107 38 10 lib/cli.ml 164 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8169 8201 8231 8261 8293 8325 8049 8384 8022 7989 7969 7956 7906 8460 9134 9196 9018 8995 8978 8944 8827 8798 8858 8888 8922 8966 9036 9076 9098 8668 8719 8638 8592 8570 8612 8515 9773 9822 9568 9601 9655 9696 9742 9799 9847 9889 9407 9455 9495 9375 10338 10357 10368 10304 10282 10105 164 21 21 21 21 1 21 22 22 1 672 183 0 855 855 183 19 7 2 7 1 6 1 1 6 7 6 9 8 7 7 0 7 32 5 1 37 38 1 7 2 39 89 48 48 48 15 0 15 0 0 0 15 30 15 15 15 15 10 10 10 10 1 71 15 70 1 0 15 1 71 161 87 87 87 0 16 1 1 16 35 18 0 0 0 0 0 0 0 0 0 0 0 9 9 5 9 0 14 5 41 4 4 45 45 5 5 5 1 0 2 0 0 0 2 5 0 5 3 8 8 8 0 3 2 5 0 5 9 27 5 5 5 5 5 5 0 0 1 5 6 38 6 6 6 0 0 0 1 18 15 0 0 6 0 48 87 40 175 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect374128807.coverage b/bisect374128807.coverage new file mode 100644 index 0000000..097a912 --- /dev/null +++ b/bisect374128807.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 15 15 0 0 0 15 0 0 0 20 17 37 0 0 0 0 0 0 0 0 0 0 0 0 7 0 7 7 12 lib/utils.ml 44 310 335 358 377 398 419 436 293 496 520 542 560 580 600 479 842 878 664 682 715 744 774 805 850 645 1043 1025 1009 994 974 959 944 913 1173 1156 1188 1228 1117 1134 1197 1094 1305 1263 1274 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 165 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 2318 2276 2287 2365 2355 2719 2737 2710 2658 2750 2572 2618 2473 2515 2448 2406 3005 2990 2917 2946 2882 2876 2850 2811 3188 3207 3104 3160 3081 3047 3378 3397 3329 3351 3306 3270 3527 3547 3493 3508 3470 3659 3681 3750 3599 3614 3786 3839 4075 3938 4006 3971 4016 3897 4283 4232 4247 4294 4364 4412 4472 4490 4610 4568 4579 4673 4647 5009 5055 5073 5096 4935 4927 4954 4984 4863 4883 4781 4815 4743 4759 4712 5513 5456 5447 5477 5499 5398 5390 5419 5324 5344 5242 5276 5216 5185 5144 5581 5571 5549 5723 5692 5709 5653 5669 5622 5843 5826 5859 5814 5880 5923 5915 5904 5776 6143 6006 6074 6039 6084 5965 165 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 45 45 92 39 6 131 7 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 14 7 0 45 7 45 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 7 7 7 7 7 7 7 7 7 0 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38 1 37 144 107 38 10 lib/cli.ml 164 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8169 8201 8231 8261 8293 8325 8049 8384 8022 7989 7969 7956 7906 8460 9134 9196 9018 8995 8978 8944 8827 8798 8858 8888 8922 8966 9036 9076 9098 8668 8719 8638 8592 8570 8612 8515 9773 9822 9568 9601 9655 9696 9742 9799 9847 9889 9407 9455 9495 9375 10338 10357 10368 10304 10282 10105 164 21 21 21 21 1 21 22 22 1 672 183 0 855 855 183 19 7 2 7 1 6 1 1 6 7 6 9 8 7 7 0 7 32 5 1 37 38 1 7 2 39 89 48 48 48 15 0 15 0 0 0 15 30 15 15 15 15 10 10 10 10 1 71 15 70 1 0 15 1 71 161 87 87 87 0 16 1 1 16 35 18 0 0 0 0 0 0 0 0 0 0 0 9 9 5 9 0 14 5 41 4 4 45 45 5 5 5 1 0 2 0 0 0 2 5 0 5 3 8 8 8 0 3 2 5 0 5 9 27 5 5 5 5 5 5 0 0 1 5 6 38 6 6 6 0 0 0 1 18 15 0 0 6 0 48 87 40 175 0 0 0 0 0 0 \ No newline at end of file diff --git a/data/responses.json b/data/responses.json index c1e1fe0..86b65a8 100644 --- a/data/responses.json +++ b/data/responses.json @@ -1,7 +1,6 @@ { "err_create_field_DNE": "That field does not exist in this type\n| ", "err_create_field_wrong_type": "That value does not match the type of the field\n| ", - "err_create_empty_name": "Please enter a non-empty name\n| ", "err_create_field_no_value": "Please input a variable and a value\n| ", "err_create_field_already_entered": "This field has already been entered\n| ", "err_assign_empty": "Please input a type name and id\n|> ", @@ -15,11 +14,11 @@ "err_unknown_command": "Unknown command. Type help for a list of commands\n|> ", "err_at_empty": "Please enter what the type and id of which to get an instance\n|> ", "err_at_no_id": "Please enter an id of the instance you which to get\n|> ", - "err_at_invalid_type": "No type of that name", - "err_invalid_expr": "Invalid comparison expression", - "err_invalid_comparison": "Invalid comparison, use <> = > < >= <=", - "err_find_invalid_type": "Cannot find type of that name", - "help_message": "\nTo define a custom dataframe, type the following,\nall valueNames must be unique:\ndef TypeName IdName\n type valueName\n ...\n type valueName\n\n\nTo assign values to the custom types:\nassign TypeName IdValue\n valueName = value\n ...\n valueName = value\n\nTo save to a file, use 'save '\n\n|> ", + "err_at_invalid_type": "No type of that name\n|> ", + "err_find_invalid_expr": "Invalid comparison expression\n|> ", + "err_find_invalid_comparison": "Invalid comparison, use <> = > < >= <=\n|> ", + "err_find_invalid_type": "Cannot find type of that name\n|> ", + "help_message": "\nTo define a custom dataframe, type the following,\nall valueNames must be unique:\ndef TypeName IdName\n type valueName\n ...\n type valueName\n\n\nTo assign values to the custom types:\nassign TypeName IdValue\n valueName = value\n ...\n valueName = value\n\nTo save to a file, use 'save '\n\nTo find a file, type 'find TypeName expr'\n'expr' must be of the form: 'variable compare value' separated by spaces.\nValid compare opperators include <> = > < <= and >=\nexpr can be chained using 'and'\n\n|> ", "indent_end": "| <|\n|> ", "indent": "| ", "default": "|> " diff --git a/lib/cli.ml b/lib/cli.ml index 92c19f2..476c522 100644 --- a/lib/cli.ml +++ b/lib/cli.ml @@ -27,7 +27,6 @@ module CLI = struct let response_names = [ - "err_create_empty_name"; "err_create_field_DNE"; "err_create_field_wrong_type"; "err_create_field_no_value"; @@ -41,8 +40,9 @@ module CLI = struct "err_defn_no_name"; "err_defn_invalid_type"; "err_unknown_command"; - "err_invalid_expr"; - "err_invalid_comparison"; + "err_find_invalid_expr"; + "err_find_invalid_comparison"; + "err_find_invalid_type"; "err_at_no_id"; "help_message"; "indent_end"; @@ -97,14 +97,10 @@ module CLI = struct input |> String.split_on_char '=' |> List.map String.trim |> List.filter (fun s -> s <> "") with - | [] | [ "" ] -> + | [] -> DB.add_named_entry name vals !db; current_state := Default; get_response "indent_end" (* "| <|\n|> " *) - | "" :: tl -> - current_state := BuildInstance (name, table, vals); - get_response "err_create_empty_name" - (* "Please enter a non-empty name\n| " *) | [ n ] -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_no_value" @@ -134,7 +130,7 @@ module CLI = struct let process_assign input = match input |> List.map String.trim |> List.filter (fun s -> s <> "") with - | [] | [ "" ] -> + | [] -> get_response "err_assign_empty" (* "Please input a type name and id\n|> " *) | [ name ] -> @@ -163,7 +159,7 @@ module CLI = struct | "float" -> Type (name, Floats) | "string" -> Type (name, Strings) | "bool" -> Type (name, Bools) - | "chars" -> Type (name, Chars) + | "char" -> Type (name, Chars) | "id" -> Type (name, Ids) | _ -> raise ParseError @@ -173,7 +169,7 @@ module CLI = struct |> List.map String.trim |> List.filter (fun s -> s <> "") with - | [] | [ "" ] -> + | [] -> db := DB.build_table !db (Type (id, Strings) :: types) name; current_state := Default; get_response "indent_end" (* "| <|\n|> " *) @@ -192,7 +188,7 @@ module CLI = struct let process_type input = match List.filter (fun s -> s <> "") input with - | [] | [ "" ] -> get_response "err_defn_needs_type_name" + | [] -> get_response "err_defn_needs_type_name" (* "Please enter a type name for the definition\n|> " *) | [ name ] -> get_response "err_defn_needs_ID_name" @@ -257,25 +253,26 @@ module CLI = struct value ) | _ -> failwith "should be impossible" - let placeholdertablehandler tn ls = "" + let placeholdertablehandler tn ls = "placeholder table\n|> " let process_find lst = let cleaned_lst = lst |> List.map String.trim |> List.filter (fun s -> s <> "") in match DB.get_table (List.hd cleaned_lst) !db with - | None -> "" + | None -> get_response "err_find_invalid_type" | Some type_table -> ( try - cleaned_lst + cleaned_lst |> List.tl |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" |> split_on_substring " and " |> List.map String.trim |> List.filter (fun s -> s <> "") + |> (fun lst -> if lst = [] then raise InvalidExpr else lst) |> List.map parse_compare_exp |> placeholdertablehandler type_table with - | InvalidExpr -> get_response "err_invalid_expr" - | InvalidComparison -> get_response "err_invalid_comparison") + | InvalidExpr -> get_response "err_find_invalid_expr" + | InvalidComparison -> get_response "err_find_invalid_comparison") (** [parse_input input] takes in new input and determines the relevant command*) let parse_input input = diff --git a/lib/cli2.ml b/lib/cli2.ml deleted file mode 100644 index 225695d..0000000 --- a/lib/cli2.ml +++ /dev/null @@ -1,157 +0,0 @@ -open Utils -open Database -open Tables -module Tbl = Tables.HashTable -module DB = Database (Tbl) - -let db = ref DB.empty - -exception ParseError - -let parse_value v = function - | Strings -> String v - | Ints -> ( - match int_of_string_opt v with - | Some i -> Int i - | None -> raise ParseError) - | Floats -> ( - match float_of_string_opt v with - | Some f -> Float f - | None -> raise ParseError) - | Bools -> ( - match bool_of_string_opt v with - | Some b -> Bool b - | None -> raise ParseError) - | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) - | Ids -> raise ParseError - -let rec build_instance (name, table, vals) = - print_string "| "; - let input = read_line () in - match input |> String.split_on_char '=' |> List.map String.trim with - | [] | [ "" ] -> - print_endline "| <|\n"; - DB.add_named_entry name vals !db - | "" :: tl -> - print_endline "Please enter a non-empty name"; - build_instance (name, table, vals) - | [ n ] -> - print_endline "Please input a value"; - build_instance (name, table, vals) - | n :: v :: tl -> ( - match List.assoc_opt n vals with - | None -> ( - match Tbl.exists table n with - | exception TypeMismatch -> - print_endline "That field does not exist in this type"; - build_instance (name, table, vals) - | t -> ( - match parse_value v t with - | x -> build_instance (name, table, (n, x) :: vals) - | exception ParseError -> - print_endline - "That value does not match the type of the field"; - build_instance (name, table, vals))) - | Some _ -> - print_endline "This field has already been entered"; - build_instance (name, table, vals)) - -let process_assign = function - | [] | [ "" ] -> print_endline "Please input a type name and id" - | [ name ] -> print_endline "Please input an id for this instance" - | name :: id :: tl -> ( - match DB.get_table name !db with - | Some t -> - build_instance - ( name, - t, - [ - ( (match Tbl.header t with - | Type (n, _) :: tl -> n - | _ -> raise ParseError), - String id ); - ] ) - | None -> print_endline "That type does not exist") - -let parse_type (typ, name) = - match typ with - | "int" -> Type (name, Ints) - | "float" -> Type (name, Floats) - | "string" -> Type (name, Strings) - | "bool" -> Type (name, Bools) - | "chars" -> Type (name, Chars) - | "id" -> Type (name, Ids) - | _ -> raise ParseError - -let rec build_type (name, id, types) () = - print_string "| "; - let input = read_line () in - match String.split_on_char ' ' input with - | [] | [ "" ] -> - print_endline "| <|\n"; - db := DB.build_table !db (Type (id, Strings) :: types) name - | [ typ ] -> print_endline "Please enter a name for this field\n " - | typ :: field_name :: tl -> ( - match parse_type (typ, field_name) with - | Type _ as t -> build_type (name, id, types @ [ t ]) () - | exception ParseError -> - print_endline "Not a recognized type"; - build_type (name, id, types) () - | _ -> raise (Failure "Should be impossible")) - -let process_type = function - | [] | [ "" ] -> print_endline "Please enter a type name for the definition" - | [ name ] -> print_endline "Please enter a name for the ID of this type" - | name :: id :: tl -> ( - match DB.get_table name !db with - | Some _ -> print_endline ("| <|\n Type " ^ name ^ " already defined") - | None -> build_type (name, id, []) ()) - -let process_at = function - | [] | [ "" ] -> - print_endline "Please enter what type you which to get an instance of" - | [ name ] -> - print_endline "Please enter an id of the instance you which to get" - | name :: id :: tl -> ( - match DB.get_table name !db with - | Some x -> - print_endline (build_row (optionize (Tbl.header x))); - print_endline (build_row (Tbl.at x (String id))) - | None -> print_endline ("No type named " ^ name)) - -(** [parse_input input] takes in new input and determines the relevant command*) -let rec parse_input input = - (match String.split_on_char ' ' input with - | "quit" :: tl -> exit 0 - | "help" :: tl -> - print_endline - "\n\ - To define a custom dataframe, type all valueNames must be unique:\n\ - def TypeName IdName\n\ - \ type valueName\n\ - \ ...\n\ - \ type valueName\n\n\n\ - To assign values to the custom types:\n\ - assign TypeName IdValue\n\ - \ valueName = value\n\ - \ ...\n\ - \ valueName = value\n\n\ - To save to a file, use 'save '\n" - | "def" :: tl -> process_type tl - | "assign" :: tl -> process_assign tl - | "print" :: tl -> print_endline (DB.db_to_string !db) - | "at" :: tl -> process_at tl - | _ -> print_endline "Unknown command. Type help for a list of commands"); - print_string "|> "; - read_line () |> parse_input - -(** [main ()] prompts for the script to start, then starts it. *) - -let main () = - print_string - "\n\n\ - Welcome to the 3110 Database Command Line\n\ - Please describe the data you want to store.\n\ - Type 'quit' to quit, 'help' for help.\n\n"; - print_string "|> "; - read_line () |> parse_input diff --git a/lib/cli2.mli b/lib/cli2.mli deleted file mode 100644 index 86f37aa..0000000 --- a/lib/cli2.mli +++ /dev/null @@ -1 +0,0 @@ -val main : unit -> unit diff --git a/lib/dune b/lib/dune index e6ef250..65e11c2 100644 --- a/lib/dune +++ b/lib/dune @@ -1,3 +1,5 @@ (library (name RelationalDatabase) - (libraries yojson)) + (libraries yojson) + (instrumentation + (backend bisect_ppx))) diff --git a/test/main.ml b/test/main.ml index 035bcd2..2913417 100644 --- a/test/main.ml +++ b/test/main.ml @@ -33,6 +33,30 @@ let rec make_test primer tests = in placeholder :: make_test primer t +let fully_defined_generic = + [ + "def Type ID"; + "int i"; + "float f"; + "char c"; + "bool b"; + "string s"; + "id d"; + ""; + ] + +let fully_assigned_generic = + fully_defined_generic + @ [ + "assign Type ID1"; + "i = 10"; + "f = 3.14"; + "c = a"; + "b = true"; + "s = hello there"; + ""; + ] + let def_tests = ( [], [ @@ -66,6 +90,10 @@ let pre_defn_assign_tests = "can define types out of order age", "age = 23", get_response "indent" ); + ( false, + "cant define a type twice age", + "age = 25", + get_response "err_create_field_already_entered" ); ( false, "can define types out of order empty end", "", @@ -78,12 +106,70 @@ let pre_defn_assign_tests = "entry no value error", "age = ", get_response "err_create_field_no_value" ); + ( true, + "assign with no name error", + " = 5", + get_response "err_create_field_no_value" ); ( true, "entry wrong type error", "age = hello", get_response "err_create_field_wrong_type" ); ] ) +let assign_type_tests = + ( fully_defined_generic @ [ "assign Type ID1" ], + [ + ( true, + "incorrect float value", + "f = hello", + get_response "err_create_field_wrong_type" ); + ( true, + "incorrect int value", + "i = 3.2", + get_response "err_create_field_wrong_type" ); + ( true, + "incorrect bool value", + "b = 2", + get_response "err_create_field_wrong_type" ); + ( true, + "incorrect char value", + "c = abc", + get_response "err_create_field_wrong_type" ); + ] ) + +let find_tests = + ( fully_assigned_generic, + [ + ( true, + "incorrect find comparison '_'", + "find Type s _ 3", + get_response "err_find_invalid_comparison" ); + ( true, + "find type DNE", + "find Tope i < 4", + get_response "err_find_invalid_type" ); + ( true, + "incorrect find expression", + "find Type s _", + get_response "err_find_invalid_expr" ); + ( true, + "incorrect find expression, empty", + "find Type s ", + get_response "err_find_invalid_expr" ); + ( true, + "incorrect find comparison '+' with and", + "find Type s > 4 and i = 2 and f + 3", + get_response "err_find_invalid_comparison" ); + ( true, + "incorrect find incorrect expr with and", + "find Type s < 4 and i =2 and f < 3", + get_response "err_find_invalid_expr" ); + ( true, + "incorrect find incorrect expr with and", + "find Type s < 4 and i = 2 and f < 3", + get_response "err_find_invalid_expr" ); + ] ) + let misc_tests = ( [], [ (true, "help message is correct", "help", get_response "help_message") ] @@ -96,7 +182,13 @@ let rec gather_tests tests = let suite = "search test suite" - >::: ([ def_tests; misc_tests; pre_defn_assign_tests ] + >::: ([ + def_tests; + misc_tests; + pre_defn_assign_tests; + find_tests; + assign_type_tests; + ] |> gather_tests |> List.flatten) let _ = run_test_tt_main suite From fdaecafc39097fe3dc689aefa1800a8ee5a07ef2 Mon Sep 17 00:00:00 2001 From: Thomas McFarland Date: Sat, 13 May 2023 14:29:53 -0400 Subject: [PATCH 09/24] First implemtn --- lib/cli.ml | 4 +--- lib/tables.ml | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ lib/tables.mli | 5 +++++ lib/utils.ml | 45 +++++++++++++++++++++++++++++++++++++ lib/utils.mli | 8 +++++++ 5 files changed, 120 insertions(+), 3 deletions(-) diff --git a/lib/cli.ml b/lib/cli.ml index 92c19f2..bbffdc7 100644 --- a/lib/cli.ml +++ b/lib/cli.ml @@ -257,8 +257,6 @@ module CLI = struct value ) | _ -> failwith "should be impossible" - let placeholdertablehandler tn ls = "" - let process_find lst = let cleaned_lst = lst |> List.map String.trim |> List.filter (fun s -> s <> "") @@ -272,7 +270,7 @@ module CLI = struct |> split_on_substring " and " |> List.map String.trim |> List.filter (fun s -> s <> "") |> List.map parse_compare_exp - |> placeholdertablehandler type_table + |> Tbl.process_constraints type_table with | InvalidExpr -> get_response "err_invalid_expr" | InvalidComparison -> get_response "err_invalid_comparison") diff --git a/lib/tables.ml b/lib/tables.ml index 6b6c1e8..0392022 100644 --- a/lib/tables.ml +++ b/lib/tables.ml @@ -59,6 +59,12 @@ let rec reorder_list (a : (string * entry) list) = function vl :: reorder_list rest tl | _ -> raise TypeMismatch +let rec get_type_index cnt name = function + | [] -> raise Not_found + | Type (n, _) :: tl -> + if n = name then cnt else get_type_index (cnt + 1) name tl + | _ -> raise TypeMismatch + module type Table = sig type t @@ -68,6 +74,7 @@ module type Table = sig val at : t -> entry -> entry option list val delete : t -> entry -> t val table_to_string : t -> string + val process_constraints : t -> (string * comparison * string) list -> string val header : t -> entry list val exists : t -> string -> types end @@ -138,6 +145,27 @@ module ListTable : Table = struct | _ :: tl -> follow_header tl in follow_header (header table) + + let rec process_constraints tbl lst = + match lst with + | [] -> table_to_string tbl + | hd :: tl -> + let ntbl = + match hd with + | name, cmp, vl -> ( + let ind = get_type_index 0 name (header tbl) in + match List.nth (header tbl) ind with + | Type (_, t) -> + let e = process_entry vl t in + List.filter + (fun a -> + match List.nth a ind with + | None -> false + | Some v -> run_constraint cmp e v) + tbl + | _ -> failwith "Impossible") + in + process_constraints ntbl tl end module HashTable = struct @@ -194,6 +222,39 @@ module HashTable = struct (hshtable table) (build_row (optionize (header table))) + let rec process_constraints tbl lst = + let newHash = Hashtbl.create 0 in + match lst with + | [] -> table_to_string tbl + | hd :: tl -> + process_constraints + (match hd with + | name, cmp, vl -> + let ind = get_type_index 0 name (header tbl) in + let cmp_func = + match + List.find + (function + | Type (n, t) -> n = name | _ -> failwith "Impossible") + (header tbl) + with + | Type (n, t) -> ( + match process_entry vl t with e -> run_constraint cmp e) + | _ -> raise (Failure "Impossible") + in + Hashtbl.iter + (fun a b -> + if ind = 0 then + if cmp_func a then Hashtbl.add newHash a b else () + else + match List.nth b (ind - 1) with + | None -> () + | Some v -> + if cmp_func v then Hashtbl.add newHash a b else ()) + (hshtable tbl); + HashTab (header tbl, newHash)) + tl + let exists table name = let rec follow_header = function | [] -> raise TypeMismatch diff --git a/lib/tables.mli b/lib/tables.mli index fd5c359..3b4a44b 100644 --- a/lib/tables.mli +++ b/lib/tables.mli @@ -22,6 +22,11 @@ module type Table = sig val delete : t -> entry -> t val table_to_string : t -> string + (* Processes a given list of constraints + Raises [Not_found] if a constraint isn't found + Raises [TypeMismatch] if the comparison value doesn't match the header*) + val process_constraints : t -> (string * comparison * string) list -> string + (* Returns the header of the table*) val header : t -> entry list diff --git a/lib/utils.ml b/lib/utils.ml index 3b7c903..e14e16f 100644 --- a/lib/utils.ml +++ b/lib/utils.ml @@ -1,6 +1,9 @@ type types = Strings | Floats | Ints | Chars | Bools | Ids type comparison = LT | LTE | EQ | NEQ | GT | GTE +exception IndexExists +exception TypeMismatch + type entry = | String of string | Float of float @@ -29,6 +32,48 @@ let name_map_types t = | Bools -> "bool" | Ids -> "id" +let guess_entry input = + match float_of_string_opt input with + | Some v -> Float v + | None -> ( + match int_of_string_opt input with + | Some v -> Int v + | None -> ( + match bool_of_string_opt input with + | Some v -> Bool v + | None -> + if String.length input = 1 then Char input.[0] else String input)) + +let process_entry input = function + | Strings -> String input + | Floats -> ( + match float_of_string_opt input with + | None -> raise TypeMismatch + | Some v -> Float v) + | Ints -> ( + match int_of_string_opt input with + | None -> raise TypeMismatch + | Some v -> Int v) + | Chars -> + if String.length input = 1 then Char input.[0] else raise TypeMismatch + | Bools -> ( + match bool_of_string_opt input with + | None -> raise TypeMismatch + | Some v -> Bool v) + | Ids -> ( + match String.split_on_char '@' input with + | [] | [ _ ] | _ :: _ :: _ :: _ -> raise TypeMismatch + | [ hd; tl ] -> Id (hd, guess_entry tl)) + +let run_constraint cmp rhs lhs = + match cmp with + | LT -> ( + match lhs with + | Float lhs -> ( + match rhs with Float rhs -> lhs < rhs | _ -> raise TypeMismatch) + | _ -> raise TypeMismatch) + | _ -> failwith "Unimplemented" + let rec entry_to_string ent = match ent with | String x -> x diff --git a/lib/utils.mli b/lib/utils.mli index dc48c27..0b026ab 100644 --- a/lib/utils.mli +++ b/lib/utils.mli @@ -1,6 +1,9 @@ type types = Strings | Floats | Ints | Chars | Bools | Ids type comparison = LT | LTE | EQ | NEQ | GT | GTE +exception IndexExists +exception TypeMismatch + type entry = | String of string | Float of float @@ -11,6 +14,11 @@ type entry = | Type of (string * types) val name_map_entry : entry -> string + +(* Turns a string into the given entry type. + Raise [TypeMismatch] if this cannot occur*) +val process_entry : string -> types -> entry +val run_constraint : comparison -> entry -> entry -> bool val name_map_types : types -> string val entry_to_string : entry -> string val shorten : string -> string From 3b9861fb5725410d65dee73c1e83605122cf9575 Mon Sep 17 00:00:00 2001 From: Thomas McFarland Date: Sat, 13 May 2023 17:24:25 -0400 Subject: [PATCH 10/24] Fix cmp --- lib/cli.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/cli.ml b/lib/cli.ml index 679384b..f1dff24 100644 --- a/lib/cli.ml +++ b/lib/cli.ml @@ -243,12 +243,12 @@ module CLI = struct | [ var; compare; value ] -> ( var, (match compare with - | "=" -> Utils.EQ - | "<>" -> Utils.NEQ - | ">" -> Utils.GT - | "<" -> Utils.LT - | "<=" -> Utils.LTE - | ">=" -> Utils.GTE + | "=" -> ( = ) + | "<>" -> ( <> ) + | ">" -> ( > ) + | "<" -> ( < ) + | "<=" -> ( <= ) + | ">=" -> ( >= ) | _ -> raise InvalidComparison), value ) | _ -> failwith "should be impossible" From 68c379c228c262767c135effbcdbf3a9a726d0ec Mon Sep 17 00:00:00 2001 From: Thomas McFarland Date: Sat, 13 May 2023 21:55:28 -0400 Subject: [PATCH 11/24] Complete Find --- lib/cli.ml | 12 ++++++------ lib/utils.ml | 38 ++++++++++++++++++++++++++++++++------ 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/lib/cli.ml b/lib/cli.ml index f1dff24..32e646f 100644 --- a/lib/cli.ml +++ b/lib/cli.ml @@ -243,12 +243,12 @@ module CLI = struct | [ var; compare; value ] -> ( var, (match compare with - | "=" -> ( = ) - | "<>" -> ( <> ) - | ">" -> ( > ) - | "<" -> ( < ) - | "<=" -> ( <= ) - | ">=" -> ( >= ) + | "=" -> EQ + | "<>" -> NEQ + | ">" -> GT + | "<" -> LT + | "<=" -> LTE + | ">=" -> GTE | _ -> raise InvalidComparison), value ) | _ -> failwith "should be impossible" diff --git a/lib/utils.ml b/lib/utils.ml index e14e16f..0484f68 100644 --- a/lib/utils.ml +++ b/lib/utils.ml @@ -65,14 +65,40 @@ let process_entry input = function | [] | [ _ ] | _ :: _ :: _ :: _ -> raise TypeMismatch | [ hd; tl ] -> Id (hd, guess_entry tl)) -let run_constraint cmp rhs lhs = +let make_compare cmp lhs rhs = match cmp with - | LT -> ( + | LT -> lhs < rhs + | LTE -> lhs <= rhs + | EQ -> lhs = rhs + | NEQ -> lhs <> rhs + | GT -> lhs > rhs + | GTE -> lhs >= rhs + +let run_constraint_float (cmp : 'a -> 'a -> bool) lhs rhs = cmp lhs rhs + +let run_constraint (cmp : comparison) rhs lhs = + match rhs with + | Float r -> ( + match lhs with + | Float l -> make_compare cmp l r + | _ -> failwith "Typing error") + | Int r -> ( + match lhs with + | Int l -> make_compare cmp l r + | _ -> failwith "Typing error") + | Char r -> ( + match lhs with + | Char l -> make_compare cmp l r + | _ -> failwith "Typing error") + | Bool r -> ( + match lhs with + | Bool l -> make_compare cmp l r + | _ -> failwith "Typing error") + | String r -> ( match lhs with - | Float lhs -> ( - match rhs with Float rhs -> lhs < rhs | _ -> raise TypeMismatch) - | _ -> raise TypeMismatch) - | _ -> failwith "Unimplemented" + | String l -> make_compare cmp l r + | _ -> failwith "Typing error") + | _ -> raise TypeMismatch let rec entry_to_string ent = match ent with From 4ff31d8f6867c51e471cff6bde66b8f9e4ba87a3 Mon Sep 17 00:00:00 2001 From: Thomas McFarland Date: Sat, 13 May 2023 21:55:59 -0400 Subject: [PATCH 12/24] Ooops --- lib/utils.ml | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/utils.ml b/lib/utils.ml index 0484f68..a44c8e9 100644 --- a/lib/utils.ml +++ b/lib/utils.ml @@ -74,8 +74,6 @@ let make_compare cmp lhs rhs = | GT -> lhs > rhs | GTE -> lhs >= rhs -let run_constraint_float (cmp : 'a -> 'a -> bool) lhs rhs = cmp lhs rhs - let run_constraint (cmp : comparison) rhs lhs = match rhs with | Float r -> ( From 541958162b92e4fa68cddc86346686d4e91fca2d Mon Sep 17 00:00:00 2001 From: Thomas McFarland Date: Sat, 13 May 2023 22:09:55 -0400 Subject: [PATCH 13/24] Update at --- _coverage/index.html | 16 +- _coverage/lib/cli.ml.html | 337 +++++++++---------- _coverage/lib/database.ml.html | 10 +- _coverage/lib/tables.ml.html | 587 ++++++++++++++++++++++----------- _coverage/lib/utils.ml.html | 479 ++++++++++++++++++++------- bisect001042343.coverage | 1 + bisect070345425.coverage | 1 - bisect091422069.coverage | 1 + bisect115162322.coverage | 1 - bisect158168986.coverage | 1 - bisect220228091.coverage | 1 - bisect374128807.coverage | 1 - bisect401024424.coverage | 1 + lib/cli.ml | 6 +- 14 files changed, 932 insertions(+), 511 deletions(-) create mode 100644 bisect001042343.coverage delete mode 100644 bisect070345425.coverage create mode 100644 bisect091422069.coverage delete mode 100644 bisect115162322.coverage delete mode 100644 bisect158168986.coverage delete mode 100644 bisect220228091.coverage delete mode 100644 bisect374128807.coverage create mode 100644 bisect401024424.coverage diff --git a/_coverage/index.html b/_coverage/index.html index d8981ff..b5abc78 100644 --- a/_coverage/index.html +++ b/_coverage/index.html @@ -3,20 +3,20 @@ Coverage report - +
- + - 75% (123 / 164) + 77% (126 / 163) lib/cli.ml @@ -32,18 +32,18 @@

41.62%

- + - 22% (37 / 165) + 30% (64 / 210) lib/tables.ml
- + - 0% (0 / 44) + 33% (33 / 98) lib/utils.ml diff --git a/_coverage/lib/cli.ml.html b/_coverage/lib/cli.ml.html index 7c2aa83..b34b720 100644 --- a/_coverage/lib/cli.ml.html +++ b/_coverage/lib/cli.ml.html @@ -3,7 +3,7 @@ cli.ml — Coverage report - + @@ -15,40 +15,37 @@

lib/cli.ml

-

75.00%

+

77.30%

@@ -302,65 +299,63 @@

75.00%

- + - - - - + + + + - + - - - - + + + + - + - - - - - - + + + + + + - - + + - - - - + + + + - - - + + + - - + + - + - + - - + + - - - +
@@ -670,8 +665,6 @@

75.00%

303 304 305 -306 -307
module type CliHandler = sig
   val parse_input : string -> string
@@ -726,101 +719,101 @@ 

75.00%

] let get_json_item file entry = - file |> to_assoc |> List.assoc entry |> to_string + file |> to_assoc |> List.assoc entry |> to_string let file_name = "data/responses.json" let rec build_response_assoc_list res_names res_assoc = - let file = Yojson.Basic.from_file file_name in - match res_names with - | [] -> res_assoc - | h :: t -> - (h, get_json_item file h) :: res_assoc |> build_response_assoc_list t + let file = Yojson.Basic.from_file file_name in + match res_names with + | [] -> res_assoc + | h :: t -> + (h, get_json_item file h) :: res_assoc |> build_response_assoc_list t - let responses = build_response_assoc_list response_names [] + let responses = build_response_assoc_list response_names [] let rec find_response key lst = - match lst with + match lst with | [] -> failwith "response not found" - | (k, v) :: t -> if k = key then v else find_response key t + | (k, v) :: t -> if k = key then v else find_response key t - let get_response response = find_response response responses + let get_response response = find_response response responses let reset () = - current_state := Default; + current_state := Default; db := DB.empty let parse_value v = function - | Strings -> String v - | Ints -> ( + | Strings -> String v + | Ints -> ( match int_of_string_opt v with - | Some i -> Int i - | None -> raise ParseError) - | Floats -> ( + | Some i -> Int i + | None -> raise ParseError) + | Floats -> ( match float_of_string_opt v with - | Some f -> Float f - | None -> raise ParseError) - | Bools -> ( + | Some f -> Float f + | None -> raise ParseError) + | Bools -> ( match bool_of_string_opt v with - | Some b -> Bool b - | None -> raise ParseError) - | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) + | Some b -> Bool b + | None -> raise ParseError) + | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) | Ids -> raise ParseError let rec build_instance (name, table, vals) input = - match - input |> String.split_on_char '=' |> List.map String.trim - |> List.filter (fun s -> s <> "") + match + input |> String.split_on_char '=' |> List.map String.trim + |> List.filter (fun s -> s <> "") with - | [] -> + | [] -> DB.add_named_entry name vals !db; - current_state := Default; + current_state := Default; get_response "indent_end" (* "| <|\n|> " *) - | [ n ] -> + | [ n ] -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_no_value" (* "Please input a variable and a value\n| " *) - | n :: v :: tl -> ( + | n :: v :: tl -> ( match List.assoc_opt n vals with - | None -> ( + | None -> ( match Tbl.exists table n with - | exception TypeMismatch -> + | exception TypeMismatch -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_DNE" (* "That field does not exist in this type\n| " *) - | t -> ( + | t -> ( match parse_value v t with - | x -> + | x -> current_state := BuildInstance (name, table, (n, x) :: vals); get_response "indent" (* "| " *) - | exception ParseError -> + | exception ParseError -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_wrong_type" (* "That value does not match the type of the field\n| " *) )) - | Some _ -> + | Some _ -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_already_entered" (* "This field has already been entered\n| " *)) let process_assign input = - match input |> List.map String.trim |> List.filter (fun s -> s <> "") with + match input |> List.map String.trim |> List.filter (fun s -> s <> "") with | [] -> get_response "err_assign_empty" (* "Please input a type name and id\n|> " *) | [ name ] -> get_response "err_assign_no_id" (* "Please input an id for this instance\n|> " *) - | name :: id :: tl -> ( + | name :: id :: tl -> ( match DB.get_table name !db with - | Some t -> + | Some t -> current_state := BuildInstance ( name, t, [ ( (match Tbl.header t with - | Type (n, _) :: tl -> n + | Type (n, _) :: tl -> n | _ -> raise ParseError), String id ); ] ); @@ -829,51 +822,51 @@

75.00%

(* "That type does not exist\n|> " *) let parse_type (typ, name) = - match typ with - | "int" -> Type (name, Ints) - | "float" -> Type (name, Floats) - | "string" -> Type (name, Strings) - | "bool" -> Type (name, Bools) - | "char" -> Type (name, Chars) - | "id" -> Type (name, Ids) - | _ -> raise ParseError + match typ with + | "int" -> Type (name, Ints) + | "float" -> Type (name, Floats) + | "string" -> Type (name, Strings) + | "bool" -> Type (name, Bools) + | "char" -> Type (name, Chars) + | "id" -> Type (name, Ids) + | _ -> raise ParseError let rec build_type (name, id, types) input = - match + match String.split_on_char ' ' input - |> List.map String.trim - |> List.filter (fun s -> s <> "") + |> List.map String.trim + |> List.filter (fun s -> s <> "") with - | [] -> - db := DB.build_table !db (Type (id, Strings) :: types) name; + | [] -> + db := DB.build_table !db (Type (id, Strings) :: types) name; current_state := Default; get_response "indent_end" (* "| <|\n|> " *) - | [ typ ] -> get_response "err_defn_no_name" + | [ typ ] -> get_response "err_defn_no_name" (* "Please enter a name for this field\n| " *) - | typ :: field_name :: tl -> ( + | typ :: field_name :: tl -> ( match parse_type (typ, field_name) with - | Type _ as t -> + | Type _ as t -> current_state := BuildType (name, id, types @ [ t ]); get_response "indent" (* "| " *) - | exception ParseError -> + | exception ParseError -> current_state := BuildType (name, id, types); get_response "err_defn_invalid_type" (* "Not a recognized type\n| " *) | _ -> raise (Failure "Should be impossible")) let process_type input = - match List.filter (fun s -> s <> "") input with - | [] -> get_response "err_defn_needs_type_name" + match List.filter (fun s -> s <> "") input with + | [] -> get_response "err_defn_needs_type_name" (* "Please enter a type name for the definition\n|> " *) - | [ name ] -> + | [ name ] -> get_response "err_defn_needs_ID_name" (* "Please enter a name for the ID of this type\n|> " *) - | name :: id :: tl -> ( + | name :: id :: tl -> ( match DB.get_table name !db with | Some _ -> get_response "err_defn_already_exists" (* "\n Type already defined\n|> " *) - | None -> + | None -> current_state := BuildType (name, id, []); get_response "indent" (* "| " *)) @@ -894,75 +887,73 @@

75.00%

get_response "err_at_invalid_type" (* "No type of that name" *)) let split_on_substring sub str = - let idxs = ref [ 0 ] in + let idxs = ref [ 0 ] in let sub_len = String.length sub in - for i = 0 to String.length str - sub_len do - if String.sub str i sub_len = sub then - idxs := !idxs @ [ i; i + String.length sub ] - else () + for i = 0 to String.length str - sub_len do + if String.sub str i sub_len = sub then + idxs := !idxs @ [ i; i + String.length sub ] + else () done; - idxs := !idxs @ [ String.length str ]; + idxs := !idxs @ [ String.length str ]; let rec create_lst idxs sub_len str = - match idxs with - | [] -> [] - | s :: e :: t -> String.sub str s (e - s) :: create_lst t sub_len str + match idxs with + | [] -> [] + | s :: e :: t -> String.sub str s (e - s) :: create_lst t sub_len str | _ -> failwith "odd" in create_lst !idxs sub_len str let parse_compare_exp str = - let str_lst = String.split_on_char ' ' str in - if List.length str_lst <> 3 then raise InvalidExpr + let str_lst = String.split_on_char ' ' str in + if List.length str_lst <> 3 then raise InvalidExpr else - match str_lst with - | [ var; compare; value ] -> + match str_lst with + | [ var; compare; value ] -> ( var, (match compare with - | "=" -> Utils.EQ - | "<>" -> Utils.NEQ - | ">" -> Utils.GT - | "<" -> Utils.LT - | "<=" -> Utils.LTE - | ">=" -> Utils.GTE - | _ -> raise InvalidComparison), + | "=" -> EQ + | "<>" -> NEQ + | ">" -> GT + | "<" -> LT + | "<=" -> LTE + | ">=" -> GTE + | _ -> raise InvalidComparison), value ) | _ -> failwith "should be impossible" - let placeholdertablehandler tn ls = "placeholder table\n|> " - let process_find lst = - let cleaned_lst = - lst |> List.map String.trim |> List.filter (fun s -> s <> "") + let cleaned_lst = + lst |> List.map String.trim |> List.filter (fun s -> s <> "") in - match DB.get_table (List.hd cleaned_lst) !db with - | None -> get_response "err_find_invalid_type" - | Some type_table -> ( + match DB.get_table (List.hd cleaned_lst) !db with + | None -> get_response "err_find_invalid_type" + | Some type_table -> ( try cleaned_lst |> List.tl - |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" - |> split_on_substring " and " |> List.map String.trim - |> List.filter (fun s -> s <> "") - |> (fun lst -> if lst = [] then raise InvalidExpr else lst) - |> List.map parse_compare_exp - |> placeholdertablehandler type_table + |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" + |> split_on_substring " and " |> List.map String.trim + |> List.filter (fun s -> s <> "") + |> (fun lst -> if lst = [] then raise InvalidExpr else lst) + |> List.map parse_compare_exp + |> Tbl.process_constraints type_table with - | InvalidExpr -> get_response "err_find_invalid_expr" - | InvalidComparison -> get_response "err_find_invalid_comparison") + | InvalidExpr -> get_response "err_find_invalid_expr" + | InvalidComparison -> get_response "err_find_invalid_comparison") (** [parse_input input] takes in new input and determines the relevant command*) let parse_input input = - match !current_state with - | BuildInstance v -> build_instance v input - | BuildType v -> build_type v input - | Default -> ( + match !current_state with + | BuildInstance v -> build_instance v input + | BuildType v -> build_type v input + | Default -> ( match String.split_on_char ' ' input with | "quit" :: tl -> exit 0 - | "help" :: tl -> get_response "help_message" - | "def" :: tl -> process_type tl - | "assign" :: tl -> process_assign tl + | "help" :: tl -> get_response "help_message" + | "def" :: tl -> process_type tl + | "assign" :: tl -> process_assign tl | "print" :: tl -> DB.db_to_string !db ^ "\n|> " | "at" :: tl -> process_at tl ^ "\n|> " - | "find" :: tl -> process_find tl + | "find" :: tl -> process_find tl | _ -> get_response "err_unknown_command" (* "Unknown command. Type help for a list of commands\n|> " *)) diff --git a/_coverage/lib/database.ml.html b/_coverage/lib/database.ml.html index 6d12a6c..c59ca70 100644 --- a/_coverage/lib/database.ml.html +++ b/_coverage/lib/database.ml.html @@ -171,17 +171,17 @@

27.27%

| _ -> raise TableExists let build_table database table name = - match + match List.find (fun a -> match a with tname, t -> name = tname) database with - | exception Not_found -> (name, ref (Table.empty table)) :: database + | exception Not_found -> (name, ref (Table.empty table)) :: database | _ -> raise TableExists let drop_table name database = List.filter (fun a -> match a with tname, t -> name <> tname) database let get_table name database = - match List.assoc_opt name database with Some x -> Some !x | None -> None + match List.assoc_opt name database with Some x -> Some !x | None -> None (*Currently doesn't work...*) let get_reference ent database = raise (Failure "Unimplemented") @@ -199,9 +199,9 @@

27.27%

| _ :: tl -> add_entry table_name new_row tl let add_named_entry table_name new_row database = - match List.assoc_opt table_name database with + match List.assoc_opt table_name database with | None -> raise Not_found - | Some x -> x := Table.insert_named !x new_row + | Some x -> x := Table.insert_named !x new_row end
diff --git a/_coverage/lib/tables.ml.html b/_coverage/lib/tables.ml.html index da359ce..fc6a0a3 100644 --- a/_coverage/lib/tables.ml.html +++ b/_coverage/lib/tables.ml.html @@ -3,7 +3,7 @@ tables.ml — Coverage report - + @@ -15,103 +15,119 @@

lib/tables.ml

-

22.42%

+

30.48%

@@ -178,10 +194,10 @@

22.42%

- - - - + + + + @@ -193,133 +209,194 @@

22.42%

- - + + - + - + - + - + - + - + - - + + - - - + + + - + - - + + - + - - - + + + - + - + - - - + + + - - + + - - + + - - - - + + + + - - - - - + + + + + - + - - - - + + + + - + - + - - - - + + + + - - + + - + - - - + + + - - - - - - + + + + + + - - - - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -528,6 +605,67 @@

22.42%

202 203 204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265
open Utils
 
@@ -576,18 +714,24 @@ 

22.42%

:: assert_types tl c) let rec reorder_list (a : (string * entry) list) = function - | [] -> if a = [] then [] else raise TypeMismatch - | Some (Type (name, v)) :: tl -> + | [] -> if a = [] then [] else raise TypeMismatch + | Some (Type (name, v)) :: tl -> let vl, rest = let rec extr_name acc = function - | [] -> (None, acc) - | (n, vr) :: rest -> - if n = name then (Some vr, acc @ rest) - else extr_name (acc @ [ (n, vr) ]) rest + | [] -> (None, acc) + | (n, vr) :: rest -> + if n = name then (Some vr, acc @ rest) + else extr_name (acc @ [ (n, vr) ]) rest in - extr_name [] a + extr_name [] a in - vl :: reorder_list rest tl + vl :: reorder_list rest tl + | _ -> raise TypeMismatch + +let rec get_type_index cnt name = function + | [] -> raise Not_found + | Type (n, _) :: tl -> + if n = name then cnt else get_type_index (cnt + 1) name tl | _ -> raise TypeMismatch module type Table = sig @@ -599,6 +743,7 @@

22.42%

val at : t -> entry -> entry option list val delete : t -> entry -> t val table_to_string : t -> string + val process_constraints : t -> (string * comparison * string) list -> string val header : t -> entry list val exists : t -> string -> types end @@ -669,6 +814,27 @@

22.42%

| _ :: tl -> follow_header tl in follow_header (header table) + + let rec process_constraints tbl lst = + match lst with + | [] -> table_to_string tbl + | hd :: tl -> + let ntbl = + match hd with + | name, cmp, vl -> ( + let ind = get_type_index 0 name (header tbl) in + match List.nth (header tbl) ind with + | Type (_, t) -> + let e = process_entry vl t in + List.filter + (fun a -> + match List.nth a ind with + | None -> false + | Some v -> run_constraint cmp e v) + tbl + | _ -> failwith "Impossible") + in + process_constraints ntbl tl end module HashTable = struct @@ -679,15 +845,15 @@

22.42%

| Some x :: tl -> x :: deoptionize_list tl | None :: tl -> failwith "Deoptionize on None" - let header = function HashTab (hd, _) -> hd - let hshtable = function HashTab (_, hsh) -> hsh + let header = function HashTab (hd, _) -> hd + let hshtable = function HashTab (_, hsh) -> hsh let deoptionize = function - | Some x -> x + | Some x -> x | None -> raise (Failure "Deoptionize on none") - let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl - let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0) + let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl + let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0) let insert table entries = match Hashtbl.find_opt (hshtable table) (List.hd entries) with @@ -703,14 +869,14 @@

22.42%

copy) ) let insert_named table entries = - let name, value = List.hd entries in - match Hashtbl.find_opt (hshtable table) value with + let name, value = List.hd entries in + match Hashtbl.find_opt (hshtable table) value with | Some x -> raise IndexExists - | None -> - let copy = Hashtbl.copy (hshtable table) in - let reordered = reorder_list entries (optionize (header table)) in - Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered); - HashTab (header table, copy) + | None -> + let copy = Hashtbl.copy (hshtable table) in + let reordered = reorder_list entries (optionize (header table)) in + Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered); + HashTab (header table, copy) let at table id = Some id :: Hashtbl.find (hshtable table) id @@ -720,18 +886,51 @@

22.42%

HashTab (header table, out) let rec table_to_string table = - Hashtbl.fold + Hashtbl.fold (fun id ent acc -> acc ^ shorten (entry_to_string id) ^ build_row ent) - (hshtable table) - (build_row (optionize (header table))) + (hshtable table) + (build_row (optionize (header table))) + + let rec process_constraints tbl lst = + let newHash = Hashtbl.create 0 in + match lst with + | [] -> table_to_string tbl + | hd :: tl -> + process_constraints + (match hd with + | name, cmp, vl -> + let ind = get_type_index 0 name (header tbl) in + let cmp_func = + match + List.find + (function + | Type (n, t) -> n = name | _ -> failwith "Impossible") + (header tbl) + with + | Type (n, t) -> ( + match process_entry vl t with e -> run_constraint cmp e) + | _ -> raise (Failure "Impossible") + in + Hashtbl.iter + (fun a b -> + if ind = 0 then + if cmp_func a then Hashtbl.add newHash a b else () + else + match List.nth b (ind - 1) with + | None -> () + | Some v -> + if cmp_func v then Hashtbl.add newHash a b else ()) + (hshtable tbl); + HashTab (header tbl, newHash)) + tl let exists table name = - let rec follow_header = function - | [] -> raise TypeMismatch - | Type (n, t) :: tl when n = name -> t - | _ :: tl -> follow_header tl + let rec follow_header = function + | [] -> raise TypeMismatch + | Type (n, t) :: tl when n = name -> t + | _ :: tl -> follow_header tl in - follow_header (header table) + follow_header (header table) end
diff --git a/_coverage/lib/utils.ml.html b/_coverage/lib/utils.ml.html index 9e720e8..ef372c3 100644 --- a/_coverage/lib/utils.ml.html +++ b/_coverage/lib/utils.ml.html @@ -3,7 +3,7 @@ utils.ml — Coverage report - + @@ -15,40 +15,62 @@

lib/utils.ml

-

0.00%

+

33.67%

@@ -67,109 +89,250 @@

0.00%

- - - + + + - - + + - - - - - - - - - - - + + + + + + + + + + + - + - + - + - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
+  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
 
type types = Strings | Floats | Ints | Chars | Bools | Ids
 type comparison = LT | LTE | EQ | NEQ | GT | GTE
 
+exception IndexExists
+exception TypeMismatch
+
 type entry =
   | String of string
   | Float of float
@@ -190,34 +353,100 @@ 

0.00%

| Type _ -> "type" let name_map_types t = - match t with - | Strings -> "string" - | Floats -> "float" - | Ints -> "int" - | Chars -> "char" - | Bools -> "bool" - | Ids -> "id" + match t with + | Strings -> "string" + | Floats -> "float" + | Ints -> "int" + | Chars -> "char" + | Bools -> "bool" + | Ids -> "id" + +let guess_entry input = + match float_of_string_opt input with + | Some v -> Float v + | None -> ( + match int_of_string_opt input with + | Some v -> Int v + | None -> ( + match bool_of_string_opt input with + | Some v -> Bool v + | None -> + if String.length input = 1 then Char input.[0] else String input)) + +let process_entry input = function + | Strings -> String input + | Floats -> ( + match float_of_string_opt input with + | None -> raise TypeMismatch + | Some v -> Float v) + | Ints -> ( + match int_of_string_opt input with + | None -> raise TypeMismatch + | Some v -> Int v) + | Chars -> + if String.length input = 1 then Char input.[0] else raise TypeMismatch + | Bools -> ( + match bool_of_string_opt input with + | None -> raise TypeMismatch + | Some v -> Bool v) + | Ids -> ( + match String.split_on_char '@' input with + | [] | [ _ ] | _ :: _ :: _ :: _ -> raise TypeMismatch + | [ hd; tl ] -> Id (hd, guess_entry tl)) + +let make_compare cmp lhs rhs = + match cmp with + | LT -> lhs < rhs + | LTE -> lhs <= rhs + | EQ -> lhs = rhs + | NEQ -> lhs <> rhs + | GT -> lhs > rhs + | GTE -> lhs >= rhs + +let run_constraint (cmp : comparison) rhs lhs = + match rhs with + | Float r -> ( + match lhs with + | Float l -> make_compare cmp l r + | _ -> failwith "Typing error") + | Int r -> ( + match lhs with + | Int l -> make_compare cmp l r + | _ -> failwith "Typing error") + | Char r -> ( + match lhs with + | Char l -> make_compare cmp l r + | _ -> failwith "Typing error") + | Bool r -> ( + match lhs with + | Bool l -> make_compare cmp l r + | _ -> failwith "Typing error") + | String r -> ( + match lhs with + | String l -> make_compare cmp l r + | _ -> failwith "Typing error") + | _ -> raise TypeMismatch let rec entry_to_string ent = - match ent with + match ent with | String x -> x | Float x -> string_of_float x | Int x -> string_of_int x | Char x -> String.make 1 x | Bool x -> string_of_bool x | Id (a, b) -> a ^ "@" ^ entry_to_string b - | Type (a, b) -> name_map_types b ^ " " ^ a + | Type (a, b) -> name_map_types b ^ " " ^ a let shorten inp = - let str = String.trim inp in - if String.length str < 8 then str ^ "\t\t" - else if String.length str < 16 then str ^ "\t" + let str = String.trim inp in + if String.length str < 8 then str ^ "\t\t" + else if String.length str < 16 then str ^ "\t" else String.sub str 0 16 let rec build_row entlist = - match entlist with - | [] -> "\n\n" - | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs + match entlist with + | [] -> "\n\n" + | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs | None :: xs -> "\t\t" ^ build_row xs let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl diff --git a/bisect001042343.coverage b/bisect001042343.coverage new file mode 100644 index 0000000..10b2528 --- /dev/null +++ b/bisect001042343.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 16 16 0 0 0 16 0 0 0 22 18 40 0 0 0 0 0 0 0 0 0 0 0 0 8 0 8 8 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 2 1 1 1 1 1 7 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 7 0 0 0 0 0 0 7 7 0 2 2 2 5 7 7 7 7 7 7 0 1 7 0 8 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 52 52 107 45 7 152 8 52 0 8 3 0 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 85 20 8 0 59 9 59 16 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 8 8 8 8 8 8 8 8 8 0 8 8 8 8 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 3 1 0 0 1 1 0 0 0 1 3 3 3 3 3 0 11 0 3 3 3 3 1 3 4 4 43 1 42 164 122 43 10 lib/cli.ml 163 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8163 8189 8213 8237 8263 8289 8049 8348 8022 7989 7969 7956 7906 9034 9096 8918 8895 8878 8844 8727 8698 8758 8788 8822 8866 8936 8976 8998 8568 8619 8538 8492 8470 8512 8415 9673 9722 9468 9501 9555 9596 9642 9699 9747 9789 9307 9355 9395 9275 10238 10257 10268 10204 10182 10005 163 21 21 21 21 1 21 22 22 1 695 198 0 893 893 198 20 8 2 8 1 7 1 1 7 8 7 10 9 8 8 0 8 37 5 1 42 43 1 8 2 44 100 54 54 54 16 0 16 0 0 0 16 32 16 16 16 16 11 11 11 11 1 77 16 76 1 0 16 1 77 174 94 94 94 0 17 1 1 17 37 19 0 0 0 0 0 0 0 0 0 0 0 12 12 6 12 0 18 6 61 6 6 67 67 6 6 6 2 0 1 3 0 0 2 8 0 8 3 11 11 11 3 2 6 0 6 12 38 6 6 6 6 6 6 1 1 1 6 7 50 7 7 7 0 0 0 1 19 16 0 0 7 0 54 94 43 191 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect070345425.coverage b/bisect070345425.coverage deleted file mode 100644 index 097a912..0000000 --- a/bisect070345425.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 15 15 0 0 0 15 0 0 0 20 17 37 0 0 0 0 0 0 0 0 0 0 0 0 7 0 7 7 12 lib/utils.ml 44 310 335 358 377 398 419 436 293 496 520 542 560 580 600 479 842 878 664 682 715 744 774 805 850 645 1043 1025 1009 994 974 959 944 913 1173 1156 1188 1228 1117 1134 1197 1094 1305 1263 1274 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 165 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 2318 2276 2287 2365 2355 2719 2737 2710 2658 2750 2572 2618 2473 2515 2448 2406 3005 2990 2917 2946 2882 2876 2850 2811 3188 3207 3104 3160 3081 3047 3378 3397 3329 3351 3306 3270 3527 3547 3493 3508 3470 3659 3681 3750 3599 3614 3786 3839 4075 3938 4006 3971 4016 3897 4283 4232 4247 4294 4364 4412 4472 4490 4610 4568 4579 4673 4647 5009 5055 5073 5096 4935 4927 4954 4984 4863 4883 4781 4815 4743 4759 4712 5513 5456 5447 5477 5499 5398 5390 5419 5324 5344 5242 5276 5216 5185 5144 5581 5571 5549 5723 5692 5709 5653 5669 5622 5843 5826 5859 5814 5880 5923 5915 5904 5776 6143 6006 6074 6039 6084 5965 165 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 45 45 92 39 6 131 7 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 14 7 0 45 7 45 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 7 7 7 7 7 7 7 7 7 0 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38 1 37 144 107 38 10 lib/cli.ml 164 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8169 8201 8231 8261 8293 8325 8049 8384 8022 7989 7969 7956 7906 8460 9134 9196 9018 8995 8978 8944 8827 8798 8858 8888 8922 8966 9036 9076 9098 8668 8719 8638 8592 8570 8612 8515 9773 9822 9568 9601 9655 9696 9742 9799 9847 9889 9407 9455 9495 9375 10338 10357 10368 10304 10282 10105 164 21 21 21 21 1 21 22 22 1 672 183 0 855 855 183 19 7 2 7 1 6 1 1 6 7 6 9 8 7 7 0 7 32 5 1 37 38 1 7 2 39 89 48 48 48 15 0 15 0 0 0 15 30 15 15 15 15 10 10 10 10 1 71 15 70 1 0 15 1 71 161 87 87 87 0 16 1 1 16 35 18 0 0 0 0 0 0 0 0 0 0 0 9 9 5 9 0 14 5 41 4 4 45 45 5 5 5 1 0 2 0 0 0 2 5 0 5 3 8 8 8 0 3 2 5 0 5 9 27 5 5 5 5 5 5 0 0 1 5 6 38 6 6 6 0 0 0 1 18 15 0 0 6 0 48 87 40 175 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect091422069.coverage b/bisect091422069.coverage new file mode 100644 index 0000000..10b2528 --- /dev/null +++ b/bisect091422069.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 16 16 0 0 0 16 0 0 0 22 18 40 0 0 0 0 0 0 0 0 0 0 0 0 8 0 8 8 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 2 1 1 1 1 1 7 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 7 0 0 0 0 0 0 7 7 0 2 2 2 5 7 7 7 7 7 7 0 1 7 0 8 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 52 52 107 45 7 152 8 52 0 8 3 0 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 85 20 8 0 59 9 59 16 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 8 8 8 8 8 8 8 8 8 0 8 8 8 8 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 3 1 0 0 1 1 0 0 0 1 3 3 3 3 3 0 11 0 3 3 3 3 1 3 4 4 43 1 42 164 122 43 10 lib/cli.ml 163 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8163 8189 8213 8237 8263 8289 8049 8348 8022 7989 7969 7956 7906 9034 9096 8918 8895 8878 8844 8727 8698 8758 8788 8822 8866 8936 8976 8998 8568 8619 8538 8492 8470 8512 8415 9673 9722 9468 9501 9555 9596 9642 9699 9747 9789 9307 9355 9395 9275 10238 10257 10268 10204 10182 10005 163 21 21 21 21 1 21 22 22 1 695 198 0 893 893 198 20 8 2 8 1 7 1 1 7 8 7 10 9 8 8 0 8 37 5 1 42 43 1 8 2 44 100 54 54 54 16 0 16 0 0 0 16 32 16 16 16 16 11 11 11 11 1 77 16 76 1 0 16 1 77 174 94 94 94 0 17 1 1 17 37 19 0 0 0 0 0 0 0 0 0 0 0 12 12 6 12 0 18 6 61 6 6 67 67 6 6 6 2 0 1 3 0 0 2 8 0 8 3 11 11 11 3 2 6 0 6 12 38 6 6 6 6 6 6 1 1 1 6 7 50 7 7 7 0 0 0 1 19 16 0 0 7 0 54 94 43 191 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect115162322.coverage b/bisect115162322.coverage deleted file mode 100644 index 097a912..0000000 --- a/bisect115162322.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 15 15 0 0 0 15 0 0 0 20 17 37 0 0 0 0 0 0 0 0 0 0 0 0 7 0 7 7 12 lib/utils.ml 44 310 335 358 377 398 419 436 293 496 520 542 560 580 600 479 842 878 664 682 715 744 774 805 850 645 1043 1025 1009 994 974 959 944 913 1173 1156 1188 1228 1117 1134 1197 1094 1305 1263 1274 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 165 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 2318 2276 2287 2365 2355 2719 2737 2710 2658 2750 2572 2618 2473 2515 2448 2406 3005 2990 2917 2946 2882 2876 2850 2811 3188 3207 3104 3160 3081 3047 3378 3397 3329 3351 3306 3270 3527 3547 3493 3508 3470 3659 3681 3750 3599 3614 3786 3839 4075 3938 4006 3971 4016 3897 4283 4232 4247 4294 4364 4412 4472 4490 4610 4568 4579 4673 4647 5009 5055 5073 5096 4935 4927 4954 4984 4863 4883 4781 4815 4743 4759 4712 5513 5456 5447 5477 5499 5398 5390 5419 5324 5344 5242 5276 5216 5185 5144 5581 5571 5549 5723 5692 5709 5653 5669 5622 5843 5826 5859 5814 5880 5923 5915 5904 5776 6143 6006 6074 6039 6084 5965 165 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 45 45 92 39 6 131 7 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 14 7 0 45 7 45 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 7 7 7 7 7 7 7 7 7 0 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38 1 37 144 107 38 10 lib/cli.ml 164 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8169 8201 8231 8261 8293 8325 8049 8384 8022 7989 7969 7956 7906 8460 9134 9196 9018 8995 8978 8944 8827 8798 8858 8888 8922 8966 9036 9076 9098 8668 8719 8638 8592 8570 8612 8515 9773 9822 9568 9601 9655 9696 9742 9799 9847 9889 9407 9455 9495 9375 10338 10357 10368 10304 10282 10105 164 21 21 21 21 1 21 22 22 1 672 183 0 855 855 183 19 7 2 7 1 6 1 1 6 7 6 9 8 7 7 0 7 32 5 1 37 38 1 7 2 39 89 48 48 48 15 0 15 0 0 0 15 30 15 15 15 15 10 10 10 10 1 71 15 70 1 0 15 1 71 161 87 87 87 0 16 1 1 16 35 18 0 0 0 0 0 0 0 0 0 0 0 9 9 5 9 0 14 5 41 4 4 45 45 5 5 5 1 0 2 0 0 0 2 5 0 5 3 8 8 8 0 3 2 5 0 5 9 27 5 5 5 5 5 5 0 0 1 5 6 38 6 6 6 0 0 0 1 18 15 0 0 6 0 48 87 40 175 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect158168986.coverage b/bisect158168986.coverage deleted file mode 100644 index 097a912..0000000 --- a/bisect158168986.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 15 15 0 0 0 15 0 0 0 20 17 37 0 0 0 0 0 0 0 0 0 0 0 0 7 0 7 7 12 lib/utils.ml 44 310 335 358 377 398 419 436 293 496 520 542 560 580 600 479 842 878 664 682 715 744 774 805 850 645 1043 1025 1009 994 974 959 944 913 1173 1156 1188 1228 1117 1134 1197 1094 1305 1263 1274 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 165 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 2318 2276 2287 2365 2355 2719 2737 2710 2658 2750 2572 2618 2473 2515 2448 2406 3005 2990 2917 2946 2882 2876 2850 2811 3188 3207 3104 3160 3081 3047 3378 3397 3329 3351 3306 3270 3527 3547 3493 3508 3470 3659 3681 3750 3599 3614 3786 3839 4075 3938 4006 3971 4016 3897 4283 4232 4247 4294 4364 4412 4472 4490 4610 4568 4579 4673 4647 5009 5055 5073 5096 4935 4927 4954 4984 4863 4883 4781 4815 4743 4759 4712 5513 5456 5447 5477 5499 5398 5390 5419 5324 5344 5242 5276 5216 5185 5144 5581 5571 5549 5723 5692 5709 5653 5669 5622 5843 5826 5859 5814 5880 5923 5915 5904 5776 6143 6006 6074 6039 6084 5965 165 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 45 45 92 39 6 131 7 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 14 7 0 45 7 45 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 7 7 7 7 7 7 7 7 7 0 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38 1 37 144 107 38 10 lib/cli.ml 164 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8169 8201 8231 8261 8293 8325 8049 8384 8022 7989 7969 7956 7906 8460 9134 9196 9018 8995 8978 8944 8827 8798 8858 8888 8922 8966 9036 9076 9098 8668 8719 8638 8592 8570 8612 8515 9773 9822 9568 9601 9655 9696 9742 9799 9847 9889 9407 9455 9495 9375 10338 10357 10368 10304 10282 10105 164 21 21 21 21 1 21 22 22 1 672 183 0 855 855 183 19 7 2 7 1 6 1 1 6 7 6 9 8 7 7 0 7 32 5 1 37 38 1 7 2 39 89 48 48 48 15 0 15 0 0 0 15 30 15 15 15 15 10 10 10 10 1 71 15 70 1 0 15 1 71 161 87 87 87 0 16 1 1 16 35 18 0 0 0 0 0 0 0 0 0 0 0 9 9 5 9 0 14 5 41 4 4 45 45 5 5 5 1 0 2 0 0 0 2 5 0 5 3 8 8 8 0 3 2 5 0 5 9 27 5 5 5 5 5 5 0 0 1 5 6 38 6 6 6 0 0 0 1 18 15 0 0 6 0 48 87 40 175 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect220228091.coverage b/bisect220228091.coverage deleted file mode 100644 index 097a912..0000000 --- a/bisect220228091.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 15 15 0 0 0 15 0 0 0 20 17 37 0 0 0 0 0 0 0 0 0 0 0 0 7 0 7 7 12 lib/utils.ml 44 310 335 358 377 398 419 436 293 496 520 542 560 580 600 479 842 878 664 682 715 744 774 805 850 645 1043 1025 1009 994 974 959 944 913 1173 1156 1188 1228 1117 1134 1197 1094 1305 1263 1274 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 165 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 2318 2276 2287 2365 2355 2719 2737 2710 2658 2750 2572 2618 2473 2515 2448 2406 3005 2990 2917 2946 2882 2876 2850 2811 3188 3207 3104 3160 3081 3047 3378 3397 3329 3351 3306 3270 3527 3547 3493 3508 3470 3659 3681 3750 3599 3614 3786 3839 4075 3938 4006 3971 4016 3897 4283 4232 4247 4294 4364 4412 4472 4490 4610 4568 4579 4673 4647 5009 5055 5073 5096 4935 4927 4954 4984 4863 4883 4781 4815 4743 4759 4712 5513 5456 5447 5477 5499 5398 5390 5419 5324 5344 5242 5276 5216 5185 5144 5581 5571 5549 5723 5692 5709 5653 5669 5622 5843 5826 5859 5814 5880 5923 5915 5904 5776 6143 6006 6074 6039 6084 5965 165 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 45 45 92 39 6 131 7 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 14 7 0 45 7 45 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 7 7 7 7 7 7 7 7 7 0 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38 1 37 144 107 38 10 lib/cli.ml 164 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8169 8201 8231 8261 8293 8325 8049 8384 8022 7989 7969 7956 7906 8460 9134 9196 9018 8995 8978 8944 8827 8798 8858 8888 8922 8966 9036 9076 9098 8668 8719 8638 8592 8570 8612 8515 9773 9822 9568 9601 9655 9696 9742 9799 9847 9889 9407 9455 9495 9375 10338 10357 10368 10304 10282 10105 164 21 21 21 21 1 21 22 22 1 672 183 0 855 855 183 19 7 2 7 1 6 1 1 6 7 6 9 8 7 7 0 7 32 5 1 37 38 1 7 2 39 89 48 48 48 15 0 15 0 0 0 15 30 15 15 15 15 10 10 10 10 1 71 15 70 1 0 15 1 71 161 87 87 87 0 16 1 1 16 35 18 0 0 0 0 0 0 0 0 0 0 0 9 9 5 9 0 14 5 41 4 4 45 45 5 5 5 1 0 2 0 0 0 2 5 0 5 3 8 8 8 0 3 2 5 0 5 9 27 5 5 5 5 5 5 0 0 1 5 6 38 6 6 6 0 0 0 1 18 15 0 0 6 0 48 87 40 175 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect374128807.coverage b/bisect374128807.coverage deleted file mode 100644 index 097a912..0000000 --- a/bisect374128807.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 15 15 0 0 0 15 0 0 0 20 17 37 0 0 0 0 0 0 0 0 0 0 0 0 7 0 7 7 12 lib/utils.ml 44 310 335 358 377 398 419 436 293 496 520 542 560 580 600 479 842 878 664 682 715 744 774 805 850 645 1043 1025 1009 994 974 959 944 913 1173 1156 1188 1228 1117 1134 1197 1094 1305 1263 1274 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 165 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 2318 2276 2287 2365 2355 2719 2737 2710 2658 2750 2572 2618 2473 2515 2448 2406 3005 2990 2917 2946 2882 2876 2850 2811 3188 3207 3104 3160 3081 3047 3378 3397 3329 3351 3306 3270 3527 3547 3493 3508 3470 3659 3681 3750 3599 3614 3786 3839 4075 3938 4006 3971 4016 3897 4283 4232 4247 4294 4364 4412 4472 4490 4610 4568 4579 4673 4647 5009 5055 5073 5096 4935 4927 4954 4984 4863 4883 4781 4815 4743 4759 4712 5513 5456 5447 5477 5499 5398 5390 5419 5324 5344 5242 5276 5216 5185 5144 5581 5571 5549 5723 5692 5709 5653 5669 5622 5843 5826 5859 5814 5880 5923 5915 5904 5776 6143 6006 6074 6039 6084 5965 165 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 45 45 92 39 6 131 7 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 14 7 0 45 7 45 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 7 7 7 7 7 7 7 7 7 0 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38 1 37 144 107 38 10 lib/cli.ml 164 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8169 8201 8231 8261 8293 8325 8049 8384 8022 7989 7969 7956 7906 8460 9134 9196 9018 8995 8978 8944 8827 8798 8858 8888 8922 8966 9036 9076 9098 8668 8719 8638 8592 8570 8612 8515 9773 9822 9568 9601 9655 9696 9742 9799 9847 9889 9407 9455 9495 9375 10338 10357 10368 10304 10282 10105 164 21 21 21 21 1 21 22 22 1 672 183 0 855 855 183 19 7 2 7 1 6 1 1 6 7 6 9 8 7 7 0 7 32 5 1 37 38 1 7 2 39 89 48 48 48 15 0 15 0 0 0 15 30 15 15 15 15 10 10 10 10 1 71 15 70 1 0 15 1 71 161 87 87 87 0 16 1 1 16 35 18 0 0 0 0 0 0 0 0 0 0 0 9 9 5 9 0 14 5 41 4 4 45 45 5 5 5 1 0 2 0 0 0 2 5 0 5 3 8 8 8 0 3 2 5 0 5 9 27 5 5 5 5 5 5 0 0 1 5 6 38 6 6 6 0 0 0 1 18 15 0 0 6 0 48 87 40 175 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect401024424.coverage b/bisect401024424.coverage new file mode 100644 index 0000000..10b2528 --- /dev/null +++ b/bisect401024424.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 16 16 0 0 0 16 0 0 0 22 18 40 0 0 0 0 0 0 0 0 0 0 0 0 8 0 8 8 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 2 1 1 1 1 1 7 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 7 0 0 0 0 0 0 7 7 0 2 2 2 5 7 7 7 7 7 7 0 1 7 0 8 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 52 52 107 45 7 152 8 52 0 8 3 0 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 85 20 8 0 59 9 59 16 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 8 8 8 8 8 8 8 8 8 0 8 8 8 8 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 3 1 0 0 1 1 0 0 0 1 3 3 3 3 3 0 11 0 3 3 3 3 1 3 4 4 43 1 42 164 122 43 10 lib/cli.ml 163 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8163 8189 8213 8237 8263 8289 8049 8348 8022 7989 7969 7956 7906 9034 9096 8918 8895 8878 8844 8727 8698 8758 8788 8822 8866 8936 8976 8998 8568 8619 8538 8492 8470 8512 8415 9673 9722 9468 9501 9555 9596 9642 9699 9747 9789 9307 9355 9395 9275 10238 10257 10268 10204 10182 10005 163 21 21 21 21 1 21 22 22 1 695 198 0 893 893 198 20 8 2 8 1 7 1 1 7 8 7 10 9 8 8 0 8 37 5 1 42 43 1 8 2 44 100 54 54 54 16 0 16 0 0 0 16 32 16 16 16 16 11 11 11 11 1 77 16 76 1 0 16 1 77 174 94 94 94 0 17 1 1 17 37 19 0 0 0 0 0 0 0 0 0 0 0 12 12 6 12 0 18 6 61 6 6 67 67 6 6 6 2 0 1 3 0 0 2 8 0 8 3 11 11 11 3 2 6 0 6 12 38 6 6 6 6 6 6 1 1 1 6 7 50 7 7 7 0 0 0 1 19 16 0 0 7 0 54 94 43 191 0 0 0 0 0 0 \ No newline at end of file diff --git a/lib/cli.ml b/lib/cli.ml index 32e646f..d4dc340 100644 --- a/lib/cli.ml +++ b/lib/cli.ml @@ -90,7 +90,11 @@ module CLI = struct | Some b -> Bool b | None -> raise ParseError) | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) - | Ids -> raise ParseError + | Ids -> + Id + (match String.split_on_char '@' (String.trim v) with + | [] | [ _ ] | _ :: _ :: _ :: _ -> raise ParseError + | [ hd; tl ] -> (hd, String tl)) let rec build_instance (name, table, vals) input = match From 93807a541bb2f87a7cb94f7df9e719bf8cb79828 Mon Sep 17 00:00:00 2001 From: Thomas McFarland Date: Sat, 13 May 2023 22:26:02 -0400 Subject: [PATCH 14/24] Fix at --- lib/cli.ml | 30 +++++++++++++++++++++++++++++- lib/database.ml | 13 ++++++++++++- lib/database.mli | 2 +- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/lib/cli.ml b/lib/cli.ml index d4dc340..1c3b3b2 100644 --- a/lib/cli.ml +++ b/lib/cli.ml @@ -213,7 +213,7 @@ module CLI = struct | [ name ] -> get_response "err_at_no_id" (* "Please enter an id of the instance you which to get\n|> " *) - | name :: id :: tl -> ( + | [ name; id ] -> ( match DB.get_table name !db with | Some x -> (x |> Tbl.header |> optionize |> build_row) @@ -221,6 +221,34 @@ module CLI = struct ^ (String id |> Tbl.at x |> build_row) | None -> get_response "err_at_invalid_type" (* "No type of that name" *)) + | name :: id :: col :: tl -> ( + match DB.get_table name !db with + | Some x -> ( + let row = Tbl.at x (String id) in + match int_of_string_opt col with + | None -> "Column number should be an int" + | Some i -> ( + match List.nth_opt row i with + | Some e -> ( + match e with + | None -> "No entry" + | Some e -> ( + match e with + | Id (name, row) -> ( + entry_to_string e ^ "=" + ^ + match DB.get_reference e !db with + | exception Not_found -> "" + | l, r -> ( + "\n" + ^ build_row (optionize l) + ^ + match r with + | None -> "" + | Some v -> build_row v)) + | _ -> entry_to_string e)) + | None -> "Column out of range. Hint: Index starts at 0")) + | None -> "No type named " ^ name) let split_on_substring sub str = let idxs = ref [ 0 ] in diff --git a/lib/database.ml b/lib/database.ml index bcdadab..54dfe85 100644 --- a/lib/database.ml +++ b/lib/database.ml @@ -32,7 +32,18 @@ module Database (Table : Table) = struct match List.assoc_opt name database with Some x -> Some !x | None -> None (*Currently doesn't work...*) - let get_reference ent database = raise (Failure "Unimplemented") + let get_reference ent database = + match ent with + | Id (tbl, id) -> ( + let tbl = + match get_table tbl database with + | None -> raise Not_found + | Some v -> v + in + ( Table.header tbl, + match Table.at tbl id with exception Not_found -> None | v -> Some v + )) + | _ -> raise TypeMismatch let rec db_to_string database = match database with diff --git a/lib/database.mli b/lib/database.mli index 8af8182..f748916 100644 --- a/lib/database.mli +++ b/lib/database.mli @@ -15,7 +15,7 @@ module Database (Table : Table) : sig val build_table : database -> entry list -> string -> database val drop_table : string -> database -> database val get_table : string -> database -> table option - val get_reference : entry -> database -> string * table + val get_reference : entry -> database -> (entry list * entry option list option) val db_to_string : database -> string (* Adds an entry to the table given by id. Raises [Not_found] if the table cannot be found*) From 607a9eeb8fdb492f97ef5e10e47ace703a51ba81 Mon Sep 17 00:00:00 2001 From: JT Klenke Date: Sun, 14 May 2023 13:56:46 -0400 Subject: [PATCH 15/24] CLI tests supports table prints --- Makefile | 4 - _coverage/index.html | 20 +- _coverage/lib/cli.ml.html | 680 +++++++++++++++++---------------- _coverage/lib/database.ml.html | 111 ++++-- _coverage/lib/tables.ml.html | 166 ++++---- _coverage/lib/utils.ml.html | 129 ++++--- bisect001042343.coverage | 1 - bisect023227872.coverage | 1 + bisect059640741.coverage | 1 + bisect091422069.coverage | 1 - bisect214014825.coverage | 1 + bisect401024424.coverage | 1 - bisect516102304.coverage | 1 + bisect775870130.coverage | 1 + data/responses.json | 10 +- lib/cli.ml | 113 ++---- lib/cli.mli | 2 + lib/database.mli | 6 +- lib/tables.mli | 6 +- test/main.ml | 101 ++++- 20 files changed, 739 insertions(+), 617 deletions(-) delete mode 100644 bisect001042343.coverage create mode 100644 bisect023227872.coverage create mode 100644 bisect059640741.coverage delete mode 100644 bisect091422069.coverage create mode 100644 bisect214014825.coverage delete mode 100644 bisect401024424.coverage create mode 100644 bisect516102304.coverage create mode 100644 bisect775870130.coverage diff --git a/Makefile b/Makefile index 798100d..4ba1f97 100644 --- a/Makefile +++ b/Makefile @@ -19,10 +19,6 @@ bisect: bisect-clean bisect-clean: rm -rf _coverage bisect*.coverage -clean: bisect-clean - dune clean - rm -f search.zip - doc: dune build @doc diff --git a/_coverage/index.html b/_coverage/index.html index b5abc78..cc2c582 100644 --- a/_coverage/index.html +++ b/_coverage/index.html @@ -3,47 +3,47 @@ Coverage report - +
- + - 77% (126 / 163) + 67% (122 / 181) lib/cli.ml
- + - 27% (9 / 33) + 22% (9 / 40) lib/database.ml
- + - 30% (64 / 210) + 17% (37 / 210) lib/tables.ml
- + - 33% (33 / 98) + 0% (0 / 98) lib/utils.ml diff --git a/_coverage/lib/cli.ml.html b/_coverage/lib/cli.ml.html index b34b720..053bbc2 100644 --- a/_coverage/lib/cli.ml.html +++ b/_coverage/lib/cli.ml.html @@ -3,7 +3,7 @@ cli.ml — Coverage report - + @@ -15,36 +15,49 @@

lib/cli.ml

-

77.30%

+

67.40%

@@ -80,77 +93,77 @@

77.30%

- - + + - + - - + + - - - + + + - - - + + + - - - - + + + + - - - + + + - + - - - - - - - + + + + + + + - - - - + + + + - - - - - - - - + + + + + + + + - + - - - - + + + + @@ -158,204 +171,201 @@

77.30%

- + - - - + + + - + - + - - - - + + + + - + - + - + - - + + - + - + - - + + - - + + - - - + + + - + - - + + - + - - + + - - + + - - - - + + + + - - + + - + - + - + - - + + - + - - + + - + - - - + + + - - + + - + - - + + - - + + - - - - + + + + - + - + - + - - - + + + - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - - - - + + + + - - - + + + - - + + - + - + - - - - - + + + + + - + - - - + + + - - - - - - - + + + +
@@ -662,9 +672,6 @@

77.30%

300 301 302 -303 -304 -305
module type CliHandler = sig
   val parse_input : string -> string
@@ -692,181 +699,144 @@ 

77.30%

exception InvalidComparison let current_state = ref Default - - let response_names = - [ - "err_create_field_DNE"; - "err_create_field_wrong_type"; - "err_create_field_no_value"; - "err_create_field_already_entered"; - "err_assign_empty"; - "err_assign_no_id"; - "err_assign_DNE"; - "err_defn_needs_type_name"; - "err_defn_needs_ID_name"; - "err_defn_already_exists"; - "err_defn_no_name"; - "err_defn_invalid_type"; - "err_unknown_command"; - "err_find_invalid_expr"; - "err_find_invalid_comparison"; - "err_find_invalid_type"; - "err_at_no_id"; - "help_message"; - "indent_end"; - "indent"; - "default"; - ] - - let get_json_item file entry = - file |> to_assoc |> List.assoc entry |> to_string - let file_name = "data/responses.json" - let rec build_response_assoc_list res_names res_assoc = - let file = Yojson.Basic.from_file file_name in - match res_names with - | [] -> res_assoc - | h :: t -> - (h, get_json_item file h) :: res_assoc |> build_response_assoc_list t - - let responses = build_response_assoc_list response_names [] - - let rec find_response key lst = - match lst with - | [] -> failwith "response not found" - | (k, v) :: t -> if k = key then v else find_response key t - - let get_response response = find_response response responses + let get_response response = + let file = Yojson.Basic.from_file file_name in + file |> to_assoc |> List.assoc response |> to_string let reset () = - current_state := Default; + current_state := Default; db := DB.empty let parse_value v = function - | Strings -> String v - | Ints -> ( + | Strings -> String v + | Ints -> ( match int_of_string_opt v with - | Some i -> Int i - | None -> raise ParseError) - | Floats -> ( + | Some i -> Int i + | None -> raise ParseError) + | Floats -> ( match float_of_string_opt v with - | Some f -> Float f - | None -> raise ParseError) - | Bools -> ( + | Some f -> Float f + | None -> raise ParseError) + | Bools -> ( match bool_of_string_opt v with - | Some b -> Bool b - | None -> raise ParseError) - | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) - | Ids -> raise ParseError + | Some b -> Bool b + | None -> raise ParseError) + | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) + | Ids -> + Id + (match String.split_on_char '@' (String.trim v) with + | [] | [ _ ] | _ :: _ :: _ :: _ -> raise ParseError + | [ hd; tl ] -> (hd, String tl)) let rec build_instance (name, table, vals) input = - match - input |> String.split_on_char '=' |> List.map String.trim - |> List.filter (fun s -> s <> "") + match + input |> String.split_on_char '=' |> List.map String.trim + |> List.filter (fun s -> s <> "") with - | [] -> + | [] -> DB.add_named_entry name vals !db; - current_state := Default; + current_state := Default; get_response "indent_end" (* "| <|\n|> " *) - | [ n ] -> + | [ n ] -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_no_value" (* "Please input a variable and a value\n| " *) - | n :: v :: tl -> ( + | n :: v :: tl -> ( match List.assoc_opt n vals with - | None -> ( + | None -> ( match Tbl.exists table n with - | exception TypeMismatch -> + | exception TypeMismatch -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_DNE" (* "That field does not exist in this type\n| " *) - | t -> ( + | t -> ( match parse_value v t with - | x -> + | x -> current_state := BuildInstance (name, table, (n, x) :: vals); get_response "indent" (* "| " *) - | exception ParseError -> + | exception ParseError -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_wrong_type" (* "That value does not match the type of the field\n| " *) )) - | Some _ -> + | Some _ -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_already_entered" (* "This field has already been entered\n| " *)) let process_assign input = - match input |> List.map String.trim |> List.filter (fun s -> s <> "") with - | [] -> + match input |> List.map String.trim |> List.filter (fun s -> s <> "") with + | [] -> get_response "err_assign_empty" (* "Please input a type name and id\n|> " *) - | [ name ] -> + | [ name ] -> get_response "err_assign_no_id" (* "Please input an id for this instance\n|> " *) - | name :: id :: tl -> ( + | name :: id :: tl -> ( match DB.get_table name !db with - | Some t -> + | Some t -> current_state := BuildInstance ( name, t, [ ( (match Tbl.header t with - | Type (n, _) :: tl -> n - | _ -> raise ParseError), + | Type (n, _) :: tl -> n + | _ -> failwith "impossible" [@coverage off]), String id ); ] ); "| " - | None -> get_response "err_assign_DNE") + | None -> get_response "err_assign_DNE") (* "That type does not exist\n|> " *) let parse_type (typ, name) = - match typ with - | "int" -> Type (name, Ints) - | "float" -> Type (name, Floats) - | "string" -> Type (name, Strings) - | "bool" -> Type (name, Bools) - | "char" -> Type (name, Chars) - | "id" -> Type (name, Ids) - | _ -> raise ParseError + match typ with + | "int" -> Type (name, Ints) + | "float" -> Type (name, Floats) + | "string" -> Type (name, Strings) + | "bool" -> Type (name, Bools) + | "char" -> Type (name, Chars) + | "id" -> Type (name, Ids) + | _ -> raise ParseError let rec build_type (name, id, types) input = - match + match String.split_on_char ' ' input - |> List.map String.trim - |> List.filter (fun s -> s <> "") + |> List.map String.trim + |> List.filter (fun s -> s <> "") with - | [] -> - db := DB.build_table !db (Type (id, Strings) :: types) name; + | [] -> + db := DB.build_table !db (Type (id, Strings) :: types) name; current_state := Default; get_response "indent_end" (* "| <|\n|> " *) - | [ typ ] -> get_response "err_defn_no_name" + | [ typ ] -> get_response "err_defn_no_name" (* "Please enter a name for this field\n| " *) - | typ :: field_name :: tl -> ( + | typ :: field_name :: tl -> ( match parse_type (typ, field_name) with - | Type _ as t -> + | Type _ as t -> current_state := BuildType (name, id, types @ [ t ]); get_response "indent" (* "| " *) - | exception ParseError -> + | exception ParseError -> current_state := BuildType (name, id, types); get_response "err_defn_invalid_type" (* "Not a recognized type\n| " *) - | _ -> raise (Failure "Should be impossible")) + | _ -> raise (Failure "Should be impossible") [@coverage off]) let process_type input = - match List.filter (fun s -> s <> "") input with - | [] -> get_response "err_defn_needs_type_name" + match List.filter (fun s -> s <> "") input with + | [] -> get_response "err_defn_needs_type_name" (* "Please enter a type name for the definition\n|> " *) - | [ name ] -> + | [ name ] -> get_response "err_defn_needs_ID_name" (* "Please enter a name for the ID of this type\n|> " *) - | name :: id :: tl -> ( + | name :: id :: tl -> ( match DB.get_table name !db with - | Some _ -> + | Some _ -> get_response "err_defn_already_exists" (* "\n Type already defined\n|> " *) - | None -> + | None -> current_state := BuildType (name, id, []); get_response "indent" (* "| " *)) @@ -877,7 +847,7 @@

77.30%

| [ name ] -> get_response "err_at_no_id" (* "Please enter an id of the instance you which to get\n|> " *) - | name :: id :: tl -> ( + | [ name; id ] -> ( match DB.get_table name !db with | Some x -> (x |> Tbl.header |> optionize |> build_row) @@ -885,76 +855,108 @@

77.30%

^ (String id |> Tbl.at x |> build_row) | None -> get_response "err_at_invalid_type" (* "No type of that name" *)) + | name :: id :: col :: tl -> ( + match DB.get_table name !db with + | Some x -> ( + let row = Tbl.at x (String id) in + match int_of_string_opt col with + | None -> + get_response "err_at_column_not_int" + (* "Column number should be an int" *) + | Some i -> ( + match List.nth_opt row i with + | Some e -> ( + match e with + | None -> get_response "no_entry" + | Some e -> ( + match e with + | Id (name, row) -> ( + entry_to_string e ^ "=" + ^ + match DB.get_reference e !db with + | exception Not_found -> get_response "unbound_type" + | l, r -> ( + "\n" + ^ build_row (optionize l) + ^ + match r with + | None -> get_response "unbound_val" + | Some v -> build_row v)) + | _ -> entry_to_string e)) + | None -> get_response "err_at_column_out_of_range")) + | None -> get_response "err_at_type_DNE") let split_on_substring sub str = - let idxs = ref [ 0 ] in + let idxs = ref [ 0 ] in let sub_len = String.length sub in - for i = 0 to String.length str - sub_len do - if String.sub str i sub_len = sub then - idxs := !idxs @ [ i; i + String.length sub ] - else () + for i = 0 to String.length str - sub_len do + if String.sub str i sub_len = sub then + idxs := !idxs @ [ i; i + String.length sub ] + else () done; - idxs := !idxs @ [ String.length str ]; + idxs := !idxs @ [ String.length str ]; let rec create_lst idxs sub_len str = - match idxs with - | [] -> [] - | s :: e :: t -> String.sub str s (e - s) :: create_lst t sub_len str - | _ -> failwith "odd" + match idxs with + | [] -> [] + | s :: e :: t -> String.sub str s (e - s) :: create_lst t sub_len str + | _ -> failwith "odd" [@coverage off] in create_lst !idxs sub_len str let parse_compare_exp str = - let str_lst = String.split_on_char ' ' str in - if List.length str_lst <> 3 then raise InvalidExpr + let str_lst = String.split_on_char ' ' str in + if List.length str_lst <> 3 then raise InvalidExpr else - match str_lst with - | [ var; compare; value ] -> + match str_lst with + | [ var; compare; value ] -> ( var, (match compare with - | "=" -> EQ + | "=" -> EQ | "<>" -> NEQ - | ">" -> GT - | "<" -> LT + | ">" -> GT + | "<" -> LT | "<=" -> LTE | ">=" -> GTE - | _ -> raise InvalidComparison), + | _ -> raise InvalidComparison), value ) - | _ -> failwith "should be impossible" + | _ -> failwith "should be impossible" [@coverage off] let process_find lst = - let cleaned_lst = - lst |> List.map String.trim |> List.filter (fun s -> s <> "") + let cleaned_lst = + lst |> List.map String.trim |> List.filter (fun s -> s <> "") in - match DB.get_table (List.hd cleaned_lst) !db with - | None -> get_response "err_find_invalid_type" - | Some type_table -> ( - try - cleaned_lst |> List.tl - |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" - |> split_on_substring " and " |> List.map String.trim - |> List.filter (fun s -> s <> "") - |> (fun lst -> if lst = [] then raise InvalidExpr else lst) - |> List.map parse_compare_exp - |> Tbl.process_constraints type_table - with - | InvalidExpr -> get_response "err_find_invalid_expr" - | InvalidComparison -> get_response "err_find_invalid_comparison") + if cleaned_lst = [] then get_response "err_find_missing_type" + else + match DB.get_table (List.hd cleaned_lst) !db with + | None -> get_response "err_find_invalid_type" + | Some type_table -> ( + try + cleaned_lst |> List.tl + |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" + |> split_on_substring "and" |> List.map String.trim + |> List.filter (fun s -> s <> "") + |> (fun lst -> if lst = [] then raise InvalidExpr else lst) + |> List.map parse_compare_exp + |> Tbl.process_constraints type_table + with + | InvalidExpr -> get_response "err_find_invalid_expr" + | InvalidComparison -> get_response "err_find_invalid_comparison") (** [parse_input input] takes in new input and determines the relevant command*) let parse_input input = - match !current_state with - | BuildInstance v -> build_instance v input - | BuildType v -> build_type v input - | Default -> ( + match !current_state with + | BuildInstance v -> build_instance v input + | BuildType v -> build_type v input + | Default -> ( match String.split_on_char ' ' input with | "quit" :: tl -> exit 0 - | "help" :: tl -> get_response "help_message" - | "def" :: tl -> process_type tl - | "assign" :: tl -> process_assign tl + | "help" :: tl -> get_response "help_message" + | "def" :: tl -> process_type tl + | "assign" :: tl -> process_assign tl | "print" :: tl -> DB.db_to_string !db ^ "\n|> " | "at" :: tl -> process_at tl ^ "\n|> " - | "find" :: tl -> process_find tl - | _ -> + | "find" :: tl -> process_find tl + | _ -> get_response "err_unknown_command" (* "Unknown command. Type help for a list of commands\n|> " *)) end @@ -962,11 +964,13 @@

77.30%

(** [main ()] prompts for the script to start, then starts it. *) let main () = - print_string - "\n\n\ - Welcome to the 3110 Database Command Line\n\ - Please describe the data you want to store.\n\ - Type 'quit' to quit, 'help' for help.\n\n"; + let file_name = "data/responses.json" in + let welcom_string = + let file = Yojson.Basic.from_file file_name in + file |> Yojson.Basic.Util.to_assoc |> List.assoc "welcome" + |> Yojson.Basic.Util.to_string + in + print_string welcom_string; print_string "|> "; while true do read_line () |> CLI.parse_input |> print_string diff --git a/_coverage/lib/database.ml.html b/_coverage/lib/database.ml.html index c59ca70..b5169fe 100644 --- a/_coverage/lib/database.ml.html +++ b/_coverage/lib/database.ml.html @@ -3,7 +3,7 @@ database.ml — Coverage report - + @@ -15,26 +15,32 @@

lib/database.ml

-

27.27%

+

22.50%

@@ -73,25 +79,36 @@

27.27%

- - - - - + + + + + - + - + - + - - + + - + + + + + + + + + + + +
@@ -149,6 +166,17 @@

27.27%

51 52 53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64
open Utils
 open Tables
@@ -171,20 +199,31 @@ 

27.27%

| _ -> raise TableExists let build_table database table name = - match + match List.find (fun a -> match a with tname, t -> name = tname) database with - | exception Not_found -> (name, ref (Table.empty table)) :: database + | exception Not_found -> (name, ref (Table.empty table)) :: database | _ -> raise TableExists let drop_table name database = List.filter (fun a -> match a with tname, t -> name <> tname) database let get_table name database = - match List.assoc_opt name database with Some x -> Some !x | None -> None + match List.assoc_opt name database with Some x -> Some !x | None -> None (*Currently doesn't work...*) - let get_reference ent database = raise (Failure "Unimplemented") + let get_reference ent database = + match ent with + | Id (tbl, id) -> ( + let tbl = + match get_table tbl database with + | None -> raise Not_found + | Some v -> v + in + ( Table.header tbl, + match Table.at tbl id with exception Not_found -> None | v -> Some v + )) + | _ -> raise TypeMismatch let rec db_to_string database = match database with @@ -199,9 +238,9 @@

27.27%

| _ :: tl -> add_entry table_name new_row tl let add_named_entry table_name new_row database = - match List.assoc_opt table_name database with + match List.assoc_opt table_name database with | None -> raise Not_found - | Some x -> x := Table.insert_named !x new_row + | Some x -> x := Table.insert_named !x new_row end
diff --git a/_coverage/lib/tables.ml.html b/_coverage/lib/tables.ml.html index fc6a0a3..23cc68b 100644 --- a/_coverage/lib/tables.ml.html +++ b/_coverage/lib/tables.ml.html @@ -3,7 +3,7 @@ tables.ml — Coverage report - + @@ -15,7 +15,7 @@

lib/tables.ml

-

30.48%

+

17.62%

@@ -195,8 +215,8 @@

30.48%

- - + + @@ -351,42 +371,42 @@

30.48%

- + - - + + - - - - + + + + - - - + + + - - + + - - + + - + - + - - - - + + + + @@ -714,24 +734,24 @@

30.48%

:: assert_types tl c) let rec reorder_list (a : (string * entry) list) = function - | [] -> if a = [] then [] else raise TypeMismatch - | Some (Type (name, v)) :: tl -> + | [] -> if a = [] then [] else raise TypeMismatch + | Some (Type (name, v)) :: tl -> let vl, rest = let rec extr_name acc = function - | [] -> (None, acc) - | (n, vr) :: rest -> - if n = name then (Some vr, acc @ rest) - else extr_name (acc @ [ (n, vr) ]) rest + | [] -> (None, acc) + | (n, vr) :: rest -> + if n = name then (Some vr, acc @ rest) + else extr_name (acc @ [ (n, vr) ]) rest in - extr_name [] a + extr_name [] a in - vl :: reorder_list rest tl + vl :: reorder_list rest tl | _ -> raise TypeMismatch let rec get_type_index cnt name = function | [] -> raise Not_found - | Type (n, _) :: tl -> - if n = name then cnt else get_type_index (cnt + 1) name tl + | Type (n, _) :: tl -> + if n = name then cnt else get_type_index (cnt + 1) name tl | _ -> raise TypeMismatch module type Table = sig @@ -845,15 +865,15 @@

30.48%

| Some x :: tl -> x :: deoptionize_list tl | None :: tl -> failwith "Deoptionize on None" - let header = function HashTab (hd, _) -> hd - let hshtable = function HashTab (_, hsh) -> hsh + let header = function HashTab (hd, _) -> hd + let hshtable = function HashTab (_, hsh) -> hsh let deoptionize = function - | Some x -> x + | Some x -> x | None -> raise (Failure "Deoptionize on none") - let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl - let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0) + let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl + let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0) let insert table entries = match Hashtbl.find_opt (hshtable table) (List.hd entries) with @@ -869,14 +889,14 @@

30.48%

copy) ) let insert_named table entries = - let name, value = List.hd entries in - match Hashtbl.find_opt (hshtable table) value with + let name, value = List.hd entries in + match Hashtbl.find_opt (hshtable table) value with | Some x -> raise IndexExists - | None -> - let copy = Hashtbl.copy (hshtable table) in - let reordered = reorder_list entries (optionize (header table)) in - Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered); - HashTab (header table, copy) + | None -> + let copy = Hashtbl.copy (hshtable table) in + let reordered = reorder_list entries (optionize (header table)) in + Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered); + HashTab (header table, copy) let at table id = Some id :: Hashtbl.find (hshtable table) id @@ -886,51 +906,51 @@

30.48%

HashTab (header table, out) let rec table_to_string table = - Hashtbl.fold + Hashtbl.fold (fun id ent acc -> acc ^ shorten (entry_to_string id) ^ build_row ent) - (hshtable table) - (build_row (optionize (header table))) + (hshtable table) + (build_row (optionize (header table))) let rec process_constraints tbl lst = - let newHash = Hashtbl.create 0 in - match lst with - | [] -> table_to_string tbl - | hd :: tl -> + let newHash = Hashtbl.create 0 in + match lst with + | [] -> table_to_string tbl + | hd :: tl -> process_constraints (match hd with - | name, cmp, vl -> - let ind = get_type_index 0 name (header tbl) in - let cmp_func = + | name, cmp, vl -> + let ind = get_type_index 0 name (header tbl) in + let cmp_func = match List.find (function - | Type (n, t) -> n = name | _ -> failwith "Impossible") - (header tbl) + | Type (n, t) -> n = name | _ -> failwith "Impossible") + (header tbl) with - | Type (n, t) -> ( - match process_entry vl t with e -> run_constraint cmp e) + | Type (n, t) -> ( + match process_entry vl t with e -> run_constraint cmp e) | _ -> raise (Failure "Impossible") in Hashtbl.iter (fun a b -> - if ind = 0 then + if ind = 0 then if cmp_func a then Hashtbl.add newHash a b else () else - match List.nth b (ind - 1) with + match List.nth b (ind - 1) with | None -> () - | Some v -> - if cmp_func v then Hashtbl.add newHash a b else ()) - (hshtable tbl); - HashTab (header tbl, newHash)) + | Some v -> + if cmp_func v then Hashtbl.add newHash a b else ()) + (hshtable tbl); + HashTab (header tbl, newHash)) tl let exists table name = - let rec follow_header = function - | [] -> raise TypeMismatch - | Type (n, t) :: tl when n = name -> t - | _ :: tl -> follow_header tl + let rec follow_header = function + | [] -> raise TypeMismatch + | Type (n, t) :: tl when n = name -> t + | _ :: tl -> follow_header tl in - follow_header (header table) + follow_header (header table) end
diff --git a/_coverage/lib/utils.ml.html b/_coverage/lib/utils.ml.html index ef372c3..df08beb 100644 --- a/_coverage/lib/utils.ml.html +++ b/_coverage/lib/utils.ml.html @@ -3,7 +3,7 @@ utils.ml — Coverage report - + @@ -15,7 +15,7 @@

lib/utils.ml

-

33.67%

+

0.00%

@@ -102,13 +127,13 @@

33.67%

- - - - - - - + + + + + + + @@ -123,15 +148,15 @@

33.67%

- - + + - - + + - + @@ -144,8 +169,8 @@

33.67%

- - + + @@ -153,7 +178,7 @@

33.67%

- + @@ -170,32 +195,32 @@

33.67%

- + - + - + - + - - - + + + - - - + + + @@ -353,13 +378,13 @@

33.67%

| Type _ -> "type" let name_map_types t = - match t with - | Strings -> "string" - | Floats -> "float" - | Ints -> "int" - | Chars -> "char" - | Bools -> "bool" - | Ids -> "id" + match t with + | Strings -> "string" + | Floats -> "float" + | Ints -> "int" + | Chars -> "char" + | Bools -> "bool" + | Ids -> "id" let guess_entry input = match float_of_string_opt input with @@ -374,15 +399,15 @@

33.67%

if String.length input = 1 then Char input.[0] else String input)) let process_entry input = function - | Strings -> String input - | Floats -> ( + | Strings -> String input + | Floats -> ( match float_of_string_opt input with | None -> raise TypeMismatch - | Some v -> Float v) - | Ints -> ( + | Some v -> Float v) + | Ints -> ( match int_of_string_opt input with | None -> raise TypeMismatch - | Some v -> Int v) + | Some v -> Int v) | Chars -> if String.length input = 1 then Char input.[0] else raise TypeMismatch | Bools -> ( @@ -395,8 +420,8 @@

33.67%

| [ hd; tl ] -> Id (hd, guess_entry tl)) let make_compare cmp lhs rhs = - match cmp with - | LT -> lhs < rhs + match cmp with + | LT -> lhs < rhs | LTE -> lhs <= rhs | EQ -> lhs = rhs | NEQ -> lhs <> rhs @@ -404,7 +429,7 @@

33.67%

| GTE -> lhs >= rhs let run_constraint (cmp : comparison) rhs lhs = - match rhs with + match rhs with | Float r -> ( match lhs with | Float l -> make_compare cmp l r @@ -421,32 +446,32 @@

33.67%

match lhs with | Bool l -> make_compare cmp l r | _ -> failwith "Typing error") - | String r -> ( + | String r -> ( match lhs with - | String l -> make_compare cmp l r + | String l -> make_compare cmp l r | _ -> failwith "Typing error") | _ -> raise TypeMismatch let rec entry_to_string ent = - match ent with + match ent with | String x -> x | Float x -> string_of_float x | Int x -> string_of_int x | Char x -> String.make 1 x | Bool x -> string_of_bool x | Id (a, b) -> a ^ "@" ^ entry_to_string b - | Type (a, b) -> name_map_types b ^ " " ^ a + | Type (a, b) -> name_map_types b ^ " " ^ a let shorten inp = - let str = String.trim inp in - if String.length str < 8 then str ^ "\t\t" - else if String.length str < 16 then str ^ "\t" + let str = String.trim inp in + if String.length str < 8 then str ^ "\t\t" + else if String.length str < 16 then str ^ "\t" else String.sub str 0 16 let rec build_row entlist = - match entlist with - | [] -> "\n\n" - | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs + match entlist with + | [] -> "\n\n" + | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs | None :: xs -> "\t\t" ^ build_row xs let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl diff --git a/bisect001042343.coverage b/bisect001042343.coverage deleted file mode 100644 index 10b2528..0000000 --- a/bisect001042343.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 16 16 0 0 0 16 0 0 0 22 18 40 0 0 0 0 0 0 0 0 0 0 0 0 8 0 8 8 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 2 1 1 1 1 1 7 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 7 0 0 0 0 0 0 7 7 0 2 2 2 5 7 7 7 7 7 7 0 1 7 0 8 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 52 52 107 45 7 152 8 52 0 8 3 0 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 85 20 8 0 59 9 59 16 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 8 8 8 8 8 8 8 8 8 0 8 8 8 8 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 3 1 0 0 1 1 0 0 0 1 3 3 3 3 3 0 11 0 3 3 3 3 1 3 4 4 43 1 42 164 122 43 10 lib/cli.ml 163 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8163 8189 8213 8237 8263 8289 8049 8348 8022 7989 7969 7956 7906 9034 9096 8918 8895 8878 8844 8727 8698 8758 8788 8822 8866 8936 8976 8998 8568 8619 8538 8492 8470 8512 8415 9673 9722 9468 9501 9555 9596 9642 9699 9747 9789 9307 9355 9395 9275 10238 10257 10268 10204 10182 10005 163 21 21 21 21 1 21 22 22 1 695 198 0 893 893 198 20 8 2 8 1 7 1 1 7 8 7 10 9 8 8 0 8 37 5 1 42 43 1 8 2 44 100 54 54 54 16 0 16 0 0 0 16 32 16 16 16 16 11 11 11 11 1 77 16 76 1 0 16 1 77 174 94 94 94 0 17 1 1 17 37 19 0 0 0 0 0 0 0 0 0 0 0 12 12 6 12 0 18 6 61 6 6 67 67 6 6 6 2 0 1 3 0 0 2 8 0 8 3 11 11 11 3 2 6 0 6 12 38 6 6 6 6 6 6 1 1 1 6 7 50 7 7 7 0 0 0 1 19 16 0 0 7 0 54 94 43 191 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect023227872.coverage b/bisect023227872.coverage new file mode 100644 index 0000000..a6ba950 --- /dev/null +++ b/bisect023227872.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 22 22 0 0 0 22 0 0 0 24 24 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 9 9 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 59 59 122 51 8 173 9 59 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 83 18 9 0 59 9 59 22 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 1 47 184 137 48 10 lib/cli.ml 181 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1408 1413 1421 1470 1386 851 877 994 1117 1237 1315 1740 2443 2604 2145 2375 2079 2875 1684 1827 2010 1660 1608 1638 1559 3685 3482 3865 3188 3293 3409 3168 3146 3107 4001 4034 4071 4110 4145 4180 4211 3980 4446 4773 4912 4413 4583 4686 4389 4337 4367 4285 5566 5686 5251 5364 5493 5225 5197 6211 6224 6232 6294 6302 6169 6315 7067 7233 7380 7369 7517 7585 7498 7567 7199 7280 7005 7617 6876 6930 6809 7660 6603 6733 6556 6486 7722 5833 5838 5973 6100 6406 8191 8219 8150 8167 8126 8069 8022 8003 7966 7931 7919 7894 7869 7802 8587 8611 8637 8661 8685 8711 8737 8497 8470 8437 8417 8404 8354 9597 9661 9473 9450 9433 9397 9278 9249 9311 9339 9375 9421 9493 9535 9557 9111 9164 9079 9053 9001 8956 8934 8976 8879 10238 10287 10033 10066 10120 10161 10207 10264 10312 10354 9872 9920 9960 9840 10875 10894 10905 10841 10819 10726 10754 10780 10688 10570 181 249 249 249 249 26 9 2 9 1 8 1 1 8 9 0 0 0 0 0 8 11 10 9 9 0 9 42 5 1 47 48 1 9 2 49 111 60 60 60 17 17 1 1 2 18 39 21 21 21 21 16 12 12 12 1 95 22 94 1 22 1 95 217 118 118 118 1 22 1 1 23 49 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 6 11 17 6 51 5 5 56 56 6 6 6 1 0 1 1 0 0 2 5 5 3 8 8 8 4 2 5 1 6 11 28 6 6 6 6 6 5 0 0 1 6 7 7 1 45 8 8 8 0 0 0 1 25 21 0 0 8 1 60 118 56 234 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect059640741.coverage b/bisect059640741.coverage new file mode 100644 index 0000000..a6ba950 --- /dev/null +++ b/bisect059640741.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 22 22 0 0 0 22 0 0 0 24 24 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 9 9 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 59 59 122 51 8 173 9 59 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 83 18 9 0 59 9 59 22 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 1 47 184 137 48 10 lib/cli.ml 181 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1408 1413 1421 1470 1386 851 877 994 1117 1237 1315 1740 2443 2604 2145 2375 2079 2875 1684 1827 2010 1660 1608 1638 1559 3685 3482 3865 3188 3293 3409 3168 3146 3107 4001 4034 4071 4110 4145 4180 4211 3980 4446 4773 4912 4413 4583 4686 4389 4337 4367 4285 5566 5686 5251 5364 5493 5225 5197 6211 6224 6232 6294 6302 6169 6315 7067 7233 7380 7369 7517 7585 7498 7567 7199 7280 7005 7617 6876 6930 6809 7660 6603 6733 6556 6486 7722 5833 5838 5973 6100 6406 8191 8219 8150 8167 8126 8069 8022 8003 7966 7931 7919 7894 7869 7802 8587 8611 8637 8661 8685 8711 8737 8497 8470 8437 8417 8404 8354 9597 9661 9473 9450 9433 9397 9278 9249 9311 9339 9375 9421 9493 9535 9557 9111 9164 9079 9053 9001 8956 8934 8976 8879 10238 10287 10033 10066 10120 10161 10207 10264 10312 10354 9872 9920 9960 9840 10875 10894 10905 10841 10819 10726 10754 10780 10688 10570 181 249 249 249 249 26 9 2 9 1 8 1 1 8 9 0 0 0 0 0 8 11 10 9 9 0 9 42 5 1 47 48 1 9 2 49 111 60 60 60 17 17 1 1 2 18 39 21 21 21 21 16 12 12 12 1 95 22 94 1 22 1 95 217 118 118 118 1 22 1 1 23 49 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 6 11 17 6 51 5 5 56 56 6 6 6 1 0 1 1 0 0 2 5 5 3 8 8 8 4 2 5 1 6 11 28 6 6 6 6 6 5 0 0 1 6 7 7 1 45 8 8 8 0 0 0 1 25 21 0 0 8 1 60 118 56 234 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect091422069.coverage b/bisect091422069.coverage deleted file mode 100644 index 10b2528..0000000 --- a/bisect091422069.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 16 16 0 0 0 16 0 0 0 22 18 40 0 0 0 0 0 0 0 0 0 0 0 0 8 0 8 8 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 2 1 1 1 1 1 7 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 7 0 0 0 0 0 0 7 7 0 2 2 2 5 7 7 7 7 7 7 0 1 7 0 8 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 52 52 107 45 7 152 8 52 0 8 3 0 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 85 20 8 0 59 9 59 16 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 8 8 8 8 8 8 8 8 8 0 8 8 8 8 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 3 1 0 0 1 1 0 0 0 1 3 3 3 3 3 0 11 0 3 3 3 3 1 3 4 4 43 1 42 164 122 43 10 lib/cli.ml 163 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8163 8189 8213 8237 8263 8289 8049 8348 8022 7989 7969 7956 7906 9034 9096 8918 8895 8878 8844 8727 8698 8758 8788 8822 8866 8936 8976 8998 8568 8619 8538 8492 8470 8512 8415 9673 9722 9468 9501 9555 9596 9642 9699 9747 9789 9307 9355 9395 9275 10238 10257 10268 10204 10182 10005 163 21 21 21 21 1 21 22 22 1 695 198 0 893 893 198 20 8 2 8 1 7 1 1 7 8 7 10 9 8 8 0 8 37 5 1 42 43 1 8 2 44 100 54 54 54 16 0 16 0 0 0 16 32 16 16 16 16 11 11 11 11 1 77 16 76 1 0 16 1 77 174 94 94 94 0 17 1 1 17 37 19 0 0 0 0 0 0 0 0 0 0 0 12 12 6 12 0 18 6 61 6 6 67 67 6 6 6 2 0 1 3 0 0 2 8 0 8 3 11 11 11 3 2 6 0 6 12 38 6 6 6 6 6 6 1 1 1 6 7 50 7 7 7 0 0 0 1 19 16 0 0 7 0 54 94 43 191 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect214014825.coverage b/bisect214014825.coverage new file mode 100644 index 0000000..a6ba950 --- /dev/null +++ b/bisect214014825.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 22 22 0 0 0 22 0 0 0 24 24 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 9 9 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 59 59 122 51 8 173 9 59 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 83 18 9 0 59 9 59 22 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 1 47 184 137 48 10 lib/cli.ml 181 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1408 1413 1421 1470 1386 851 877 994 1117 1237 1315 1740 2443 2604 2145 2375 2079 2875 1684 1827 2010 1660 1608 1638 1559 3685 3482 3865 3188 3293 3409 3168 3146 3107 4001 4034 4071 4110 4145 4180 4211 3980 4446 4773 4912 4413 4583 4686 4389 4337 4367 4285 5566 5686 5251 5364 5493 5225 5197 6211 6224 6232 6294 6302 6169 6315 7067 7233 7380 7369 7517 7585 7498 7567 7199 7280 7005 7617 6876 6930 6809 7660 6603 6733 6556 6486 7722 5833 5838 5973 6100 6406 8191 8219 8150 8167 8126 8069 8022 8003 7966 7931 7919 7894 7869 7802 8587 8611 8637 8661 8685 8711 8737 8497 8470 8437 8417 8404 8354 9597 9661 9473 9450 9433 9397 9278 9249 9311 9339 9375 9421 9493 9535 9557 9111 9164 9079 9053 9001 8956 8934 8976 8879 10238 10287 10033 10066 10120 10161 10207 10264 10312 10354 9872 9920 9960 9840 10875 10894 10905 10841 10819 10726 10754 10780 10688 10570 181 249 249 249 249 26 9 2 9 1 8 1 1 8 9 0 0 0 0 0 8 11 10 9 9 0 9 42 5 1 47 48 1 9 2 49 111 60 60 60 17 17 1 1 2 18 39 21 21 21 21 16 12 12 12 1 95 22 94 1 22 1 95 217 118 118 118 1 22 1 1 23 49 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 6 11 17 6 51 5 5 56 56 6 6 6 1 0 1 1 0 0 2 5 5 3 8 8 8 4 2 5 1 6 11 28 6 6 6 6 6 5 0 0 1 6 7 7 1 45 8 8 8 0 0 0 1 25 21 0 0 8 1 60 118 56 234 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect401024424.coverage b/bisect401024424.coverage deleted file mode 100644 index 10b2528..0000000 --- a/bisect401024424.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 33 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 971 1160 1178 1068 1085 1042 1344 1264 1328 1292 1363 1238 1577 1515 1545 1463 33 0 0 0 0 0 16 16 0 0 0 16 0 0 0 22 18 40 0 0 0 0 0 0 0 0 0 0 0 0 8 0 8 8 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 2 1 1 1 1 1 7 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 7 0 0 0 0 0 0 7 7 0 2 2 2 5 7 7 7 7 7 7 0 1 7 0 8 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 52 52 107 45 7 152 8 52 0 8 3 0 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 85 20 8 0 59 9 59 16 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 8 8 8 8 8 8 8 8 8 0 8 8 8 8 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 3 1 0 0 1 1 0 0 0 1 3 3 3 3 3 0 11 0 3 3 3 3 1 3 4 4 43 1 42 164 122 43 10 lib/cli.ml 163 1262 1282 1242 1530 1474 1496 1447 1396 1627 1787 1780 1707 1749 1686 1838 1893 2061 2087 2182 2210 2303 2330 2416 2405 2392 1976 2002 2119 2242 2362 2440 2703 3406 3567 3108 3338 3042 3838 2647 2790 2973 2623 2571 2601 2522 4648 4695 4445 4807 4151 4256 4372 4131 4109 4070 4943 4976 5013 5052 5087 5122 5153 4922 5388 5715 5854 6046 5355 5525 5628 5331 5279 5309 5227 6492 6612 6177 6290 6419 6151 6123 7141 7154 7162 7224 7232 7099 7245 6759 6764 6899 7026 7759 7787 7718 7735 7811 7694 7637 7590 7571 7534 7499 7487 7462 7437 7370 8139 8163 8189 8213 8237 8263 8289 8049 8348 8022 7989 7969 7956 7906 9034 9096 8918 8895 8878 8844 8727 8698 8758 8788 8822 8866 8936 8976 8998 8568 8619 8538 8492 8470 8512 8415 9673 9722 9468 9501 9555 9596 9642 9699 9747 9789 9307 9355 9395 9275 10238 10257 10268 10204 10182 10005 163 21 21 21 21 1 21 22 22 1 695 198 0 893 893 198 20 8 2 8 1 7 1 1 7 8 7 10 9 8 8 0 8 37 5 1 42 43 1 8 2 44 100 54 54 54 16 0 16 0 0 0 16 32 16 16 16 16 11 11 11 11 1 77 16 76 1 0 16 1 77 174 94 94 94 0 17 1 1 17 37 19 0 0 0 0 0 0 0 0 0 0 0 12 12 6 12 0 18 6 61 6 6 67 67 6 6 6 2 0 1 3 0 0 2 8 0 8 3 11 11 11 3 2 6 0 6 12 38 6 6 6 6 6 6 1 1 1 6 7 50 7 7 7 0 0 0 1 19 16 0 0 7 0 54 94 43 191 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect516102304.coverage b/bisect516102304.coverage new file mode 100644 index 0000000..a6ba950 --- /dev/null +++ b/bisect516102304.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 22 22 0 0 0 22 0 0 0 24 24 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 9 9 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 59 59 122 51 8 173 9 59 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 83 18 9 0 59 9 59 22 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 1 47 184 137 48 10 lib/cli.ml 181 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1408 1413 1421 1470 1386 851 877 994 1117 1237 1315 1740 2443 2604 2145 2375 2079 2875 1684 1827 2010 1660 1608 1638 1559 3685 3482 3865 3188 3293 3409 3168 3146 3107 4001 4034 4071 4110 4145 4180 4211 3980 4446 4773 4912 4413 4583 4686 4389 4337 4367 4285 5566 5686 5251 5364 5493 5225 5197 6211 6224 6232 6294 6302 6169 6315 7067 7233 7380 7369 7517 7585 7498 7567 7199 7280 7005 7617 6876 6930 6809 7660 6603 6733 6556 6486 7722 5833 5838 5973 6100 6406 8191 8219 8150 8167 8126 8069 8022 8003 7966 7931 7919 7894 7869 7802 8587 8611 8637 8661 8685 8711 8737 8497 8470 8437 8417 8404 8354 9597 9661 9473 9450 9433 9397 9278 9249 9311 9339 9375 9421 9493 9535 9557 9111 9164 9079 9053 9001 8956 8934 8976 8879 10238 10287 10033 10066 10120 10161 10207 10264 10312 10354 9872 9920 9960 9840 10875 10894 10905 10841 10819 10726 10754 10780 10688 10570 181 249 249 249 249 26 9 2 9 1 8 1 1 8 9 0 0 0 0 0 8 11 10 9 9 0 9 42 5 1 47 48 1 9 2 49 111 60 60 60 17 17 1 1 2 18 39 21 21 21 21 16 12 12 12 1 95 22 94 1 22 1 95 217 118 118 118 1 22 1 1 23 49 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 6 11 17 6 51 5 5 56 56 6 6 6 1 0 1 1 0 0 2 5 5 3 8 8 8 4 2 5 1 6 11 28 6 6 6 6 6 5 0 0 1 6 7 7 1 45 8 8 8 0 0 0 1 25 21 0 0 8 1 60 118 56 234 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect775870130.coverage b/bisect775870130.coverage new file mode 100644 index 0000000..a6ba950 --- /dev/null +++ b/bisect775870130.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 22 22 0 0 0 22 0 0 0 24 24 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 9 9 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 59 59 122 51 8 173 9 59 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 83 18 9 0 59 9 59 22 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 1 47 184 137 48 10 lib/cli.ml 181 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1408 1413 1421 1470 1386 851 877 994 1117 1237 1315 1740 2443 2604 2145 2375 2079 2875 1684 1827 2010 1660 1608 1638 1559 3685 3482 3865 3188 3293 3409 3168 3146 3107 4001 4034 4071 4110 4145 4180 4211 3980 4446 4773 4912 4413 4583 4686 4389 4337 4367 4285 5566 5686 5251 5364 5493 5225 5197 6211 6224 6232 6294 6302 6169 6315 7067 7233 7380 7369 7517 7585 7498 7567 7199 7280 7005 7617 6876 6930 6809 7660 6603 6733 6556 6486 7722 5833 5838 5973 6100 6406 8191 8219 8150 8167 8126 8069 8022 8003 7966 7931 7919 7894 7869 7802 8587 8611 8637 8661 8685 8711 8737 8497 8470 8437 8417 8404 8354 9597 9661 9473 9450 9433 9397 9278 9249 9311 9339 9375 9421 9493 9535 9557 9111 9164 9079 9053 9001 8956 8934 8976 8879 10238 10287 10033 10066 10120 10161 10207 10264 10312 10354 9872 9920 9960 9840 10875 10894 10905 10841 10819 10726 10754 10780 10688 10570 181 249 249 249 249 26 9 2 9 1 8 1 1 8 9 0 0 0 0 0 8 11 10 9 9 0 9 42 5 1 47 48 1 9 2 49 111 60 60 60 17 17 1 1 2 18 39 21 21 21 21 16 12 12 12 1 95 22 94 1 22 1 95 217 118 118 118 1 22 1 1 23 49 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 6 11 17 6 51 5 5 56 56 6 6 6 1 0 1 1 0 0 2 5 5 3 8 8 8 4 2 5 1 6 11 28 6 6 6 6 6 5 0 0 1 6 7 7 1 45 8 8 8 0 0 0 1 25 21 0 0 8 1 60 118 56 234 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/data/responses.json b/data/responses.json index 86b65a8..2ab45e9 100644 --- a/data/responses.json +++ b/data/responses.json @@ -14,12 +14,20 @@ "err_unknown_command": "Unknown command. Type help for a list of commands\n|> ", "err_at_empty": "Please enter what the type and id of which to get an instance\n|> ", "err_at_no_id": "Please enter an id of the instance you which to get\n|> ", + "err_at_column_not_int": "Column number should be an int\n|> ", "err_at_invalid_type": "No type of that name\n|> ", + "err_at_type_DNE": "No type of that name\n|> ", + "err_at_column_out_of_range": "Column out of range. Hint: Index starts at 0\n|> ", + "unbound_type": "\n|> ", + "unbound_val": "\n|> ", + "no_entry": "No entry\n|> ", + "err_find_missing_type": "Must specify type in find\n|> ", "err_find_invalid_expr": "Invalid comparison expression\n|> ", "err_find_invalid_comparison": "Invalid comparison, use <> = > < >= <=\n|> ", "err_find_invalid_type": "Cannot find type of that name\n|> ", "help_message": "\nTo define a custom dataframe, type the following,\nall valueNames must be unique:\ndef TypeName IdName\n type valueName\n ...\n type valueName\n\n\nTo assign values to the custom types:\nassign TypeName IdValue\n valueName = value\n ...\n valueName = value\n\nTo save to a file, use 'save '\n\nTo find a file, type 'find TypeName expr'\n'expr' must be of the form: 'variable compare value' separated by spaces.\nValid compare opperators include <> = > < <= and >=\nexpr can be chained using 'and'\n\n|> ", "indent_end": "| <|\n|> ", "indent": "| ", - "default": "|> " + "default": "|> ", + "welcome": "\n\nWelcome to the 3110 Database Command Line\nPlease describe the data you want to store.\nType 'quit' to quit, 'help' for help.\n\n" } \ No newline at end of file diff --git a/lib/cli.ml b/lib/cli.ml index 1c3b3b2..e401960 100644 --- a/lib/cli.ml +++ b/lib/cli.ml @@ -24,52 +24,11 @@ module CLI = struct exception InvalidComparison let current_state = ref Default - - let response_names = - [ - "err_create_field_DNE"; - "err_create_field_wrong_type"; - "err_create_field_no_value"; - "err_create_field_already_entered"; - "err_assign_empty"; - "err_assign_no_id"; - "err_assign_DNE"; - "err_defn_needs_type_name"; - "err_defn_needs_ID_name"; - "err_defn_already_exists"; - "err_defn_no_name"; - "err_defn_invalid_type"; - "err_unknown_command"; - "err_find_invalid_expr"; - "err_find_invalid_comparison"; - "err_find_invalid_type"; - "err_at_no_id"; - "help_message"; - "indent_end"; - "indent"; - "default"; - ] - - let get_json_item file entry = - file |> to_assoc |> List.assoc entry |> to_string - let file_name = "data/responses.json" - let rec build_response_assoc_list res_names res_assoc = + let get_response response = let file = Yojson.Basic.from_file file_name in - match res_names with - | [] -> res_assoc - | h :: t -> - (h, get_json_item file h) :: res_assoc |> build_response_assoc_list t - - let responses = build_response_assoc_list response_names [] - - let rec find_response key lst = - match lst with - | [] -> failwith "response not found" - | (k, v) :: t -> if k = key then v else find_response key t - - let get_response response = find_response response responses + file |> to_assoc |> List.assoc response |> to_string let reset () = current_state := Default; @@ -92,7 +51,7 @@ module CLI = struct | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) | Ids -> Id - (match String.split_on_char '@' (String.trim v) with + (match v |> String.split_on_char '@' |> List.map String.trim with | [] | [ _ ] | _ :: _ :: _ :: _ -> raise ParseError | [ hd; tl ] -> (hd, String tl)) @@ -150,10 +109,10 @@ module CLI = struct [ ( (match Tbl.header t with | Type (n, _) :: tl -> n - | _ -> raise ParseError), + | _ -> failwith "impossible" [@coverage off]), String id ); ] ); - "| " + get_response "indent" | None -> get_response "err_assign_DNE") (* "That type does not exist\n|> " *) @@ -188,7 +147,7 @@ module CLI = struct current_state := BuildType (name, id, types); get_response "err_defn_invalid_type" (* "Not a recognized type\n| " *) - | _ -> raise (Failure "Should be impossible")) + | _ -> raise (Failure "Should be impossible") [@coverage off]) let process_type input = match List.filter (fun s -> s <> "") input with @@ -226,29 +185,31 @@ module CLI = struct | Some x -> ( let row = Tbl.at x (String id) in match int_of_string_opt col with - | None -> "Column number should be an int" + | None -> + get_response "err_at_column_not_int" + (* "Column number should be an int" *) | Some i -> ( match List.nth_opt row i with | Some e -> ( match e with - | None -> "No entry" + | None -> get_response "no_entry" | Some e -> ( match e with | Id (name, row) -> ( entry_to_string e ^ "=" ^ match DB.get_reference e !db with - | exception Not_found -> "" + | exception Not_found -> get_response "unbound_type" | l, r -> ( "\n" ^ build_row (optionize l) ^ match r with - | None -> "" + | None -> get_response "unbound_val" | Some v -> build_row v)) | _ -> entry_to_string e)) - | None -> "Column out of range. Hint: Index starts at 0")) - | None -> "No type named " ^ name) + | None -> get_response "err_at_column_out_of_range")) + | None -> get_response "err_at_type_DNE") let split_on_substring sub str = let idxs = ref [ 0 ] in @@ -263,7 +224,7 @@ module CLI = struct match idxs with | [] -> [] | s :: e :: t -> String.sub str s (e - s) :: create_lst t sub_len str - | _ -> failwith "odd" + | _ -> failwith "odd" [@coverage off] in create_lst !idxs sub_len str @@ -283,26 +244,28 @@ module CLI = struct | ">=" -> GTE | _ -> raise InvalidComparison), value ) - | _ -> failwith "should be impossible" + | _ -> failwith "should be impossible" [@coverage off] let process_find lst = let cleaned_lst = lst |> List.map String.trim |> List.filter (fun s -> s <> "") in - match DB.get_table (List.hd cleaned_lst) !db with - | None -> get_response "err_find_invalid_type" - | Some type_table -> ( - try - cleaned_lst |> List.tl - |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" - |> split_on_substring " and " |> List.map String.trim - |> List.filter (fun s -> s <> "") - |> (fun lst -> if lst = [] then raise InvalidExpr else lst) - |> List.map parse_compare_exp - |> Tbl.process_constraints type_table - with - | InvalidExpr -> get_response "err_find_invalid_expr" - | InvalidComparison -> get_response "err_find_invalid_comparison") + if cleaned_lst = [] then get_response "err_find_missing_type" + else + match DB.get_table (List.hd cleaned_lst) !db with + | None -> get_response "err_find_invalid_type" + | Some type_table -> ( + try + cleaned_lst |> List.tl + |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" + |> split_on_substring "and" |> List.map String.trim + |> List.filter (fun s -> s <> "") + |> (fun lst -> if lst = [] then raise InvalidExpr else lst) + |> List.map parse_compare_exp + |> Tbl.process_constraints type_table + with + | InvalidExpr -> get_response "err_find_invalid_expr" + | InvalidComparison -> get_response "err_find_invalid_comparison") (** [parse_input input] takes in new input and determines the relevant command*) let parse_input input = @@ -326,11 +289,13 @@ end (** [main ()] prompts for the script to start, then starts it. *) let main () = - print_string - "\n\n\ - Welcome to the 3110 Database Command Line\n\ - Please describe the data you want to store.\n\ - Type 'quit' to quit, 'help' for help.\n\n"; + let file_name = "data/responses.json" in + let welcom_string = + let file = Yojson.Basic.from_file file_name in + file |> Yojson.Basic.Util.to_assoc |> List.assoc "welcome" + |> Yojson.Basic.Util.to_string + in + print_string welcom_string; print_string "|> "; while true do read_line () |> CLI.parse_input |> print_string diff --git a/lib/cli.mli b/lib/cli.mli index f58acae..08d874e 100644 --- a/lib/cli.mli +++ b/lib/cli.mli @@ -12,6 +12,8 @@ val read_input : string -> unit*) val main : unit -> unit +(** [main ()] parses the user's input from the terminal using + CliHandler and prints the resulting message to the terminal until the user quits *) module type CliHandler = sig val parse_input : string -> string diff --git a/lib/database.mli b/lib/database.mli index f748916..27a624a 100644 --- a/lib/database.mli +++ b/lib/database.mli @@ -4,6 +4,7 @@ open Tables module Database (Table : Table) : sig exception NoEntry (** Raised when an entry that does not exist is parsed. *) + exception WrongType exception TableExists @@ -15,10 +16,11 @@ module Database (Table : Table) : sig val build_table : database -> entry list -> string -> database val drop_table : string -> database -> database val get_table : string -> database -> table option - val get_reference : entry -> database -> (entry list * entry option list option) + val get_reference : entry -> database -> entry list * entry option list option val db_to_string : database -> string - (* Adds an entry to the table given by id. Raises [Not_found] if the table cannot be found*) val add_entry : string -> entry list -> database -> unit + (** [add_entry s lst db] Adds an entry to the table given by id. Raises [Not_found] if the table cannot be found*) + val add_named_entry : string -> (string * entry) list -> database -> unit end diff --git a/lib/tables.mli b/lib/tables.mli index 3b4a44b..fdea669 100644 --- a/lib/tables.mli +++ b/lib/tables.mli @@ -6,13 +6,13 @@ exception TypeMismatch module type Table = sig type t - (* Creates a new table given a list of type definitions. Raises [TypeMismatch] if the list provided is not types*) val empty : entry list -> t + (** [empty lst] Creates a new table given a list of type definitions. Raises [TypeMismatch] if the list provided is not types**) - (* Adds a new set of entries to the table. Precondition: Entry list has at least one element + val insert : t -> entry list -> t + (** Adds a new set of entries to the table. Precondition: Entry list has at least one element Raises [IndexExists] if the index provided is already in the table. Raises [TypeMismatch] if the new row fits the type definition*) - val insert : t -> entry list -> t (* Adds a new set of entries to the table, in the columns that the ids identify. Any non-entered rows will be a none Raises [IndexExists] if the index provided is already in the table. diff --git a/test/main.ml b/test/main.ml index 2913417..0dc188a 100644 --- a/test/main.ml +++ b/test/main.ml @@ -8,6 +8,10 @@ end let better_print s = "'" ^ String.escaped s ^ "'" let get_response = CLI.get_response +let handle_table_prints str = + str |> String.split_on_char '\t' |> List.map String.trim + |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" + let rec add_input lst = match lst with | [] -> () @@ -20,7 +24,7 @@ let cli_test (name : string) (actual_output : string) (expected_output : string) name >:: fun _ -> assert_equal expected_output actual_output ~printer:better_print -let rec make_test primer tests = +let rec make_test primer tests is_print = match tests with | [] -> [] | (reset, name, input, expected) :: t -> @@ -29,9 +33,11 @@ let rec make_test primer tests = CLI.reset (); add_input primer) else (); - cli_test name (CLI.parse_input input) expected + if is_print then + cli_test name (CLI.parse_input input |> handle_table_prints) expected + else cli_test name (CLI.parse_input input) expected in - placeholder :: make_test primer t + placeholder :: make_test primer t is_print let fully_defined_generic = [ @@ -77,6 +83,41 @@ let def_tests = "no name error when blank spaces", "string ", get_response "err_defn_no_name" ); + ( false, + "cannot define the same type twice, end of defn", + " ", + get_response "indent_end" ); + ( false, + "cannot define the same type twice, defn", + "def Person Name", + get_response "err_defn_already_exists" ); + ] ) + +let malformed_assign_states = + ( [ + "def City Name"; + "int sq_footage"; + "float coordinates"; + "string nickname"; + ""; + ], + [ + ( true, + "assign with no extra terms", + "assign ", + get_response "err_assign_empty" ); + ( true, + "assign with type and no id", + "assign City", + get_response "err_assign_no_id" ); + ( true, + "assign with incorrect type and no id", + "assign Coty", + get_response "err_assign_no_id" ); + ( true, + "assign with incorrect type and no id", + "assign Coty Ithaca", + get_response "err_assign_DNE" ); ] ) let pre_defn_assign_tests = @@ -162,33 +203,51 @@ let find_tests = get_response "err_find_invalid_comparison" ); ( true, "incorrect find incorrect expr with and", - "find Type s < 4 and i =2 and f < 3", + "find Type s < 4 and i =2 and f <= 3", get_response "err_find_invalid_expr" ); ( true, - "incorrect find incorrect expr with and", - "find Type s < 4 and i = 2 and f < 3", + "empty find expression", + "find ", + get_response "err_find_missing_type" ); + ( true, + "empty expr with and", + "find Type and ", get_response "err_find_invalid_expr" ); ] ) let misc_tests = ( [], - [ (true, "help message is correct", "help", get_response "help_message") ] - ) + [ + (true, "help message is correct", "help", get_response "help_message"); + ( true, + "unknown command error on random input", + "asdf", + get_response "err_unknown_command" ); + ] ) -let rec gather_tests tests = +let rec gather_tests_no_print tests = match tests with | [] -> [] - | (primer, tests) :: t -> make_test primer tests :: gather_tests t - -let suite = - "search test suite" - >::: ([ - def_tests; - misc_tests; - pre_defn_assign_tests; - find_tests; - assign_type_tests; - ] - |> gather_tests |> List.flatten) + | (primer, tests) :: t -> + make_test primer tests false @ gather_tests_no_print t + +let gather_tests_with_print tests = + match tests with + | [] -> [] + | (primer, tests) :: t -> + make_test primer tests true @ gather_tests_no_print t + +let tests = + ([ + def_tests; + misc_tests; + pre_defn_assign_tests; + find_tests; + assign_type_tests; + malformed_assign_states; + ] + |> gather_tests_no_print) + @ ([] |> gather_tests_with_print) +let suite = "search test suite" >::: tests let _ = run_test_tt_main suite From 70dea4c1ae0cbd5a685f6db25841dc32ebc46781 Mon Sep 17 00:00:00 2001 From: JT Klenke Date: Mon, 15 May 2023 00:03:30 -0400 Subject: [PATCH 16/24] Added Test cases, updated error - changed TypeMismatch to be localized in the Util File - added test cases to CLI --- _coverage/index.html | 16 +- _coverage/lib/cli.ml.html | 300 +++++++-------- _coverage/lib/database.ml.html | 10 +- _coverage/lib/tables.ml.html | 658 ++++++++++++++++----------------- _coverage/lib/utils.ml.html | 204 ++++------ bisect023227872.coverage | 1 - bisect059640741.coverage | 1 - bisect214014825.coverage | 1 - bisect447167505.coverage | 1 + bisect485952471.coverage | 1 + bisect516102304.coverage | 1 - bisect650975287.coverage | 1 + bisect775870130.coverage | 1 - bisect849772197.coverage | 1 + bisect981581601.coverage | 1 + data/responses.json | 2 + lib/cli.ml | 4 +- lib/tables.ml | 3 - lib/tables.mli | 3 - test/main.ml | 58 ++- 20 files changed, 624 insertions(+), 644 deletions(-) delete mode 100644 bisect023227872.coverage delete mode 100644 bisect059640741.coverage delete mode 100644 bisect214014825.coverage create mode 100644 bisect447167505.coverage create mode 100644 bisect485952471.coverage delete mode 100644 bisect516102304.coverage create mode 100644 bisect650975287.coverage delete mode 100644 bisect775870130.coverage create mode 100644 bisect849772197.coverage create mode 100644 bisect981581601.coverage diff --git a/_coverage/index.html b/_coverage/index.html index cc2c582..2342916 100644 --- a/_coverage/index.html +++ b/_coverage/index.html @@ -3,20 +3,20 @@ Coverage report - +
- + - 67% (122 / 181) + 70% (129 / 183) lib/cli.ml @@ -32,18 +32,18 @@

31.75%

- + - 17% (37 / 210) + 33% (70 / 210) lib/tables.ml
- + - 0% (0 / 98) + 50% (49 / 98) lib/utils.ml diff --git a/_coverage/lib/cli.ml.html b/_coverage/lib/cli.ml.html index 053bbc2..fc79197 100644 --- a/_coverage/lib/cli.ml.html +++ b/_coverage/lib/cli.ml.html @@ -3,7 +3,7 @@ cli.ml — Coverage report - + @@ -15,48 +15,44 @@

lib/cli.ml

-

67.40%

+

70.49%

@@ -672,6 +670,8 @@

67.40%

300 301 302 +303 +304
module type CliHandler = sig
   val parse_input : string -> string
@@ -702,58 +702,58 @@ 

67.40%

let file_name = "data/responses.json" let get_response response = - let file = Yojson.Basic.from_file file_name in - file |> to_assoc |> List.assoc response |> to_string + let file = Yojson.Basic.from_file file_name in + file |> to_assoc |> List.assoc response |> to_string let reset () = - current_state := Default; + current_state := Default; db := DB.empty let parse_value v = function - | Strings -> String v - | Ints -> ( + | Strings -> String v + | Ints -> ( match int_of_string_opt v with - | Some i -> Int i + | Some i -> Int i | None -> raise ParseError) - | Floats -> ( + | Floats -> ( match float_of_string_opt v with - | Some f -> Float f + | Some f -> Float f | None -> raise ParseError) - | Bools -> ( + | Bools -> ( match bool_of_string_opt v with - | Some b -> Bool b + | Some b -> Bool b | None -> raise ParseError) - | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) + | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) | Ids -> Id - (match String.split_on_char '@' (String.trim v) with + (match v |> String.split_on_char '@' |> List.map String.trim with | [] | [ _ ] | _ :: _ :: _ :: _ -> raise ParseError | [ hd; tl ] -> (hd, String tl)) let rec build_instance (name, table, vals) input = - match - input |> String.split_on_char '=' |> List.map String.trim - |> List.filter (fun s -> s <> "") + match + input |> String.split_on_char '=' |> List.map String.trim + |> List.filter (fun s -> s <> "") with - | [] -> + | [] -> DB.add_named_entry name vals !db; - current_state := Default; + current_state := Default; get_response "indent_end" (* "| <|\n|> " *) | [ n ] -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_no_value" (* "Please input a variable and a value\n| " *) - | n :: v :: tl -> ( + | n :: v :: tl -> ( match List.assoc_opt n vals with - | None -> ( + | None -> ( match Tbl.exists table n with | exception TypeMismatch -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_DNE" (* "That field does not exist in this type\n| " *) - | t -> ( + | t -> ( match parse_value v t with - | x -> + | x -> current_state := BuildInstance (name, table, (n, x) :: vals); get_response "indent" (* "| " *) | exception ParseError -> @@ -767,55 +767,55 @@

67.40%

(* "This field has already been entered\n| " *)) let process_assign input = - match input |> List.map String.trim |> List.filter (fun s -> s <> "") with + match input |> List.map String.trim |> List.filter (fun s -> s <> "") with | [] -> get_response "err_assign_empty" (* "Please input a type name and id\n|> " *) | [ name ] -> get_response "err_assign_no_id" (* "Please input an id for this instance\n|> " *) - | name :: id :: tl -> ( + | name :: id :: tl -> ( match DB.get_table name !db with - | Some t -> + | Some t -> current_state := BuildInstance ( name, t, [ ( (match Tbl.header t with - | Type (n, _) :: tl -> n + | Type (n, _) :: tl -> n | _ -> failwith "impossible" [@coverage off]), String id ); ] ); - "| " + get_response "indent" | None -> get_response "err_assign_DNE") (* "That type does not exist\n|> " *) let parse_type (typ, name) = - match typ with - | "int" -> Type (name, Ints) - | "float" -> Type (name, Floats) - | "string" -> Type (name, Strings) - | "bool" -> Type (name, Bools) - | "char" -> Type (name, Chars) - | "id" -> Type (name, Ids) + match typ with + | "int" -> Type (name, Ints) + | "float" -> Type (name, Floats) + | "string" -> Type (name, Strings) + | "bool" -> Type (name, Bools) + | "char" -> Type (name, Chars) + | "id" -> Type (name, Ids) | _ -> raise ParseError let rec build_type (name, id, types) input = - match + match String.split_on_char ' ' input - |> List.map String.trim - |> List.filter (fun s -> s <> "") + |> List.map String.trim + |> List.filter (fun s -> s <> "") with - | [] -> - db := DB.build_table !db (Type (id, Strings) :: types) name; + | [] -> + db := DB.build_table !db (Type (id, Strings) :: types) name; current_state := Default; get_response "indent_end" (* "| <|\n|> " *) | [ typ ] -> get_response "err_defn_no_name" (* "Please enter a name for this field\n| " *) - | typ :: field_name :: tl -> ( + | typ :: field_name :: tl -> ( match parse_type (typ, field_name) with - | Type _ as t -> + | Type _ as t -> current_state := BuildType (name, id, types @ [ t ]); get_response "indent" (* "| " *) | exception ParseError -> @@ -825,18 +825,18 @@

67.40%

| _ -> raise (Failure "Should be impossible") [@coverage off]) let process_type input = - match List.filter (fun s -> s <> "") input with + match List.filter (fun s -> s <> "") input with | [] -> get_response "err_defn_needs_type_name" (* "Please enter a type name for the definition\n|> " *) | [ name ] -> get_response "err_defn_needs_ID_name" (* "Please enter a name for the ID of this type\n|> " *) - | name :: id :: tl -> ( + | name :: id :: tl -> ( match DB.get_table name !db with - | Some _ -> + | Some _ -> get_response "err_defn_already_exists" (* "\n Type already defined\n|> " *) - | None -> + | None -> current_state := BuildType (name, id, []); get_response "indent" (* "| " *)) @@ -887,76 +887,78 @@

67.40%

| None -> get_response "err_at_type_DNE") let split_on_substring sub str = - let idxs = ref [ 0 ] in + let idxs = ref [ 0 ] in let sub_len = String.length sub in - for i = 0 to String.length str - sub_len do - if String.sub str i sub_len = sub then - idxs := !idxs @ [ i; i + String.length sub ] - else () + for i = 0 to String.length str - sub_len do + if String.sub str i sub_len = sub then + idxs := !idxs @ [ i; i + String.length sub ] + else () done; - idxs := !idxs @ [ String.length str ]; + idxs := !idxs @ [ String.length str ]; let rec create_lst idxs sub_len str = - match idxs with - | [] -> [] - | s :: e :: t -> String.sub str s (e - s) :: create_lst t sub_len str + match idxs with + | [] -> [] + | s :: e :: t -> String.sub str s (e - s) :: create_lst t sub_len str | _ -> failwith "odd" [@coverage off] in create_lst !idxs sub_len str let parse_compare_exp str = - let str_lst = String.split_on_char ' ' str in - if List.length str_lst <> 3 then raise InvalidExpr + let str_lst = String.split_on_char ' ' str in + if List.length str_lst <> 3 then raise InvalidExpr else - match str_lst with - | [ var; compare; value ] -> + match str_lst with + | [ var; compare; value ] -> ( var, (match compare with - | "=" -> EQ - | "<>" -> NEQ + | "=" -> EQ + | "<>" -> NEQ | ">" -> GT | "<" -> LT - | "<=" -> LTE - | ">=" -> GTE + | "<=" -> LTE + | ">=" -> GTE | _ -> raise InvalidComparison), value ) | _ -> failwith "should be impossible" [@coverage off] let process_find lst = - let cleaned_lst = - lst |> List.map String.trim |> List.filter (fun s -> s <> "") + let cleaned_lst = + lst |> List.map String.trim |> List.filter (fun s -> s <> "") in - if cleaned_lst = [] then get_response "err_find_missing_type" + if cleaned_lst = [] then get_response "err_find_missing_type" else - match DB.get_table (List.hd cleaned_lst) !db with + match DB.get_table (List.hd cleaned_lst) !db with | None -> get_response "err_find_invalid_type" - | Some type_table -> ( + | Some type_table -> ( try cleaned_lst |> List.tl - |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" - |> split_on_substring "and" |> List.map String.trim - |> List.filter (fun s -> s <> "") - |> (fun lst -> if lst = [] then raise InvalidExpr else lst) - |> List.map parse_compare_exp - |> Tbl.process_constraints type_table + |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" + |> split_on_substring "and" |> List.map String.trim + |> List.filter (fun s -> s <> "") + |> (fun lst -> if lst = [] then raise InvalidExpr else lst) + |> List.map parse_compare_exp + |> Tbl.process_constraints type_table with | InvalidExpr -> get_response "err_find_invalid_expr" - | InvalidComparison -> get_response "err_find_invalid_comparison") + | InvalidComparison -> get_response "err_find_invalid_comparison" + | TypeMismatch -> get_response "err_find_wrong_type" + | Not_found -> get_response "err_find_var_DNE") (** [parse_input input] takes in new input and determines the relevant command*) let parse_input input = - match !current_state with - | BuildInstance v -> build_instance v input - | BuildType v -> build_type v input - | Default -> ( + match !current_state with + | BuildInstance v -> build_instance v input + | BuildType v -> build_type v input + | Default -> ( match String.split_on_char ' ' input with | "quit" :: tl -> exit 0 | "help" :: tl -> get_response "help_message" - | "def" :: tl -> process_type tl - | "assign" :: tl -> process_assign tl + | "def" :: tl -> process_type tl + | "assign" :: tl -> process_assign tl | "print" :: tl -> DB.db_to_string !db ^ "\n|> " | "at" :: tl -> process_at tl ^ "\n|> " - | "find" :: tl -> process_find tl - | _ -> + | "find" :: tl -> process_find tl + | _ -> get_response "err_unknown_command" (* "Unknown command. Type help for a list of commands\n|> " *)) end diff --git a/_coverage/lib/database.ml.html b/_coverage/lib/database.ml.html index b5169fe..0c08dee 100644 --- a/_coverage/lib/database.ml.html +++ b/_coverage/lib/database.ml.html @@ -199,17 +199,17 @@

22.50%

| _ -> raise TableExists let build_table database table name = - match + match List.find (fun a -> match a with tname, t -> name = tname) database with - | exception Not_found -> (name, ref (Table.empty table)) :: database + | exception Not_found -> (name, ref (Table.empty table)) :: database | _ -> raise TableExists let drop_table name database = List.filter (fun a -> match a with tname, t -> name <> tname) database let get_table name database = - match List.assoc_opt name database with Some x -> Some !x | None -> None + match List.assoc_opt name database with Some x -> Some !x | None -> None (*Currently doesn't work...*) let get_reference ent database = @@ -238,9 +238,9 @@

22.50%

| _ :: tl -> add_entry table_name new_row tl let add_named_entry table_name new_row database = - match List.assoc_opt table_name database with + match List.assoc_opt table_name database with | None -> raise Not_found - | Some x -> x := Table.insert_named !x new_row + | Some x -> x := Table.insert_named !x new_row end
diff --git a/_coverage/lib/tables.ml.html b/_coverage/lib/tables.ml.html index 23cc68b..f1582b9 100644 --- a/_coverage/lib/tables.ml.html +++ b/_coverage/lib/tables.ml.html @@ -3,7 +3,7 @@ tables.ml — Coverage report - + @@ -15,139 +15,116 @@

lib/tables.ml

-

17.62%

+

33.33%

@@ -155,69 +132,69 @@

17.62%

- - - - + + + + - - + + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - + - - + + - + - - - + + + - - - - + + + + - - - + + + @@ -233,190 +210,187 @@

17.62%

- - + + - + - + - - + + - - - + + + - - + + - - + + - + - - - - - + + + + + - + - - - - - - - - - + + + + + + + + + - + - - - + + + - + - + - - + + - + - + - - - - + + + + - - + + - + - - + + - - + + - + - + - - - - - - + + + + + + - + - + - + - - - - + + + + - + - + - - - - - + + + + + - + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - + - - - - - - - - - - + + + + + + + + + + - + - - - - +
@@ -683,15 +657,9 @@

17.62%

260 261 262 -263 -264 -265
open Utils
 
-exception IndexExists
-exception TypeMismatch
-
 let rec assert_types header a =
   match header with
   | [] -> if a = [] then [] else raise TypeMismatch
@@ -734,24 +702,24 @@ 

17.62%

:: assert_types tl c) let rec reorder_list (a : (string * entry) list) = function - | [] -> if a = [] then [] else raise TypeMismatch - | Some (Type (name, v)) :: tl -> + | [] -> if a = [] then [] else raise TypeMismatch + | Some (Type (name, v)) :: tl -> let vl, rest = let rec extr_name acc = function - | [] -> (None, acc) - | (n, vr) :: rest -> - if n = name then (Some vr, acc @ rest) - else extr_name (acc @ [ (n, vr) ]) rest + | [] -> (None, acc) + | (n, vr) :: rest -> + if n = name then (Some vr, acc @ rest) + else extr_name (acc @ [ (n, vr) ]) rest in - extr_name [] a + extr_name [] a in - vl :: reorder_list rest tl + vl :: reorder_list rest tl | _ -> raise TypeMismatch let rec get_type_index cnt name = function - | [] -> raise Not_found - | Type (n, _) :: tl -> - if n = name then cnt else get_type_index (cnt + 1) name tl + | [] -> raise Not_found + | Type (n, _) :: tl -> + if n = name then cnt else get_type_index (cnt + 1) name tl | _ -> raise TypeMismatch module type Table = sig @@ -865,15 +833,15 @@

17.62%

| Some x :: tl -> x :: deoptionize_list tl | None :: tl -> failwith "Deoptionize on None" - let header = function HashTab (hd, _) -> hd - let hshtable = function HashTab (_, hsh) -> hsh + let header = function HashTab (hd, _) -> hd + let hshtable = function HashTab (_, hsh) -> hsh let deoptionize = function - | Some x -> x + | Some x -> x | None -> raise (Failure "Deoptionize on none") - let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl - let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0) + let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl + let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0) let insert table entries = match Hashtbl.find_opt (hshtable table) (List.hd entries) with @@ -889,14 +857,14 @@

17.62%

copy) ) let insert_named table entries = - let name, value = List.hd entries in - match Hashtbl.find_opt (hshtable table) value with + let name, value = List.hd entries in + match Hashtbl.find_opt (hshtable table) value with | Some x -> raise IndexExists - | None -> - let copy = Hashtbl.copy (hshtable table) in - let reordered = reorder_list entries (optionize (header table)) in - Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered); - HashTab (header table, copy) + | None -> + let copy = Hashtbl.copy (hshtable table) in + let reordered = reorder_list entries (optionize (header table)) in + Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered); + HashTab (header table, copy) let at table id = Some id :: Hashtbl.find (hshtable table) id @@ -906,51 +874,51 @@

17.62%

HashTab (header table, out) let rec table_to_string table = - Hashtbl.fold - (fun id ent acc -> acc ^ shorten (entry_to_string id) ^ build_row ent) - (hshtable table) - (build_row (optionize (header table))) + Hashtbl.fold + (fun id ent acc -> acc ^ shorten (entry_to_string id) ^ build_row ent) + (hshtable table) + (build_row (optionize (header table))) let rec process_constraints tbl lst = - let newHash = Hashtbl.create 0 in - match lst with - | [] -> table_to_string tbl - | hd :: tl -> + let newHash = Hashtbl.create 0 in + match lst with + | [] -> table_to_string tbl + | hd :: tl -> process_constraints (match hd with - | name, cmp, vl -> - let ind = get_type_index 0 name (header tbl) in - let cmp_func = + | name, cmp, vl -> + let ind = get_type_index 0 name (header tbl) in + let cmp_func = match List.find (function - | Type (n, t) -> n = name | _ -> failwith "Impossible") - (header tbl) + | Type (n, t) -> n = name | _ -> failwith "Impossible") + (header tbl) with - | Type (n, t) -> ( - match process_entry vl t with e -> run_constraint cmp e) + | Type (n, t) -> ( + match process_entry vl t with e -> run_constraint cmp e) | _ -> raise (Failure "Impossible") in Hashtbl.iter (fun a b -> - if ind = 0 then + if ind = 0 then if cmp_func a then Hashtbl.add newHash a b else () else - match List.nth b (ind - 1) with + match List.nth b (ind - 1) with | None -> () - | Some v -> - if cmp_func v then Hashtbl.add newHash a b else ()) - (hshtable tbl); - HashTab (header tbl, newHash)) + | Some v -> + if cmp_func v then Hashtbl.add newHash a b else ()) + (hshtable tbl); + HashTab (header tbl, newHash)) tl let exists table name = - let rec follow_header = function + let rec follow_header = function | [] -> raise TypeMismatch - | Type (n, t) :: tl when n = name -> t - | _ :: tl -> follow_header tl + | Type (n, t) :: tl when n = name -> t + | _ :: tl -> follow_header tl in - follow_header (header table) + follow_header (header table) end
diff --git a/_coverage/lib/utils.ml.html b/_coverage/lib/utils.ml.html index df08beb..e4262be 100644 --- a/_coverage/lib/utils.ml.html +++ b/_coverage/lib/utils.ml.html @@ -3,7 +3,7 @@ utils.ml — Coverage report - + @@ -15,7 +15,7 @@

lib/utils.ml

-

0.00%

+

50.00%

@@ -127,13 +87,13 @@

0.00%

- - - - - - - + + + + + + + @@ -149,51 +109,51 @@

0.00%

- + - - + + - - + + - + - + - + - - - + + + - + - - + + - + - + - + - + - + @@ -202,26 +162,26 @@

0.00%

- - - - - - + + + + + + - + - - - + + + - - - - + + + + @@ -378,13 +338,13 @@

0.00%

| Type _ -> "type" let name_map_types t = - match t with - | Strings -> "string" - | Floats -> "float" - | Ints -> "int" - | Chars -> "char" - | Bools -> "bool" - | Ids -> "id" + match t with + | Strings -> "string" + | Floats -> "float" + | Ints -> "int" + | Chars -> "char" + | Bools -> "bool" + | Ids -> "id" let guess_entry input = match float_of_string_opt input with @@ -400,51 +360,51 @@

0.00%

let process_entry input = function | Strings -> String input - | Floats -> ( + | Floats -> ( match float_of_string_opt input with | None -> raise TypeMismatch - | Some v -> Float v) - | Ints -> ( + | Some v -> Float v) + | Ints -> ( match int_of_string_opt input with - | None -> raise TypeMismatch - | Some v -> Int v) + | None -> raise TypeMismatch + | Some v -> Int v) | Chars -> if String.length input = 1 then Char input.[0] else raise TypeMismatch - | Bools -> ( + | Bools -> ( match bool_of_string_opt input with | None -> raise TypeMismatch - | Some v -> Bool v) + | Some v -> Bool v) | Ids -> ( match String.split_on_char '@' input with | [] | [ _ ] | _ :: _ :: _ :: _ -> raise TypeMismatch | [ hd; tl ] -> Id (hd, guess_entry tl)) let make_compare cmp lhs rhs = - match cmp with + match cmp with | LT -> lhs < rhs - | LTE -> lhs <= rhs - | EQ -> lhs = rhs - | NEQ -> lhs <> rhs + | LTE -> lhs <= rhs + | EQ -> lhs = rhs + | NEQ -> lhs <> rhs | GT -> lhs > rhs - | GTE -> lhs >= rhs + | GTE -> lhs >= rhs let run_constraint (cmp : comparison) rhs lhs = - match rhs with - | Float r -> ( + match rhs with + | Float r -> ( match lhs with - | Float l -> make_compare cmp l r + | Float l -> make_compare cmp l r | _ -> failwith "Typing error") - | Int r -> ( + | Int r -> ( match lhs with - | Int l -> make_compare cmp l r + | Int l -> make_compare cmp l r | _ -> failwith "Typing error") | Char r -> ( match lhs with | Char l -> make_compare cmp l r | _ -> failwith "Typing error") - | Bool r -> ( + | Bool r -> ( match lhs with - | Bool l -> make_compare cmp l r + | Bool l -> make_compare cmp l r | _ -> failwith "Typing error") | String r -> ( match lhs with @@ -453,26 +413,26 @@

0.00%

| _ -> raise TypeMismatch let rec entry_to_string ent = - match ent with - | String x -> x - | Float x -> string_of_float x - | Int x -> string_of_int x - | Char x -> String.make 1 x - | Bool x -> string_of_bool x + match ent with + | String x -> x + | Float x -> string_of_float x + | Int x -> string_of_int x + | Char x -> String.make 1 x + | Bool x -> string_of_bool x | Id (a, b) -> a ^ "@" ^ entry_to_string b - | Type (a, b) -> name_map_types b ^ " " ^ a + | Type (a, b) -> name_map_types b ^ " " ^ a let shorten inp = - let str = String.trim inp in - if String.length str < 8 then str ^ "\t\t" - else if String.length str < 16 then str ^ "\t" + let str = String.trim inp in + if String.length str < 8 then str ^ "\t\t" + else if String.length str < 16 then str ^ "\t" else String.sub str 0 16 let rec build_row entlist = - match entlist with - | [] -> "\n\n" - | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs - | None :: xs -> "\t\t" ^ build_row xs + match entlist with + | [] -> "\n\n" + | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs + | None :: xs -> "\t\t" ^ build_row xs let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl
diff --git a/bisect023227872.coverage b/bisect023227872.coverage deleted file mode 100644 index a6ba950..0000000 --- a/bisect023227872.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 22 22 0 0 0 22 0 0 0 24 24 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 9 9 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 59 59 122 51 8 173 9 59 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 83 18 9 0 59 9 59 22 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 1 47 184 137 48 10 lib/cli.ml 181 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1408 1413 1421 1470 1386 851 877 994 1117 1237 1315 1740 2443 2604 2145 2375 2079 2875 1684 1827 2010 1660 1608 1638 1559 3685 3482 3865 3188 3293 3409 3168 3146 3107 4001 4034 4071 4110 4145 4180 4211 3980 4446 4773 4912 4413 4583 4686 4389 4337 4367 4285 5566 5686 5251 5364 5493 5225 5197 6211 6224 6232 6294 6302 6169 6315 7067 7233 7380 7369 7517 7585 7498 7567 7199 7280 7005 7617 6876 6930 6809 7660 6603 6733 6556 6486 7722 5833 5838 5973 6100 6406 8191 8219 8150 8167 8126 8069 8022 8003 7966 7931 7919 7894 7869 7802 8587 8611 8637 8661 8685 8711 8737 8497 8470 8437 8417 8404 8354 9597 9661 9473 9450 9433 9397 9278 9249 9311 9339 9375 9421 9493 9535 9557 9111 9164 9079 9053 9001 8956 8934 8976 8879 10238 10287 10033 10066 10120 10161 10207 10264 10312 10354 9872 9920 9960 9840 10875 10894 10905 10841 10819 10726 10754 10780 10688 10570 181 249 249 249 249 26 9 2 9 1 8 1 1 8 9 0 0 0 0 0 8 11 10 9 9 0 9 42 5 1 47 48 1 9 2 49 111 60 60 60 17 17 1 1 2 18 39 21 21 21 21 16 12 12 12 1 95 22 94 1 22 1 95 217 118 118 118 1 22 1 1 23 49 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 6 11 17 6 51 5 5 56 56 6 6 6 1 0 1 1 0 0 2 5 5 3 8 8 8 4 2 5 1 6 11 28 6 6 6 6 6 5 0 0 1 6 7 7 1 45 8 8 8 0 0 0 1 25 21 0 0 8 1 60 118 56 234 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect059640741.coverage b/bisect059640741.coverage deleted file mode 100644 index a6ba950..0000000 --- a/bisect059640741.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 22 22 0 0 0 22 0 0 0 24 24 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 9 9 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 59 59 122 51 8 173 9 59 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 83 18 9 0 59 9 59 22 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 1 47 184 137 48 10 lib/cli.ml 181 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1408 1413 1421 1470 1386 851 877 994 1117 1237 1315 1740 2443 2604 2145 2375 2079 2875 1684 1827 2010 1660 1608 1638 1559 3685 3482 3865 3188 3293 3409 3168 3146 3107 4001 4034 4071 4110 4145 4180 4211 3980 4446 4773 4912 4413 4583 4686 4389 4337 4367 4285 5566 5686 5251 5364 5493 5225 5197 6211 6224 6232 6294 6302 6169 6315 7067 7233 7380 7369 7517 7585 7498 7567 7199 7280 7005 7617 6876 6930 6809 7660 6603 6733 6556 6486 7722 5833 5838 5973 6100 6406 8191 8219 8150 8167 8126 8069 8022 8003 7966 7931 7919 7894 7869 7802 8587 8611 8637 8661 8685 8711 8737 8497 8470 8437 8417 8404 8354 9597 9661 9473 9450 9433 9397 9278 9249 9311 9339 9375 9421 9493 9535 9557 9111 9164 9079 9053 9001 8956 8934 8976 8879 10238 10287 10033 10066 10120 10161 10207 10264 10312 10354 9872 9920 9960 9840 10875 10894 10905 10841 10819 10726 10754 10780 10688 10570 181 249 249 249 249 26 9 2 9 1 8 1 1 8 9 0 0 0 0 0 8 11 10 9 9 0 9 42 5 1 47 48 1 9 2 49 111 60 60 60 17 17 1 1 2 18 39 21 21 21 21 16 12 12 12 1 95 22 94 1 22 1 95 217 118 118 118 1 22 1 1 23 49 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 6 11 17 6 51 5 5 56 56 6 6 6 1 0 1 1 0 0 2 5 5 3 8 8 8 4 2 5 1 6 11 28 6 6 6 6 6 5 0 0 1 6 7 7 1 45 8 8 8 0 0 0 1 25 21 0 0 8 1 60 118 56 234 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect214014825.coverage b/bisect214014825.coverage deleted file mode 100644 index a6ba950..0000000 --- a/bisect214014825.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 22 22 0 0 0 22 0 0 0 24 24 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 9 9 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 59 59 122 51 8 173 9 59 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 83 18 9 0 59 9 59 22 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 1 47 184 137 48 10 lib/cli.ml 181 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1408 1413 1421 1470 1386 851 877 994 1117 1237 1315 1740 2443 2604 2145 2375 2079 2875 1684 1827 2010 1660 1608 1638 1559 3685 3482 3865 3188 3293 3409 3168 3146 3107 4001 4034 4071 4110 4145 4180 4211 3980 4446 4773 4912 4413 4583 4686 4389 4337 4367 4285 5566 5686 5251 5364 5493 5225 5197 6211 6224 6232 6294 6302 6169 6315 7067 7233 7380 7369 7517 7585 7498 7567 7199 7280 7005 7617 6876 6930 6809 7660 6603 6733 6556 6486 7722 5833 5838 5973 6100 6406 8191 8219 8150 8167 8126 8069 8022 8003 7966 7931 7919 7894 7869 7802 8587 8611 8637 8661 8685 8711 8737 8497 8470 8437 8417 8404 8354 9597 9661 9473 9450 9433 9397 9278 9249 9311 9339 9375 9421 9493 9535 9557 9111 9164 9079 9053 9001 8956 8934 8976 8879 10238 10287 10033 10066 10120 10161 10207 10264 10312 10354 9872 9920 9960 9840 10875 10894 10905 10841 10819 10726 10754 10780 10688 10570 181 249 249 249 249 26 9 2 9 1 8 1 1 8 9 0 0 0 0 0 8 11 10 9 9 0 9 42 5 1 47 48 1 9 2 49 111 60 60 60 17 17 1 1 2 18 39 21 21 21 21 16 12 12 12 1 95 22 94 1 22 1 95 217 118 118 118 1 22 1 1 23 49 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 6 11 17 6 51 5 5 56 56 6 6 6 1 0 1 1 0 0 2 5 5 3 8 8 8 4 2 5 1 6 11 28 6 6 6 6 6 5 0 0 1 6 7 7 1 45 8 8 8 0 0 0 1 25 21 0 0 8 1 60 118 56 234 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect447167505.coverage b/bisect447167505.coverage new file mode 100644 index 0000000..a8ee348 --- /dev/null +++ b/bisect447167505.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 29 29 0 0 0 29 0 0 0 48 31 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 0 21 21 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 10 5 5 5 5 5 35 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 0 35 10 5 5 5 5 0 35 65 0 15 15 15 50 65 65 65 60 60 60 5 10 60 5 75 0 0 0 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 143 143 302 123 20 425 21 143 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 208 54 21 0 178 26 178 29 29 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 21 21 21 21 21 21 21 21 21 0 21 21 21 21 0 0 0 0 0 0 0 0 0 5 5 5 5 5 5 5 5 5 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 108 1 107 424 317 108 10 lib/cli.ml 183 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6238 6251 6259 6321 6329 6196 6342 7094 7260 7407 7396 7544 7612 7525 7594 7226 7307 7032 7644 6903 6957 6836 7687 6630 6760 6583 6513 7749 5860 5865 6000 6127 6433 8218 8246 8177 8194 8153 8096 8049 8030 7993 7958 7946 7921 7896 7829 8614 8638 8664 8688 8712 8738 8764 8524 8497 8464 8444 8431 8381 9624 9688 9764 9827 9500 9477 9460 9424 9305 9276 9338 9366 9402 9448 9520 9562 9584 9138 9191 9106 9080 9028 8983 8961 9003 8906 10385 10434 10180 10213 10267 10308 10354 10411 10459 10501 10019 10067 10107 9987 11022 11041 11052 10988 10966 10873 10901 10927 10835 10717 183 452 452 452 452 34 21 2 21 1 20 1 1 20 21 0 0 0 0 0 20 23 22 21 21 0 21 102 5 1 107 108 1 21 2 109 243 132 132 132 29 29 1 1 2 30 63 33 33 28 28 23 19 19 19 1 137 29 136 1 29 1 137 308 167 167 167 6 29 1 1 35 73 37 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 0 0 0 1 37 33 0 0 15 37 132 167 123 422 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect485952471.coverage b/bisect485952471.coverage new file mode 100644 index 0000000..a8ee348 --- /dev/null +++ b/bisect485952471.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 29 29 0 0 0 29 0 0 0 48 31 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 0 21 21 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 10 5 5 5 5 5 35 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 0 35 10 5 5 5 5 0 35 65 0 15 15 15 50 65 65 65 60 60 60 5 10 60 5 75 0 0 0 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 143 143 302 123 20 425 21 143 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 208 54 21 0 178 26 178 29 29 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 21 21 21 21 21 21 21 21 21 0 21 21 21 21 0 0 0 0 0 0 0 0 0 5 5 5 5 5 5 5 5 5 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 108 1 107 424 317 108 10 lib/cli.ml 183 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6238 6251 6259 6321 6329 6196 6342 7094 7260 7407 7396 7544 7612 7525 7594 7226 7307 7032 7644 6903 6957 6836 7687 6630 6760 6583 6513 7749 5860 5865 6000 6127 6433 8218 8246 8177 8194 8153 8096 8049 8030 7993 7958 7946 7921 7896 7829 8614 8638 8664 8688 8712 8738 8764 8524 8497 8464 8444 8431 8381 9624 9688 9764 9827 9500 9477 9460 9424 9305 9276 9338 9366 9402 9448 9520 9562 9584 9138 9191 9106 9080 9028 8983 8961 9003 8906 10385 10434 10180 10213 10267 10308 10354 10411 10459 10501 10019 10067 10107 9987 11022 11041 11052 10988 10966 10873 10901 10927 10835 10717 183 452 452 452 452 34 21 2 21 1 20 1 1 20 21 0 0 0 0 0 20 23 22 21 21 0 21 102 5 1 107 108 1 21 2 109 243 132 132 132 29 29 1 1 2 30 63 33 33 28 28 23 19 19 19 1 137 29 136 1 29 1 137 308 167 167 167 6 29 1 1 35 73 37 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 0 0 0 1 37 33 0 0 15 37 132 167 123 422 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect516102304.coverage b/bisect516102304.coverage deleted file mode 100644 index a6ba950..0000000 --- a/bisect516102304.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 22 22 0 0 0 22 0 0 0 24 24 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 9 9 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 59 59 122 51 8 173 9 59 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 83 18 9 0 59 9 59 22 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 1 47 184 137 48 10 lib/cli.ml 181 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1408 1413 1421 1470 1386 851 877 994 1117 1237 1315 1740 2443 2604 2145 2375 2079 2875 1684 1827 2010 1660 1608 1638 1559 3685 3482 3865 3188 3293 3409 3168 3146 3107 4001 4034 4071 4110 4145 4180 4211 3980 4446 4773 4912 4413 4583 4686 4389 4337 4367 4285 5566 5686 5251 5364 5493 5225 5197 6211 6224 6232 6294 6302 6169 6315 7067 7233 7380 7369 7517 7585 7498 7567 7199 7280 7005 7617 6876 6930 6809 7660 6603 6733 6556 6486 7722 5833 5838 5973 6100 6406 8191 8219 8150 8167 8126 8069 8022 8003 7966 7931 7919 7894 7869 7802 8587 8611 8637 8661 8685 8711 8737 8497 8470 8437 8417 8404 8354 9597 9661 9473 9450 9433 9397 9278 9249 9311 9339 9375 9421 9493 9535 9557 9111 9164 9079 9053 9001 8956 8934 8976 8879 10238 10287 10033 10066 10120 10161 10207 10264 10312 10354 9872 9920 9960 9840 10875 10894 10905 10841 10819 10726 10754 10780 10688 10570 181 249 249 249 249 26 9 2 9 1 8 1 1 8 9 0 0 0 0 0 8 11 10 9 9 0 9 42 5 1 47 48 1 9 2 49 111 60 60 60 17 17 1 1 2 18 39 21 21 21 21 16 12 12 12 1 95 22 94 1 22 1 95 217 118 118 118 1 22 1 1 23 49 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 6 11 17 6 51 5 5 56 56 6 6 6 1 0 1 1 0 0 2 5 5 3 8 8 8 4 2 5 1 6 11 28 6 6 6 6 6 5 0 0 1 6 7 7 1 45 8 8 8 0 0 0 1 25 21 0 0 8 1 60 118 56 234 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect650975287.coverage b/bisect650975287.coverage new file mode 100644 index 0000000..a8ee348 --- /dev/null +++ b/bisect650975287.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 29 29 0 0 0 29 0 0 0 48 31 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 0 21 21 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 10 5 5 5 5 5 35 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 0 35 10 5 5 5 5 0 35 65 0 15 15 15 50 65 65 65 60 60 60 5 10 60 5 75 0 0 0 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 143 143 302 123 20 425 21 143 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 208 54 21 0 178 26 178 29 29 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 21 21 21 21 21 21 21 21 21 0 21 21 21 21 0 0 0 0 0 0 0 0 0 5 5 5 5 5 5 5 5 5 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 108 1 107 424 317 108 10 lib/cli.ml 183 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6238 6251 6259 6321 6329 6196 6342 7094 7260 7407 7396 7544 7612 7525 7594 7226 7307 7032 7644 6903 6957 6836 7687 6630 6760 6583 6513 7749 5860 5865 6000 6127 6433 8218 8246 8177 8194 8153 8096 8049 8030 7993 7958 7946 7921 7896 7829 8614 8638 8664 8688 8712 8738 8764 8524 8497 8464 8444 8431 8381 9624 9688 9764 9827 9500 9477 9460 9424 9305 9276 9338 9366 9402 9448 9520 9562 9584 9138 9191 9106 9080 9028 8983 8961 9003 8906 10385 10434 10180 10213 10267 10308 10354 10411 10459 10501 10019 10067 10107 9987 11022 11041 11052 10988 10966 10873 10901 10927 10835 10717 183 452 452 452 452 34 21 2 21 1 20 1 1 20 21 0 0 0 0 0 20 23 22 21 21 0 21 102 5 1 107 108 1 21 2 109 243 132 132 132 29 29 1 1 2 30 63 33 33 28 28 23 19 19 19 1 137 29 136 1 29 1 137 308 167 167 167 6 29 1 1 35 73 37 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 0 0 0 1 37 33 0 0 15 37 132 167 123 422 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect775870130.coverage b/bisect775870130.coverage deleted file mode 100644 index a6ba950..0000000 --- a/bisect775870130.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 22 22 0 0 0 22 0 0 0 24 24 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 9 9 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 lib/tables.ml 210 143 135 360 397 423 532 568 594 701 735 761 869 904 930 1038 1073 1099 1205 1238 1264 287 460 631 798 967 1136 1301 1350 207 240 114 166 92 1452 1444 1802 1763 1701 1660 1580 1610 1423 1475 1816 1967 1958 1888 1914 2004 2585 2543 2554 2632 2622 2986 3004 2977 2925 3017 2839 2885 2740 2782 2715 2673 3272 3257 3184 3213 3149 3143 3117 3078 3455 3474 3371 3427 3348 3314 3645 3664 3596 3618 3573 3537 3794 3814 3760 3775 3737 3926 3948 4017 3866 3881 4053 4106 4342 4205 4273 4238 4283 4164 4859 4897 4809 4755 4745 4664 4971 4632 4587 4611 4516 4417 4449 4396 5245 5194 5209 5256 5326 5374 5434 5452 5572 5530 5541 5635 5609 5971 6017 6035 6058 5897 5889 5916 5946 5825 5845 5743 5777 5705 5721 5674 6475 6418 6409 6439 6461 6360 6352 6381 6286 6306 6204 6238 6178 6147 6106 6543 6533 6511 6685 6654 6671 6615 6631 6584 6805 6788 6821 6776 6842 6885 6877 6866 6738 8046 7982 7953 7867 7900 7813 7767 7738 7719 7683 8010 8032 7532 7514 7447 7559 7321 7347 7401 7178 7202 7109 7000 7032 6979 6941 8285 8148 8216 8181 8226 8107 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 59 59 122 51 8 173 9 59 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 83 18 9 0 59 9 59 22 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 9 9 9 9 9 9 9 9 9 0 9 9 9 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 1 47 184 137 48 10 lib/cli.ml 181 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1408 1413 1421 1470 1386 851 877 994 1117 1237 1315 1740 2443 2604 2145 2375 2079 2875 1684 1827 2010 1660 1608 1638 1559 3685 3482 3865 3188 3293 3409 3168 3146 3107 4001 4034 4071 4110 4145 4180 4211 3980 4446 4773 4912 4413 4583 4686 4389 4337 4367 4285 5566 5686 5251 5364 5493 5225 5197 6211 6224 6232 6294 6302 6169 6315 7067 7233 7380 7369 7517 7585 7498 7567 7199 7280 7005 7617 6876 6930 6809 7660 6603 6733 6556 6486 7722 5833 5838 5973 6100 6406 8191 8219 8150 8167 8126 8069 8022 8003 7966 7931 7919 7894 7869 7802 8587 8611 8637 8661 8685 8711 8737 8497 8470 8437 8417 8404 8354 9597 9661 9473 9450 9433 9397 9278 9249 9311 9339 9375 9421 9493 9535 9557 9111 9164 9079 9053 9001 8956 8934 8976 8879 10238 10287 10033 10066 10120 10161 10207 10264 10312 10354 9872 9920 9960 9840 10875 10894 10905 10841 10819 10726 10754 10780 10688 10570 181 249 249 249 249 26 9 2 9 1 8 1 1 8 9 0 0 0 0 0 8 11 10 9 9 0 9 42 5 1 47 48 1 9 2 49 111 60 60 60 17 17 1 1 2 18 39 21 21 21 21 16 12 12 12 1 95 22 94 1 22 1 95 217 118 118 118 1 22 1 1 23 49 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 6 11 17 6 51 5 5 56 56 6 6 6 1 0 1 1 0 0 2 5 5 3 8 8 8 4 2 5 1 6 11 28 6 6 6 6 6 5 0 0 1 6 7 7 1 45 8 8 8 0 0 0 1 25 21 0 0 8 1 60 118 56 234 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect849772197.coverage b/bisect849772197.coverage new file mode 100644 index 0000000..a8ee348 --- /dev/null +++ b/bisect849772197.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 29 29 0 0 0 29 0 0 0 48 31 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 0 21 21 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 10 5 5 5 5 5 35 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 0 35 10 5 5 5 5 0 35 65 0 15 15 15 50 65 65 65 60 60 60 5 10 60 5 75 0 0 0 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 143 143 302 123 20 425 21 143 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 208 54 21 0 178 26 178 29 29 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 21 21 21 21 21 21 21 21 21 0 21 21 21 21 0 0 0 0 0 0 0 0 0 5 5 5 5 5 5 5 5 5 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 108 1 107 424 317 108 10 lib/cli.ml 183 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6238 6251 6259 6321 6329 6196 6342 7094 7260 7407 7396 7544 7612 7525 7594 7226 7307 7032 7644 6903 6957 6836 7687 6630 6760 6583 6513 7749 5860 5865 6000 6127 6433 8218 8246 8177 8194 8153 8096 8049 8030 7993 7958 7946 7921 7896 7829 8614 8638 8664 8688 8712 8738 8764 8524 8497 8464 8444 8431 8381 9624 9688 9764 9827 9500 9477 9460 9424 9305 9276 9338 9366 9402 9448 9520 9562 9584 9138 9191 9106 9080 9028 8983 8961 9003 8906 10385 10434 10180 10213 10267 10308 10354 10411 10459 10501 10019 10067 10107 9987 11022 11041 11052 10988 10966 10873 10901 10927 10835 10717 183 452 452 452 452 34 21 2 21 1 20 1 1 20 21 0 0 0 0 0 20 23 22 21 21 0 21 102 5 1 107 108 1 21 2 109 243 132 132 132 29 29 1 1 2 30 63 33 33 28 28 23 19 19 19 1 137 29 136 1 29 1 137 308 167 167 167 6 29 1 1 35 73 37 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 0 0 0 1 37 33 0 0 15 37 132 167 123 422 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect981581601.coverage b/bisect981581601.coverage new file mode 100644 index 0000000..a8ee348 --- /dev/null +++ b/bisect981581601.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 29 29 0 0 0 29 0 0 0 48 31 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 0 21 21 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 10 5 5 5 5 5 35 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 0 35 10 5 5 5 5 0 35 65 0 15 15 15 50 65 65 65 60 60 60 5 10 60 5 75 0 0 0 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 143 143 302 123 20 425 21 143 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 208 54 21 0 178 26 178 29 29 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 21 21 21 21 21 21 21 21 21 0 21 21 21 21 0 0 0 0 0 0 0 0 0 5 5 5 5 5 5 5 5 5 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 108 1 107 424 317 108 10 lib/cli.ml 183 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6238 6251 6259 6321 6329 6196 6342 7094 7260 7407 7396 7544 7612 7525 7594 7226 7307 7032 7644 6903 6957 6836 7687 6630 6760 6583 6513 7749 5860 5865 6000 6127 6433 8218 8246 8177 8194 8153 8096 8049 8030 7993 7958 7946 7921 7896 7829 8614 8638 8664 8688 8712 8738 8764 8524 8497 8464 8444 8431 8381 9624 9688 9764 9827 9500 9477 9460 9424 9305 9276 9338 9366 9402 9448 9520 9562 9584 9138 9191 9106 9080 9028 8983 8961 9003 8906 10385 10434 10180 10213 10267 10308 10354 10411 10459 10501 10019 10067 10107 9987 11022 11041 11052 10988 10966 10873 10901 10927 10835 10717 183 452 452 452 452 34 21 2 21 1 20 1 1 20 21 0 0 0 0 0 20 23 22 21 21 0 21 102 5 1 107 108 1 21 2 109 243 132 132 132 29 29 1 1 2 30 63 33 33 28 28 23 19 19 19 1 137 29 136 1 29 1 137 308 167 167 167 6 29 1 1 35 73 37 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 0 0 0 1 37 33 0 0 15 37 132 167 123 422 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/data/responses.json b/data/responses.json index 2ab45e9..b5b075e 100644 --- a/data/responses.json +++ b/data/responses.json @@ -25,6 +25,8 @@ "err_find_invalid_expr": "Invalid comparison expression\n|> ", "err_find_invalid_comparison": "Invalid comparison, use <> = > < >= <=\n|> ", "err_find_invalid_type": "Cannot find type of that name\n|> ", + "err_find_wrong_type": "Wrong type in find expression\n|> ", + "err_find_var_DNE": "A variable in the expression does not exist\n|> ", "help_message": "\nTo define a custom dataframe, type the following,\nall valueNames must be unique:\ndef TypeName IdName\n type valueName\n ...\n type valueName\n\n\nTo assign values to the custom types:\nassign TypeName IdValue\n valueName = value\n ...\n valueName = value\n\nTo save to a file, use 'save '\n\nTo find a file, type 'find TypeName expr'\n'expr' must be of the form: 'variable compare value' separated by spaces.\nValid compare opperators include <> = > < <= and >=\nexpr can be chained using 'and'\n\n|> ", "indent_end": "| <|\n|> ", "indent": "| ", diff --git a/lib/cli.ml b/lib/cli.ml index e401960..f0bb7a3 100644 --- a/lib/cli.ml +++ b/lib/cli.ml @@ -265,7 +265,9 @@ module CLI = struct |> Tbl.process_constraints type_table with | InvalidExpr -> get_response "err_find_invalid_expr" - | InvalidComparison -> get_response "err_find_invalid_comparison") + | InvalidComparison -> get_response "err_find_invalid_comparison" + | TypeMismatch -> get_response "err_find_wrong_type" + | Not_found -> get_response "err_find_var_DNE") (** [parse_input input] takes in new input and determines the relevant command*) let parse_input input = diff --git a/lib/tables.ml b/lib/tables.ml index 0392022..4bac436 100644 --- a/lib/tables.ml +++ b/lib/tables.ml @@ -1,8 +1,5 @@ open Utils -exception IndexExists -exception TypeMismatch - let rec assert_types header a = match header with | [] -> if a = [] then [] else raise TypeMismatch diff --git a/lib/tables.mli b/lib/tables.mli index fdea669..025b454 100644 --- a/lib/tables.mli +++ b/lib/tables.mli @@ -1,8 +1,5 @@ open Utils -exception IndexExists -exception TypeMismatch - module type Table = sig type t diff --git a/test/main.ml b/test/main.ml index 0dc188a..0e6947d 100644 --- a/test/main.ml +++ b/test/main.ml @@ -10,7 +10,9 @@ let get_response = CLI.get_response let handle_table_prints str = str |> String.split_on_char '\t' |> List.map String.trim + |> List.filter (fun a -> a <> "") |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" + |> String.trim let rec add_input lst = match lst with @@ -178,7 +180,7 @@ let assign_type_tests = get_response "err_create_field_wrong_type" ); ] ) -let find_tests = +let find_errors_tests = ( fully_assigned_generic, [ ( true, @@ -213,6 +215,52 @@ let find_tests = "empty expr with and", "find Type and ", get_response "err_find_invalid_expr" ); + ( true, + "find Type with wrong type in expr", + "find Type i <= 3.2", + get_response "err_find_wrong_type" ); + ( true, + "find Type with wrong type in expr", + "find Type k <= 3.2", + get_response "err_find_var_DNE" ); + ] ) + +let find_tests = + ( fully_defined_generic @ fully_assigned_generic + @ [ + "assign Type ID2"; + "i = 1"; + "f = 2.71"; + "c = b"; + "b = false"; + "s = good bye"; + ""; + ], + [ + ( true, + "test find for no values with and", + "find Type i = 1 and b = true", + "string ID int i float f char c bool b string s id d" ); + ( true, + "test find for one value with and", + "find Type i = 1 and b = false", + "string ID int i float f char c bool b string s id d ID2 1 2.71 b \ + false good bye" ); + ( true, + "test find for two value with no and", + "find Type i <> 5", + "string ID int i float f char c bool b string s id d ID1 10 3.14 a \ + true hello there ID2 1 2.71 b false good bye" ); + ( true, + "test find for one value with no and", + "find Type i <= 1", + "string ID int i float f char c bool b string s id d ID2 1 2.71 b \ + false good bye" ); + ( true, + "test find for one value with no and", + "find Type f >= 3", + "string ID int i float f char c bool b string s id d ID1 10 3.14 a \ + true hello there" ); ] ) let misc_tests = @@ -223,6 +271,10 @@ let misc_tests = "unknown command error on random input", "asdf", get_response "err_unknown_command" ); + ( true, + "unknown command error on typo input", + "fi nd", + get_response "err_unknown_command" ); ] ) let rec gather_tests_no_print tests = @@ -242,12 +294,12 @@ let tests = def_tests; misc_tests; pre_defn_assign_tests; - find_tests; + find_errors_tests; assign_type_tests; malformed_assign_states; ] |> gather_tests_no_print) - @ ([] |> gather_tests_with_print) + @ ([ find_tests ] |> gather_tests_with_print) let suite = "search test suite" >::: tests let _ = run_test_tt_main suite From 66e0ff497b832e6435164c24d152d86f951adb89 Mon Sep 17 00:00:00 2001 From: JT Klenke Date: Mon, 15 May 2023 01:32:40 -0400 Subject: [PATCH 17/24] Finished CLI test cases to >95% --- _coverage/index.html | 20 +- _coverage/lib/cli.ml.html | 441 ++++++++++++++++----------------- _coverage/lib/database.ml.html | 59 ++--- _coverage/lib/tables.ml.html | 65 +++-- _coverage/lib/utils.ml.html | 56 ++--- bisect170274499.coverage | 1 + bisect189174176.coverage | 1 + bisect248934128.coverage | 1 + bisect447167505.coverage | 1 - bisect485952471.coverage | 1 - bisect615383338.coverage | 1 + bisect623476032.coverage | 1 + bisect650975287.coverage | 1 - bisect849772197.coverage | 1 - bisect981581601.coverage | 1 - data/responses.json | 2 +- lib/cli.ml | 80 +++--- test/main.ml | 116 ++++++++- 18 files changed, 471 insertions(+), 378 deletions(-) create mode 100644 bisect170274499.coverage create mode 100644 bisect189174176.coverage create mode 100644 bisect248934128.coverage delete mode 100644 bisect447167505.coverage delete mode 100644 bisect485952471.coverage create mode 100644 bisect615383338.coverage create mode 100644 bisect623476032.coverage delete mode 100644 bisect650975287.coverage delete mode 100644 bisect849772197.coverage delete mode 100644 bisect981581601.coverage diff --git a/_coverage/index.html b/_coverage/index.html index 2342916..ed424a8 100644 --- a/_coverage/index.html +++ b/_coverage/index.html @@ -3,47 +3,47 @@ Coverage report - +
- + - 70% (129 / 183) + 95% (171 / 179) lib/cli.ml
- + - 22% (9 / 40) + 50% (20 / 40) lib/database.ml
- + - 33% (70 / 210) + 34% (73 / 210) lib/tables.ml
- + - 50% (49 / 98) + 55% (54 / 98) lib/utils.ml diff --git a/_coverage/lib/cli.ml.html b/_coverage/lib/cli.ml.html index fc79197..6f8b4e2 100644 --- a/_coverage/lib/cli.ml.html +++ b/_coverage/lib/cli.ml.html @@ -3,7 +3,7 @@ cli.ml — Coverage report - + @@ -15,47 +15,14 @@

lib/cli.ml

-

70.49%

+

95.53%

@@ -111,11 +78,11 @@

70.49%

- + - - - + + + @@ -228,142 +195,150 @@

70.49%

- - + + - - + + - - - - + + + + - - - - - - - - + + + + + + + + - - - + + + - - - - - - + + + + + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - + - + - + - + - - + + - + - - - - - - + + + + + + - - + + - - + + - + - + - + - - + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - + + - - - + + + + + + + + + + +
@@ -672,6 +647,14 @@

70.49%

302 303 304 +305 +306 +307 +308 +309 +310 +311 +312
module type CliHandler = sig
   val parse_input : string -> string
@@ -702,61 +685,61 @@ 

70.49%

let file_name = "data/responses.json" let get_response response = - let file = Yojson.Basic.from_file file_name in - file |> to_assoc |> List.assoc response |> to_string + let file = Yojson.Basic.from_file file_name in + file |> to_assoc |> List.assoc response |> to_string let reset () = - current_state := Default; + current_state := Default; db := DB.empty let parse_value v = function - | Strings -> String v - | Ints -> ( + | Strings -> String v + | Ints -> ( match int_of_string_opt v with - | Some i -> Int i + | Some i -> Int i | None -> raise ParseError) - | Floats -> ( + | Floats -> ( match float_of_string_opt v with - | Some f -> Float f + | Some f -> Float f | None -> raise ParseError) - | Bools -> ( + | Bools -> ( match bool_of_string_opt v with - | Some b -> Bool b + | Some b -> Bool b | None -> raise ParseError) - | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) - | Ids -> + | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) + | Ids -> Id - (match v |> String.split_on_char '@' |> List.map String.trim with - | [] | [ _ ] | _ :: _ :: _ :: _ -> raise ParseError - | [ hd; tl ] -> (hd, String tl)) + (match v |> String.split_on_char '@' |> List.map String.trim with + | [] | [ _ ] | _ :: _ :: _ :: _ -> raise ParseError + | [ hd; tl ] -> (hd, String tl)) let rec build_instance (name, table, vals) input = - match - input |> String.split_on_char '=' |> List.map String.trim - |> List.filter (fun s -> s <> "") + match + input |> String.split_on_char '=' |> List.map String.trim + |> List.filter (fun s -> s <> "") with - | [] -> + | [] -> DB.add_named_entry name vals !db; - current_state := Default; + current_state := Default; get_response "indent_end" (* "| <|\n|> " *) | [ n ] -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_no_value" (* "Please input a variable and a value\n| " *) - | n :: v :: tl -> ( + | n :: v :: tl -> ( match List.assoc_opt n vals with - | None -> ( + | None -> ( match Tbl.exists table n with | exception TypeMismatch -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_DNE" (* "That field does not exist in this type\n| " *) - | t -> ( + | t -> ( match parse_value v t with - | x -> + | x -> current_state := BuildInstance (name, table, (n, x) :: vals); get_response "indent" (* "| " *) - | exception ParseError -> + | exception ParseError -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_wrong_type" (* "That value does not match the type of the field\n| " *) @@ -767,23 +750,23 @@

70.49%

(* "This field has already been entered\n| " *)) let process_assign input = - match input |> List.map String.trim |> List.filter (fun s -> s <> "") with + match input |> List.map String.trim |> List.filter (fun s -> s <> "") with | [] -> get_response "err_assign_empty" (* "Please input a type name and id\n|> " *) | [ name ] -> get_response "err_assign_no_id" (* "Please input an id for this instance\n|> " *) - | name :: id :: tl -> ( + | name :: id :: tl -> ( match DB.get_table name !db with - | Some t -> + | Some t -> current_state := BuildInstance ( name, t, [ ( (match Tbl.header t with - | Type (n, _) :: tl -> n + | Type (n, _) :: tl -> n | _ -> failwith "impossible" [@coverage off]), String id ); ] ); @@ -792,30 +775,30 @@

70.49%

(* "That type does not exist\n|> " *) let parse_type (typ, name) = - match typ with - | "int" -> Type (name, Ints) - | "float" -> Type (name, Floats) - | "string" -> Type (name, Strings) - | "bool" -> Type (name, Bools) - | "char" -> Type (name, Chars) - | "id" -> Type (name, Ids) + match typ with + | "int" -> Type (name, Ints) + | "float" -> Type (name, Floats) + | "string" -> Type (name, Strings) + | "bool" -> Type (name, Bools) + | "char" -> Type (name, Chars) + | "id" -> Type (name, Ids) | _ -> raise ParseError let rec build_type (name, id, types) input = - match + match String.split_on_char ' ' input - |> List.map String.trim - |> List.filter (fun s -> s <> "") + |> List.map String.trim + |> List.filter (fun s -> s <> "") with - | [] -> - db := DB.build_table !db (Type (id, Strings) :: types) name; + | [] -> + db := DB.build_table !db (Type (id, Strings) :: types) name; current_state := Default; get_response "indent_end" (* "| <|\n|> " *) | [ typ ] -> get_response "err_defn_no_name" (* "Please enter a name for this field\n| " *) - | typ :: field_name :: tl -> ( + | typ :: field_name :: tl -> ( match parse_type (typ, field_name) with - | Type _ as t -> + | Type _ as t -> current_state := BuildType (name, id, types @ [ t ]); get_response "indent" (* "| " *) | exception ParseError -> @@ -825,66 +808,73 @@

70.49%

| _ -> raise (Failure "Should be impossible") [@coverage off]) let process_type input = - match List.filter (fun s -> s <> "") input with + match List.filter (fun s -> s <> "") input with | [] -> get_response "err_defn_needs_type_name" (* "Please enter a type name for the definition\n|> " *) | [ name ] -> get_response "err_defn_needs_ID_name" (* "Please enter a name for the ID of this type\n|> " *) - | name :: id :: tl -> ( + | name :: id :: tl -> ( match DB.get_table name !db with - | Some _ -> + | Some _ -> get_response "err_defn_already_exists" (* "\n Type already defined\n|> " *) - | None -> + | None -> current_state := BuildType (name, id, []); get_response "indent" (* "| " *)) - let process_at = function - | [] | [ "" ] -> + let process_at input = + match input |> List.map String.trim |> List.filter (fun s -> s <> "") with + | [] -> get_response "err_at_empty" (* "Please enter what the type and id of which to get an instance\n|> " *) - | [ name ] -> + | [ name ] -> get_response "err_at_no_id" (* "Please enter an id of the instance you which to get\n|> " *) - | [ name; id ] -> ( + | [ name; id ] -> ( match DB.get_table name !db with - | Some x -> - (x |> Tbl.header |> optionize |> build_row) - ^ "\n" - ^ (String id |> Tbl.at x |> build_row) - | None -> + | Some x -> ( + try + (x |> Tbl.header |> optionize |> build_row) + ^ "\n" + ^ (String id |> Tbl.at x |> build_row) + with Not_found -> get_response "err_at_id_DNE") + | None -> get_response "err_at_invalid_type" (* "No type of that name" *)) - | name :: id :: col :: tl -> ( + | name :: id :: col :: tl -> ( match DB.get_table name !db with - | Some x -> ( - let row = Tbl.at x (String id) in - match int_of_string_opt col with - | None -> - get_response "err_at_column_not_int" - (* "Column number should be an int" *) - | Some i -> ( - match List.nth_opt row i with - | Some e -> ( - match e with - | None -> get_response "no_entry" - | Some e -> ( - match e with - | Id (name, row) -> ( - entry_to_string e ^ "=" - ^ - match DB.get_reference e !db with - | exception Not_found -> get_response "unbound_type" - | l, r -> ( - "\n" - ^ build_row (optionize l) - ^ - match r with - | None -> get_response "unbound_val" - | Some v -> build_row v)) - | _ -> entry_to_string e)) - | None -> get_response "err_at_column_out_of_range")) - | None -> get_response "err_at_type_DNE") + | Some x -> ( + try + let row = Tbl.at x (String id) in + match int_of_string_opt col with + | None -> + get_response "err_at_column_not_int" + (* "Column number should be an int" *) + | Some i -> ( + match List.nth_opt row i with + | Some e -> ( + match e with + | None -> get_response "no_entry" + | Some e -> ( + match e with + | Id (name, row) -> + (entry_to_string e ^ "=" + ^ + match DB.get_reference e !db with + | exception Not_found -> + get_response "unbound_type" + | l, r -> ( + "\n" + ^ build_row (optionize l) + ^ + match r with + | None -> get_response "unbound_val" + | Some v -> build_row v)) + ^ "\n|> " + | _ -> entry_to_string e ^ "\n|> ")) + | None -> get_response "err_at_column_out_of_range") + with Not_found -> get_response "err_at_id_DNE") + | None -> get_response "err_at_invalid_type") let split_on_substring sub str = let idxs = ref [ 0 ] in @@ -946,19 +936,19 @@

70.49%

(** [parse_input input] takes in new input and determines the relevant command*) let parse_input input = - match !current_state with - | BuildInstance v -> build_instance v input - | BuildType v -> build_type v input - | Default -> ( + match !current_state with + | BuildInstance v -> build_instance v input + | BuildType v -> build_type v input + | Default -> ( match String.split_on_char ' ' input with - | "quit" :: tl -> exit 0 + | "quit" :: tl -> exit 0 [@coverage off] | "help" :: tl -> get_response "help_message" - | "def" :: tl -> process_type tl - | "assign" :: tl -> process_assign tl - | "print" :: tl -> DB.db_to_string !db ^ "\n|> " - | "at" :: tl -> process_at tl ^ "\n|> " + | "def" :: tl -> process_type tl + | "assign" :: tl -> process_assign tl + | "print" :: tl -> DB.db_to_string !db ^ "|> " + | "at" :: tl -> process_at tl | "find" :: tl -> process_find tl - | _ -> + | _ -> get_response "err_unknown_command" (* "Unknown command. Type help for a list of commands\n|> " *)) end @@ -966,17 +956,18 @@

70.49%

(** [main ()] prompts for the script to start, then starts it. *) let main () = - let file_name = "data/responses.json" in + let file_name = "data/responses.json" in let welcom_string = let file = Yojson.Basic.from_file file_name in - file |> Yojson.Basic.Util.to_assoc |> List.assoc "welcome" - |> Yojson.Basic.Util.to_string + file |> Yojson.Basic.Util.to_assoc |> List.assoc "welcome" + |> Yojson.Basic.Util.to_string in print_string welcom_string; - print_string "|> "; - while true do - read_line () |> CLI.parse_input |> print_string + print_string "|> "; + while true do + read_line () |> CLI.parse_input |> print_string done + [@@coverage off]
diff --git a/_coverage/lib/database.ml.html b/_coverage/lib/database.ml.html index 0c08dee..b974575 100644 --- a/_coverage/lib/database.ml.html +++ b/_coverage/lib/database.ml.html @@ -3,7 +3,7 @@ database.ml — Coverage report - + @@ -15,7 +15,7 @@

lib/database.ml

-

22.50%

+

50.00%

diff --git a/_coverage/lib/tables.ml.html b/_coverage/lib/tables.ml.html index f1582b9..f99e9f1 100644 --- a/_coverage/lib/tables.ml.html +++ b/_coverage/lib/tables.ml.html @@ -3,7 +3,7 @@ tables.ml — Coverage report - + @@ -15,7 +15,7 @@

lib/tables.ml

-

33.33%

+

34.76%

diff --git a/_coverage/lib/utils.ml.html b/_coverage/lib/utils.ml.html index e4262be..d5dddfe 100644 --- a/_coverage/lib/utils.ml.html +++ b/_coverage/lib/utils.ml.html @@ -3,7 +3,7 @@ utils.ml — Coverage report - + @@ -15,7 +15,7 @@

lib/utils.ml

-

50.00%

+

55.10%

@@ -168,7 +166,7 @@

50.00%

- + @@ -183,7 +181,7 @@

50.00%

- +
@@ -338,13 +336,13 @@

50.00%

| Type _ -> "type" let name_map_types t = - match t with - | Strings -> "string" - | Floats -> "float" - | Ints -> "int" - | Chars -> "char" - | Bools -> "bool" - | Ids -> "id" + match t with + | Strings -> "string" + | Floats -> "float" + | Ints -> "int" + | Chars -> "char" + | Bools -> "bool" + | Ids -> "id" let guess_entry input = match float_of_string_opt input with @@ -413,28 +411,28 @@

50.00%

| _ -> raise TypeMismatch let rec entry_to_string ent = - match ent with - | String x -> x - | Float x -> string_of_float x - | Int x -> string_of_int x - | Char x -> String.make 1 x - | Bool x -> string_of_bool x - | Id (a, b) -> a ^ "@" ^ entry_to_string b - | Type (a, b) -> name_map_types b ^ " " ^ a + match ent with + | String x -> x + | Float x -> string_of_float x + | Int x -> string_of_int x + | Char x -> String.make 1 x + | Bool x -> string_of_bool x + | Id (a, b) -> a ^ "@" ^ entry_to_string b + | Type (a, b) -> name_map_types b ^ " " ^ a let shorten inp = - let str = String.trim inp in - if String.length str < 8 then str ^ "\t\t" - else if String.length str < 16 then str ^ "\t" + let str = String.trim inp in + if String.length str < 8 then str ^ "\t\t" + else if String.length str < 16 then str ^ "\t" else String.sub str 0 16 let rec build_row entlist = - match entlist with - | [] -> "\n\n" - | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs - | None :: xs -> "\t\t" ^ build_row xs + match entlist with + | [] -> "\n\n" + | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs + | None :: xs -> "\t\t" ^ build_row xs -let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl +let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl
diff --git a/bisect170274499.coverage b/bisect170274499.coverage new file mode 100644 index 0000000..9289ab7 --- /dev/null +++ b/bisect170274499.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 42 42 0 0 0 42 0 0 0 69 46 115 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 37 0 37 37 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 16 8 8 8 8 8 56 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 56 16 7 8 7 7 2 56 103 0 23 23 23 75 98 98 98 92 92 92 7 15 92 7 114 14 2 14 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 253 253 512 207 46 719 37 253 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 329 97 37 0 295 43 295 42 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 37 37 37 37 37 37 37 37 37 0 37 37 37 37 10 7 10 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 178 1 177 711 534 178 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/bisect189174176.coverage b/bisect189174176.coverage new file mode 100644 index 0000000..9289ab7 --- /dev/null +++ b/bisect189174176.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 42 42 0 0 0 42 0 0 0 69 46 115 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 37 0 37 37 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 16 8 8 8 8 8 56 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 56 16 7 8 7 7 2 56 103 0 23 23 23 75 98 98 98 92 92 92 7 15 92 7 114 14 2 14 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 253 253 512 207 46 719 37 253 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 329 97 37 0 295 43 295 42 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 37 37 37 37 37 37 37 37 37 0 37 37 37 37 10 7 10 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 178 1 177 711 534 178 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/bisect248934128.coverage b/bisect248934128.coverage new file mode 100644 index 0000000..9289ab7 --- /dev/null +++ b/bisect248934128.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 42 42 0 0 0 42 0 0 0 69 46 115 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 37 0 37 37 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 16 8 8 8 8 8 56 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 56 16 7 8 7 7 2 56 103 0 23 23 23 75 98 98 98 92 92 92 7 15 92 7 114 14 2 14 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 253 253 512 207 46 719 37 253 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 329 97 37 0 295 43 295 42 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 37 37 37 37 37 37 37 37 37 0 37 37 37 37 10 7 10 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 178 1 177 711 534 178 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/bisect447167505.coverage b/bisect447167505.coverage deleted file mode 100644 index a8ee348..0000000 --- a/bisect447167505.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 29 29 0 0 0 29 0 0 0 48 31 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 0 21 21 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 10 5 5 5 5 5 35 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 0 35 10 5 5 5 5 0 35 65 0 15 15 15 50 65 65 65 60 60 60 5 10 60 5 75 0 0 0 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 143 143 302 123 20 425 21 143 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 208 54 21 0 178 26 178 29 29 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 21 21 21 21 21 21 21 21 21 0 21 21 21 21 0 0 0 0 0 0 0 0 0 5 5 5 5 5 5 5 5 5 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 108 1 107 424 317 108 10 lib/cli.ml 183 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6238 6251 6259 6321 6329 6196 6342 7094 7260 7407 7396 7544 7612 7525 7594 7226 7307 7032 7644 6903 6957 6836 7687 6630 6760 6583 6513 7749 5860 5865 6000 6127 6433 8218 8246 8177 8194 8153 8096 8049 8030 7993 7958 7946 7921 7896 7829 8614 8638 8664 8688 8712 8738 8764 8524 8497 8464 8444 8431 8381 9624 9688 9764 9827 9500 9477 9460 9424 9305 9276 9338 9366 9402 9448 9520 9562 9584 9138 9191 9106 9080 9028 8983 8961 9003 8906 10385 10434 10180 10213 10267 10308 10354 10411 10459 10501 10019 10067 10107 9987 11022 11041 11052 10988 10966 10873 10901 10927 10835 10717 183 452 452 452 452 34 21 2 21 1 20 1 1 20 21 0 0 0 0 0 20 23 22 21 21 0 21 102 5 1 107 108 1 21 2 109 243 132 132 132 29 29 1 1 2 30 63 33 33 28 28 23 19 19 19 1 137 29 136 1 29 1 137 308 167 167 167 6 29 1 1 35 73 37 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 0 0 0 1 37 33 0 0 15 37 132 167 123 422 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect485952471.coverage b/bisect485952471.coverage deleted file mode 100644 index a8ee348..0000000 --- a/bisect485952471.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 29 29 0 0 0 29 0 0 0 48 31 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 0 21 21 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 10 5 5 5 5 5 35 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 0 35 10 5 5 5 5 0 35 65 0 15 15 15 50 65 65 65 60 60 60 5 10 60 5 75 0 0 0 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 143 143 302 123 20 425 21 143 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 208 54 21 0 178 26 178 29 29 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 21 21 21 21 21 21 21 21 21 0 21 21 21 21 0 0 0 0 0 0 0 0 0 5 5 5 5 5 5 5 5 5 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 108 1 107 424 317 108 10 lib/cli.ml 183 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6238 6251 6259 6321 6329 6196 6342 7094 7260 7407 7396 7544 7612 7525 7594 7226 7307 7032 7644 6903 6957 6836 7687 6630 6760 6583 6513 7749 5860 5865 6000 6127 6433 8218 8246 8177 8194 8153 8096 8049 8030 7993 7958 7946 7921 7896 7829 8614 8638 8664 8688 8712 8738 8764 8524 8497 8464 8444 8431 8381 9624 9688 9764 9827 9500 9477 9460 9424 9305 9276 9338 9366 9402 9448 9520 9562 9584 9138 9191 9106 9080 9028 8983 8961 9003 8906 10385 10434 10180 10213 10267 10308 10354 10411 10459 10501 10019 10067 10107 9987 11022 11041 11052 10988 10966 10873 10901 10927 10835 10717 183 452 452 452 452 34 21 2 21 1 20 1 1 20 21 0 0 0 0 0 20 23 22 21 21 0 21 102 5 1 107 108 1 21 2 109 243 132 132 132 29 29 1 1 2 30 63 33 33 28 28 23 19 19 19 1 137 29 136 1 29 1 137 308 167 167 167 6 29 1 1 35 73 37 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 0 0 0 1 37 33 0 0 15 37 132 167 123 422 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect615383338.coverage b/bisect615383338.coverage new file mode 100644 index 0000000..9289ab7 --- /dev/null +++ b/bisect615383338.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 42 42 0 0 0 42 0 0 0 69 46 115 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 37 0 37 37 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 16 8 8 8 8 8 56 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 56 16 7 8 7 7 2 56 103 0 23 23 23 75 98 98 98 92 92 92 7 15 92 7 114 14 2 14 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 253 253 512 207 46 719 37 253 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 329 97 37 0 295 43 295 42 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 37 37 37 37 37 37 37 37 37 0 37 37 37 37 10 7 10 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 178 1 177 711 534 178 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/bisect623476032.coverage b/bisect623476032.coverage new file mode 100644 index 0000000..9289ab7 --- /dev/null +++ b/bisect623476032.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 42 42 0 0 0 42 0 0 0 69 46 115 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 37 0 37 37 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 16 8 8 8 8 8 56 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 56 16 7 8 7 7 2 56 103 0 23 23 23 75 98 98 98 92 92 92 7 15 92 7 114 14 2 14 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 253 253 512 207 46 719 37 253 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 329 97 37 0 295 43 295 42 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 37 37 37 37 37 37 37 37 37 0 37 37 37 37 10 7 10 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 178 1 177 711 534 178 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/bisect650975287.coverage b/bisect650975287.coverage deleted file mode 100644 index a8ee348..0000000 --- a/bisect650975287.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 29 29 0 0 0 29 0 0 0 48 31 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 0 21 21 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 10 5 5 5 5 5 35 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 0 35 10 5 5 5 5 0 35 65 0 15 15 15 50 65 65 65 60 60 60 5 10 60 5 75 0 0 0 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 143 143 302 123 20 425 21 143 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 208 54 21 0 178 26 178 29 29 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 21 21 21 21 21 21 21 21 21 0 21 21 21 21 0 0 0 0 0 0 0 0 0 5 5 5 5 5 5 5 5 5 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 108 1 107 424 317 108 10 lib/cli.ml 183 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6238 6251 6259 6321 6329 6196 6342 7094 7260 7407 7396 7544 7612 7525 7594 7226 7307 7032 7644 6903 6957 6836 7687 6630 6760 6583 6513 7749 5860 5865 6000 6127 6433 8218 8246 8177 8194 8153 8096 8049 8030 7993 7958 7946 7921 7896 7829 8614 8638 8664 8688 8712 8738 8764 8524 8497 8464 8444 8431 8381 9624 9688 9764 9827 9500 9477 9460 9424 9305 9276 9338 9366 9402 9448 9520 9562 9584 9138 9191 9106 9080 9028 8983 8961 9003 8906 10385 10434 10180 10213 10267 10308 10354 10411 10459 10501 10019 10067 10107 9987 11022 11041 11052 10988 10966 10873 10901 10927 10835 10717 183 452 452 452 452 34 21 2 21 1 20 1 1 20 21 0 0 0 0 0 20 23 22 21 21 0 21 102 5 1 107 108 1 21 2 109 243 132 132 132 29 29 1 1 2 30 63 33 33 28 28 23 19 19 19 1 137 29 136 1 29 1 137 308 167 167 167 6 29 1 1 35 73 37 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 0 0 0 1 37 33 0 0 15 37 132 167 123 422 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect849772197.coverage b/bisect849772197.coverage deleted file mode 100644 index a8ee348..0000000 --- a/bisect849772197.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 29 29 0 0 0 29 0 0 0 48 31 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 0 21 21 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 10 5 5 5 5 5 35 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 0 35 10 5 5 5 5 0 35 65 0 15 15 15 50 65 65 65 60 60 60 5 10 60 5 75 0 0 0 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 143 143 302 123 20 425 21 143 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 208 54 21 0 178 26 178 29 29 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 21 21 21 21 21 21 21 21 21 0 21 21 21 21 0 0 0 0 0 0 0 0 0 5 5 5 5 5 5 5 5 5 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 108 1 107 424 317 108 10 lib/cli.ml 183 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6238 6251 6259 6321 6329 6196 6342 7094 7260 7407 7396 7544 7612 7525 7594 7226 7307 7032 7644 6903 6957 6836 7687 6630 6760 6583 6513 7749 5860 5865 6000 6127 6433 8218 8246 8177 8194 8153 8096 8049 8030 7993 7958 7946 7921 7896 7829 8614 8638 8664 8688 8712 8738 8764 8524 8497 8464 8444 8431 8381 9624 9688 9764 9827 9500 9477 9460 9424 9305 9276 9338 9366 9402 9448 9520 9562 9584 9138 9191 9106 9080 9028 8983 8961 9003 8906 10385 10434 10180 10213 10267 10308 10354 10411 10459 10501 10019 10067 10107 9987 11022 11041 11052 10988 10966 10873 10901 10927 10835 10717 183 452 452 452 452 34 21 2 21 1 20 1 1 20 21 0 0 0 0 0 20 23 22 21 21 0 21 102 5 1 107 108 1 21 2 109 243 132 132 132 29 29 1 1 2 30 63 33 33 28 28 23 19 19 19 1 137 29 136 1 29 1 137 308 167 167 167 6 29 1 1 35 73 37 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 0 0 0 1 37 33 0 0 15 37 132 167 123 422 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/bisect981581601.coverage b/bisect981581601.coverage deleted file mode 100644 index a8ee348..0000000 --- a/bisect981581601.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 29 29 0 0 0 29 0 0 0 48 31 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 0 21 21 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 10 5 5 5 5 5 35 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 0 35 10 5 5 5 5 0 35 65 0 15 15 15 50 65 65 65 60 60 60 5 10 60 5 75 0 0 0 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 143 143 302 123 20 425 21 143 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 208 54 21 0 178 26 178 29 29 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 21 21 21 21 21 21 21 21 21 0 21 21 21 21 0 0 0 0 0 0 0 0 0 5 5 5 5 5 5 5 5 5 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 108 1 107 424 317 108 10 lib/cli.ml 183 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6238 6251 6259 6321 6329 6196 6342 7094 7260 7407 7396 7544 7612 7525 7594 7226 7307 7032 7644 6903 6957 6836 7687 6630 6760 6583 6513 7749 5860 5865 6000 6127 6433 8218 8246 8177 8194 8153 8096 8049 8030 7993 7958 7946 7921 7896 7829 8614 8638 8664 8688 8712 8738 8764 8524 8497 8464 8444 8431 8381 9624 9688 9764 9827 9500 9477 9460 9424 9305 9276 9338 9366 9402 9448 9520 9562 9584 9138 9191 9106 9080 9028 8983 8961 9003 8906 10385 10434 10180 10213 10267 10308 10354 10411 10459 10501 10019 10067 10107 9987 11022 11041 11052 10988 10966 10873 10901 10927 10835 10717 183 452 452 452 452 34 21 2 21 1 20 1 1 20 21 0 0 0 0 0 20 23 22 21 21 0 21 102 5 1 107 108 1 21 2 109 243 132 132 132 29 29 1 1 2 30 63 33 33 28 28 23 19 19 19 1 137 29 136 1 29 1 137 308 167 167 167 6 29 1 1 35 73 37 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 0 0 0 1 37 33 0 0 15 37 132 167 123 422 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/data/responses.json b/data/responses.json index b5b075e..1547ff5 100644 --- a/data/responses.json +++ b/data/responses.json @@ -16,8 +16,8 @@ "err_at_no_id": "Please enter an id of the instance you which to get\n|> ", "err_at_column_not_int": "Column number should be an int\n|> ", "err_at_invalid_type": "No type of that name\n|> ", - "err_at_type_DNE": "No type of that name\n|> ", "err_at_column_out_of_range": "Column out of range. Hint: Index starts at 0\n|> ", + "err_at_id_DNE": "That ID does not exist\n|> ", "unbound_type": "\n|> ", "unbound_val": "\n|> ", "no_entry": "No entry\n|> ", diff --git a/lib/cli.ml b/lib/cli.ml index f0bb7a3..8ca976c 100644 --- a/lib/cli.ml +++ b/lib/cli.ml @@ -165,8 +165,9 @@ module CLI = struct current_state := BuildType (name, id, []); get_response "indent" (* "| " *)) - let process_at = function - | [] | [ "" ] -> + let process_at input = + match input |> List.map String.trim |> List.filter (fun s -> s <> "") with + | [] -> get_response "err_at_empty" (* "Please enter what the type and id of which to get an instance\n|> " *) | [ name ] -> @@ -174,42 +175,48 @@ module CLI = struct (* "Please enter an id of the instance you which to get\n|> " *) | [ name; id ] -> ( match DB.get_table name !db with - | Some x -> - (x |> Tbl.header |> optionize |> build_row) - ^ "\n" - ^ (String id |> Tbl.at x |> build_row) + | Some x -> ( + try + (x |> Tbl.header |> optionize |> build_row) + ^ "\n" + ^ (String id |> Tbl.at x |> build_row) + with Not_found -> get_response "err_at_id_DNE") | None -> get_response "err_at_invalid_type" (* "No type of that name" *)) | name :: id :: col :: tl -> ( match DB.get_table name !db with | Some x -> ( - let row = Tbl.at x (String id) in - match int_of_string_opt col with - | None -> - get_response "err_at_column_not_int" - (* "Column number should be an int" *) - | Some i -> ( - match List.nth_opt row i with - | Some e -> ( - match e with - | None -> get_response "no_entry" - | Some e -> ( - match e with - | Id (name, row) -> ( - entry_to_string e ^ "=" - ^ - match DB.get_reference e !db with - | exception Not_found -> get_response "unbound_type" - | l, r -> ( - "\n" - ^ build_row (optionize l) - ^ - match r with - | None -> get_response "unbound_val" - | Some v -> build_row v)) - | _ -> entry_to_string e)) - | None -> get_response "err_at_column_out_of_range")) - | None -> get_response "err_at_type_DNE") + try + let row = Tbl.at x (String id) in + match int_of_string_opt col with + | None -> + get_response "err_at_column_not_int" + (* "Column number should be an int" *) + | Some i -> ( + match List.nth_opt row i with + | Some e -> ( + match e with + | None -> get_response "no_entry" + | Some e -> ( + match e with + | Id (name, row) -> + (entry_to_string e ^ "=" + ^ + match DB.get_reference e !db with + | exception Not_found -> + get_response "unbound_type" + | l, r -> ( + "\n" + ^ build_row (optionize l) + ^ + match r with + | None -> get_response "unbound_val" + | Some v -> build_row v)) + ^ "\n|> " + | _ -> entry_to_string e ^ "\n|> ")) + | None -> get_response "err_at_column_out_of_range") + with Not_found -> get_response "err_at_id_DNE") + | None -> get_response "err_at_invalid_type") let split_on_substring sub str = let idxs = ref [ 0 ] in @@ -276,12 +283,12 @@ module CLI = struct | BuildType v -> build_type v input | Default -> ( match String.split_on_char ' ' input with - | "quit" :: tl -> exit 0 + | "quit" :: tl -> exit 0 [@coverage off] | "help" :: tl -> get_response "help_message" | "def" :: tl -> process_type tl | "assign" :: tl -> process_assign tl - | "print" :: tl -> DB.db_to_string !db ^ "\n|> " - | "at" :: tl -> process_at tl ^ "\n|> " + | "print" :: tl -> DB.db_to_string !db ^ "|> " + | "at" :: tl -> process_at tl | "find" :: tl -> process_find tl | _ -> get_response "err_unknown_command" @@ -302,3 +309,4 @@ let main () = while true do read_line () |> CLI.parse_input |> print_string done + [@@coverage off] diff --git a/test/main.ml b/test/main.ml index 0e6947d..a150e72 100644 --- a/test/main.ml +++ b/test/main.ml @@ -123,7 +123,14 @@ let malformed_assign_states = ] ) let pre_defn_assign_tests = - ( [ "def Person Name"; "int age"; "float bank"; ""; "assign Person John" ], + ( [ + "def Person Name"; + "int age"; + "float bank"; + "id friend"; + ""; + "assign Person John"; + ], [ ( true, "can define types out of order bank", @@ -141,6 +148,26 @@ let pre_defn_assign_tests = "can define types out of order empty end", "", get_response "indent_end" ); + ( false, + "testing the id system doesnt throw errors 1", + "assign Person Jim", + get_response "indent" ); + ( false, + "testing the id system throws error when no @", + "friend = Person", + get_response "err_create_field_wrong_type" ); + ( false, + "testing the id system on multiple @", + "friend = Person @ John @ Jim", + get_response "err_create_field_wrong_type" ); + ( false, + "testing the id system doesnt throw errors 2", + "friend = Person @ John", + get_response "indent" ); + ( false, + "testing the id system doesnt throw errors 3", + "", + get_response "indent_end" ); ( true, "entry doesnt exist error", "test = 5", @@ -226,7 +253,7 @@ let find_errors_tests = ] ) let find_tests = - ( fully_defined_generic @ fully_assigned_generic + ( fully_assigned_generic @ [ "assign Type ID2"; "i = 1"; @@ -263,6 +290,84 @@ let find_tests = true hello there" ); ] ) +let at_tests = + ( fully_assigned_generic, + [ + (true, "test empty at statement ", "at ", get_response "err_at_empty"); + (true, "test at with no id", "at Type", get_response "err_at_no_id"); + ( true, + "test at statement with invalid id ", + "at Type ID", + get_response "err_at_id_DNE" ); + ( true, + "test at statement with incorrect type name", + "at Tupe ID", + get_response "err_at_invalid_type" ); + ( true, + "test at statement with non int column number", + "at Type ID1 i", + get_response "err_at_column_not_int" ); + ( true, + "test at statement with out of range column number", + "at Type ID1 10", + get_response "err_at_column_out_of_range" ); + ( true, + "test at statement on no entry column", + "at Type ID1 6", + get_response "no_entry" ); + ( true, + "test at statement on column with int value 10 ", + "at Type ID1 1", + "10\n|> " ); + ( true, + "test empty at statement ", + "at Type ID 1", + get_response "err_at_id_DNE" ); + ( true, + "test empty at statement ", + "at Tye ID 1", + get_response "err_at_invalid_type" ); + ( true, + "test empty at statement ", + "assign Type ID2", + get_response "indent" ); + ( false, + "test empty at statement ", + "d = Type @ asdf", + get_response "indent" ); + (false, "test empty at statement ", "", get_response "indent_end"); + ( false, + "test empty at statement ", + "at Type ID2 6", + "Type@asdf=\n\ + string ID\tint i\t\tfloat f\t\tchar c\t\tbool b\t\tstring s\tid d\t\t\n\n\ + \n\ + |> \n\ + |> " ); + ] ) + +let print_tests = + ( fully_assigned_generic, + [ + ( true, + "test print on fully defined generic", + "print", + "Table: Type\n\n\ + string ID int i float f char c bool b string s id d ID1 10 3.14 a \ + true hello there |>" ); + ] ) + +let at_id_tests = + ( fully_assigned_generic @ [ "assign Type ID2"; "d = Type @ ID1"; "" ], + [ + ( true, + "at tests on id instance", + "at Type ID2 6", + "Type@ID1=\n\ + string ID int i float f char c bool b string s id d ID1 10 3.14 a \ + true hello there |>" ); + ] ) + let misc_tests = ( [], [ @@ -283,11 +388,11 @@ let rec gather_tests_no_print tests = | (primer, tests) :: t -> make_test primer tests false @ gather_tests_no_print t -let gather_tests_with_print tests = +let rec gather_tests_with_print tests = match tests with | [] -> [] | (primer, tests) :: t -> - make_test primer tests true @ gather_tests_no_print t + make_test primer tests true @ gather_tests_with_print t let tests = ([ @@ -297,9 +402,10 @@ let tests = find_errors_tests; assign_type_tests; malformed_assign_states; + at_tests; ] |> gather_tests_no_print) - @ ([ find_tests ] |> gather_tests_with_print) + @ ([ find_tests; print_tests; at_id_tests ] |> gather_tests_with_print) let suite = "search test suite" >::: tests let _ = run_test_tt_main suite From 446f1e6cc2beb78062b48b183e4ffcfafad52aef Mon Sep 17 00:00:00 2001 From: JT Klenke Date: Mon, 15 May 2023 01:33:10 -0400 Subject: [PATCH 18/24] removed bisect --- _coverage/coverage.css | 500 ----------------- _coverage/coverage.js | 164 ------ _coverage/highlight.pack.js | 2 - _coverage/index.html | 53 -- _coverage/lib/cli.ml.html | 976 --------------------------------- _coverage/lib/database.ml.html | 241 -------- _coverage/lib/tables.ml.html | 927 ------------------------------- _coverage/lib/utils.ml.html | 441 --------------- bisect170274499.coverage | 1 - bisect189174176.coverage | 1 - bisect248934128.coverage | 1 - bisect615383338.coverage | 1 - bisect623476032.coverage | 1 - 13 files changed, 3309 deletions(-) delete mode 100644 _coverage/coverage.css delete mode 100644 _coverage/coverage.js delete mode 100644 _coverage/highlight.pack.js delete mode 100644 _coverage/index.html delete mode 100644 _coverage/lib/cli.ml.html delete mode 100644 _coverage/lib/database.ml.html delete mode 100644 _coverage/lib/tables.ml.html delete mode 100644 _coverage/lib/utils.ml.html delete mode 100644 bisect170274499.coverage delete mode 100644 bisect189174176.coverage delete mode 100644 bisect248934128.coverage delete mode 100644 bisect615383338.coverage delete mode 100644 bisect623476032.coverage diff --git a/_coverage/coverage.css b/_coverage/coverage.css deleted file mode 100644 index 35bb22a..0000000 --- a/_coverage/coverage.css +++ /dev/null @@ -1,500 +0,0 @@ -:root, .light:root { - --main-background: #fff; - --code-background: transparent; - --line-numbers-background: rgba(0, 0, 0, 0.025); - --navbar-background: #eee; - - --meter-unvisited-color: #f9c3c3; - --meter-visited-color: #9ed09f; - --meter-separator-color: white; - - --color: #000; - --dirname-color: #bbb; - --stats-color: #aaa; - --underline-color: #ddd; - --visited-color: #eaffea; - --visited-number-color: rgba(64, 192, 64, 0.2); - --unvisited-color: #ffecec; - --unvisited-number-color: rgba(255, 128, 128, 0.5); - --somevisited-color: #ffd; - --highlight-color: #a0fbff; - --line-number-color: rgba(0, 0, 0, 0.4); - --unvisited-margin-color: #d69e9e; - --border: #eee; - --navbar-border: #ddd; - --code-color: #000; - --hljs-link: #6a737d; - --hljs-keyword: #d73a49; - --hljs-regexp: #032f62; - --hljs-title: #900; - --hljs-type: #6f42c1; - --hljs-meta: #22863a; - --hljs-variable: #005cc5; -} - -.dark:root { - --main-background: #202020; - --code-background: #222; - --line-numbers-background: rgba(0, 0, 0, 0.125); - --navbar-background: #202020; - - --meter-unvisited-color: #622; - --meter-visited-color: #252; - --meter-separator-color: black; - - --color: #bebebe; - --dirname-color: #666; - --stats-color: #555; - --underline-color: #444; - --visited-color: #002800; - --visited-number-color: #252; - --unvisited-color: #380000; - --unvisited-number-color: #822; - --somevisited-color: #303000; - --highlight-color: #303e3f; - --line-number-color: rgba(230, 230, 230, 0.3); - --unvisited-margin-color: #622; - --border: #333; - --navbar-border: #333; - --code-color: #ccc; - --hljs-link: #999; - --hljs-keyword: #cda869; - --hljs-regexp: #f9ee98; - --hljs-title: #dcdcaa; - --hljs-type: #ac885b; - --hljs-meta: #82aaff; - --hljs-variable: #cf6a4c; -} - -@media (prefers-color-scheme: dark) { - :root { - --main-background: #202020; - --code-background: #222; - --line-numbers-background: rgba(0, 0, 0, 0.125); - --navbar-background: #202020; - - --meter-unvisited-color: #622; - --meter-visited-color: #252; - --meter-separator-color: black; - - --color: #bebebe; - --dirname-color: #666; - --underline-color: #444; - --visited-color: #002800; - --visited-number-color: #252; - --unvisited-color: #380000; - --unvisited-number-color: #822; - --somevisited-color: #303000; - --highlight-color: #303e3f; - --line-number-color: rgba(230, 230, 230, 0.3); - --unvisited-margin-color: #622; - --border: #333; - --navbar-border: #333; - --code-color: #ccc; - --hljs-link: #999; - --hljs-keyword: #cda869; - --hljs-regexp: #f9ee98; - --hljs-title: #dcdcaa; - --hljs-type: #ac885b; - --hljs-meta: #82aaff; - --hljs-variable: #cf6a4c; - } -} - -body { - margin: 0; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 16px; - line-height: 1.5em; - background-color: var(--main-background); -} - -pre { - margin: 0; - font-family: "Fira Code", "Cascadia Code", Consolas, "Liberation Mono", Menlo, Courier, monospace; - font-size: 13px; - color: var(--code-color); - cursor: text; -} - -code { - font-family: inherit; -} - -a { - text-decoration: none; - color: inherit; -} - -a:visited { - color: inherit; -} - -#header { - color: var(--color); -} - -h1 { - display: inline-block; - margin: 1.5em 1.5em 0.75em 1.5em; -} - -.dirname { - color: var(--dirname-color); -} - -h2 { - display: inline-block; - position: relative; - top: -1px; -} - -#footer { - margin: 1em 0 1em 4em; - color: #aaa; - font-size: 12px; -} - -#footer a { - color: #666; - border-bottom: 1px solid #ccc; -} - -#footer a:visited { - color: #666; -} - -#navbar { - position: fixed; - top: 0; - left: 0; - width: 1em; - height: 100%; - background-color: var(--navbar-background); - border-right: 1px solid var(--navbar-border); - cursor: pointer; -} - -#navbar span { - display: block; - position: absolute; - width: 100%; - height: 5px; -} - -#navbar .unvisited, #navbar .some-visited { - background-color: var(--unvisited-margin-color); -} - -#report { - border-top: 1px solid var(--border); - border-bottom: 1px solid var(--border); - overflow: hidden; -} - -#lines-layer { - position: absolute; - z-index: -100; - width: 100%; - background-color: var(--code-background); -} - -#lines-layer span { - display: inline-block; - width: 100%; -} - -a[id] { - display: block; - position: relative; - top: -5.5em; -} - -#lines-layer .unvisited { - background-color: var(--unvisited-color); -} - -#lines-layer .visited { - background-color: var(--visited-color); -} - -#lines-layer .some-visited { - background-color: var(--somevisited-color); -} - -a[id]:target + span { - -webkit-animation: highlight-blank 0.5s; - -moz-animation: highlight-blank 0.5s; - -o-animation: highlight-blank 0.5s; - animation: highlight-blank 0.5s; -} - -a[id]:target + .unvisited { - -webkit-animation: highlight-unvisited 0.5s; - -moz-animation: highlight-unvisited 0.5s; - -o-animation: highlight-unvisited 0.5s; - animation: highlight-unvisited 0.5s; -} - -a[id]:target + .visited { - -webkit-animation: highlight-visited 0.5s; - -moz-animation: highlight-visited 0.5s; - -o-animation: highlight-visited 0.5s; - animation: highlight-visited 0.5s; -} - -a[id]:target + .some-visited { - -webkit-animation: highlight-some-visited 0.5s; - -moz-animation: highlight-some-visited 0.5s; - -o-animation: highlight-some-visited 0.5s; - animation: highlight-some-visited 0.5s; -} - -@-webkit-keyframes highlight-blank { - from { background-color: var(--highlight-color); } - to { background-color: transparent; } -} - -@-moz-keyframes highlight-blank { - from { background-color: var(--highlight-color); } - to { background-color: transparent; } -} - -@-o-keyframes highlight-blank { - from { background-color: var(--highlight-color); } - to { background-color: transparent; } -} - -@keyframes highlight-blank { - from { background-color: var(--highlight-color); } - to { background-color: transparent; } -} - -@-webkit-keyframes highlight-unvisited { - from { background-color: var(--highlight-color); } - to { background-color: var(--unvisited-color); } -} - -@-moz-keyframes highlight-unvisited { - from { background-color: var(--highlight-color); } - to { background-color: var(--unvisited-color); } -} - -@-o-keyframes highlight-unvisited { - from { background-color: var(--highlight-color); } - to { background-color: var(--unvisited-color); } -} - -@keyframes highlight-unvisited { - from { background-color: var(--highlight-color); } - to { background-color: var(--unvisited-color); } -} - -@-webkit-keyframes highlight-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--visited-color); } -} - -@-moz-keyframes highlight-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--visited-color); } -} - -@-o-keyframes highlight-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--visited-color); } -} - -@keyframes highlight-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--visited-color); } -} - -@-webkit-keyframes highlight-some-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--somevisited-color); } -} - -@-moz-keyframes highlight-some-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--somevisited-color); } -} - -@-o-keyframes highlight-some-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--somevisited-color); } -} - -@keyframes highlight-some-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--somevisited-color); } -} - -#line-numbers { - float: left; - border-right: 1px solid var(--border); - margin-right: 1em; - color: var(--line-number-color); - background-color: var(--line-numbers-background); - text-align: right; -} - -#line-numbers a { - display: inline-block; - padding-left: 2.35em; - padding-right: 1em; - text-decoration: none; - color: var(--line-number-color); -} - -#line-numbers .unvisited { - background-color: var(--unvisted-number-color); -} - -#line-numbers .visited { - background-color: var(--visted-number-color); -} - -code span[data-count] { - background-color: var(--visited-number-color); -} - -code span[data-count="0"] { - background-color: var(--unvisited-number-color); -} - -#tool-tip { - display: none; - position: fixed; - padding: 0 0.25em; - background-color: black; - color: white; -} - -#tool-tip.visible { - display: block; -} - -#files { - padding: 1.5em 4em; - background-color: var(--code-background); - border-top: 1px solid var(--border); - border-bottom: 1px solid var(--border); -} - -.meter { - display: inline-block; - position: relative; - top: 3px; - width: 5em; - height: 1em; - background-color: var(--meter-unvisited-color); -} - -.covered { - display: inline-block; - position: absolute; - width: 50%; - height: 100%; - background-color: var(--meter-visited-color); - border-right: 1px solid var(--meter-separator-color); -} - -#files div { - display: flex; -} - -summary { - cursor: pointer; - display: flex; -} - -.summary-indicator { - display: inline-block; - width: 1em; - color: var(--color); -} - -/* Adds indentation to the directory tree */ -details > details, details > div { - margin-left: 1em; -} - -details > summary > .summary-indicator { - text-align: center; - font-weight: bold; -} - -details > summary > .summary-indicator::before { - content: "+"; -} - -details[open] > summary > .summary-indicator::before { - content: "-"; -} - -.percentage { - display: inline-block; - min-width: 7.5em; - margin: 0 0.5em; - font-size: 90%; - color: var(--color); -} - -.stats { - display: inline-block; - font-size: 70%; - color: var(--stats-color); -} - -#files a { - text-decoration: none; - border-bottom: 1px solid var(--underline-color); - color: var(--color); -} - -.hljs-link, -.hljs-comment, -.hljs-quote { - color: var(--hljs-link); -} - -.hljs-built_in, -.hljs-builtin-name, -.hljs-keyword, -.hljs-selector-tag, -.hljs-subst { - color: var(--hljs-keyword); -} - -.hljs-number, -.hljs-literal, -.hljs-variable, -.hljs-template-variable, -.hljs-tag .hljs-attr { - color: var(--hljs-variable); -} - -.hljs-regexp, -.hljs-string, -.hljs-doctag { - color: var(--hljs-regexp); -} - -.hljs-title, -.hljs-section, -.hljs-selector-id { - color: var(--hljs-title); -} - -.hljs-type, -.hljs-class .hljs-title { - color: var(--hljs-type); -} - -.hljs-meta, -.hljs-tag, -.hljs-name, -.hljs-attribute { - color: var(--hljs-meta); -} diff --git a/_coverage/coverage.js b/_coverage/coverage.js deleted file mode 100644 index ef27254..0000000 --- a/_coverage/coverage.js +++ /dev/null @@ -1,164 +0,0 @@ -function tool_tip_element() -{ - var element = document.querySelector("#tool-tip"); - if (element === null) { - element = document.createElement("div"); - element.id = "tool-tip"; - document.querySelector("body").appendChild(element); - } - - return element; -}; - -var tool_tip = tool_tip_element(); -var html = document.getElementsByTagName("html")[0]; - -function attach_tool_tip() -{ - document.querySelector("body").onmousemove = function (event) - { - var element = event.target; - if (element.dataset.count === undefined) - element = event.target.parentNode; - - if (element.dataset.count && element.dataset.count !== "0") { - tool_tip.textContent = element.dataset.count; - tool_tip.classList.add("visible"); - - if (event.clientY < html.clientHeight - 48) - tool_tip.style.top = event.clientY + 7 + "px"; - else - tool_tip.style.top = event.clientY - 32 + "px"; - - tool_tip.style.left = event.clientX + 7 + "px"; - } - else - tool_tip.classList.remove("visible"); - } -}; - -attach_tool_tip(); - -function move_line_to_cursor(cursor_y, line_number) -{ - var id = "L" + line_number; - - var line_anchor = - document.querySelector("a[id=" + id + "] + span"); - if (line_anchor === null) - return; - - var line_y = line_anchor.getBoundingClientRect().top + 18; - - var y = window.scrollY; - window.location = "#" + id; - window.scrollTo(0, y + line_y - cursor_y); -}; - -function handle_navbar_clicks() -{ - var line_count = document.querySelectorAll("a[id]").length; - var navbar = document.querySelector("#navbar"); - - if (navbar === null) - return; - - navbar.onclick = function (event) - { - event.preventDefault(); - - var line_number = - Math.floor(event.clientY / navbar.clientHeight * line_count + 1); - - move_line_to_cursor(event.clientY, line_number); - }; -}; - -handle_navbar_clicks(); - -function handle_line_number_clicks() -{ - document.querySelector("body").onclick = function (event) - { - if (event.target.tagName != "A") - return; - - var line_number_location = event.target.href.search(/#L[0-9]+\$/); - if (line_number_location === -1) - return; - - var anchor = event.target.href.slice(line_number_location); - - event.preventDefault(); - - var y = window.scrollY; - window.location = anchor; - window.scrollTo(0, y); - }; -}; - -handle_line_number_clicks(); - -function handle_collapsible_click() -{ - document.querySelectorAll("summary").forEach( - function (summary) - { - summary.onclick = function (event) - { - var details = summary.parentElement; - - var all_open = function (sub_details) { - var all_are_open = true; - for (let details of sub_details) { - all_are_open = - all_are_open && - details.hasAttribute('open'); - } - return all_are_open; - }; - - var all_toggle = function (sub_details, toggle) { - for (let details of sub_details) { - if (toggle) - details.removeAttribute('open'); - else - details.setAttribute('open', ''); - } - }; - - // ctrl-click toggles the state of the folder and all sub-folders, recursively: - // - if all sub-folders are opened, then all sub-folders are closed - // - if at least one sub-folder is closed (or the folder itself), - // then all sub-folders are opened - if (event.ctrlKey) { - var sub_details = Array.prototype.slice.call( - details.querySelectorAll("details") - ); - sub_details.push(details); - all_toggle(sub_details, all_open(sub_details)); - return false; - } - - // shift-click toggles the state of all immediate sub-folders: - // - if the folder is closed, just open it - // - if the folder is opened: - // - if all sub-folders are opened, then all sub-folders are closed - // - if at least one sub-folder is closed, then all sub-folders are opened - if (event.shiftKey && details.hasAttribute('open')) { - details.setAttribute('open', ''); - var sub_details = - Array.prototype.filter.call( - details.querySelectorAll("details"), - function (sub_details) { - return sub_details.parentNode === details; - } - ); - all_toggle(sub_details, all_open(sub_details)); - return false; - } - }; - }); -} - -handle_collapsible_click(); diff --git a/_coverage/highlight.pack.js b/_coverage/highlight.pack.js deleted file mode 100644 index 2e55d49..0000000 --- a/_coverage/highlight.pack.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! highlight.js v9.15.8 | BSD3 License | git.io/hljslicense */ -!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(a){var f=[],u=Object.keys,N={},c={},n=/^(no-?highlight|plain|text)$/i,s=/\blang(?:uage)?-([\w-]+)\b/i,t=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,r={case_insensitive:"cI",lexemes:"l",contains:"c",keywords:"k",subLanguage:"sL",className:"cN",begin:"b",beginKeywords:"bK",end:"e",endsWithParent:"eW",illegal:"i",excludeBegin:"eB",excludeEnd:"eE",returnBegin:"rB",returnEnd:"rE",relevance:"r",variants:"v",IDENT_RE:"IR",UNDERSCORE_IDENT_RE:"UIR",NUMBER_RE:"NR",C_NUMBER_RE:"CNR",BINARY_NUMBER_RE:"BNR",RE_STARTERS_RE:"RSR",BACKSLASH_ESCAPE:"BE",APOS_STRING_MODE:"ASM",QUOTE_STRING_MODE:"QSM",PHRASAL_WORDS_MODE:"PWM",C_LINE_COMMENT_MODE:"CLCM",C_BLOCK_COMMENT_MODE:"CBCM",HASH_COMMENT_MODE:"HCM",NUMBER_MODE:"NM",C_NUMBER_MODE:"CNM",BINARY_NUMBER_MODE:"BNM",CSS_NUMBER_MODE:"CSSNM",REGEXP_MODE:"RM",TITLE_MODE:"TM",UNDERSCORE_TITLE_MODE:"UTM",COMMENT:"C",beginRe:"bR",endRe:"eR",illegalRe:"iR",lexemesRe:"lR",terminators:"t",terminator_end:"tE"},b="",h={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function _(e){return e.replace(/&/g,"&").replace(//g,">")}function E(e){return e.nodeName.toLowerCase()}function v(e,n){var t=e&&e.exec(n);return t&&0===t.index}function l(e){return n.test(e)}function g(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function R(e){var a=[];return function e(n,t){for(var r=n.firstChild;r;r=r.nextSibling)3===r.nodeType?t+=r.nodeValue.length:1===r.nodeType&&(a.push({event:"start",offset:t,node:r}),t=e(r,t),E(r).match(/br|hr|img|input/)||a.push({event:"stop",offset:t,node:r}));return t}(e,0),a}function i(e){if(r&&!e.langApiRestored){for(var n in e.langApiRestored=!0,r)e[n]&&(e[r[n]]=e[n]);(e.c||[]).concat(e.v||[]).forEach(i)}}function m(o){function s(e){return e&&e.source||e}function c(e,n){return new RegExp(s(e),"m"+(o.cI?"i":"")+(n?"g":""))}!function n(t,e){if(!t.compiled){if(t.compiled=!0,t.k=t.k||t.bK,t.k){function r(t,e){o.cI&&(e=e.toLowerCase()),e.split(" ").forEach(function(e){var n=e.split("|");a[n[0]]=[t,n[1]?Number(n[1]):1]})}var a={};"string"==typeof t.k?r("keyword",t.k):u(t.k).forEach(function(e){r(e,t.k[e])}),t.k=a}t.lR=c(t.l||/\w+/,!0),e&&(t.bK&&(t.b="\\b("+t.bK.split(" ").join("|")+")\\b"),t.b||(t.b=/\B|\b/),t.bR=c(t.b),t.endSameAsBegin&&(t.e=t.b),t.e||t.eW||(t.e=/\B|\b/),t.e&&(t.eR=c(t.e)),t.tE=s(t.e)||"",t.eW&&e.tE&&(t.tE+=(t.e?"|":"")+e.tE)),t.i&&(t.iR=c(t.i)),null==t.r&&(t.r=1),t.c||(t.c=[]),t.c=Array.prototype.concat.apply([],t.c.map(function(e){return function(n){return n.v&&!n.cached_variants&&(n.cached_variants=n.v.map(function(e){return g(n,{v:null},e)})),n.cached_variants||n.eW&&[g(n)]||[n]}("self"===e?t:e)})),t.c.forEach(function(e){n(e,t)}),t.starts&&n(t.starts,e);var i=t.c.map(function(e){return e.bK?"\\.?(?:"+e.b+")\\.?":e.b}).concat([t.tE,t.i]).map(s).filter(Boolean);t.t=i.length?c(function(e,n){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i')+n+(t?"":b):n}function o(){E+=null!=l.sL?function(){var e="string"==typeof l.sL;if(e&&!N[l.sL])return _(g);var n=e?C(l.sL,g,!0,f[l.sL]):O(g,l.sL.length?l.sL:void 0);return 0")+'"');return g+=n,n.length||1}var s=B(e);if(!s)throw new Error('Unknown language: "'+e+'"');m(s);var a,l=t||s,f={},E="";for(a=l;a!==s;a=a.parent)a.cN&&(E=c(a.cN,"",!0)+E);var g="",R=0;try{for(var d,p,M=0;l.t.lastIndex=M,d=l.t.exec(n);)p=r(n.substring(M,d.index),d[0]),M=d.index+p;for(r(n.substr(M)),a=l;a.parent;a=a.parent)a.cN&&(E+=b);return{r:R,value:E,language:e,top:l}}catch(e){if(e.message&&-1!==e.message.indexOf("Illegal"))return{r:0,value:_(n)};throw e}}function O(t,e){e=e||h.languages||u(N);var r={r:0,value:_(t)},a=r;return e.filter(B).filter(M).forEach(function(e){var n=C(e,t,!1);n.language=e,n.r>a.r&&(a=n),n.r>r.r&&(a=r,r=n)}),a.language&&(r.second_best=a),r}function d(e){return h.tabReplace||h.useBR?e.replace(t,function(e,n){return h.useBR&&"\n"===e?"
":h.tabReplace?n.replace(/\t/g,h.tabReplace):""}):e}function o(e){var n,t,r,a,i,o=function(e){var n,t,r,a,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=s.exec(i))return B(t[1])?t[1]:"no-highlight";for(n=0,r=(i=i.split(/\s+/)).length;n/g,"\n"):n=e,i=n.textContent,r=o?C(o,i,!0):O(i),(t=R(n)).length&&((a=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=r.value,r.value=function(e,n,t){var r=0,a="",i=[];function o(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function u(e){a+=""}function s(e){("start"===e.event?c:u)(e.node)}for(;e.length||n.length;){var l=o();if(a+=_(t.substring(r,l[0].offset)),r=l[0].offset,l===e){for(i.reverse().forEach(u);s(l.splice(0,1)[0]),(l=o())===e&&l.length&&l[0].offset===r;);i.reverse().forEach(c)}else"start"===l[0].event?i.push(l[0].node):i.pop(),s(l.splice(0,1)[0])}return a+_(t.substr(r))}(t,R(a),i)),r.value=d(r.value),e.innerHTML=r.value,e.className=function(e,n,t){var r=n?c[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}(e.className,o,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function p(){if(!p.called){p.called=!0;var e=document.querySelectorAll("pre code");f.forEach.call(e,o)}}function B(e){return e=(e||"").toLowerCase(),N[e]||N[c[e]]}function M(e){var n=B(e);return n&&!n.disableAutodetect}return a.highlight=C,a.highlightAuto=O,a.fixMarkup=d,a.highlightBlock=o,a.configure=function(e){h=g(h,e)},a.initHighlighting=p,a.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",p,!1),addEventListener("load",p,!1)},a.registerLanguage=function(n,e){var t=N[n]=e(a);i(t),t.aliases&&t.aliases.forEach(function(e){c[e]=n})},a.listLanguages=function(){return u(N)},a.getLanguage=B,a.autoDetection=M,a.inherit=g,a.IR=a.IDENT_RE="[a-zA-Z]\\w*",a.UIR=a.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",a.NR=a.NUMBER_RE="\\b\\d+(\\.\\d+)?",a.CNR=a.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",a.BNR=a.BINARY_NUMBER_RE="\\b(0b[01]+)",a.RSR=a.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",a.BE=a.BACKSLASH_ESCAPE={b:"\\\\[\\s\\S]",r:0},a.ASM=a.APOS_STRING_MODE={cN:"string",b:"'",e:"'",i:"\\n",c:[a.BE]},a.QSM=a.QUOTE_STRING_MODE={cN:"string",b:'"',e:'"',i:"\\n",c:[a.BE]},a.PWM=a.PHRASAL_WORDS_MODE={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},a.C=a.COMMENT=function(e,n,t){var r=a.inherit({cN:"comment",b:e,e:n,c:[]},t||{});return r.c.push(a.PWM),r.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),r},a.CLCM=a.C_LINE_COMMENT_MODE=a.C("//","$"),a.CBCM=a.C_BLOCK_COMMENT_MODE=a.C("/\\*","\\*/"),a.HCM=a.HASH_COMMENT_MODE=a.C("#","$"),a.NM=a.NUMBER_MODE={cN:"number",b:a.NR,r:0},a.CNM=a.C_NUMBER_MODE={cN:"number",b:a.CNR,r:0},a.BNM=a.BINARY_NUMBER_MODE={cN:"number",b:a.BNR,r:0},a.CSSNM=a.CSS_NUMBER_MODE={cN:"number",b:a.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},a.RM=a.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[a.BE,{b:/\[/,e:/\]/,r:0,c:[a.BE]}]},a.TM=a.TITLE_MODE={cN:"title",b:a.IR,r:0},a.UTM=a.UNDERSCORE_TITLE_MODE={cN:"title",b:a.UIR,r:0},a.METHOD_GUARD={b:"\\.\\s*"+a.UIR,r:0},a});hljs.registerLanguage("ocaml",function(e){return{aliases:["ml"],k:{keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref",literal:"true false"},i:/\/\/|>>/,l:"[a-z_]\\w*!?",c:[{cN:"literal",b:"\\[(\\|\\|)?\\]|\\(\\)",r:0},e.C("\\(\\*","\\*\\)",{c:["self"]}),{cN:"symbol",b:"'[A-Za-z_](?!')[\\w']*"},{cN:"type",b:"`[A-Z][\\w']*"},{cN:"type",b:"\\b[A-Z][\\w']*",r:0},{b:"[a-z_]\\w*'[\\w']*",r:0},e.inherit(e.ASM,{cN:"string",r:0}),e.inherit(e.QSM,{i:null}),{cN:"number",b:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",r:0},{b:/[-=]>/}]}});hljs.registerLanguage("reasonml",function(r){var e="~?[a-z$_][0-9a-zA-Z$_]*",a="`?[A-Z$_][0-9a-zA-Z$_]*",c="("+["||","&&","++","**","+.","*","/","*.","/.","...","|>"].map(function(r){return r.split("").map(function(r){return"\\"+r}).join("")}).join("|")+"|==|===)",n="\\s+"+c+"\\s+",t={keyword:"and as asr assert begin class constraint do done downto else end exception externalfor fun function functor if in include inherit initializerland lazy let lor lsl lsr lxor match method mod module mutable new nonrecobject of open or private rec sig struct then to try type val virtual when while with",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ",literal:"true false"},i="\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",s={cN:"number",r:0,v:[{b:i},{b:"\\(\\-"+i+"\\)"}]},b={cN:"operator",r:0,b:c},o=[{cN:"identifier",r:0,b:e},b,s],l=[r.QSM,b,{cN:"module",b:"\\b"+a,rB:!0,e:".",c:[{cN:"identifier",b:a,r:0}]}],u=[{cN:"module",b:"\\b"+a,rB:!0,e:".",r:0,c:[{cN:"identifier",b:a,r:0}]}],_={cN:"function",r:0,k:t,v:[{b:"\\s(\\(\\.?.*?\\)|"+e+")\\s*=>",e:"\\s*=>",rB:!0,r:0,c:[{cN:"params",v:[{b:e},{b:"~?[a-z$_][0-9a-zA-Z$_]*(s*:s*[a-z$_][0-9a-z$_]*((s*('?[a-z$_][0-9a-z$_]*s*(,'?[a-z$_][0-9a-z$_]*)*)?s*))?)?(s*:s*[a-z$_][0-9a-z$_]*((s*('?[a-z$_][0-9a-z$_]*s*(,'?[a-z$_][0-9a-z$_]*)*)?s*))?)?"},{b:/\(\s*\)/}]}]},{b:"\\s\\(\\.?[^;\\|]*\\)\\s*=>",e:"\\s=>",rB:!0,r:0,c:[{cN:"params",r:0,v:[{b:e,e:"(,|\\n|\\))",r:0,c:[b,{cN:"typing",b:":",e:"(,|\\n)",rB:!0,r:0,c:u}]}]}]},{b:"\\(\\.\\s"+e+"\\)\\s*=>"}]};l.push(_);var N={cN:"constructor",b:a+"\\(",e:"\\)",i:"\\n",k:t,c:[r.QSM,b,{cN:"params",b:"\\b"+e}]},d={cN:"pattern-match",b:"\\|",rB:!0,k:t,e:"=>",r:0,c:[N,b,{r:0,cN:"constructor",b:a}]},z={cN:"module-access",k:t,rB:!0,v:[{b:"\\b("+a+"\\.)+"+e},{b:"\\b("+a+"\\.)+\\(",e:"\\)",rB:!0,c:[_,{b:"\\(",e:"\\)",skip:!0}].concat(l)},{b:"\\b("+a+"\\.)+{",e:"}"}],c:l};return u.push(z),{aliases:["re"],k:t,i:"(:\\-|:=|\\${|\\+=)",c:[r.C("/\\*","\\*/",{i:"^(\\#,\\/\\/)"}),{cN:"character",b:"'(\\\\[^']+|[^'])'",i:"\\n",r:0},r.QSM,{cN:"literal",b:"\\(\\)",r:0},{cN:"literal",b:"\\[\\|",e:"\\|\\]",r:0,c:o},{cN:"literal",b:"\\[",e:"\\]",r:0,c:o},N,{cN:"operator",b:n,i:"\\-\\->",r:0},s,r.CLCM,d,_,{cN:"module-def",b:"\\bmodule\\s+"+e+"\\s+"+a+"\\s+=\\s+{",e:"}",rB:!0,k:t,r:0,c:[{cN:"module",r:0,b:a},{b:"{",e:"}",skip:!0}].concat(l)},z]}}); \ No newline at end of file diff --git a/_coverage/index.html b/_coverage/index.html deleted file mode 100644 index ed424a8..0000000 --- a/_coverage/index.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Coverage report - - - - - -
-
- - - - 95% (171 / 179) - - lib/cli.ml - -
-
- - - - 50% (20 / 40) - - lib/database.ml - -
-
- - - - 34% (73 / 210) - - lib/tables.ml - -
-
- - - - 55% (54 / 98) - - lib/utils.ml - -
-
- - diff --git a/_coverage/lib/cli.ml.html b/_coverage/lib/cli.ml.html deleted file mode 100644 index 6f8b4e2..0000000 --- a/_coverage/lib/cli.ml.html +++ /dev/null @@ -1,976 +0,0 @@ - - - - - cli.ml — Coverage report - - - - - - - - -
-
-
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
-
-
-
-
-  1
-  2
-  3
-  4
-  5
-  6
-  7
-  8
-  9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-
-
module type CliHandler = sig
-  val parse_input : string -> string
-  val get_response : string -> string
-  val reset : unit -> unit
-end
-
-module CLI = struct
-  open Utils
-  open Database
-  open Tables
-  module Tbl = Tables.HashTable
-  module DB = Database (Tbl)
-  open Yojson.Basic.Util
-
-  let db = ref DB.empty
-
-  type state =
-    | Default
-    | BuildInstance of (string * Tbl.t * (string * entry) list)
-    | BuildType of (string * string * entry list)
-
-  exception ParseError
-  exception InvalidExpr
-  exception InvalidComparison
-
-  let current_state = ref Default
-  let file_name = "data/responses.json"
-
-  let get_response response =
-    let file = Yojson.Basic.from_file file_name in
-    file |> to_assoc |> List.assoc response |> to_string
-
-  let reset () =
-    current_state := Default;
-    db := DB.empty
-
-  let parse_value v = function
-    | Strings -> String v
-    | Ints -> (
-        match int_of_string_opt v with
-        | Some i -> Int i
-        | None -> raise ParseError)
-    | Floats -> (
-        match float_of_string_opt v with
-        | Some f -> Float f
-        | None -> raise ParseError)
-    | Bools -> (
-        match bool_of_string_opt v with
-        | Some b -> Bool b
-        | None -> raise ParseError)
-    | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError)
-    | Ids ->
-        Id
-          (match v |> String.split_on_char '@' |> List.map String.trim with
-          | [] | [ _ ] | _ :: _ :: _ :: _ -> raise ParseError
-          | [ hd; tl ] -> (hd, String tl))
-
-  let rec build_instance (name, table, vals) input =
-    match
-      input |> String.split_on_char '=' |> List.map String.trim
-      |> List.filter (fun s -> s <> "")
-    with
-    | [] ->
-        DB.add_named_entry name vals !db;
-        current_state := Default;
-        get_response "indent_end" (* "|    <|\n|> " *)
-    | [ n ] ->
-        current_state := BuildInstance (name, table, vals);
-        get_response "err_create_field_no_value"
-        (* "Please input a variable and a value\n|    " *)
-    | n :: v :: tl -> (
-        match List.assoc_opt n vals with
-        | None -> (
-            match Tbl.exists table n with
-            | exception TypeMismatch ->
-                current_state := BuildInstance (name, table, vals);
-                get_response "err_create_field_DNE"
-                (* "That field does not exist in this type\n|    " *)
-            | t -> (
-                match parse_value v t with
-                | x ->
-                    current_state := BuildInstance (name, table, (n, x) :: vals);
-                    get_response "indent" (* "|    " *)
-                | exception ParseError ->
-                    current_state := BuildInstance (name, table, vals);
-                    get_response "err_create_field_wrong_type"
-                    (* "That value does not match the type of the field\n|    " *)
-                ))
-        | Some _ ->
-            current_state := BuildInstance (name, table, vals);
-            get_response "err_create_field_already_entered"
-            (* "This field has already been entered\n|    " *))
-
-  let process_assign input =
-    match input |> List.map String.trim |> List.filter (fun s -> s <> "") with
-    | [] ->
-        get_response "err_assign_empty"
-        (* "Please input a type name and id\n|> " *)
-    | [ name ] ->
-        get_response "err_assign_no_id"
-        (* "Please input an id for this instance\n|> " *)
-    | name :: id :: tl -> (
-        match DB.get_table name !db with
-        | Some t ->
-            current_state :=
-              BuildInstance
-                ( name,
-                  t,
-                  [
-                    ( (match Tbl.header t with
-                      | Type (n, _) :: tl -> n
-                      | _ -> failwith "impossible" [@coverage off]),
-                      String id );
-                  ] );
-            get_response "indent"
-        | None -> get_response "err_assign_DNE")
-  (* "That type does not exist\n|> " *)
-
-  let parse_type (typ, name) =
-    match typ with
-    | "int" -> Type (name, Ints)
-    | "float" -> Type (name, Floats)
-    | "string" -> Type (name, Strings)
-    | "bool" -> Type (name, Bools)
-    | "char" -> Type (name, Chars)
-    | "id" -> Type (name, Ids)
-    | _ -> raise ParseError
-
-  let rec build_type (name, id, types) input =
-    match
-      String.split_on_char ' ' input
-      |> List.map String.trim
-      |> List.filter (fun s -> s <> "")
-    with
-    | [] ->
-        db := DB.build_table !db (Type (id, Strings) :: types) name;
-        current_state := Default;
-        get_response "indent_end" (* "|    <|\n|> " *)
-    | [ typ ] -> get_response "err_defn_no_name"
-    (* "Please enter a name for this field\n|    " *)
-    | typ :: field_name :: tl -> (
-        match parse_type (typ, field_name) with
-        | Type _ as t ->
-            current_state := BuildType (name, id, types @ [ t ]);
-            get_response "indent" (* "|    " *)
-        | exception ParseError ->
-            current_state := BuildType (name, id, types);
-            get_response
-              "err_defn_invalid_type" (* "Not a recognized type\n|    " *)
-        | _ -> raise (Failure "Should be impossible") [@coverage off])
-
-  let process_type input =
-    match List.filter (fun s -> s <> "") input with
-    | [] -> get_response "err_defn_needs_type_name"
-    (* "Please enter a type name for the definition\n|> " *)
-    | [ name ] ->
-        get_response "err_defn_needs_ID_name"
-        (* "Please enter a name for the ID of this type\n|> " *)
-    | name :: id :: tl -> (
-        match DB.get_table name !db with
-        | Some _ ->
-            get_response "err_defn_already_exists"
-            (* "\n Type already defined\n|> " *)
-        | None ->
-            current_state := BuildType (name, id, []);
-            get_response "indent" (* "|    " *))
-
-  let process_at input =
-    match input |> List.map String.trim |> List.filter (fun s -> s <> "") with
-    | [] ->
-        get_response "err_at_empty"
-        (* "Please enter what the type and id of which to get an instance\n|> " *)
-    | [ name ] ->
-        get_response "err_at_no_id"
-        (* "Please enter an id of the instance you which to get\n|> " *)
-    | [ name; id ] -> (
-        match DB.get_table name !db with
-        | Some x -> (
-            try
-              (x |> Tbl.header |> optionize |> build_row)
-              ^ "\n"
-              ^ (String id |> Tbl.at x |> build_row)
-            with Not_found -> get_response "err_at_id_DNE")
-        | None ->
-            get_response "err_at_invalid_type" (* "No type of that name" *))
-    | name :: id :: col :: tl -> (
-        match DB.get_table name !db with
-        | Some x -> (
-            try
-              let row = Tbl.at x (String id) in
-              match int_of_string_opt col with
-              | None ->
-                  get_response "err_at_column_not_int"
-                  (* "Column number should be an int" *)
-              | Some i -> (
-                  match List.nth_opt row i with
-                  | Some e -> (
-                      match e with
-                      | None -> get_response "no_entry"
-                      | Some e -> (
-                          match e with
-                          | Id (name, row) ->
-                              (entry_to_string e ^ "="
-                              ^
-                              match DB.get_reference e !db with
-                              | exception Not_found ->
-                                  get_response "unbound_type"
-                              | l, r -> (
-                                  "\n"
-                                  ^ build_row (optionize l)
-                                  ^
-                                  match r with
-                                  | None -> get_response "unbound_val"
-                                  | Some v -> build_row v))
-                              ^ "\n|> "
-                          | _ -> entry_to_string e ^ "\n|> "))
-                  | None -> get_response "err_at_column_out_of_range")
-            with Not_found -> get_response "err_at_id_DNE")
-        | None -> get_response "err_at_invalid_type")
-
-  let split_on_substring sub str =
-    let idxs = ref [ 0 ] in
-    let sub_len = String.length sub in
-    for i = 0 to String.length str - sub_len do
-      if String.sub str i sub_len = sub then
-        idxs := !idxs @ [ i; i + String.length sub ]
-      else ()
-    done;
-    idxs := !idxs @ [ String.length str ];
-    let rec create_lst idxs sub_len str =
-      match idxs with
-      | [] -> []
-      | s :: e :: t -> String.sub str s (e - s) :: create_lst t sub_len str
-      | _ -> failwith "odd" [@coverage off]
-    in
-    create_lst !idxs sub_len str
-
-  let parse_compare_exp str =
-    let str_lst = String.split_on_char ' ' str in
-    if List.length str_lst <> 3 then raise InvalidExpr
-    else
-      match str_lst with
-      | [ var; compare; value ] ->
-          ( var,
-            (match compare with
-            | "=" -> EQ
-            | "<>" -> NEQ
-            | ">" -> GT
-            | "<" -> LT
-            | "<=" -> LTE
-            | ">=" -> GTE
-            | _ -> raise InvalidComparison),
-            value )
-      | _ -> failwith "should be impossible" [@coverage off]
-
-  let process_find lst =
-    let cleaned_lst =
-      lst |> List.map String.trim |> List.filter (fun s -> s <> "")
-    in
-    if cleaned_lst = [] then get_response "err_find_missing_type"
-    else
-      match DB.get_table (List.hd cleaned_lst) !db with
-      | None -> get_response "err_find_invalid_type"
-      | Some type_table -> (
-          try
-            cleaned_lst |> List.tl
-            |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) ""
-            |> split_on_substring "and" |> List.map String.trim
-            |> List.filter (fun s -> s <> "")
-            |> (fun lst -> if lst = [] then raise InvalidExpr else lst)
-            |> List.map parse_compare_exp
-            |> Tbl.process_constraints type_table
-          with
-          | InvalidExpr -> get_response "err_find_invalid_expr"
-          | InvalidComparison -> get_response "err_find_invalid_comparison"
-          | TypeMismatch -> get_response "err_find_wrong_type"
-          | Not_found -> get_response "err_find_var_DNE")
-
-  (** [parse_input input] takes in new input and determines the relevant command*)
-  let parse_input input =
-    match !current_state with
-    | BuildInstance v -> build_instance v input
-    | BuildType v -> build_type v input
-    | Default -> (
-        match String.split_on_char ' ' input with
-        | "quit" :: tl -> exit 0 [@coverage off]
-        | "help" :: tl -> get_response "help_message"
-        | "def" :: tl -> process_type tl
-        | "assign" :: tl -> process_assign tl
-        | "print" :: tl -> DB.db_to_string !db ^ "|> "
-        | "at" :: tl -> process_at tl
-        | "find" :: tl -> process_find tl
-        | _ ->
-            get_response "err_unknown_command"
-            (* "Unknown command. Type help for a list of commands\n|> " *))
-end
-
-(** [main ()] prompts for the script to start, then starts it. *)
-
-let main () =
-  let file_name = "data/responses.json" in
-  let welcom_string =
-    let file = Yojson.Basic.from_file file_name in
-    file |> Yojson.Basic.Util.to_assoc |> List.assoc "welcome"
-    |> Yojson.Basic.Util.to_string
-  in
-  print_string welcom_string;
-  print_string "|> ";
-  while true do
-    read_line () |> CLI.parse_input |> print_string
-  done
-  [@@coverage off]
-
-
-
- - - diff --git a/_coverage/lib/database.ml.html b/_coverage/lib/database.ml.html deleted file mode 100644 index b974575..0000000 --- a/_coverage/lib/database.ml.html +++ /dev/null @@ -1,241 +0,0 @@ - - - - - database.ml — Coverage report - - - - - - - - -
-
-
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
-
-
-
-
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-
-
open Utils
-open Tables
-
-module Database (Table : Table) = struct
-  exception NoEntry
-  exception WrongType
-  exception TableExists
-
-  type table = Table.t
-  type database = (string * table ref) list
-
-  let empty = []
-
-  let add_table database table name : database =
-    match
-      List.find (fun a -> match a with tname, t -> name = tname) database
-    with
-    | exception Not_found -> (name, ref table) :: database
-    | _ -> raise TableExists
-
-  let build_table database table name =
-    match
-      List.find (fun a -> match a with tname, t -> name = tname) database
-    with
-    | exception Not_found -> (name, ref (Table.empty table)) :: database
-    | _ -> raise TableExists
-
-  let drop_table name database =
-    List.filter (fun a -> match a with tname, t -> name <> tname) database
-
-  let get_table name database =
-    match List.assoc_opt name database with Some x -> Some !x | None -> None
-
-  (*Currently doesn't work...*)
-  let get_reference ent database =
-    match ent with
-    | Id (tbl, id) -> (
-        let tbl =
-          match get_table tbl database with
-          | None -> raise Not_found
-          | Some v -> v
-        in
-        ( Table.header tbl,
-          match Table.at tbl id with exception Not_found -> None | v -> Some v
-        ))
-    | _ -> raise TypeMismatch
-
-  let rec db_to_string database =
-    match database with
-    | [] -> "\n"
-    | (name, x) :: xs ->
-        "Table: " ^ name ^ "\n\n" ^ Table.table_to_string !x ^ db_to_string xs
-
-  let rec add_entry table_name new_row database =
-    match database with
-    | [] -> raise Not_found
-    | (a, b) :: tl when a = table_name -> b := Table.insert !b new_row
-    | _ :: tl -> add_entry table_name new_row tl
-
-  let add_named_entry table_name new_row database =
-    match List.assoc_opt table_name database with
-    | None -> raise Not_found
-    | Some x -> x := Table.insert_named !x new_row
-end
-
-
-
- - - diff --git a/_coverage/lib/tables.ml.html b/_coverage/lib/tables.ml.html deleted file mode 100644 index f99e9f1..0000000 --- a/_coverage/lib/tables.ml.html +++ /dev/null @@ -1,927 +0,0 @@ - - - - - tables.ml — Coverage report - - - - - - - - -
-
-
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
-
-
-
-
-  1
-  2
-  3
-  4
-  5
-  6
-  7
-  8
-  9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-
-
open Utils
-
-let rec assert_types header a =
-  match header with
-  | [] -> if a = [] then [] else raise TypeMismatch
-  | hd :: tl -> (
-      match a with
-      | [] -> raise TypeMismatch
-      | b :: c ->
-          (match hd with
-          | Some (Type (_, Strings)) -> (
-              match b with
-              | Some (String _) -> b
-              | None -> b
-              | _ -> raise TypeMismatch)
-          | Some (Type (_, Floats)) -> (
-              match b with
-              | Some (Float _) -> b
-              | None -> b
-              | _ -> raise TypeMismatch)
-          | Some (Type (_, Ints)) -> (
-              match b with
-              | Some (Int _) -> b
-              | None -> b
-              | _ -> raise TypeMismatch)
-          | Some (Type (_, Bools)) -> (
-              match b with
-              | Some (Bool _) -> b
-              | None -> b
-              | _ -> raise TypeMismatch)
-          | Some (Type (_, Chars)) -> (
-              match b with
-              | Some (Char _) -> b
-              | None -> b
-              | _ -> raise TypeMismatch)
-          | Some (Type (_, Ids)) -> (
-              match b with
-              | Some (Id _) -> b
-              | None -> b
-              | _ -> raise TypeMismatch)
-          | _ -> raise TypeMismatch)
-          :: assert_types tl c)
-
-let rec reorder_list (a : (string * entry) list) = function
-  | [] -> if a = [] then [] else raise TypeMismatch
-  | Some (Type (name, v)) :: tl ->
-      let vl, rest =
-        let rec extr_name acc = function
-          | [] -> (None, acc)
-          | (n, vr) :: rest ->
-              if n = name then (Some vr, acc @ rest)
-              else extr_name (acc @ [ (n, vr) ]) rest
-        in
-        extr_name [] a
-      in
-      vl :: reorder_list rest tl
-  | _ -> raise TypeMismatch
-
-let rec get_type_index cnt name = function
-  | [] -> raise Not_found
-  | Type (n, _) :: tl ->
-      if n = name then cnt else get_type_index (cnt + 1) name tl
-  | _ -> raise TypeMismatch
-
-module type Table = sig
-  type t
-
-  val empty : entry list -> t
-  val insert : t -> entry list -> t
-  val insert_named : t -> (string * entry) list -> t
-  val at : t -> entry -> entry option list
-  val delete : t -> entry -> t
-  val table_to_string : t -> string
-  val process_constraints : t -> (string * comparison * string) list -> string
-  val header : t -> entry list
-  val exists : t -> string -> types
-end
-
-module ListTable : Table = struct
-  type t = entry option list list
-
-  let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl
-  let empty (ex : entry list) = [ optionize ex ]
-
-  let insert (table : t) a =
-    match
-      List.find (fun b ->
-          match a with
-          | [] -> raise (Failure "Error")
-          | hd :: tl -> (
-              match b with
-              | [] -> raise (Failure "Error")
-              | hdb :: tlb -> hd = hdb))
-    with
-    | exception Not_found ->
-        table @ [ assert_types (List.hd table) (optionize a) ]
-    | x -> raise IndexExists
-
-  let insert_named table elist =
-    let name, value = List.hd elist in
-    match List.find (fun a -> List.hd a = Some value) table with
-    | x -> raise IndexExists
-    | exception Not_found -> table @ [ reorder_list elist (List.hd table) ]
-
-  let at (table : t) id =
-    List.find
-      (fun a ->
-        match a with
-        | [] -> raise (Failure "This shouldn't happen")
-        | hd :: tl -> ( match hd with Some x -> x = id | None -> false))
-      table
-
-  let delete (table : t) id =
-    List.filter
-      (fun a ->
-        match a with
-        | [] -> false
-        | a :: asd -> ( match a with Some x -> x = id | None -> false))
-      table
-
-  let rec table_to_string (table : t) =
-    match table with
-    | [] -> ""
-    | b :: xs -> build_row b ^ table_to_string xs ^ "\n"
-
-  let rec deoptionize = function
-    | [] -> []
-    | hd :: tl ->
-        (match hd with
-        | Some x -> x
-        | None -> raise (Failure "Deoptionize saw None"))
-        :: deoptionize tl
-
-  let header = function
-    | [] -> raise (Failure "RI Violated for tables")
-    | hd :: tl -> deoptionize hd
-
-  let exists table name =
-    let rec follow_header = function
-      | [] -> raise TypeMismatch
-      | Type (n, t) :: tl when n = name -> t
-      | _ :: tl -> follow_header tl
-    in
-    follow_header (header table)
-
-  let rec process_constraints tbl lst =
-    match lst with
-    | [] -> table_to_string tbl
-    | hd :: tl ->
-        let ntbl =
-          match hd with
-          | name, cmp, vl -> (
-              let ind = get_type_index 0 name (header tbl) in
-              match List.nth (header tbl) ind with
-              | Type (_, t) ->
-                  let e = process_entry vl t in
-                  List.filter
-                    (fun a ->
-                      match List.nth a ind with
-                      | None -> false
-                      | Some v -> run_constraint cmp e v)
-                    tbl
-              | _ -> failwith "Impossible")
-        in
-        process_constraints ntbl tl
-end
-
-module HashTable = struct
-  type t = HashTab of entry list * (entry, entry option list) Hashtbl.t
-
-  let rec deoptionize_list = function
-    | [] -> []
-    | Some x :: tl -> x :: deoptionize_list tl
-    | None :: tl -> failwith "Deoptionize on None"
-
-  let header = function HashTab (hd, _) -> hd
-  let hshtable = function HashTab (_, hsh) -> hsh
-
-  let deoptionize = function
-    | Some x -> x
-    | None -> raise (Failure "Deoptionize on none")
-
-  let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl
-  let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0)
-
-  let insert table entries =
-    match Hashtbl.find_opt (hshtable table) (List.hd entries) with
-    | Some x -> raise IndexExists
-    | None ->
-        let copy = Hashtbl.copy (hshtable table) in
-        let entrs =
-          assert_types (optionize (header table)) (optionize entries)
-        in
-        HashTab
-          ( header table,
-            (Hashtbl.add copy (List.hd entries) (List.tl entrs);
-             copy) )
-
-  let insert_named table entries =
-    let name, value = List.hd entries in
-    match Hashtbl.find_opt (hshtable table) value with
-    | Some x -> raise IndexExists
-    | None ->
-        let copy = Hashtbl.copy (hshtable table) in
-        let reordered = reorder_list entries (optionize (header table)) in
-        Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered);
-        HashTab (header table, copy)
-
-  let at table id = Some id :: Hashtbl.find (hshtable table) id
-
-  let delete table id =
-    let out = Hashtbl.copy (hshtable table) in
-    Hashtbl.remove (hshtable table) id;
-    HashTab (header table, out)
-
-  let rec table_to_string table =
-    Hashtbl.fold
-      (fun id ent acc -> acc ^ shorten (entry_to_string id) ^ build_row ent)
-      (hshtable table)
-      (build_row (optionize (header table)))
-
-  let rec process_constraints tbl lst =
-    let newHash = Hashtbl.create 0 in
-    match lst with
-    | [] -> table_to_string tbl
-    | hd :: tl ->
-        process_constraints
-          (match hd with
-          | name, cmp, vl ->
-              let ind = get_type_index 0 name (header tbl) in
-              let cmp_func =
-                match
-                  List.find
-                    (function
-                      | Type (n, t) -> n = name | _ -> failwith "Impossible")
-                    (header tbl)
-                with
-                | Type (n, t) -> (
-                    match process_entry vl t with e -> run_constraint cmp e)
-                | _ -> raise (Failure "Impossible")
-              in
-              Hashtbl.iter
-                (fun a b ->
-                  if ind = 0 then
-                    if cmp_func a then Hashtbl.add newHash a b else ()
-                  else
-                    match List.nth b (ind - 1) with
-                    | None -> ()
-                    | Some v ->
-                        if cmp_func v then Hashtbl.add newHash a b else ())
-                (hshtable tbl);
-              HashTab (header tbl, newHash))
-          tl
-
-  let exists table name =
-    let rec follow_header = function
-      | [] -> raise TypeMismatch
-      | Type (n, t) :: tl when n = name -> t
-      | _ :: tl -> follow_header tl
-    in
-    follow_header (header table)
-end
-
-
-
- - - diff --git a/_coverage/lib/utils.ml.html b/_coverage/lib/utils.ml.html deleted file mode 100644 index d5dddfe..0000000 --- a/_coverage/lib/utils.ml.html +++ /dev/null @@ -1,441 +0,0 @@ - - - - - utils.ml — Coverage report - - - - - - - - -
-
-
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
-
-
-
-
-  1
-  2
-  3
-  4
-  5
-  6
-  7
-  8
-  9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-
-
type types = Strings | Floats | Ints | Chars | Bools | Ids
-type comparison = LT | LTE | EQ | NEQ | GT | GTE
-
-exception IndexExists
-exception TypeMismatch
-
-type entry =
-  | String of string
-  | Float of float
-  | Int of int
-  | Char of char
-  | Bool of bool
-  | Id of (string * entry)
-  | Type of (string * types)
-
-let name_map_entry t =
-  match t with
-  | String _ -> "string"
-  | Float _ -> "float"
-  | Int _ -> "int"
-  | Char _ -> "char"
-  | Bool _ -> "bool"
-  | Id _ -> "id"
-  | Type _ -> "type"
-
-let name_map_types t =
-  match t with
-  | Strings -> "string"
-  | Floats -> "float"
-  | Ints -> "int"
-  | Chars -> "char"
-  | Bools -> "bool"
-  | Ids -> "id"
-
-let guess_entry input =
-  match float_of_string_opt input with
-  | Some v -> Float v
-  | None -> (
-      match int_of_string_opt input with
-      | Some v -> Int v
-      | None -> (
-          match bool_of_string_opt input with
-          | Some v -> Bool v
-          | None ->
-              if String.length input = 1 then Char input.[0] else String input))
-
-let process_entry input = function
-  | Strings -> String input
-  | Floats -> (
-      match float_of_string_opt input with
-      | None -> raise TypeMismatch
-      | Some v -> Float v)
-  | Ints -> (
-      match int_of_string_opt input with
-      | None -> raise TypeMismatch
-      | Some v -> Int v)
-  | Chars ->
-      if String.length input = 1 then Char input.[0] else raise TypeMismatch
-  | Bools -> (
-      match bool_of_string_opt input with
-      | None -> raise TypeMismatch
-      | Some v -> Bool v)
-  | Ids -> (
-      match String.split_on_char '@' input with
-      | [] | [ _ ] | _ :: _ :: _ :: _ -> raise TypeMismatch
-      | [ hd; tl ] -> Id (hd, guess_entry tl))
-
-let make_compare cmp lhs rhs =
-  match cmp with
-  | LT -> lhs < rhs
-  | LTE -> lhs <= rhs
-  | EQ -> lhs = rhs
-  | NEQ -> lhs <> rhs
-  | GT -> lhs > rhs
-  | GTE -> lhs >= rhs
-
-let run_constraint (cmp : comparison) rhs lhs =
-  match rhs with
-  | Float r -> (
-      match lhs with
-      | Float l -> make_compare cmp l r
-      | _ -> failwith "Typing error")
-  | Int r -> (
-      match lhs with
-      | Int l -> make_compare cmp l r
-      | _ -> failwith "Typing error")
-  | Char r -> (
-      match lhs with
-      | Char l -> make_compare cmp l r
-      | _ -> failwith "Typing error")
-  | Bool r -> (
-      match lhs with
-      | Bool l -> make_compare cmp l r
-      | _ -> failwith "Typing error")
-  | String r -> (
-      match lhs with
-      | String l -> make_compare cmp l r
-      | _ -> failwith "Typing error")
-  | _ -> raise TypeMismatch
-
-let rec entry_to_string ent =
-  match ent with
-  | String x -> x
-  | Float x -> string_of_float x
-  | Int x -> string_of_int x
-  | Char x -> String.make 1 x
-  | Bool x -> string_of_bool x
-  | Id (a, b) -> a ^ "@" ^ entry_to_string b
-  | Type (a, b) -> name_map_types b ^ " " ^ a
-
-let shorten inp =
-  let str = String.trim inp in
-  if String.length str < 8 then str ^ "\t\t"
-  else if String.length str < 16 then str ^ "\t"
-  else String.sub str 0 16
-
-let rec build_row entlist =
-  match entlist with
-  | [] -> "\n\n"
-  | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs
-  | None :: xs -> "\t\t" ^ build_row xs
-
-let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl
-
-
-
- - - diff --git a/bisect170274499.coverage b/bisect170274499.coverage deleted file mode 100644 index 9289ab7..0000000 --- a/bisect170274499.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 42 42 0 0 0 42 0 0 0 69 46 115 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 37 0 37 37 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 16 8 8 8 8 8 56 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 56 16 7 8 7 7 2 56 103 0 23 23 23 75 98 98 98 92 92 92 7 15 92 7 114 14 2 14 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 253 253 512 207 46 719 37 253 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 329 97 37 0 295 43 295 42 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 37 37 37 37 37 37 37 37 37 0 37 37 37 37 10 7 10 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 178 1 177 711 534 178 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/bisect189174176.coverage b/bisect189174176.coverage deleted file mode 100644 index 9289ab7..0000000 --- a/bisect189174176.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 42 42 0 0 0 42 0 0 0 69 46 115 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 37 0 37 37 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 16 8 8 8 8 8 56 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 56 16 7 8 7 7 2 56 103 0 23 23 23 75 98 98 98 92 92 92 7 15 92 7 114 14 2 14 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 253 253 512 207 46 719 37 253 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 329 97 37 0 295 43 295 42 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 37 37 37 37 37 37 37 37 37 0 37 37 37 37 10 7 10 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 178 1 177 711 534 178 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/bisect248934128.coverage b/bisect248934128.coverage deleted file mode 100644 index 9289ab7..0000000 --- a/bisect248934128.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 42 42 0 0 0 42 0 0 0 69 46 115 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 37 0 37 37 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 16 8 8 8 8 8 56 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 56 16 7 8 7 7 2 56 103 0 23 23 23 75 98 98 98 92 92 92 7 15 92 7 114 14 2 14 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 253 253 512 207 46 719 37 253 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 329 97 37 0 295 43 295 42 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 37 37 37 37 37 37 37 37 37 0 37 37 37 37 10 7 10 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 178 1 177 711 534 178 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/bisect615383338.coverage b/bisect615383338.coverage deleted file mode 100644 index 9289ab7..0000000 --- a/bisect615383338.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 42 42 0 0 0 42 0 0 0 69 46 115 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 37 0 37 37 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 16 8 8 8 8 8 56 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 56 16 7 8 7 7 2 56 103 0 23 23 23 75 98 98 98 92 92 92 7 15 92 7 114 14 2 14 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 253 253 512 207 46 719 37 253 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 329 97 37 0 295 43 295 42 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 37 37 37 37 37 37 37 37 37 0 37 37 37 37 10 7 10 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 178 1 177 711 534 178 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/bisect623476032.coverage b/bisect623476032.coverage deleted file mode 100644 index 9289ab7..0000000 --- a/bisect623476032.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1168 1212 1242 1088 1124 996 1271 975 1452 1470 1360 1377 1334 1636 1556 1620 1584 1655 1530 1869 1807 1837 1755 40 0 0 0 0 0 42 42 0 0 0 42 0 0 0 69 46 115 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 37 0 37 37 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 16 8 8 8 8 8 56 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 56 16 7 8 7 7 2 56 103 0 23 23 23 75 98 98 98 92 92 92 7 15 92 7 114 14 2 14 13 lib/tables.ml 210 97 89 314 351 377 486 522 548 655 689 715 823 858 884 992 1027 1053 1159 1192 1218 241 414 585 752 921 1090 1255 1304 161 194 68 120 46 1406 1398 1756 1717 1655 1614 1534 1564 1377 1429 1770 1921 1912 1842 1868 1958 2539 2497 2508 2586 2576 2940 2958 2931 2879 2971 2793 2839 2694 2736 2669 2627 3226 3211 3138 3167 3103 3097 3071 3032 3409 3428 3325 3381 3302 3268 3599 3618 3550 3572 3527 3491 3748 3768 3714 3729 3691 3880 3902 3971 3820 3835 4007 4060 4296 4159 4227 4192 4237 4118 4813 4851 4763 4709 4699 4618 4925 4586 4541 4565 4470 4371 4403 4350 5199 5148 5163 5210 5280 5328 5388 5406 5526 5484 5495 5589 5563 5925 5971 5989 6012 5851 5843 5870 5900 5779 5799 5697 5731 5659 5675 5628 6429 6372 6363 6393 6415 6314 6306 6335 6240 6260 6158 6192 6132 6101 6060 6497 6487 6465 6639 6608 6625 6569 6585 6538 6759 6742 6775 6730 6796 6839 6831 6820 6692 8000 7936 7907 7821 7854 7767 7721 7692 7673 7637 7964 7986 7486 7468 7401 7513 7275 7301 7355 7132 7156 7063 6954 6986 6933 6895 8239 8102 8170 8135 8180 8061 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 253 253 512 207 46 719 37 253 0 22 8 1 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 329 97 37 0 295 43 295 42 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 37 37 37 37 37 37 37 37 37 0 37 37 37 37 10 7 10 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 178 1 177 711 534 178 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file From f44406ed168407c8ef1bdbe04459866014caad25 Mon Sep 17 00:00:00 2001 From: Thomas McFarland Date: Mon, 15 May 2023 01:53:33 -0400 Subject: [PATCH 19/24] Yippee! --- _coverage/coverage.css | 500 +++++++++++++++++ _coverage/coverage.js | 164 ++++++ _coverage/highlight.pack.js | 2 + _coverage/index.html | 53 ++ _coverage/lib/cli.ml.html | 976 +++++++++++++++++++++++++++++++++ _coverage/lib/database.ml.html | 225 ++++++++ _coverage/lib/tables.ml.html | 869 +++++++++++++++++++++++++++++ _coverage/lib/utils.ml.html | 440 +++++++++++++++ bisect037238731.coverage | 1 + bisect116092532.coverage | 1 + bisect452780914.coverage | 1 + lib/database.ml | 1 - lib/tables.ml | 42 +- test/main.ml | 381 ++++++++++++- 14 files changed, 3636 insertions(+), 20 deletions(-) create mode 100644 _coverage/coverage.css create mode 100644 _coverage/coverage.js create mode 100644 _coverage/highlight.pack.js create mode 100644 _coverage/index.html create mode 100644 _coverage/lib/cli.ml.html create mode 100644 _coverage/lib/database.ml.html create mode 100644 _coverage/lib/tables.ml.html create mode 100644 _coverage/lib/utils.ml.html create mode 100644 bisect037238731.coverage create mode 100644 bisect116092532.coverage create mode 100644 bisect452780914.coverage diff --git a/_coverage/coverage.css b/_coverage/coverage.css new file mode 100644 index 0000000..35bb22a --- /dev/null +++ b/_coverage/coverage.css @@ -0,0 +1,500 @@ +:root, .light:root { + --main-background: #fff; + --code-background: transparent; + --line-numbers-background: rgba(0, 0, 0, 0.025); + --navbar-background: #eee; + + --meter-unvisited-color: #f9c3c3; + --meter-visited-color: #9ed09f; + --meter-separator-color: white; + + --color: #000; + --dirname-color: #bbb; + --stats-color: #aaa; + --underline-color: #ddd; + --visited-color: #eaffea; + --visited-number-color: rgba(64, 192, 64, 0.2); + --unvisited-color: #ffecec; + --unvisited-number-color: rgba(255, 128, 128, 0.5); + --somevisited-color: #ffd; + --highlight-color: #a0fbff; + --line-number-color: rgba(0, 0, 0, 0.4); + --unvisited-margin-color: #d69e9e; + --border: #eee; + --navbar-border: #ddd; + --code-color: #000; + --hljs-link: #6a737d; + --hljs-keyword: #d73a49; + --hljs-regexp: #032f62; + --hljs-title: #900; + --hljs-type: #6f42c1; + --hljs-meta: #22863a; + --hljs-variable: #005cc5; +} + +.dark:root { + --main-background: #202020; + --code-background: #222; + --line-numbers-background: rgba(0, 0, 0, 0.125); + --navbar-background: #202020; + + --meter-unvisited-color: #622; + --meter-visited-color: #252; + --meter-separator-color: black; + + --color: #bebebe; + --dirname-color: #666; + --stats-color: #555; + --underline-color: #444; + --visited-color: #002800; + --visited-number-color: #252; + --unvisited-color: #380000; + --unvisited-number-color: #822; + --somevisited-color: #303000; + --highlight-color: #303e3f; + --line-number-color: rgba(230, 230, 230, 0.3); + --unvisited-margin-color: #622; + --border: #333; + --navbar-border: #333; + --code-color: #ccc; + --hljs-link: #999; + --hljs-keyword: #cda869; + --hljs-regexp: #f9ee98; + --hljs-title: #dcdcaa; + --hljs-type: #ac885b; + --hljs-meta: #82aaff; + --hljs-variable: #cf6a4c; +} + +@media (prefers-color-scheme: dark) { + :root { + --main-background: #202020; + --code-background: #222; + --line-numbers-background: rgba(0, 0, 0, 0.125); + --navbar-background: #202020; + + --meter-unvisited-color: #622; + --meter-visited-color: #252; + --meter-separator-color: black; + + --color: #bebebe; + --dirname-color: #666; + --underline-color: #444; + --visited-color: #002800; + --visited-number-color: #252; + --unvisited-color: #380000; + --unvisited-number-color: #822; + --somevisited-color: #303000; + --highlight-color: #303e3f; + --line-number-color: rgba(230, 230, 230, 0.3); + --unvisited-margin-color: #622; + --border: #333; + --navbar-border: #333; + --code-color: #ccc; + --hljs-link: #999; + --hljs-keyword: #cda869; + --hljs-regexp: #f9ee98; + --hljs-title: #dcdcaa; + --hljs-type: #ac885b; + --hljs-meta: #82aaff; + --hljs-variable: #cf6a4c; + } +} + +body { + margin: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 16px; + line-height: 1.5em; + background-color: var(--main-background); +} + +pre { + margin: 0; + font-family: "Fira Code", "Cascadia Code", Consolas, "Liberation Mono", Menlo, Courier, monospace; + font-size: 13px; + color: var(--code-color); + cursor: text; +} + +code { + font-family: inherit; +} + +a { + text-decoration: none; + color: inherit; +} + +a:visited { + color: inherit; +} + +#header { + color: var(--color); +} + +h1 { + display: inline-block; + margin: 1.5em 1.5em 0.75em 1.5em; +} + +.dirname { + color: var(--dirname-color); +} + +h2 { + display: inline-block; + position: relative; + top: -1px; +} + +#footer { + margin: 1em 0 1em 4em; + color: #aaa; + font-size: 12px; +} + +#footer a { + color: #666; + border-bottom: 1px solid #ccc; +} + +#footer a:visited { + color: #666; +} + +#navbar { + position: fixed; + top: 0; + left: 0; + width: 1em; + height: 100%; + background-color: var(--navbar-background); + border-right: 1px solid var(--navbar-border); + cursor: pointer; +} + +#navbar span { + display: block; + position: absolute; + width: 100%; + height: 5px; +} + +#navbar .unvisited, #navbar .some-visited { + background-color: var(--unvisited-margin-color); +} + +#report { + border-top: 1px solid var(--border); + border-bottom: 1px solid var(--border); + overflow: hidden; +} + +#lines-layer { + position: absolute; + z-index: -100; + width: 100%; + background-color: var(--code-background); +} + +#lines-layer span { + display: inline-block; + width: 100%; +} + +a[id] { + display: block; + position: relative; + top: -5.5em; +} + +#lines-layer .unvisited { + background-color: var(--unvisited-color); +} + +#lines-layer .visited { + background-color: var(--visited-color); +} + +#lines-layer .some-visited { + background-color: var(--somevisited-color); +} + +a[id]:target + span { + -webkit-animation: highlight-blank 0.5s; + -moz-animation: highlight-blank 0.5s; + -o-animation: highlight-blank 0.5s; + animation: highlight-blank 0.5s; +} + +a[id]:target + .unvisited { + -webkit-animation: highlight-unvisited 0.5s; + -moz-animation: highlight-unvisited 0.5s; + -o-animation: highlight-unvisited 0.5s; + animation: highlight-unvisited 0.5s; +} + +a[id]:target + .visited { + -webkit-animation: highlight-visited 0.5s; + -moz-animation: highlight-visited 0.5s; + -o-animation: highlight-visited 0.5s; + animation: highlight-visited 0.5s; +} + +a[id]:target + .some-visited { + -webkit-animation: highlight-some-visited 0.5s; + -moz-animation: highlight-some-visited 0.5s; + -o-animation: highlight-some-visited 0.5s; + animation: highlight-some-visited 0.5s; +} + +@-webkit-keyframes highlight-blank { + from { background-color: var(--highlight-color); } + to { background-color: transparent; } +} + +@-moz-keyframes highlight-blank { + from { background-color: var(--highlight-color); } + to { background-color: transparent; } +} + +@-o-keyframes highlight-blank { + from { background-color: var(--highlight-color); } + to { background-color: transparent; } +} + +@keyframes highlight-blank { + from { background-color: var(--highlight-color); } + to { background-color: transparent; } +} + +@-webkit-keyframes highlight-unvisited { + from { background-color: var(--highlight-color); } + to { background-color: var(--unvisited-color); } +} + +@-moz-keyframes highlight-unvisited { + from { background-color: var(--highlight-color); } + to { background-color: var(--unvisited-color); } +} + +@-o-keyframes highlight-unvisited { + from { background-color: var(--highlight-color); } + to { background-color: var(--unvisited-color); } +} + +@keyframes highlight-unvisited { + from { background-color: var(--highlight-color); } + to { background-color: var(--unvisited-color); } +} + +@-webkit-keyframes highlight-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--visited-color); } +} + +@-moz-keyframes highlight-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--visited-color); } +} + +@-o-keyframes highlight-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--visited-color); } +} + +@keyframes highlight-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--visited-color); } +} + +@-webkit-keyframes highlight-some-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--somevisited-color); } +} + +@-moz-keyframes highlight-some-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--somevisited-color); } +} + +@-o-keyframes highlight-some-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--somevisited-color); } +} + +@keyframes highlight-some-visited { + from { background-color: var(--highlight-color); } + to { background-color: var(--somevisited-color); } +} + +#line-numbers { + float: left; + border-right: 1px solid var(--border); + margin-right: 1em; + color: var(--line-number-color); + background-color: var(--line-numbers-background); + text-align: right; +} + +#line-numbers a { + display: inline-block; + padding-left: 2.35em; + padding-right: 1em; + text-decoration: none; + color: var(--line-number-color); +} + +#line-numbers .unvisited { + background-color: var(--unvisted-number-color); +} + +#line-numbers .visited { + background-color: var(--visted-number-color); +} + +code span[data-count] { + background-color: var(--visited-number-color); +} + +code span[data-count="0"] { + background-color: var(--unvisited-number-color); +} + +#tool-tip { + display: none; + position: fixed; + padding: 0 0.25em; + background-color: black; + color: white; +} + +#tool-tip.visible { + display: block; +} + +#files { + padding: 1.5em 4em; + background-color: var(--code-background); + border-top: 1px solid var(--border); + border-bottom: 1px solid var(--border); +} + +.meter { + display: inline-block; + position: relative; + top: 3px; + width: 5em; + height: 1em; + background-color: var(--meter-unvisited-color); +} + +.covered { + display: inline-block; + position: absolute; + width: 50%; + height: 100%; + background-color: var(--meter-visited-color); + border-right: 1px solid var(--meter-separator-color); +} + +#files div { + display: flex; +} + +summary { + cursor: pointer; + display: flex; +} + +.summary-indicator { + display: inline-block; + width: 1em; + color: var(--color); +} + +/* Adds indentation to the directory tree */ +details > details, details > div { + margin-left: 1em; +} + +details > summary > .summary-indicator { + text-align: center; + font-weight: bold; +} + +details > summary > .summary-indicator::before { + content: "+"; +} + +details[open] > summary > .summary-indicator::before { + content: "-"; +} + +.percentage { + display: inline-block; + min-width: 7.5em; + margin: 0 0.5em; + font-size: 90%; + color: var(--color); +} + +.stats { + display: inline-block; + font-size: 70%; + color: var(--stats-color); +} + +#files a { + text-decoration: none; + border-bottom: 1px solid var(--underline-color); + color: var(--color); +} + +.hljs-link, +.hljs-comment, +.hljs-quote { + color: var(--hljs-link); +} + +.hljs-built_in, +.hljs-builtin-name, +.hljs-keyword, +.hljs-selector-tag, +.hljs-subst { + color: var(--hljs-keyword); +} + +.hljs-number, +.hljs-literal, +.hljs-variable, +.hljs-template-variable, +.hljs-tag .hljs-attr { + color: var(--hljs-variable); +} + +.hljs-regexp, +.hljs-string, +.hljs-doctag { + color: var(--hljs-regexp); +} + +.hljs-title, +.hljs-section, +.hljs-selector-id { + color: var(--hljs-title); +} + +.hljs-type, +.hljs-class .hljs-title { + color: var(--hljs-type); +} + +.hljs-meta, +.hljs-tag, +.hljs-name, +.hljs-attribute { + color: var(--hljs-meta); +} diff --git a/_coverage/coverage.js b/_coverage/coverage.js new file mode 100644 index 0000000..ef27254 --- /dev/null +++ b/_coverage/coverage.js @@ -0,0 +1,164 @@ +function tool_tip_element() +{ + var element = document.querySelector("#tool-tip"); + if (element === null) { + element = document.createElement("div"); + element.id = "tool-tip"; + document.querySelector("body").appendChild(element); + } + + return element; +}; + +var tool_tip = tool_tip_element(); +var html = document.getElementsByTagName("html")[0]; + +function attach_tool_tip() +{ + document.querySelector("body").onmousemove = function (event) + { + var element = event.target; + if (element.dataset.count === undefined) + element = event.target.parentNode; + + if (element.dataset.count && element.dataset.count !== "0") { + tool_tip.textContent = element.dataset.count; + tool_tip.classList.add("visible"); + + if (event.clientY < html.clientHeight - 48) + tool_tip.style.top = event.clientY + 7 + "px"; + else + tool_tip.style.top = event.clientY - 32 + "px"; + + tool_tip.style.left = event.clientX + 7 + "px"; + } + else + tool_tip.classList.remove("visible"); + } +}; + +attach_tool_tip(); + +function move_line_to_cursor(cursor_y, line_number) +{ + var id = "L" + line_number; + + var line_anchor = + document.querySelector("a[id=" + id + "] + span"); + if (line_anchor === null) + return; + + var line_y = line_anchor.getBoundingClientRect().top + 18; + + var y = window.scrollY; + window.location = "#" + id; + window.scrollTo(0, y + line_y - cursor_y); +}; + +function handle_navbar_clicks() +{ + var line_count = document.querySelectorAll("a[id]").length; + var navbar = document.querySelector("#navbar"); + + if (navbar === null) + return; + + navbar.onclick = function (event) + { + event.preventDefault(); + + var line_number = + Math.floor(event.clientY / navbar.clientHeight * line_count + 1); + + move_line_to_cursor(event.clientY, line_number); + }; +}; + +handle_navbar_clicks(); + +function handle_line_number_clicks() +{ + document.querySelector("body").onclick = function (event) + { + if (event.target.tagName != "A") + return; + + var line_number_location = event.target.href.search(/#L[0-9]+\$/); + if (line_number_location === -1) + return; + + var anchor = event.target.href.slice(line_number_location); + + event.preventDefault(); + + var y = window.scrollY; + window.location = anchor; + window.scrollTo(0, y); + }; +}; + +handle_line_number_clicks(); + +function handle_collapsible_click() +{ + document.querySelectorAll("summary").forEach( + function (summary) + { + summary.onclick = function (event) + { + var details = summary.parentElement; + + var all_open = function (sub_details) { + var all_are_open = true; + for (let details of sub_details) { + all_are_open = + all_are_open && + details.hasAttribute('open'); + } + return all_are_open; + }; + + var all_toggle = function (sub_details, toggle) { + for (let details of sub_details) { + if (toggle) + details.removeAttribute('open'); + else + details.setAttribute('open', ''); + } + }; + + // ctrl-click toggles the state of the folder and all sub-folders, recursively: + // - if all sub-folders are opened, then all sub-folders are closed + // - if at least one sub-folder is closed (or the folder itself), + // then all sub-folders are opened + if (event.ctrlKey) { + var sub_details = Array.prototype.slice.call( + details.querySelectorAll("details") + ); + sub_details.push(details); + all_toggle(sub_details, all_open(sub_details)); + return false; + } + + // shift-click toggles the state of all immediate sub-folders: + // - if the folder is closed, just open it + // - if the folder is opened: + // - if all sub-folders are opened, then all sub-folders are closed + // - if at least one sub-folder is closed, then all sub-folders are opened + if (event.shiftKey && details.hasAttribute('open')) { + details.setAttribute('open', ''); + var sub_details = + Array.prototype.filter.call( + details.querySelectorAll("details"), + function (sub_details) { + return sub_details.parentNode === details; + } + ); + all_toggle(sub_details, all_open(sub_details)); + return false; + } + }; + }); +} + +handle_collapsible_click(); diff --git a/_coverage/highlight.pack.js b/_coverage/highlight.pack.js new file mode 100644 index 0000000..2e55d49 --- /dev/null +++ b/_coverage/highlight.pack.js @@ -0,0 +1,2 @@ +/*! highlight.js v9.15.8 | BSD3 License | git.io/hljslicense */ +!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(a){var f=[],u=Object.keys,N={},c={},n=/^(no-?highlight|plain|text)$/i,s=/\blang(?:uage)?-([\w-]+)\b/i,t=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,r={case_insensitive:"cI",lexemes:"l",contains:"c",keywords:"k",subLanguage:"sL",className:"cN",begin:"b",beginKeywords:"bK",end:"e",endsWithParent:"eW",illegal:"i",excludeBegin:"eB",excludeEnd:"eE",returnBegin:"rB",returnEnd:"rE",relevance:"r",variants:"v",IDENT_RE:"IR",UNDERSCORE_IDENT_RE:"UIR",NUMBER_RE:"NR",C_NUMBER_RE:"CNR",BINARY_NUMBER_RE:"BNR",RE_STARTERS_RE:"RSR",BACKSLASH_ESCAPE:"BE",APOS_STRING_MODE:"ASM",QUOTE_STRING_MODE:"QSM",PHRASAL_WORDS_MODE:"PWM",C_LINE_COMMENT_MODE:"CLCM",C_BLOCK_COMMENT_MODE:"CBCM",HASH_COMMENT_MODE:"HCM",NUMBER_MODE:"NM",C_NUMBER_MODE:"CNM",BINARY_NUMBER_MODE:"BNM",CSS_NUMBER_MODE:"CSSNM",REGEXP_MODE:"RM",TITLE_MODE:"TM",UNDERSCORE_TITLE_MODE:"UTM",COMMENT:"C",beginRe:"bR",endRe:"eR",illegalRe:"iR",lexemesRe:"lR",terminators:"t",terminator_end:"tE"},b="",h={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function _(e){return e.replace(/&/g,"&").replace(//g,">")}function E(e){return e.nodeName.toLowerCase()}function v(e,n){var t=e&&e.exec(n);return t&&0===t.index}function l(e){return n.test(e)}function g(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function R(e){var a=[];return function e(n,t){for(var r=n.firstChild;r;r=r.nextSibling)3===r.nodeType?t+=r.nodeValue.length:1===r.nodeType&&(a.push({event:"start",offset:t,node:r}),t=e(r,t),E(r).match(/br|hr|img|input/)||a.push({event:"stop",offset:t,node:r}));return t}(e,0),a}function i(e){if(r&&!e.langApiRestored){for(var n in e.langApiRestored=!0,r)e[n]&&(e[r[n]]=e[n]);(e.c||[]).concat(e.v||[]).forEach(i)}}function m(o){function s(e){return e&&e.source||e}function c(e,n){return new RegExp(s(e),"m"+(o.cI?"i":"")+(n?"g":""))}!function n(t,e){if(!t.compiled){if(t.compiled=!0,t.k=t.k||t.bK,t.k){function r(t,e){o.cI&&(e=e.toLowerCase()),e.split(" ").forEach(function(e){var n=e.split("|");a[n[0]]=[t,n[1]?Number(n[1]):1]})}var a={};"string"==typeof t.k?r("keyword",t.k):u(t.k).forEach(function(e){r(e,t.k[e])}),t.k=a}t.lR=c(t.l||/\w+/,!0),e&&(t.bK&&(t.b="\\b("+t.bK.split(" ").join("|")+")\\b"),t.b||(t.b=/\B|\b/),t.bR=c(t.b),t.endSameAsBegin&&(t.e=t.b),t.e||t.eW||(t.e=/\B|\b/),t.e&&(t.eR=c(t.e)),t.tE=s(t.e)||"",t.eW&&e.tE&&(t.tE+=(t.e?"|":"")+e.tE)),t.i&&(t.iR=c(t.i)),null==t.r&&(t.r=1),t.c||(t.c=[]),t.c=Array.prototype.concat.apply([],t.c.map(function(e){return function(n){return n.v&&!n.cached_variants&&(n.cached_variants=n.v.map(function(e){return g(n,{v:null},e)})),n.cached_variants||n.eW&&[g(n)]||[n]}("self"===e?t:e)})),t.c.forEach(function(e){n(e,t)}),t.starts&&n(t.starts,e);var i=t.c.map(function(e){return e.bK?"\\.?(?:"+e.b+")\\.?":e.b}).concat([t.tE,t.i]).map(s).filter(Boolean);t.t=i.length?c(function(e,n){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i')+n+(t?"":b):n}function o(){E+=null!=l.sL?function(){var e="string"==typeof l.sL;if(e&&!N[l.sL])return _(g);var n=e?C(l.sL,g,!0,f[l.sL]):O(g,l.sL.length?l.sL:void 0);return 0")+'"');return g+=n,n.length||1}var s=B(e);if(!s)throw new Error('Unknown language: "'+e+'"');m(s);var a,l=t||s,f={},E="";for(a=l;a!==s;a=a.parent)a.cN&&(E=c(a.cN,"",!0)+E);var g="",R=0;try{for(var d,p,M=0;l.t.lastIndex=M,d=l.t.exec(n);)p=r(n.substring(M,d.index),d[0]),M=d.index+p;for(r(n.substr(M)),a=l;a.parent;a=a.parent)a.cN&&(E+=b);return{r:R,value:E,language:e,top:l}}catch(e){if(e.message&&-1!==e.message.indexOf("Illegal"))return{r:0,value:_(n)};throw e}}function O(t,e){e=e||h.languages||u(N);var r={r:0,value:_(t)},a=r;return e.filter(B).filter(M).forEach(function(e){var n=C(e,t,!1);n.language=e,n.r>a.r&&(a=n),n.r>r.r&&(a=r,r=n)}),a.language&&(r.second_best=a),r}function d(e){return h.tabReplace||h.useBR?e.replace(t,function(e,n){return h.useBR&&"\n"===e?"
":h.tabReplace?n.replace(/\t/g,h.tabReplace):""}):e}function o(e){var n,t,r,a,i,o=function(e){var n,t,r,a,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=s.exec(i))return B(t[1])?t[1]:"no-highlight";for(n=0,r=(i=i.split(/\s+/)).length;n/g,"\n"):n=e,i=n.textContent,r=o?C(o,i,!0):O(i),(t=R(n)).length&&((a=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=r.value,r.value=function(e,n,t){var r=0,a="",i=[];function o(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function u(e){a+=""}function s(e){("start"===e.event?c:u)(e.node)}for(;e.length||n.length;){var l=o();if(a+=_(t.substring(r,l[0].offset)),r=l[0].offset,l===e){for(i.reverse().forEach(u);s(l.splice(0,1)[0]),(l=o())===e&&l.length&&l[0].offset===r;);i.reverse().forEach(c)}else"start"===l[0].event?i.push(l[0].node):i.pop(),s(l.splice(0,1)[0])}return a+_(t.substr(r))}(t,R(a),i)),r.value=d(r.value),e.innerHTML=r.value,e.className=function(e,n,t){var r=n?c[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}(e.className,o,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function p(){if(!p.called){p.called=!0;var e=document.querySelectorAll("pre code");f.forEach.call(e,o)}}function B(e){return e=(e||"").toLowerCase(),N[e]||N[c[e]]}function M(e){var n=B(e);return n&&!n.disableAutodetect}return a.highlight=C,a.highlightAuto=O,a.fixMarkup=d,a.highlightBlock=o,a.configure=function(e){h=g(h,e)},a.initHighlighting=p,a.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",p,!1),addEventListener("load",p,!1)},a.registerLanguage=function(n,e){var t=N[n]=e(a);i(t),t.aliases&&t.aliases.forEach(function(e){c[e]=n})},a.listLanguages=function(){return u(N)},a.getLanguage=B,a.autoDetection=M,a.inherit=g,a.IR=a.IDENT_RE="[a-zA-Z]\\w*",a.UIR=a.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",a.NR=a.NUMBER_RE="\\b\\d+(\\.\\d+)?",a.CNR=a.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",a.BNR=a.BINARY_NUMBER_RE="\\b(0b[01]+)",a.RSR=a.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",a.BE=a.BACKSLASH_ESCAPE={b:"\\\\[\\s\\S]",r:0},a.ASM=a.APOS_STRING_MODE={cN:"string",b:"'",e:"'",i:"\\n",c:[a.BE]},a.QSM=a.QUOTE_STRING_MODE={cN:"string",b:'"',e:'"',i:"\\n",c:[a.BE]},a.PWM=a.PHRASAL_WORDS_MODE={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},a.C=a.COMMENT=function(e,n,t){var r=a.inherit({cN:"comment",b:e,e:n,c:[]},t||{});return r.c.push(a.PWM),r.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),r},a.CLCM=a.C_LINE_COMMENT_MODE=a.C("//","$"),a.CBCM=a.C_BLOCK_COMMENT_MODE=a.C("/\\*","\\*/"),a.HCM=a.HASH_COMMENT_MODE=a.C("#","$"),a.NM=a.NUMBER_MODE={cN:"number",b:a.NR,r:0},a.CNM=a.C_NUMBER_MODE={cN:"number",b:a.CNR,r:0},a.BNM=a.BINARY_NUMBER_MODE={cN:"number",b:a.BNR,r:0},a.CSSNM=a.CSS_NUMBER_MODE={cN:"number",b:a.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},a.RM=a.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[a.BE,{b:/\[/,e:/\]/,r:0,c:[a.BE]}]},a.TM=a.TITLE_MODE={cN:"title",b:a.IR,r:0},a.UTM=a.UNDERSCORE_TITLE_MODE={cN:"title",b:a.UIR,r:0},a.METHOD_GUARD={b:"\\.\\s*"+a.UIR,r:0},a});hljs.registerLanguage("ocaml",function(e){return{aliases:["ml"],k:{keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref",literal:"true false"},i:/\/\/|>>/,l:"[a-z_]\\w*!?",c:[{cN:"literal",b:"\\[(\\|\\|)?\\]|\\(\\)",r:0},e.C("\\(\\*","\\*\\)",{c:["self"]}),{cN:"symbol",b:"'[A-Za-z_](?!')[\\w']*"},{cN:"type",b:"`[A-Z][\\w']*"},{cN:"type",b:"\\b[A-Z][\\w']*",r:0},{b:"[a-z_]\\w*'[\\w']*",r:0},e.inherit(e.ASM,{cN:"string",r:0}),e.inherit(e.QSM,{i:null}),{cN:"number",b:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",r:0},{b:/[-=]>/}]}});hljs.registerLanguage("reasonml",function(r){var e="~?[a-z$_][0-9a-zA-Z$_]*",a="`?[A-Z$_][0-9a-zA-Z$_]*",c="("+["||","&&","++","**","+.","*","/","*.","/.","...","|>"].map(function(r){return r.split("").map(function(r){return"\\"+r}).join("")}).join("|")+"|==|===)",n="\\s+"+c+"\\s+",t={keyword:"and as asr assert begin class constraint do done downto else end exception externalfor fun function functor if in include inherit initializerland lazy let lor lsl lsr lxor match method mod module mutable new nonrecobject of open or private rec sig struct then to try type val virtual when while with",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ",literal:"true false"},i="\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",s={cN:"number",r:0,v:[{b:i},{b:"\\(\\-"+i+"\\)"}]},b={cN:"operator",r:0,b:c},o=[{cN:"identifier",r:0,b:e},b,s],l=[r.QSM,b,{cN:"module",b:"\\b"+a,rB:!0,e:".",c:[{cN:"identifier",b:a,r:0}]}],u=[{cN:"module",b:"\\b"+a,rB:!0,e:".",r:0,c:[{cN:"identifier",b:a,r:0}]}],_={cN:"function",r:0,k:t,v:[{b:"\\s(\\(\\.?.*?\\)|"+e+")\\s*=>",e:"\\s*=>",rB:!0,r:0,c:[{cN:"params",v:[{b:e},{b:"~?[a-z$_][0-9a-zA-Z$_]*(s*:s*[a-z$_][0-9a-z$_]*((s*('?[a-z$_][0-9a-z$_]*s*(,'?[a-z$_][0-9a-z$_]*)*)?s*))?)?(s*:s*[a-z$_][0-9a-z$_]*((s*('?[a-z$_][0-9a-z$_]*s*(,'?[a-z$_][0-9a-z$_]*)*)?s*))?)?"},{b:/\(\s*\)/}]}]},{b:"\\s\\(\\.?[^;\\|]*\\)\\s*=>",e:"\\s=>",rB:!0,r:0,c:[{cN:"params",r:0,v:[{b:e,e:"(,|\\n|\\))",r:0,c:[b,{cN:"typing",b:":",e:"(,|\\n)",rB:!0,r:0,c:u}]}]}]},{b:"\\(\\.\\s"+e+"\\)\\s*=>"}]};l.push(_);var N={cN:"constructor",b:a+"\\(",e:"\\)",i:"\\n",k:t,c:[r.QSM,b,{cN:"params",b:"\\b"+e}]},d={cN:"pattern-match",b:"\\|",rB:!0,k:t,e:"=>",r:0,c:[N,b,{r:0,cN:"constructor",b:a}]},z={cN:"module-access",k:t,rB:!0,v:[{b:"\\b("+a+"\\.)+"+e},{b:"\\b("+a+"\\.)+\\(",e:"\\)",rB:!0,c:[_,{b:"\\(",e:"\\)",skip:!0}].concat(l)},{b:"\\b("+a+"\\.)+{",e:"}"}],c:l};return u.push(z),{aliases:["re"],k:t,i:"(:\\-|:=|\\${|\\+=)",c:[r.C("/\\*","\\*/",{i:"^(\\#,\\/\\/)"}),{cN:"character",b:"'(\\\\[^']+|[^'])'",i:"\\n",r:0},r.QSM,{cN:"literal",b:"\\(\\)",r:0},{cN:"literal",b:"\\[\\|",e:"\\|\\]",r:0,c:o},{cN:"literal",b:"\\[",e:"\\]",r:0,c:o},N,{cN:"operator",b:n,i:"\\-\\->",r:0},s,r.CLCM,d,_,{cN:"module-def",b:"\\bmodule\\s+"+e+"\\s+"+a+"\\s+=\\s+{",e:"}",rB:!0,k:t,r:0,c:[{cN:"module",r:0,b:a},{b:"{",e:"}",skip:!0}].concat(l)},z]}}); \ No newline at end of file diff --git a/_coverage/index.html b/_coverage/index.html new file mode 100644 index 0000000..7ea46c2 --- /dev/null +++ b/_coverage/index.html @@ -0,0 +1,53 @@ + + + + + Coverage report + + + + + +
+
+ + + + 95% (171 / 179) + + lib/cli.ml + +
+
+ + + + 97% (39 / 40) + + lib/database.ml + +
+
+ + + + 83% (173 / 207) + + lib/tables.ml + +
+
+ + + + 56% (55 / 98) + + lib/utils.ml + +
+
+ + diff --git a/_coverage/lib/cli.ml.html b/_coverage/lib/cli.ml.html new file mode 100644 index 0000000..81c3bff --- /dev/null +++ b/_coverage/lib/cli.ml.html @@ -0,0 +1,976 @@ + + + + + cli.ml — Coverage report + + + + + + + + +
+
+
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+
+
+
+
+  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+
+
module type CliHandler = sig
+  val parse_input : string -> string
+  val get_response : string -> string
+  val reset : unit -> unit
+end
+
+module CLI = struct
+  open Utils
+  open Database
+  open Tables
+  module Tbl = Tables.HashTable
+  module DB = Database (Tbl)
+  open Yojson.Basic.Util
+
+  let db = ref DB.empty
+
+  type state =
+    | Default
+    | BuildInstance of (string * Tbl.t * (string * entry) list)
+    | BuildType of (string * string * entry list)
+
+  exception ParseError
+  exception InvalidExpr
+  exception InvalidComparison
+
+  let current_state = ref Default
+  let file_name = "data/responses.json"
+
+  let get_response response =
+    let file = Yojson.Basic.from_file file_name in
+    file |> to_assoc |> List.assoc response |> to_string
+
+  let reset () =
+    current_state := Default;
+    db := DB.empty
+
+  let parse_value v = function
+    | Strings -> String v
+    | Ints -> (
+        match int_of_string_opt v with
+        | Some i -> Int i
+        | None -> raise ParseError)
+    | Floats -> (
+        match float_of_string_opt v with
+        | Some f -> Float f
+        | None -> raise ParseError)
+    | Bools -> (
+        match bool_of_string_opt v with
+        | Some b -> Bool b
+        | None -> raise ParseError)
+    | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError)
+    | Ids ->
+        Id
+          (match v |> String.split_on_char '@' |> List.map String.trim with
+          | [] | [ _ ] | _ :: _ :: _ :: _ -> raise ParseError
+          | [ hd; tl ] -> (hd, String tl))
+
+  let rec build_instance (name, table, vals) input =
+    match
+      input |> String.split_on_char '=' |> List.map String.trim
+      |> List.filter (fun s -> s <> "")
+    with
+    | [] ->
+        DB.add_named_entry name vals !db;
+        current_state := Default;
+        get_response "indent_end" (* "|    <|\n|> " *)
+    | [ n ] ->
+        current_state := BuildInstance (name, table, vals);
+        get_response "err_create_field_no_value"
+        (* "Please input a variable and a value\n|    " *)
+    | n :: v :: tl -> (
+        match List.assoc_opt n vals with
+        | None -> (
+            match Tbl.exists table n with
+            | exception TypeMismatch ->
+                current_state := BuildInstance (name, table, vals);
+                get_response "err_create_field_DNE"
+                (* "That field does not exist in this type\n|    " *)
+            | t -> (
+                match parse_value v t with
+                | x ->
+                    current_state := BuildInstance (name, table, (n, x) :: vals);
+                    get_response "indent" (* "|    " *)
+                | exception ParseError ->
+                    current_state := BuildInstance (name, table, vals);
+                    get_response "err_create_field_wrong_type"
+                    (* "That value does not match the type of the field\n|    " *)
+                ))
+        | Some _ ->
+            current_state := BuildInstance (name, table, vals);
+            get_response "err_create_field_already_entered"
+            (* "This field has already been entered\n|    " *))
+
+  let process_assign input =
+    match input |> List.map String.trim |> List.filter (fun s -> s <> "") with
+    | [] ->
+        get_response "err_assign_empty"
+        (* "Please input a type name and id\n|> " *)
+    | [ name ] ->
+        get_response "err_assign_no_id"
+        (* "Please input an id for this instance\n|> " *)
+    | name :: id :: tl -> (
+        match DB.get_table name !db with
+        | Some t ->
+            current_state :=
+              BuildInstance
+                ( name,
+                  t,
+                  [
+                    ( (match Tbl.header t with
+                      | Type (n, _) :: tl -> n
+                      | _ -> failwith "impossible" [@coverage off]),
+                      String id );
+                  ] );
+            get_response "indent"
+        | None -> get_response "err_assign_DNE")
+  (* "That type does not exist\n|> " *)
+
+  let parse_type (typ, name) =
+    match typ with
+    | "int" -> Type (name, Ints)
+    | "float" -> Type (name, Floats)
+    | "string" -> Type (name, Strings)
+    | "bool" -> Type (name, Bools)
+    | "char" -> Type (name, Chars)
+    | "id" -> Type (name, Ids)
+    | _ -> raise ParseError
+
+  let rec build_type (name, id, types) input =
+    match
+      String.split_on_char ' ' input
+      |> List.map String.trim
+      |> List.filter (fun s -> s <> "")
+    with
+    | [] ->
+        db := DB.build_table !db (Type (id, Strings) :: types) name;
+        current_state := Default;
+        get_response "indent_end" (* "|    <|\n|> " *)
+    | [ typ ] -> get_response "err_defn_no_name"
+    (* "Please enter a name for this field\n|    " *)
+    | typ :: field_name :: tl -> (
+        match parse_type (typ, field_name) with
+        | Type _ as t ->
+            current_state := BuildType (name, id, types @ [ t ]);
+            get_response "indent" (* "|    " *)
+        | exception ParseError ->
+            current_state := BuildType (name, id, types);
+            get_response
+              "err_defn_invalid_type" (* "Not a recognized type\n|    " *)
+        | _ -> raise (Failure "Should be impossible") [@coverage off])
+
+  let process_type input =
+    match List.filter (fun s -> s <> "") input with
+    | [] -> get_response "err_defn_needs_type_name"
+    (* "Please enter a type name for the definition\n|> " *)
+    | [ name ] ->
+        get_response "err_defn_needs_ID_name"
+        (* "Please enter a name for the ID of this type\n|> " *)
+    | name :: id :: tl -> (
+        match DB.get_table name !db with
+        | Some _ ->
+            get_response "err_defn_already_exists"
+            (* "\n Type already defined\n|> " *)
+        | None ->
+            current_state := BuildType (name, id, []);
+            get_response "indent" (* "|    " *))
+
+  let process_at input =
+    match input |> List.map String.trim |> List.filter (fun s -> s <> "") with
+    | [] ->
+        get_response "err_at_empty"
+        (* "Please enter what the type and id of which to get an instance\n|> " *)
+    | [ name ] ->
+        get_response "err_at_no_id"
+        (* "Please enter an id of the instance you which to get\n|> " *)
+    | [ name; id ] -> (
+        match DB.get_table name !db with
+        | Some x -> (
+            try
+              (x |> Tbl.header |> optionize |> build_row)
+              ^ "\n"
+              ^ (String id |> Tbl.at x |> build_row)
+            with Not_found -> get_response "err_at_id_DNE")
+        | None ->
+            get_response "err_at_invalid_type" (* "No type of that name" *))
+    | name :: id :: col :: tl -> (
+        match DB.get_table name !db with
+        | Some x -> (
+            try
+              let row = Tbl.at x (String id) in
+              match int_of_string_opt col with
+              | None ->
+                  get_response "err_at_column_not_int"
+                  (* "Column number should be an int" *)
+              | Some i -> (
+                  match List.nth_opt row i with
+                  | Some e -> (
+                      match e with
+                      | None -> get_response "no_entry"
+                      | Some e -> (
+                          match e with
+                          | Id (name, row) ->
+                              (entry_to_string e ^ "="
+                              ^
+                              match DB.get_reference e !db with
+                              | exception Not_found ->
+                                  get_response "unbound_type"
+                              | l, r -> (
+                                  "\n"
+                                  ^ build_row (optionize l)
+                                  ^
+                                  match r with
+                                  | None -> get_response "unbound_val"
+                                  | Some v -> build_row v))
+                              ^ "\n|> "
+                          | _ -> entry_to_string e ^ "\n|> "))
+                  | None -> get_response "err_at_column_out_of_range")
+            with Not_found -> get_response "err_at_id_DNE")
+        | None -> get_response "err_at_invalid_type")
+
+  let split_on_substring sub str =
+    let idxs = ref [ 0 ] in
+    let sub_len = String.length sub in
+    for i = 0 to String.length str - sub_len do
+      if String.sub str i sub_len = sub then
+        idxs := !idxs @ [ i; i + String.length sub ]
+      else ()
+    done;
+    idxs := !idxs @ [ String.length str ];
+    let rec create_lst idxs sub_len str =
+      match idxs with
+      | [] -> []
+      | s :: e :: t -> String.sub str s (e - s) :: create_lst t sub_len str
+      | _ -> failwith "odd" [@coverage off]
+    in
+    create_lst !idxs sub_len str
+
+  let parse_compare_exp str =
+    let str_lst = String.split_on_char ' ' str in
+    if List.length str_lst <> 3 then raise InvalidExpr
+    else
+      match str_lst with
+      | [ var; compare; value ] ->
+          ( var,
+            (match compare with
+            | "=" -> EQ
+            | "<>" -> NEQ
+            | ">" -> GT
+            | "<" -> LT
+            | "<=" -> LTE
+            | ">=" -> GTE
+            | _ -> raise InvalidComparison),
+            value )
+      | _ -> failwith "should be impossible" [@coverage off]
+
+  let process_find lst =
+    let cleaned_lst =
+      lst |> List.map String.trim |> List.filter (fun s -> s <> "")
+    in
+    if cleaned_lst = [] then get_response "err_find_missing_type"
+    else
+      match DB.get_table (List.hd cleaned_lst) !db with
+      | None -> get_response "err_find_invalid_type"
+      | Some type_table -> (
+          try
+            cleaned_lst |> List.tl
+            |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) ""
+            |> split_on_substring "and" |> List.map String.trim
+            |> List.filter (fun s -> s <> "")
+            |> (fun lst -> if lst = [] then raise InvalidExpr else lst)
+            |> List.map parse_compare_exp
+            |> Tbl.process_constraints type_table
+          with
+          | InvalidExpr -> get_response "err_find_invalid_expr"
+          | InvalidComparison -> get_response "err_find_invalid_comparison"
+          | TypeMismatch -> get_response "err_find_wrong_type"
+          | Not_found -> get_response "err_find_var_DNE")
+
+  (** [parse_input input] takes in new input and determines the relevant command*)
+  let parse_input input =
+    match !current_state with
+    | BuildInstance v -> build_instance v input
+    | BuildType v -> build_type v input
+    | Default -> (
+        match String.split_on_char ' ' input with
+        | "quit" :: tl -> exit 0 [@coverage off]
+        | "help" :: tl -> get_response "help_message"
+        | "def" :: tl -> process_type tl
+        | "assign" :: tl -> process_assign tl
+        | "print" :: tl -> DB.db_to_string !db ^ "|> "
+        | "at" :: tl -> process_at tl
+        | "find" :: tl -> process_find tl
+        | _ ->
+            get_response "err_unknown_command"
+            (* "Unknown command. Type help for a list of commands\n|> " *))
+end
+
+(** [main ()] prompts for the script to start, then starts it. *)
+
+let main () =
+  let file_name = "data/responses.json" in
+  let welcom_string =
+    let file = Yojson.Basic.from_file file_name in
+    file |> Yojson.Basic.Util.to_assoc |> List.assoc "welcome"
+    |> Yojson.Basic.Util.to_string
+  in
+  print_string welcom_string;
+  print_string "|> ";
+  while true do
+    read_line () |> CLI.parse_input |> print_string
+  done
+  [@@coverage off]
+
+
+
+ + + diff --git a/_coverage/lib/database.ml.html b/_coverage/lib/database.ml.html new file mode 100644 index 0000000..2e54b3c --- /dev/null +++ b/_coverage/lib/database.ml.html @@ -0,0 +1,225 @@ + + + + + database.ml — Coverage report + + + + + + + + +
+
+
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+
+
+
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
+
open Utils
+open Tables
+
+module Database (Table : Table) = struct
+  exception NoEntry
+  exception WrongType
+  exception TableExists
+
+  type table = Table.t
+  type database = (string * table ref) list
+
+  let empty = []
+
+  let add_table database table name : database =
+    match
+      List.find (fun a -> match a with tname, t -> name = tname) database
+    with
+    | exception Not_found -> (name, ref table) :: database
+    | _ -> raise TableExists
+
+  let build_table database table name =
+    match
+      List.find (fun a -> match a with tname, t -> name = tname) database
+    with
+    | exception Not_found -> (name, ref (Table.empty table)) :: database
+    | _ -> raise TableExists
+
+  let drop_table name database =
+    List.filter (fun a -> match a with tname, t -> name <> tname) database
+
+  let get_table name database =
+    match List.assoc_opt name database with Some x -> Some !x | None -> None
+
+  let get_reference ent database =
+    match ent with
+    | Id (tbl, id) -> (
+        let tbl =
+          match get_table tbl database with
+          | None -> raise Not_found
+          | Some v -> v
+        in
+        ( Table.header tbl,
+          match Table.at tbl id with exception Not_found -> None | v -> Some v
+        ))
+    | _ -> raise TypeMismatch
+
+  let rec db_to_string database =
+    match database with
+    | [] -> "\n"
+    | (name, x) :: xs ->
+        "Table: " ^ name ^ "\n\n" ^ Table.table_to_string !x ^ db_to_string xs
+
+  let rec add_entry table_name new_row database =
+    match database with
+    | [] -> raise Not_found
+    | (a, b) :: tl when a = table_name -> b := Table.insert !b new_row
+    | _ :: tl -> add_entry table_name new_row tl
+
+  let add_named_entry table_name new_row database =
+    match List.assoc_opt table_name database with
+    | None -> raise Not_found
+    | Some x -> x := Table.insert_named !x new_row
+end
+
+
+
+ + + diff --git a/_coverage/lib/tables.ml.html b/_coverage/lib/tables.ml.html new file mode 100644 index 0000000..fe3f6b1 --- /dev/null +++ b/_coverage/lib/tables.ml.html @@ -0,0 +1,869 @@ + + + + + tables.ml — Coverage report + + + + + + + + +
+
+
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+
+
+
+
+  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+
+
open Utils
+
+let rec assert_types header a =
+  match header with
+  | [] -> if a = [] then [] else raise TypeMismatch [@coverage off]
+  | hd :: tl -> (
+      match a with
+      | [] -> raise TypeMismatch
+      | b :: c ->
+          (match hd with
+          | Some (Type (_, Strings)) -> (
+              match b with
+              | Some (String _) -> b
+              | None -> b
+              | _ -> raise TypeMismatch)
+          | Some (Type (_, Floats)) -> (
+              match b with
+              | Some (Float _) -> b
+              | None -> b
+              | _ -> raise TypeMismatch)
+          | Some (Type (_, Ints)) -> (
+              match b with
+              | Some (Int _) -> b
+              | None -> b
+              | _ -> raise TypeMismatch)
+          | Some (Type (_, Bools)) -> (
+              match b with
+              | Some (Bool _) -> b
+              | None -> b
+              | _ -> raise TypeMismatch)
+          | Some (Type (_, Chars)) -> (
+              match b with
+              | Some (Char _) -> b
+              | None -> b
+              | _ -> raise TypeMismatch)
+          | Some (Type (_, Ids)) -> (
+              match b with
+              | Some (Id _) -> b
+              | None -> b
+              | _ -> raise TypeMismatch)
+          | _ -> raise TypeMismatch)
+          :: assert_types tl c)
+
+let rec reorder_list (a : (string * entry) list) = function
+  | [] -> if a = [] then [] else raise TypeMismatch
+  | Some (Type (name, v)) :: tl ->
+      let vl, rest =
+        let rec extr_name acc = function
+          | [] -> (None, acc)
+          | (n, vr) :: rest ->
+              if n = name then (Some vr, acc @ rest)
+              else extr_name (acc @ [ (n, vr) ]) rest
+        in
+        extr_name [] a
+      in
+      vl :: reorder_list rest tl
+  | _ -> raise TypeMismatch
+
+let rec get_type_index cnt name = function
+  | [] -> raise Not_found
+  | Type (n, _) :: tl ->
+      if n = name then cnt else get_type_index (cnt + 1) name tl
+  | _ -> raise TypeMismatch
+
+module type Table = sig
+  type t
+
+  val empty : entry list -> t
+  val insert : t -> entry list -> t
+  val insert_named : t -> (string * entry) list -> t
+  val at : t -> entry -> entry option list
+  val delete : t -> entry -> t
+  val table_to_string : t -> string
+  val process_constraints : t -> (string * comparison * string) list -> string
+  val header : t -> entry list
+  val exists : t -> string -> types
+end
+
+module ListTable : Table = struct
+  type t = entry option list list
+
+  let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl
+  let empty (ex : entry list) = [ optionize ex ]
+
+  let insert (table : t) a =
+    match
+      List.find
+        (fun b ->
+          match optionize a with
+          | [] -> false
+          | hd :: tl -> ( match b with [] -> false | hdb :: tlb -> hd = hdb))
+        table
+    with
+    | exception Not_found ->
+        table @ [ assert_types (List.hd table) (optionize a) ]
+    | x -> raise IndexExists
+
+  let insert_named table elist =
+    let name, value = List.hd elist in
+    match List.find (fun a -> List.hd a = Some value) table with
+    | x -> raise IndexExists
+    | exception Not_found ->
+        table
+        @ [ assert_types (List.hd table) (reorder_list elist (List.hd table)) ]
+
+  let at (table : t) id =
+    List.find
+      (fun a ->
+        match a with
+        | [] -> raise Not_found
+        | hd :: tl -> ( match hd with Some x -> x = id | None -> false))
+      table
+
+  let delete (table : t) id : t =
+    List.filter
+      (fun a ->
+        match a with
+        | [] -> true
+        | a :: asd -> ( match a with Some x -> x <> id | None -> true))
+      table
+
+  let rec table_to_string (table : t) =
+    match table with
+    | [] -> ""
+    | b :: xs -> build_row b ^ table_to_string xs ^ "\n"
+
+  let rec deoptionize = function
+    | [] -> []
+    | hd :: tl ->
+        (match hd with
+        | Some x -> x
+        | None -> raise (Failure "Deoptionize saw None") [@coverage off])
+        :: deoptionize tl
+
+  let header = function
+    | [] -> raise (Failure "RI Violated for tables") [@coverage off]
+    | hd :: tl -> deoptionize hd
+
+  let exists table name =
+    let rec follow_header = function
+      | [] -> raise TypeMismatch
+      | Type (n, t) :: tl when n = name -> t
+      | _ :: tl -> follow_header tl
+    in
+    follow_header (header table)
+
+  let rec process_constraints tbl lst =
+    match lst with
+    | [] -> table_to_string tbl
+    | hd :: tl ->
+        let ntbl =
+          match hd with
+          | name, cmp, vl -> (
+              let ind = get_type_index 0 name (header tbl) in
+              match List.nth (header tbl) ind with
+              | Type (_, t) ->
+                  let e = process_entry vl t in
+                  List.filter
+                    (fun a ->
+                      match List.nth a ind with
+                      | None -> false
+                      | Some v -> run_constraint cmp e v)
+                    tbl
+              | _ -> failwith "Impossible")
+        in
+        process_constraints ntbl tl
+end
+
+module HashTable = struct
+  type t = HashTab of entry list * (entry, entry option list) Hashtbl.t
+
+  let rec deoptionize_list = function
+    | [] -> []
+    | Some x :: tl -> x :: deoptionize_list tl
+    | None :: tl -> raise (Failure "Deoptionize on none")
+    [@@coverage off]
+
+  let header = function HashTab (hd, _) -> hd
+  let hshtable = function HashTab (_, hsh) -> hsh
+
+  let deoptionize = function
+    | Some x -> x
+    | None -> raise (Failure "Deoptionize on none") [@coverage off]
+
+  let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl
+  let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0)
+
+  let insert table entries =
+    match Hashtbl.find_opt (hshtable table) (List.hd entries) with
+    | Some x -> raise IndexExists
+    | None ->
+        let copy = Hashtbl.copy (hshtable table) in
+        let entrs =
+          assert_types (optionize (header table)) (optionize entries)
+        in
+        HashTab
+          ( header table,
+            (Hashtbl.add copy (List.hd entries) (List.tl entrs);
+             copy) )
+
+  let insert_named table entries =
+    let name, value = List.hd entries in
+    match Hashtbl.find_opt (hshtable table) value with
+    | Some x -> raise IndexExists
+    | None ->
+        let copy = Hashtbl.copy (hshtable table) in
+        let reordered =
+          assert_types
+            (header table |> optionize)
+            (reorder_list entries (optionize (header table)))
+        in
+        Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered);
+        HashTab (header table, copy)
+
+  let at table id = Some id :: Hashtbl.find (hshtable table) id
+
+  let delete table id =
+    let out = Hashtbl.copy (hshtable table) in
+    Hashtbl.remove (hshtable table) id;
+    HashTab (header table, out)
+
+  let rec table_to_string table =
+    Hashtbl.fold
+      (fun id ent acc -> acc ^ shorten (entry_to_string id) ^ build_row ent)
+      (hshtable table)
+      (build_row (optionize (header table)))
+
+  let rec process_constraints tbl lst =
+    let newHash = Hashtbl.create 0 in
+    match lst with
+    | [] -> table_to_string tbl
+    | hd :: tl ->
+        process_constraints
+          (match hd with
+          | name, cmp, vl ->
+              let ind = get_type_index 0 name (header tbl) in
+              let cmp_func =
+                match
+                  List.find
+                    (function
+                      | Type (n, t) -> n = name | _ -> failwith "Impossible")
+                    (header tbl)
+                with
+                | Type (n, t) -> (
+                    match process_entry vl t with e -> run_constraint cmp e)
+                | _ -> raise (Failure "Impossible")
+              in
+              Hashtbl.iter
+                (fun a b ->
+                  if ind = 0 then
+                    if cmp_func a then Hashtbl.add newHash a b else ()
+                  else
+                    match List.nth b (ind - 1) with
+                    | None -> ()
+                    | Some v ->
+                        if cmp_func v then Hashtbl.add newHash a b else ())
+                (hshtable tbl);
+              HashTab (header tbl, newHash))
+          tl
+
+  let exists table name =
+    let rec follow_header = function
+      | [] -> raise TypeMismatch
+      | Type (n, t) :: tl when n = name -> t
+      | _ :: tl -> follow_header tl
+    in
+    follow_header (header table)
+end
+
+
+
+ + + diff --git a/_coverage/lib/utils.ml.html b/_coverage/lib/utils.ml.html new file mode 100644 index 0000000..0a2f315 --- /dev/null +++ b/_coverage/lib/utils.ml.html @@ -0,0 +1,440 @@ + + + + + utils.ml — Coverage report + + + + + + + + +
+
+
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+
+
+
+
+  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+
+
type types = Strings | Floats | Ints | Chars | Bools | Ids
+type comparison = LT | LTE | EQ | NEQ | GT | GTE
+
+exception IndexExists
+exception TypeMismatch
+
+type entry =
+  | String of string
+  | Float of float
+  | Int of int
+  | Char of char
+  | Bool of bool
+  | Id of (string * entry)
+  | Type of (string * types)
+
+let name_map_entry t =
+  match t with
+  | String _ -> "string"
+  | Float _ -> "float"
+  | Int _ -> "int"
+  | Char _ -> "char"
+  | Bool _ -> "bool"
+  | Id _ -> "id"
+  | Type _ -> "type"
+
+let name_map_types t =
+  match t with
+  | Strings -> "string"
+  | Floats -> "float"
+  | Ints -> "int"
+  | Chars -> "char"
+  | Bools -> "bool"
+  | Ids -> "id"
+
+let guess_entry input =
+  match float_of_string_opt input with
+  | Some v -> Float v
+  | None -> (
+      match int_of_string_opt input with
+      | Some v -> Int v
+      | None -> (
+          match bool_of_string_opt input with
+          | Some v -> Bool v
+          | None ->
+              if String.length input = 1 then Char input.[0] else String input))
+
+let process_entry input = function
+  | Strings -> String input
+  | Floats -> (
+      match float_of_string_opt input with
+      | None -> raise TypeMismatch
+      | Some v -> Float v)
+  | Ints -> (
+      match int_of_string_opt input with
+      | None -> raise TypeMismatch
+      | Some v -> Int v)
+  | Chars ->
+      if String.length input = 1 then Char input.[0] else raise TypeMismatch
+  | Bools -> (
+      match bool_of_string_opt input with
+      | None -> raise TypeMismatch
+      | Some v -> Bool v)
+  | Ids -> (
+      match String.split_on_char '@' input with
+      | [] | [ _ ] | _ :: _ :: _ :: _ -> raise TypeMismatch
+      | [ hd; tl ] -> Id (hd, guess_entry tl))
+
+let make_compare cmp lhs rhs =
+  match cmp with
+  | LT -> lhs < rhs
+  | LTE -> lhs <= rhs
+  | EQ -> lhs = rhs
+  | NEQ -> lhs <> rhs
+  | GT -> lhs > rhs
+  | GTE -> lhs >= rhs
+
+let run_constraint (cmp : comparison) rhs lhs =
+  match rhs with
+  | Float r -> (
+      match lhs with
+      | Float l -> make_compare cmp l r
+      | _ -> failwith "Typing error")
+  | Int r -> (
+      match lhs with
+      | Int l -> make_compare cmp l r
+      | _ -> failwith "Typing error")
+  | Char r -> (
+      match lhs with
+      | Char l -> make_compare cmp l r
+      | _ -> failwith "Typing error")
+  | Bool r -> (
+      match lhs with
+      | Bool l -> make_compare cmp l r
+      | _ -> failwith "Typing error")
+  | String r -> (
+      match lhs with
+      | String l -> make_compare cmp l r
+      | _ -> failwith "Typing error")
+  | _ -> raise TypeMismatch
+
+let rec entry_to_string ent =
+  match ent with
+  | String x -> x
+  | Float x -> string_of_float x
+  | Int x -> string_of_int x
+  | Char x -> String.make 1 x
+  | Bool x -> string_of_bool x
+  | Id (a, b) -> a ^ "@" ^ entry_to_string b
+  | Type (a, b) -> name_map_types b ^ " " ^ a
+
+let shorten inp =
+  let str = String.trim inp in
+  if String.length str < 8 then str ^ "\t\t"
+  else if String.length str < 16 then str ^ "\t"
+  else String.sub str 0 16
+
+let rec build_row entlist =
+  match entlist with
+  | [] -> "\n\n"
+  | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs
+  | None :: xs -> "\t\t" ^ build_row xs
+
+let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl
+
+
+
+ + + diff --git a/bisect037238731.coverage b/bisect037238731.coverage new file mode 100644 index 0000000..06f0247 --- /dev/null +++ b/bisect037238731.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1136 1180 1210 1056 1092 964 1239 943 1420 1438 1328 1345 1302 1604 1524 1588 1552 1623 1498 1837 1775 1805 1723 40 12 2 4 4 14 44 44 1 2 2 45 2 2 3 73 49 122 4 2 2 1 4 5 0 5 2 2 3 2 5 1 1 1 2 1 3 38 1 38 39 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 22 12 13 12 12 12 83 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 6 83 24 11 12 11 11 6 83 158 4 45 49 49 100 149 149 149 141 141 141 7 26 141 7 174 14 2 14 13 lib/tables.ml 207 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2555 2513 2524 2602 2592 2908 2926 2899 2847 2939 2779 2793 2728 2752 2693 2643 3204 3240 3225 3195 3106 3135 3071 3065 3039 3000 3400 3419 3340 3372 3317 3283 3593 3613 3545 3566 3522 3486 3742 3762 3708 3723 3685 3874 3981 3814 3829 4086 4322 4185 4253 4218 4263 4144 4839 4877 4789 4735 4725 4644 4951 4612 4567 4591 4496 4397 4429 4376 5334 5382 5442 5596 5554 5565 5659 5633 5995 6041 6059 6082 5921 5913 5940 5970 5849 5869 5767 5801 5729 5745 5698 6584 6527 6518 6548 6570 6398 6406 6460 6452 6433 6490 6310 6330 6228 6262 6202 6171 6130 6652 6642 6620 6794 6763 6780 6724 6740 6693 6914 6897 6930 6885 6951 6994 6986 6975 6847 8155 8091 8062 7976 8009 7922 7876 7847 7828 7792 8119 8141 7641 7623 7556 7668 7430 7456 7510 7287 7311 7218 7109 7141 7088 7050 8394 8257 8325 8290 8335 8216 207 61 104 4 0 48 5 0 51 8 0 43 8 0 37 14 0 7 46 0 108 53 59 51 51 53 0 375 0 375 61 375 436 2 56 349 353 528 264 89 792 58 353 0 22 8 1 30 0 51 16 51 10 10 2 2 2 2 1 0 4 0 4 4 3 10 11 10 10 1 11 13 13 12 12 22 0 0 22 22 11 1 0 0 1 1 1 5 5 3 5 8 6 6 3 6 3 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 406 137 46 687 109 687 51 51 3 3 3 3 3 3 3 3 3 3 0 3 3 3 3 46 46 46 46 46 46 46 47 47 46 46 47 47 0 47 47 47 47 18 14 18 1 1 1 1 1 1 8 8 8 8 10 10 10 10 10 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 179 1 178 712 534 179 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/bisect116092532.coverage b/bisect116092532.coverage new file mode 100644 index 0000000..47b5af9 --- /dev/null +++ b/bisect116092532.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1136 1180 1210 1056 1092 964 1239 943 1420 1438 1328 1345 1302 1604 1524 1588 1552 1623 1498 1837 1775 1805 1723 40 12 0 4 4 12 44 44 1 2 2 45 6 6 5 73 49 122 4 2 2 1 4 5 0 5 2 2 3 2 5 1 1 1 2 1 3 38 1 38 39 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 18 8 9 8 8 8 59 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 59 16 7 8 7 7 2 59 106 0 25 25 25 76 101 101 101 95 95 95 7 18 95 7 120 14 2 14 13 lib/tables.ml 207 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2555 2513 2524 2602 2592 2908 2926 2899 2847 2939 2779 2793 2728 2752 2693 2643 3204 3240 3225 3195 3106 3135 3071 3065 3039 3000 3400 3419 3340 3372 3317 3283 3593 3613 3545 3566 3522 3486 3742 3762 3708 3723 3685 3874 3981 3814 3829 4086 4322 4185 4253 4218 4263 4144 4839 4877 4789 4735 4725 4644 4951 4612 4567 4591 4496 4397 4429 4376 5334 5382 5442 5596 5554 5565 5659 5633 5995 6041 6059 6082 5921 5913 5940 5970 5849 5869 5767 5801 5729 5745 5698 6584 6527 6518 6548 6570 6398 6406 6460 6452 6433 6490 6310 6330 6228 6262 6202 6171 6130 6652 6642 6620 6794 6763 6780 6724 6740 6693 6914 6897 6930 6885 6951 6994 6986 6975 6847 8155 8091 8062 7976 8009 7922 7876 7847 7828 7792 8119 8141 7641 7623 7556 7668 7430 7456 7510 7287 7311 7218 7109 7141 7088 7050 8394 8257 8325 8290 8335 8216 207 61 104 4 0 46 5 0 49 10 0 41 8 0 35 14 0 5 46 0 108 51 59 49 49 51 0 367 0 367 61 367 428 0 58 353 353 524 266 87 790 58 353 0 22 8 1 30 0 40 13 40 9 9 2 2 2 2 0 0 2 0 2 2 2 10 10 10 10 0 10 10 10 10 10 12 0 1 12 13 7 0 0 1 0 1 1 2 2 2 2 4 2 2 1 2 1 1 1 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 406 136 48 662 105 662 52 52 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 48 48 48 48 48 48 48 48 48 48 48 48 48 1 48 49 49 49 20 14 20 1 1 1 1 1 1 6 6 6 6 7 7 7 7 7 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 179 2 177 713 536 179 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/bisect452780914.coverage b/bisect452780914.coverage new file mode 100644 index 0000000..2178920 --- /dev/null +++ b/bisect452780914.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1136 1180 1210 1056 1092 964 1239 943 1420 1438 1328 1345 1302 1604 1524 1588 1552 1623 1498 1837 1775 1805 1723 40 10 0 2 2 10 42 42 0 0 0 42 0 0 0 69 46 115 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 37 0 37 37 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 16 8 8 8 8 8 56 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 56 16 7 8 7 7 2 56 103 0 23 23 23 75 98 98 98 92 92 92 7 15 92 7 114 14 2 14 13 lib/tables.ml 207 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2555 2513 2524 2602 2592 2908 2926 2899 2847 2939 2779 2793 2728 2752 2693 2643 3204 3240 3225 3195 3106 3135 3071 3065 3039 3000 3400 3419 3340 3372 3317 3283 3593 3613 3545 3566 3522 3486 3742 3762 3708 3723 3685 3874 3981 3814 3829 4086 4322 4185 4253 4218 4263 4144 4839 4877 4789 4735 4725 4644 4951 4612 4567 4591 4496 4397 4429 4376 5334 5382 5442 5596 5554 5565 5659 5633 5995 6041 6059 6082 5921 5913 5940 5970 5849 5869 5767 5801 5729 5745 5698 6584 6527 6518 6548 6570 6398 6406 6460 6452 6433 6490 6310 6330 6228 6262 6202 6171 6130 6652 6642 6620 6794 6763 6780 6724 6740 6693 6914 6897 6930 6885 6951 6994 6986 6975 6847 8155 8091 8062 7976 8009 7922 7876 7847 7828 7792 8119 8141 7641 7623 7556 7668 7430 7456 7510 7287 7311 7218 7109 7141 7088 7050 8394 8257 8325 8290 8335 8216 207 57 100 4 0 46 5 0 48 7 0 41 8 0 35 14 0 5 46 0 104 51 55 49 49 51 0 359 0 359 57 359 416 0 55 347 347 524 263 84 787 55 347 0 22 8 1 30 0 34 10 34 8 8 1 1 1 1 0 0 1 0 1 1 1 9 9 9 9 0 9 9 9 9 9 12 0 0 12 12 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 395 123 46 654 100 654 50 50 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 46 46 46 46 46 46 46 46 46 46 46 46 46 0 46 46 46 46 16 13 16 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 178 1 177 711 534 178 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/lib/database.ml b/lib/database.ml index 54dfe85..f1a45d1 100644 --- a/lib/database.ml +++ b/lib/database.ml @@ -31,7 +31,6 @@ module Database (Table : Table) = struct let get_table name database = match List.assoc_opt name database with Some x -> Some !x | None -> None - (*Currently doesn't work...*) let get_reference ent database = match ent with | Id (tbl, id) -> ( diff --git a/lib/tables.ml b/lib/tables.ml index 4bac436..0fa04af 100644 --- a/lib/tables.ml +++ b/lib/tables.ml @@ -2,7 +2,7 @@ open Utils let rec assert_types header a = match header with - | [] -> if a = [] then [] else raise TypeMismatch + | [] -> if a = [] then [] else raise TypeMismatch [@coverage off] | hd :: tl -> ( match a with | [] -> raise TypeMismatch @@ -84,13 +84,12 @@ module ListTable : Table = struct let insert (table : t) a = match - List.find (fun b -> - match a with - | [] -> raise (Failure "Error") - | hd :: tl -> ( - match b with - | [] -> raise (Failure "Error") - | hdb :: tlb -> hd = hdb)) + List.find + (fun b -> + match optionize a with + | [] -> false + | hd :: tl -> ( match b with [] -> false | hdb :: tlb -> hd = hdb)) + table with | exception Not_found -> table @ [ assert_types (List.hd table) (optionize a) ] @@ -100,22 +99,24 @@ module ListTable : Table = struct let name, value = List.hd elist in match List.find (fun a -> List.hd a = Some value) table with | x -> raise IndexExists - | exception Not_found -> table @ [ reorder_list elist (List.hd table) ] + | exception Not_found -> + table + @ [ assert_types (List.hd table) (reorder_list elist (List.hd table)) ] let at (table : t) id = List.find (fun a -> match a with - | [] -> raise (Failure "This shouldn't happen") + | [] -> raise Not_found | hd :: tl -> ( match hd with Some x -> x = id | None -> false)) table - let delete (table : t) id = + let delete (table : t) id : t = List.filter (fun a -> match a with - | [] -> false - | a :: asd -> ( match a with Some x -> x = id | None -> false)) + | [] -> true + | a :: asd -> ( match a with Some x -> x <> id | None -> true)) table let rec table_to_string (table : t) = @@ -128,11 +129,11 @@ module ListTable : Table = struct | hd :: tl -> (match hd with | Some x -> x - | None -> raise (Failure "Deoptionize saw None")) + | None -> raise (Failure "Deoptionize saw None") [@coverage off]) :: deoptionize tl let header = function - | [] -> raise (Failure "RI Violated for tables") + | [] -> raise (Failure "RI Violated for tables") [@coverage off] | hd :: tl -> deoptionize hd let exists table name = @@ -171,14 +172,15 @@ module HashTable = struct let rec deoptionize_list = function | [] -> [] | Some x :: tl -> x :: deoptionize_list tl - | None :: tl -> failwith "Deoptionize on None" + | None :: tl -> raise (Failure "Deoptionize on none") + [@@coverage off] let header = function HashTab (hd, _) -> hd let hshtable = function HashTab (_, hsh) -> hsh let deoptionize = function | Some x -> x - | None -> raise (Failure "Deoptionize on none") + | None -> raise (Failure "Deoptionize on none") [@coverage off] let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0) @@ -202,7 +204,11 @@ module HashTable = struct | Some x -> raise IndexExists | None -> let copy = Hashtbl.copy (hshtable table) in - let reordered = reorder_list entries (optionize (header table)) in + let reordered = + assert_types + (header table |> optionize) + (reorder_list entries (optionize (header table))) + in Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered); HashTab (header table, copy) diff --git a/test/main.ml b/test/main.ml index a150e72..74b7d3a 100644 --- a/test/main.ml +++ b/test/main.ml @@ -1,6 +1,375 @@ open OUnit2 +open RelationalDatabase.Tables +open RelationalDatabase.Database +open RelationalDatabase.Utils open RelationalDatabase.Cli +let trim str = + str |> String.split_on_char '\t' |> List.map String.trim + |> List.filter (fun a -> a <> "") + |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" + |> String.trim + +module TableTests (T : Table) = struct + (*Table Tests*) + + let make_test name act exp = name >:: fun _ -> assert_equal exp act + + let person = + T.empty + [ + Type ("name", Strings); + Type ("loc", Strings); + Type ("age", Ints); + Type ("net", Floats); + Type ("alive", Bools); + Type ("char", Chars); + Type ("ids", Ids); + ] + + let test_empty_table name ex expected = + name >:: fun _ -> assert_equal expected (T.empty ex) + + let test_insert name table elist expected = + name >:: fun _ -> + assert_equal expected (T.insert table elist) ~printer:T.table_to_string + + let test_insert_exception name table elist expected = + name >:: fun _ -> assert_raises expected (fun () -> T.insert table elist) + + let test_insert_named name table elist expected = + name >:: fun _ -> assert_equal expected (T.insert_named table elist) + + let test_insert_named_exception name table elist expected = + name >:: fun _ -> + assert_raises expected (fun () -> T.insert_named table elist) + + let test_at name table id expected = + name >:: fun _ -> assert_equal expected (T.at table id) + + let test_at_exception name table id expected = + name >:: fun _ -> assert_raises expected (fun () -> T.at table id) + + let test_delete name table id expected = + name >:: fun _ -> assert_equal expected (T.delete table id) + + let test_table_to_string name table expected = + name >:: fun _ -> assert_equal expected (T.table_to_string table |> trim) + + let test_exists_exception name table table_name expected = + name >:: fun _ -> + assert_raises expected (fun () -> T.exists table table_name) + + let test_exists name table table_name expected = + name >:: fun _ -> assert_equal expected (T.exists table table_name) + + let empty_table = T.empty [] + let table = T.empty [ Type ("name", Strings); Type ("age", Ints) ] + + let large_table = + T.empty + [ + Type ("String", Strings); + Type ("Floats", Floats); + Type ("Ints", Ints); + Type ("Bools", Bools); + Type ("Chars", Chars); + Type ("Ids", Ids); + ] + + let insert = + T.insert large_table + [ + String "John"; + Float 2.5; + Int 9; + Bool true; + Char 'a'; + Id ("Person", String "Johnathan"); + ] + + let elist = [ ("name", String "John") ] + let elist2 = [ ("age", Int 25) ] + let elist_exception = [ ("", String "s") ] + let elist_exception2 = [ ("name", String "John") ] + let elist_for_at = [ Some (String "John") ] + let insert_named = T.insert_named table elist + let partial_table = T.empty [ Type ("name", Strings) ] + let partial_insert = T.insert_named partial_table elist + + let table_tests = + [ + test_empty_table "empty table test" [] empty_table; + test_insert_named "add entry on existing table" table elist insert_named; + test_insert_named_exception "TypeMismatch thrown on insert_named" table + elist_exception TypeMismatch; + test_insert_named_exception "IndexExists thrown on insert_named" + insert_named elist_exception2 IndexExists; + test_insert "testing insert" large_table + [ + String "John"; + Float 2.5; + Int 9; + Bool true; + Char 'a'; + Id ("Person", String "Johnathan"); + ] + insert; + test_insert_exception "IndexExists thrown on insert" insert_named + [ String "John" ] IndexExists; + test_at "testing at for simple table" partial_insert (String "John") + elist_for_at; + test_at_exception "testing invalid string for at" insert_named + (String "invalid") Not_found; + test_at_exception "testing invalid type for at" insert_named (Int 25) + Not_found; + test_at_exception "testing at for an empty table" empty_table + (String "name") Not_found; + test_delete "testing invalid delete" partial_table (String "invalid") + partial_table; + test_delete "testing empty delete" empty_table (String "invalid") + empty_table; + test_exists "testing exists on existing table" table "name" Strings; + test_exists_exception "testing invalid exists on table" table "i" + TypeMismatch; + test_table_to_string "testing empty table to string" empty_table ""; + test_table_to_string "testing table to string" table "string name int age"; + make_test "No Strings insert" + (List.nth + ((T.insert_named person + [ + ("name", String "joe"); + ("age", Int 5); + ("net", Float 5.); + ("alive", Bool true); + ] + |> T.at) + (String "joe")) + 1) + None; + make_test "No Int insert" + (List.nth + ((T.insert_named person + [ + ("name", String "joe"); + ("loc", String "DC"); + ("net", Float 5.); + ("alive", Bool true); + ] + |> T.at) + (String "joe")) + 2) + None; + make_test "No Floats insert" + (List.nth + ((T.insert_named person + [ + ("name", String "joe"); + ("loc", String "DC"); + ("age", Int 5); + ("alive", Bool true); + ] + |> T.at) + (String "joe")) + 3) + None; + make_test "No Bools insert" + (List.nth + ((T.insert_named person + [ + ("name", String "joe"); + ("loc", String "DC"); + ("age", Int 5); + ("net", Float 5.); + ] + |> T.at) + (String "joe")) + 4) + None; + make_test "No chars insert" + (List.nth + ((T.insert_named person + [ + ("name", String "joe"); + ("loc", String "DC"); + ("age", Int 5); + ("net", Float 5.); + ] + |> T.at) + (String "joe")) + 5) + None; + make_test "No ids insert" + (List.nth + ((T.insert_named person + [ + ("name", String "joe"); + ("loc", String "DC"); + ("age", Int 5); + ("net", Float 5.); + ] + |> T.at) + (String "joe")) + 6) + None; + ] +end + +module ListTableTests = TableTests (ListTable) +module HashTableTests = TableTests (HashTable) + +module DatabaseTests (T : Table) = struct + module PersonDB = Database (T) + + let test_empty_database name expected = + name >:: fun _ -> assert_equal expected PersonDB.empty + + let test_add_table fun_name database table name expected = + fun_name >:: fun _ -> + assert_equal (PersonDB.add_table database table name) expected + + let test_add_table_exception fun_name database table name expected = + fun_name >:: fun _ -> + assert_raises expected (fun () -> PersonDB.add_table database table name) + + let test_build_table fun_name database table name expected = + fun_name >:: fun _ -> + assert_equal (PersonDB.build_table database table name) expected + + let test_build_table_exception fun_name database table name expected = + fun_name >:: fun _ -> + assert_raises expected (fun () -> PersonDB.build_table database table name) + + let test_drop_table fun_name name database expected = + fun_name >:: fun _ -> + assert_equal (PersonDB.drop_table name database) expected + + let test_get_table fun_name name database expected = + fun_name >:: fun _ -> + assert_equal (PersonDB.get_table name database) expected + + let test_get_reference fun_name ent database expected = + fun_name >:: fun _ -> + assert_equal (PersonDB.get_reference ent database) expected + + let test_add_entry fun_name table_name new_row database expected = + fun_name >:: fun _ -> + assert_equal (PersonDB.add_entry table_name new_row database) expected + + let test_add_entry_exception fun_name table_name new_row database expected = + fun_name >:: fun _ -> + assert_raises expected (fun () -> + PersonDB.add_entry table_name new_row database) + + let test_get_reference_exception fun_name ent database expected = + fun_name >:: fun _ -> + assert_raises expected (fun () -> PersonDB.get_reference ent database) + + let test_add_named_entry fun_name table_name new_row database expected = + fun_name >:: fun _ -> + assert_equal (PersonDB.add_named_entry table_name new_row database) expected + + let test_add_named_entry_exception fun_name table_name new_row database + expected = + fun_name >:: fun _ -> + assert_raises expected (fun () -> + PersonDB.add_named_entry table_name new_row database) + + let test_database_to_string fun_name database expected = + fun_name >:: fun _ -> + assert_equal (PersonDB.db_to_string database |> trim) expected + + let database_person_ent_list = [ Type ("name", Strings); Type ("age", Ints) ] + + let database_airport_ent_list = + [ + Type ("location", Strings); + Type ("passengers", Strings); + Type ("delayed", Bools); + ] + + let t = T.empty [ Type ("name", Strings) ] + let new_table = T.empty [ Type ("name", Strings); Type ("age", Ints) ] + let elist = [ ("name", String "John"); ("age", Int 25) ] + let add_table = T.insert_named new_table elist + let reference = ([ String "name" ], Some [ Some (String "Person") ]) + + let table2 = + T.empty + [ + Type ("location", Strings); + Type ("passengers", Strings); + Type ("delayed", Bools); + ] + + let empty = PersonDB.empty + let add_table_database = PersonDB.add_table empty add_table "Person" + let person_database = PersonDB.add_table empty new_table "Person" + let airport_database = PersonDB.add_table empty table2 "Airport" + let large_database = PersonDB.add_table person_database table2 "Airport" + let small_database = PersonDB.add_table empty t "" + + let database_tests = + [ + test_empty_database "empty test" empty; + test_add_table "Testing add_table" empty new_table "Person" + person_database; + test_add_table "Testing add_table to non-empty database" person_database + table2 "Airport" large_database; + test_add_table_exception + "Raising failure by adding existing table to database" person_database + new_table "Person" PersonDB.TableExists; + test_drop_table "Testing drop_table" "Person" person_database empty; + test_drop_table "Testing drop_table on empty table" "Person" empty empty; + test_drop_table "Testing drop_table with invalid table" "Invalid" + person_database person_database; + test_drop_table "Testing drop_table on multi-table database" "Person" + large_database airport_database; + test_get_table "Testing Valid get_table" "Person" person_database + (Some new_table); + test_get_table "Testing Empty table for get_table" "Person" empty None; + test_get_table "Testing Invalid table for get_table" "Airport" + person_database None; + test_get_table "Testing Valid get_table in multitable database" "Airport" + large_database (Some table2); + test_build_table "Testing Valid build_table on empty database" empty + database_person_ent_list "Person" person_database; + test_build_table "Testing Valid build_table on existing database" + person_database database_airport_ent_list "Airport" large_database; + test_build_table_exception "Testing TableExists exception on build_table" + person_database database_person_ent_list "Person" PersonDB.TableExists; + test_add_named_entry "Testing add_named_entry" "Person" + [ ("name", String "location") ] + person_database (); + test_add_named_entry_exception "Testing Not_found in add_named_entry" + "Invalid" + [ ("name", String "location") ] + person_database Not_found; + test_database_to_string "Testing to string on empty database" empty ""; + test_database_to_string "Testing db_to_string" small_database + "Table: \n\nstring name"; + test_get_reference "Test Get reference" + (Id ("Person", String "John")) + add_table_database + ( [ Type ("name", Strings); Type ("age", Ints) ], + Some [ Some (String "John"); Some (Int 25) ] ); + test_get_reference_exception "Testing Not Found for get reference" + (Id ("Invalid", String "John")) + add_table_database Not_found; + test_get_reference "Testing Type Mismatch for get reference" + (Id ("Person", String "Invalid")) + add_table_database + ([ Type ("name", Strings); Type ("age", Ints) ], None); + test_add_entry "Testing add_entry" "Person" [ String "Amy"; Int 30 ] + person_database (); + test_add_entry_exception "Testing Not_found in add_entry" "invalid" + [ String "Amy"; Int 30 ] person_database Not_found; + ] +end + +module DatabaseListTable = DatabaseTests (ListTable) +module DatabaseHashTable = DatabaseTests (HashTable) + module type StringList = sig val input_list : string list ref end @@ -407,5 +776,15 @@ let tests = |> gather_tests_no_print) @ ([ find_tests; print_tests; at_id_tests ] |> gather_tests_with_print) -let suite = "search test suite" >::: tests +let suite = + "test suite" + >::: List.flatten + [ + ListTableTests.table_tests; + HashTableTests.table_tests; + DatabaseListTable.database_tests; + DatabaseHashTable.database_tests; + tests; + ] + let _ = run_test_tt_main suite From 4fe8f9adc915042ae6e62a40f57e6f6771201e4a Mon Sep 17 00:00:00 2001 From: Thomas McFarland Date: Mon, 15 May 2023 02:01:35 -0400 Subject: [PATCH 20/24] I want to sleep --- lib/tables.ml | 90 -------------------------------------------------- lib/tables.mli | 1 - test/main.ml | 10 +----- 3 files changed, 1 insertion(+), 100 deletions(-) diff --git a/lib/tables.ml b/lib/tables.ml index 0fa04af..9885e11 100644 --- a/lib/tables.ml +++ b/lib/tables.ml @@ -76,96 +76,6 @@ module type Table = sig val exists : t -> string -> types end -module ListTable : Table = struct - type t = entry option list list - - let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl - let empty (ex : entry list) = [ optionize ex ] - - let insert (table : t) a = - match - List.find - (fun b -> - match optionize a with - | [] -> false - | hd :: tl -> ( match b with [] -> false | hdb :: tlb -> hd = hdb)) - table - with - | exception Not_found -> - table @ [ assert_types (List.hd table) (optionize a) ] - | x -> raise IndexExists - - let insert_named table elist = - let name, value = List.hd elist in - match List.find (fun a -> List.hd a = Some value) table with - | x -> raise IndexExists - | exception Not_found -> - table - @ [ assert_types (List.hd table) (reorder_list elist (List.hd table)) ] - - let at (table : t) id = - List.find - (fun a -> - match a with - | [] -> raise Not_found - | hd :: tl -> ( match hd with Some x -> x = id | None -> false)) - table - - let delete (table : t) id : t = - List.filter - (fun a -> - match a with - | [] -> true - | a :: asd -> ( match a with Some x -> x <> id | None -> true)) - table - - let rec table_to_string (table : t) = - match table with - | [] -> "" - | b :: xs -> build_row b ^ table_to_string xs ^ "\n" - - let rec deoptionize = function - | [] -> [] - | hd :: tl -> - (match hd with - | Some x -> x - | None -> raise (Failure "Deoptionize saw None") [@coverage off]) - :: deoptionize tl - - let header = function - | [] -> raise (Failure "RI Violated for tables") [@coverage off] - | hd :: tl -> deoptionize hd - - let exists table name = - let rec follow_header = function - | [] -> raise TypeMismatch - | Type (n, t) :: tl when n = name -> t - | _ :: tl -> follow_header tl - in - follow_header (header table) - - let rec process_constraints tbl lst = - match lst with - | [] -> table_to_string tbl - | hd :: tl -> - let ntbl = - match hd with - | name, cmp, vl -> ( - let ind = get_type_index 0 name (header tbl) in - match List.nth (header tbl) ind with - | Type (_, t) -> - let e = process_entry vl t in - List.filter - (fun a -> - match List.nth a ind with - | None -> false - | Some v -> run_constraint cmp e v) - tbl - | _ -> failwith "Impossible") - in - process_constraints ntbl tl -end - module HashTable = struct type t = HashTab of entry list * (entry, entry option list) Hashtbl.t diff --git a/lib/tables.mli b/lib/tables.mli index 025b454..ab98294 100644 --- a/lib/tables.mli +++ b/lib/tables.mli @@ -31,5 +31,4 @@ module type Table = sig val exists : t -> string -> types end -module ListTable : Table module HashTable : Table diff --git a/test/main.ml b/test/main.ml index 74b7d3a..f66a826 100644 --- a/test/main.ml +++ b/test/main.ml @@ -215,7 +215,6 @@ module TableTests (T : Table) = struct ] end -module ListTableTests = TableTests (ListTable) module HashTableTests = TableTests (HashTable) module DatabaseTests (T : Table) = struct @@ -367,7 +366,6 @@ module DatabaseTests (T : Table) = struct ] end -module DatabaseListTable = DatabaseTests (ListTable) module DatabaseHashTable = DatabaseTests (HashTable) module type StringList = sig @@ -779,12 +777,6 @@ let tests = let suite = "test suite" >::: List.flatten - [ - ListTableTests.table_tests; - HashTableTests.table_tests; - DatabaseListTable.database_tests; - DatabaseHashTable.database_tests; - tests; - ] + [ HashTableTests.table_tests; DatabaseHashTable.database_tests; tests ] let _ = run_test_tt_main suite From 1845063f2454db6ad4366d7c83143bdc3b07b71f Mon Sep 17 00:00:00 2001 From: Thomas McFarland Date: Mon, 15 May 2023 02:29:42 -0400 Subject: [PATCH 21/24] Finish docs --- _coverage/index.html | 16 +- _coverage/lib/cli.ml.html | 116 ++++---- _coverage/lib/database.ml.html | 52 ++-- _coverage/lib/tables.ml.html | 526 ++++++++------------------------- _coverage/lib/utils.ml.html | 493 +++++++++++++----------------- bisect037238731.coverage | 1 - bisect116092532.coverage | 1 - bisect214350425.coverage | 1 + bisect401940087.coverage | 1 + bisect452780914.coverage | 1 - bisect666521526.coverage | 1 + lib/cli.mli | 7 + lib/database.mli | 21 ++ lib/tables.mli | 11 +- lib/utils.ml | 27 +- lib/utils.mli | 40 ++- test/main.ml | 6 + 17 files changed, 492 insertions(+), 829 deletions(-) delete mode 100644 bisect037238731.coverage delete mode 100644 bisect116092532.coverage create mode 100644 bisect214350425.coverage create mode 100644 bisect401940087.coverage delete mode 100644 bisect452780914.coverage create mode 100644 bisect666521526.coverage diff --git a/_coverage/index.html b/_coverage/index.html index 7ea46c2..7a65d79 100644 --- a/_coverage/index.html +++ b/_coverage/index.html @@ -3,20 +3,20 @@ Coverage report - +
- + - 95% (171 / 179) + 98% (176 / 179) lib/cli.ml @@ -32,18 +32,18 @@

83.58%

- + - 83% (173 / 207) + 88% (123 / 139) lib/tables.ml
- + - 56% (55 / 98) + 73% (55 / 75) lib/utils.ml diff --git a/_coverage/lib/cli.ml.html b/_coverage/lib/cli.ml.html index 81c3bff..b7e8eee 100644 --- a/_coverage/lib/cli.ml.html +++ b/_coverage/lib/cli.ml.html @@ -3,7 +3,7 @@ cli.ml — Coverage report - + @@ -15,12 +15,10 @@

lib/cli.ml

-

95.53%

+

98.32%

@@ -206,9 +204,9 @@

95.53%

- + - + @@ -685,28 +683,28 @@

95.53%

let file_name = "data/responses.json" let get_response response = - let file = Yojson.Basic.from_file file_name in - file |> to_assoc |> List.assoc response |> to_string + let file = Yojson.Basic.from_file file_name in + file |> to_assoc |> List.assoc response |> to_string let reset () = - current_state := Default; + current_state := Default; db := DB.empty let parse_value v = function - | Strings -> String v - | Ints -> ( + | Strings -> String v + | Ints -> ( match int_of_string_opt v with - | Some i -> Int i + | Some i -> Int i | None -> raise ParseError) - | Floats -> ( + | Floats -> ( match float_of_string_opt v with - | Some f -> Float f + | Some f -> Float f | None -> raise ParseError) - | Bools -> ( + | Bools -> ( match bool_of_string_opt v with - | Some b -> Bool b + | Some b -> Bool b | None -> raise ParseError) - | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) + | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) | Ids -> Id (match v |> String.split_on_char '@' |> List.map String.trim with @@ -714,29 +712,29 @@

95.53%

| [ hd; tl ] -> (hd, String tl)) let rec build_instance (name, table, vals) input = - match - input |> String.split_on_char '=' |> List.map String.trim - |> List.filter (fun s -> s <> "") + match + input |> String.split_on_char '=' |> List.map String.trim + |> List.filter (fun s -> s <> "") with - | [] -> + | [] -> DB.add_named_entry name vals !db; - current_state := Default; + current_state := Default; get_response "indent_end" (* "| <|\n|> " *) | [ n ] -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_no_value" (* "Please input a variable and a value\n| " *) - | n :: v :: tl -> ( + | n :: v :: tl -> ( match List.assoc_opt n vals with - | None -> ( + | None -> ( match Tbl.exists table n with | exception TypeMismatch -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_DNE" (* "That field does not exist in this type\n| " *) - | t -> ( + | t -> ( match parse_value v t with - | x -> + | x -> current_state := BuildInstance (name, table, (n, x) :: vals); get_response "indent" (* "| " *) | exception ParseError -> @@ -750,23 +748,23 @@

95.53%

(* "This field has already been entered\n| " *)) let process_assign input = - match input |> List.map String.trim |> List.filter (fun s -> s <> "") with + match input |> List.map String.trim |> List.filter (fun s -> s <> "") with | [] -> get_response "err_assign_empty" (* "Please input a type name and id\n|> " *) | [ name ] -> get_response "err_assign_no_id" (* "Please input an id for this instance\n|> " *) - | name :: id :: tl -> ( + | name :: id :: tl -> ( match DB.get_table name !db with - | Some t -> + | Some t -> current_state := BuildInstance ( name, t, [ ( (match Tbl.header t with - | Type (n, _) :: tl -> n + | Type (n, _) :: tl -> n | _ -> failwith "impossible" [@coverage off]), String id ); ] ); @@ -775,30 +773,30 @@

95.53%

(* "That type does not exist\n|> " *) let parse_type (typ, name) = - match typ with - | "int" -> Type (name, Ints) - | "float" -> Type (name, Floats) - | "string" -> Type (name, Strings) - | "bool" -> Type (name, Bools) - | "char" -> Type (name, Chars) - | "id" -> Type (name, Ids) + match typ with + | "int" -> Type (name, Ints) + | "float" -> Type (name, Floats) + | "string" -> Type (name, Strings) + | "bool" -> Type (name, Bools) + | "char" -> Type (name, Chars) + | "id" -> Type (name, Ids) | _ -> raise ParseError let rec build_type (name, id, types) input = - match + match String.split_on_char ' ' input - |> List.map String.trim - |> List.filter (fun s -> s <> "") + |> List.map String.trim + |> List.filter (fun s -> s <> "") with - | [] -> - db := DB.build_table !db (Type (id, Strings) :: types) name; + | [] -> + db := DB.build_table !db (Type (id, Strings) :: types) name; current_state := Default; get_response "indent_end" (* "| <|\n|> " *) | [ typ ] -> get_response "err_defn_no_name" (* "Please enter a name for this field\n| " *) - | typ :: field_name :: tl -> ( + | typ :: field_name :: tl -> ( match parse_type (typ, field_name) with - | Type _ as t -> + | Type _ as t -> current_state := BuildType (name, id, types @ [ t ]); get_response "indent" (* "| " *) | exception ParseError -> @@ -808,36 +806,36 @@

95.53%

| _ -> raise (Failure "Should be impossible") [@coverage off]) let process_type input = - match List.filter (fun s -> s <> "") input with + match List.filter (fun s -> s <> "") input with | [] -> get_response "err_defn_needs_type_name" (* "Please enter a type name for the definition\n|> " *) | [ name ] -> get_response "err_defn_needs_ID_name" (* "Please enter a name for the ID of this type\n|> " *) - | name :: id :: tl -> ( + | name :: id :: tl -> ( match DB.get_table name !db with | Some _ -> get_response "err_defn_already_exists" (* "\n Type already defined\n|> " *) - | None -> + | None -> current_state := BuildType (name, id, []); get_response "indent" (* "| " *)) let process_at input = - match input |> List.map String.trim |> List.filter (fun s -> s <> "") with + match input |> List.map String.trim |> List.filter (fun s -> s <> "") with | [] -> get_response "err_at_empty" (* "Please enter what the type and id of which to get an instance\n|> " *) | [ name ] -> get_response "err_at_no_id" (* "Please enter an id of the instance you which to get\n|> " *) - | [ name; id ] -> ( + | [ name; id ] -> ( match DB.get_table name !db with - | Some x -> ( + | Some x -> ( try - (x |> Tbl.header |> optionize |> build_row) + (x |> Tbl.header |> optionize |> build_row) ^ "\n" - ^ (String id |> Tbl.at x |> build_row) + ^ (String id |> Tbl.at x |> build_row) with Not_found -> get_response "err_at_id_DNE") | None -> get_response "err_at_invalid_type" (* "No type of that name" *)) @@ -936,17 +934,17 @@

95.53%

(** [parse_input input] takes in new input and determines the relevant command*) let parse_input input = - match !current_state with - | BuildInstance v -> build_instance v input - | BuildType v -> build_type v input - | Default -> ( + match !current_state with + | BuildInstance v -> build_instance v input + | BuildType v -> build_type v input + | Default -> ( match String.split_on_char ' ' input with | "quit" :: tl -> exit 0 [@coverage off] | "help" :: tl -> get_response "help_message" - | "def" :: tl -> process_type tl - | "assign" :: tl -> process_assign tl + | "def" :: tl -> process_type tl + | "assign" :: tl -> process_assign tl | "print" :: tl -> DB.db_to_string !db ^ "|> " - | "at" :: tl -> process_at tl + | "at" :: tl -> process_at tl | "find" :: tl -> process_find tl | _ -> get_response "err_unknown_command" diff --git a/_coverage/lib/database.ml.html b/_coverage/lib/database.ml.html index 2e54b3c..20dc7a0 100644 --- a/_coverage/lib/database.ml.html +++ b/_coverage/lib/database.ml.html @@ -168,54 +168,54 @@

97.50%

let empty = [] let add_table database table name : database = - match - List.find (fun a -> match a with tname, t -> name = tname) database + match + List.find (fun a -> match a with tname, t -> name = tname) database with - | exception Not_found -> (name, ref table) :: database - | _ -> raise TableExists + | exception Not_found -> (name, ref table) :: database + | _ -> raise TableExists let build_table database table name = match - List.find (fun a -> match a with tname, t -> name = tname) database + List.find (fun a -> match a with tname, t -> name = tname) database with - | exception Not_found -> (name, ref (Table.empty table)) :: database - | _ -> raise TableExists + | exception Not_found -> (name, ref (Table.empty table)) :: database + | _ -> raise TableExists let drop_table name database = - List.filter (fun a -> match a with tname, t -> name <> tname) database + List.filter (fun a -> match a with tname, t -> name <> tname) database let get_table name database = - match List.assoc_opt name database with Some x -> Some !x | None -> None + match List.assoc_opt name database with Some x -> Some !x | None -> None let get_reference ent database = - match ent with - | Id (tbl, id) -> ( + match ent with + | Id (tbl, id) -> ( let tbl = match get_table tbl database with - | None -> raise Not_found - | Some v -> v + | None -> raise Not_found + | Some v -> v in - ( Table.header tbl, - match Table.at tbl id with exception Not_found -> None | v -> Some v + ( Table.header tbl, + match Table.at tbl id with exception Not_found -> None | v -> Some v )) | _ -> raise TypeMismatch let rec db_to_string database = - match database with - | [] -> "\n" - | (name, x) :: xs -> - "Table: " ^ name ^ "\n\n" ^ Table.table_to_string !x ^ db_to_string xs + match database with + | [] -> "\n" + | (name, x) :: xs -> + "Table: " ^ name ^ "\n\n" ^ Table.table_to_string !x ^ db_to_string xs let rec add_entry table_name new_row database = - match database with - | [] -> raise Not_found - | (a, b) :: tl when a = table_name -> b := Table.insert !b new_row - | _ :: tl -> add_entry table_name new_row tl + match database with + | [] -> raise Not_found + | (a, b) :: tl when a = table_name -> b := Table.insert !b new_row + | _ :: tl -> add_entry table_name new_row tl let add_named_entry table_name new_row database = - match List.assoc_opt table_name database with - | None -> raise Not_found - | Some x -> x := Table.insert_named !x new_row + match List.assoc_opt table_name database with + | None -> raise Not_found + | Some x -> x := Table.insert_named !x new_row end
diff --git a/_coverage/lib/tables.ml.html b/_coverage/lib/tables.ml.html index fe3f6b1..8b5e802 100644 --- a/_coverage/lib/tables.ml.html +++ b/_coverage/lib/tables.ml.html @@ -3,7 +3,7 @@ tables.ml — Coverage report - + @@ -15,39 +15,23 @@

lib/tables.ml

-

83.57%

+

88.49%

@@ -133,19 +117,19 @@

83.57%

- - + + - + - + - - - + + + - + @@ -154,172 +138,82 @@

83.57%

- + - + - + - - - - - + + + + + - + - - - + + + - + - + - - + + - - - - + + + + - + - + - - - - - - - - - - + + + + + + + + + + - + - + - - + + - - - - + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
@@ -502,153 +396,63 @@

83.57%

176 177 178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268
open Utils
 
 let rec assert_types header a =
-  match header with
-  | [] -> if a = [] then [] else raise TypeMismatch [@coverage off]
-  | hd :: tl -> (
+  match header with
+  | [] -> if a = [] then [] else raise TypeMismatch [@coverage off]
+  | hd :: tl -> (
       match a with
       | [] -> raise TypeMismatch
-      | b :: c ->
+      | b :: c ->
           (match hd with
-          | Some (Type (_, Strings)) -> (
+          | Some (Type (_, Strings)) -> (
               match b with
-              | Some (String _) -> b
-              | None -> b
+              | Some (String _) -> b
+              | None -> b
               | _ -> raise TypeMismatch)
-          | Some (Type (_, Floats)) -> (
+          | Some (Type (_, Floats)) -> (
               match b with
-              | Some (Float _) -> b
-              | None -> b
+              | Some (Float _) -> b
+              | None -> b
               | _ -> raise TypeMismatch)
-          | Some (Type (_, Ints)) -> (
+          | Some (Type (_, Ints)) -> (
               match b with
-              | Some (Int _) -> b
-              | None -> b
+              | Some (Int _) -> b
+              | None -> b
               | _ -> raise TypeMismatch)
-          | Some (Type (_, Bools)) -> (
+          | Some (Type (_, Bools)) -> (
               match b with
-              | Some (Bool _) -> b
-              | None -> b
+              | Some (Bool _) -> b
+              | None -> b
               | _ -> raise TypeMismatch)
-          | Some (Type (_, Chars)) -> (
+          | Some (Type (_, Chars)) -> (
               match b with
-              | Some (Char _) -> b
-              | None -> b
+              | Some (Char _) -> b
+              | None -> b
               | _ -> raise TypeMismatch)
-          | Some (Type (_, Ids)) -> (
+          | Some (Type (_, Ids)) -> (
               match b with
-              | Some (Id _) -> b
-              | None -> b
+              | Some (Id _) -> b
+              | None -> b
               | _ -> raise TypeMismatch)
           | _ -> raise TypeMismatch)
-          :: assert_types tl c)
+          :: assert_types tl c)
 
 let rec reorder_list (a : (string * entry) list) = function
-  | [] -> if a = [] then [] else raise TypeMismatch
-  | Some (Type (name, v)) :: tl ->
+  | [] -> if a = [] then [] else raise TypeMismatch
+  | Some (Type (name, v)) :: tl ->
       let vl, rest =
         let rec extr_name acc = function
-          | [] -> (None, acc)
-          | (n, vr) :: rest ->
-              if n = name then (Some vr, acc @ rest)
-              else extr_name (acc @ [ (n, vr) ]) rest
+          | [] -> (None, acc)
+          | (n, vr) :: rest ->
+              if n = name then (Some vr, acc @ rest)
+              else extr_name (acc @ [ (n, vr) ]) rest
         in
-        extr_name [] a
+        extr_name [] a
       in
-      vl :: reorder_list rest tl
+      vl :: reorder_list rest tl
   | _ -> raise TypeMismatch
 
 let rec get_type_index cnt name = function
@@ -671,96 +475,6 @@ 

83.57%

val exists : t -> string -> types end -module ListTable : Table = struct - type t = entry option list list - - let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl - let empty (ex : entry list) = [ optionize ex ] - - let insert (table : t) a = - match - List.find - (fun b -> - match optionize a with - | [] -> false - | hd :: tl -> ( match b with [] -> false | hdb :: tlb -> hd = hdb)) - table - with - | exception Not_found -> - table @ [ assert_types (List.hd table) (optionize a) ] - | x -> raise IndexExists - - let insert_named table elist = - let name, value = List.hd elist in - match List.find (fun a -> List.hd a = Some value) table with - | x -> raise IndexExists - | exception Not_found -> - table - @ [ assert_types (List.hd table) (reorder_list elist (List.hd table)) ] - - let at (table : t) id = - List.find - (fun a -> - match a with - | [] -> raise Not_found - | hd :: tl -> ( match hd with Some x -> x = id | None -> false)) - table - - let delete (table : t) id : t = - List.filter - (fun a -> - match a with - | [] -> true - | a :: asd -> ( match a with Some x -> x <> id | None -> true)) - table - - let rec table_to_string (table : t) = - match table with - | [] -> "" - | b :: xs -> build_row b ^ table_to_string xs ^ "\n" - - let rec deoptionize = function - | [] -> [] - | hd :: tl -> - (match hd with - | Some x -> x - | None -> raise (Failure "Deoptionize saw None") [@coverage off]) - :: deoptionize tl - - let header = function - | [] -> raise (Failure "RI Violated for tables") [@coverage off] - | hd :: tl -> deoptionize hd - - let exists table name = - let rec follow_header = function - | [] -> raise TypeMismatch - | Type (n, t) :: tl when n = name -> t - | _ :: tl -> follow_header tl - in - follow_header (header table) - - let rec process_constraints tbl lst = - match lst with - | [] -> table_to_string tbl - | hd :: tl -> - let ntbl = - match hd with - | name, cmp, vl -> ( - let ind = get_type_index 0 name (header tbl) in - match List.nth (header tbl) ind with - | Type (_, t) -> - let e = process_entry vl t in - List.filter - (fun a -> - match List.nth a ind with - | None -> false - | Some v -> run_constraint cmp e v) - tbl - | _ -> failwith "Impossible") - in - process_constraints ntbl tl -end - module HashTable = struct type t = HashTab of entry list * (entry, entry option list) Hashtbl.t @@ -770,15 +484,15 @@

83.57%

| None :: tl -> raise (Failure "Deoptionize on none") [@@coverage off] - let header = function HashTab (hd, _) -> hd - let hshtable = function HashTab (_, hsh) -> hsh + let header = function HashTab (hd, _) -> hd + let hshtable = function HashTab (_, hsh) -> hsh let deoptionize = function - | Some x -> x + | Some x -> x | None -> raise (Failure "Deoptionize on none") [@coverage off] - let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl - let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0) + let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl + let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0) let insert table entries = match Hashtbl.find_opt (hshtable table) (List.hd entries) with @@ -794,20 +508,20 @@

83.57%

copy) ) let insert_named table entries = - let name, value = List.hd entries in - match Hashtbl.find_opt (hshtable table) value with + let name, value = List.hd entries in + match Hashtbl.find_opt (hshtable table) value with | Some x -> raise IndexExists - | None -> - let copy = Hashtbl.copy (hshtable table) in - let reordered = + | None -> + let copy = Hashtbl.copy (hshtable table) in + let reordered = assert_types - (header table |> optionize) - (reorder_list entries (optionize (header table))) + (header table |> optionize) + (reorder_list entries (optionize (header table))) in - Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered); - HashTab (header table, copy) + Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered); + HashTab (header table, copy) - let at table id = Some id :: Hashtbl.find (hshtable table) id + let at table id = Some id :: Hashtbl.find (hshtable table) id let delete table id = let out = Hashtbl.copy (hshtable table) in @@ -854,12 +568,12 @@

83.57%

tl let exists table name = - let rec follow_header = function + let rec follow_header = function | [] -> raise TypeMismatch - | Type (n, t) :: tl when n = name -> t - | _ :: tl -> follow_header tl + | Type (n, t) :: tl when n = name -> t + | _ :: tl -> follow_header tl in - follow_header (header table) + follow_header (header table) end
diff --git a/_coverage/lib/utils.ml.html b/_coverage/lib/utils.ml.html index 0a2f315..435e212 100644 --- a/_coverage/lib/utils.ml.html +++ b/_coverage/lib/utils.ml.html @@ -3,7 +3,7 @@ utils.ml — Coverage report - + @@ -15,45 +15,27 @@

lib/utils.ml

-

56.12%

+

73.33%

@@ -74,240 +56,190 @@

56.12%

- - - - - - - - + + + + + + + + - + - - + + - + - - + + - - - - + + + + - - + + - - - - - - - + + + + + + + - - + + - - - + + + - - - + + + - + - - + + - - - + + + - + - + - + - + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + +
-  1
-  2
-  3
-  4
-  5
-  6
-  7
-  8
-  9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
 
type types = Strings | Floats | Ints | Chars | Bools | Ids
 type comparison = LT | LTE | EQ | NEQ | GT | GTE
@@ -324,36 +256,14 @@ 

56.12%

| Id of (string * entry) | Type of (string * types) -let name_map_entry t = - match t with - | String _ -> "string" - | Float _ -> "float" - | Int _ -> "int" - | Char _ -> "char" - | Bool _ -> "bool" - | Id _ -> "id" - | Type _ -> "type" - let name_map_types t = - match t with - | Strings -> "string" - | Floats -> "float" + match t with + | Strings -> "string" + | Floats -> "float" | Ints -> "int" - | Chars -> "char" - | Bools -> "bool" - | Ids -> "id" - -let guess_entry input = - match float_of_string_opt input with - | Some v -> Float v - | None -> ( - match int_of_string_opt input with - | Some v -> Int v - | None -> ( - match bool_of_string_opt input with - | Some v -> Bool v - | None -> - if String.length input = 1 then Char input.[0] else String input)) + | Chars -> "char" + | Bools -> "bool" + | Ids -> "id" let process_entry input = function | Strings -> String input @@ -371,10 +281,7 @@

56.12%

match bool_of_string_opt input with | None -> raise TypeMismatch | Some v -> Bool v) - | Ids -> ( - match String.split_on_char '@' input with - | [] | [ _ ] | _ :: _ :: _ :: _ -> raise TypeMismatch - | [ hd; tl ] -> Id (hd, guess_entry tl)) + | _ -> raise TypeMismatch let make_compare cmp lhs rhs = match cmp with @@ -410,28 +317,28 @@

56.12%

| _ -> raise TypeMismatch let rec entry_to_string ent = - match ent with - | String x -> x - | Float x -> string_of_float x - | Int x -> string_of_int x - | Char x -> String.make 1 x - | Bool x -> string_of_bool x - | Id (a, b) -> a ^ "@" ^ entry_to_string b - | Type (a, b) -> name_map_types b ^ " " ^ a + match ent with + | String x -> x + | Float x -> string_of_float x + | Int x -> string_of_int x + | Char x -> String.make 1 x + | Bool x -> string_of_bool x + | Id (a, b) -> a ^ "@" ^ entry_to_string b + | Type (a, b) -> name_map_types b ^ " " ^ a let shorten inp = - let str = String.trim inp in - if String.length str < 8 then str ^ "\t\t" - else if String.length str < 16 then str ^ "\t" - else String.sub str 0 16 + let str = String.trim inp in + if String.length str < 8 then str ^ "\t\t" + else if String.length str < 16 then str ^ "\t" + else String.sub str 0 16 let rec build_row entlist = - match entlist with - | [] -> "\n\n" - | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs - | None :: xs -> "\t\t" ^ build_row xs + match entlist with + | [] -> "\n\n" + | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs + | None :: xs -> "\t\t" ^ build_row xs -let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl +let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl
diff --git a/bisect037238731.coverage b/bisect037238731.coverage deleted file mode 100644 index 06f0247..0000000 --- a/bisect037238731.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1136 1180 1210 1056 1092 964 1239 943 1420 1438 1328 1345 1302 1604 1524 1588 1552 1623 1498 1837 1775 1805 1723 40 12 2 4 4 14 44 44 1 2 2 45 2 2 3 73 49 122 4 2 2 1 4 5 0 5 2 2 3 2 5 1 1 1 2 1 3 38 1 38 39 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 22 12 13 12 12 12 83 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 6 83 24 11 12 11 11 6 83 158 4 45 49 49 100 149 149 149 141 141 141 7 26 141 7 174 14 2 14 13 lib/tables.ml 207 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2555 2513 2524 2602 2592 2908 2926 2899 2847 2939 2779 2793 2728 2752 2693 2643 3204 3240 3225 3195 3106 3135 3071 3065 3039 3000 3400 3419 3340 3372 3317 3283 3593 3613 3545 3566 3522 3486 3742 3762 3708 3723 3685 3874 3981 3814 3829 4086 4322 4185 4253 4218 4263 4144 4839 4877 4789 4735 4725 4644 4951 4612 4567 4591 4496 4397 4429 4376 5334 5382 5442 5596 5554 5565 5659 5633 5995 6041 6059 6082 5921 5913 5940 5970 5849 5869 5767 5801 5729 5745 5698 6584 6527 6518 6548 6570 6398 6406 6460 6452 6433 6490 6310 6330 6228 6262 6202 6171 6130 6652 6642 6620 6794 6763 6780 6724 6740 6693 6914 6897 6930 6885 6951 6994 6986 6975 6847 8155 8091 8062 7976 8009 7922 7876 7847 7828 7792 8119 8141 7641 7623 7556 7668 7430 7456 7510 7287 7311 7218 7109 7141 7088 7050 8394 8257 8325 8290 8335 8216 207 61 104 4 0 48 5 0 51 8 0 43 8 0 37 14 0 7 46 0 108 53 59 51 51 53 0 375 0 375 61 375 436 2 56 349 353 528 264 89 792 58 353 0 22 8 1 30 0 51 16 51 10 10 2 2 2 2 1 0 4 0 4 4 3 10 11 10 10 1 11 13 13 12 12 22 0 0 22 22 11 1 0 0 1 1 1 5 5 3 5 8 6 6 3 6 3 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 406 137 46 687 109 687 51 51 3 3 3 3 3 3 3 3 3 3 0 3 3 3 3 46 46 46 46 46 46 46 47 47 46 46 47 47 0 47 47 47 47 18 14 18 1 1 1 1 1 1 8 8 8 8 10 10 10 10 10 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 179 1 178 712 534 179 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/bisect116092532.coverage b/bisect116092532.coverage deleted file mode 100644 index 47b5af9..0000000 --- a/bisect116092532.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1136 1180 1210 1056 1092 964 1239 943 1420 1438 1328 1345 1302 1604 1524 1588 1552 1623 1498 1837 1775 1805 1723 40 12 0 4 4 12 44 44 1 2 2 45 6 6 5 73 49 122 4 2 2 1 4 5 0 5 2 2 3 2 5 1 1 1 2 1 3 38 1 38 39 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 18 8 9 8 8 8 59 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 59 16 7 8 7 7 2 59 106 0 25 25 25 76 101 101 101 95 95 95 7 18 95 7 120 14 2 14 13 lib/tables.ml 207 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2555 2513 2524 2602 2592 2908 2926 2899 2847 2939 2779 2793 2728 2752 2693 2643 3204 3240 3225 3195 3106 3135 3071 3065 3039 3000 3400 3419 3340 3372 3317 3283 3593 3613 3545 3566 3522 3486 3742 3762 3708 3723 3685 3874 3981 3814 3829 4086 4322 4185 4253 4218 4263 4144 4839 4877 4789 4735 4725 4644 4951 4612 4567 4591 4496 4397 4429 4376 5334 5382 5442 5596 5554 5565 5659 5633 5995 6041 6059 6082 5921 5913 5940 5970 5849 5869 5767 5801 5729 5745 5698 6584 6527 6518 6548 6570 6398 6406 6460 6452 6433 6490 6310 6330 6228 6262 6202 6171 6130 6652 6642 6620 6794 6763 6780 6724 6740 6693 6914 6897 6930 6885 6951 6994 6986 6975 6847 8155 8091 8062 7976 8009 7922 7876 7847 7828 7792 8119 8141 7641 7623 7556 7668 7430 7456 7510 7287 7311 7218 7109 7141 7088 7050 8394 8257 8325 8290 8335 8216 207 61 104 4 0 46 5 0 49 10 0 41 8 0 35 14 0 5 46 0 108 51 59 49 49 51 0 367 0 367 61 367 428 0 58 353 353 524 266 87 790 58 353 0 22 8 1 30 0 40 13 40 9 9 2 2 2 2 0 0 2 0 2 2 2 10 10 10 10 0 10 10 10 10 10 12 0 1 12 13 7 0 0 1 0 1 1 2 2 2 2 4 2 2 1 2 1 1 1 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 406 136 48 662 105 662 52 52 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 48 48 48 48 48 48 48 48 48 48 48 48 48 1 48 49 49 49 20 14 20 1 1 1 1 1 1 6 6 6 6 7 7 7 7 7 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 179 2 177 713 536 179 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/bisect214350425.coverage b/bisect214350425.coverage new file mode 100644 index 0000000..153bbd9 --- /dev/null +++ b/bisect214350425.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1136 1180 1210 1056 1092 964 1239 943 1420 1438 1328 1345 1302 1604 1524 1588 1552 1623 1498 1837 1775 1805 1723 40 5 0 1 1 5 43 43 0 0 0 43 0 0 0 71 47 118 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 38 0 38 38 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 18 9 9 9 9 9 63 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 63 18 8 9 8 8 2 63 116 0 26 26 26 85 111 111 111 105 105 105 8 17 105 8 130 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 48 87 3 0 41 4 0 42 5 0 38 5 0 35 8 0 4 41 0 90 45 47 43 43 45 0 313 0 313 48 313 361 0 47 307 307 533 241 66 774 47 307 0 22 8 1 30 0 405 126 47 668 102 668 51 51 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 47 47 47 47 47 47 47 47 47 47 47 47 47 0 47 47 47 47 17 14 17 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 183 1 182 731 549 183 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file diff --git a/bisect401940087.coverage b/bisect401940087.coverage new file mode 100644 index 0000000..8392594 --- /dev/null +++ b/bisect401940087.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1136 1180 1210 1056 1092 964 1239 943 1420 1438 1328 1345 1302 1604 1524 1588 1552 1623 1498 1837 1775 1805 1723 40 6 1 2 2 7 44 44 0 1 1 44 2 2 2 74 48 122 4 2 2 0 4 4 0 4 1 1 2 1 3 0 1 0 1 1 2 39 0 39 39 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 18 9 9 9 9 9 63 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 63 18 8 9 8 8 2 63 116 0 26 26 26 85 111 111 111 105 105 105 8 18 105 8 131 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 50 89 3 0 41 4 0 42 7 0 38 5 0 35 8 0 4 41 0 92 45 49 43 43 45 0 317 0 317 50 317 367 0 49 311 311 533 243 68 776 49 311 0 22 8 1 30 0 416 138 49 676 107 676 52 52 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 49 49 49 49 49 49 49 49 49 49 49 49 49 1 49 50 50 50 20 15 20 1 1 1 1 1 1 6 6 6 6 7 7 7 7 7 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 184 1 183 732 549 184 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file diff --git a/bisect452780914.coverage b/bisect452780914.coverage deleted file mode 100644 index 2178920..0000000 --- a/bisect452780914.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1136 1180 1210 1056 1092 964 1239 943 1420 1438 1328 1345 1302 1604 1524 1588 1552 1623 1498 1837 1775 1805 1723 40 10 0 2 2 10 42 42 0 0 0 42 0 0 0 69 46 115 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 37 0 37 37 12 lib/utils.ml 98 356 381 404 423 444 465 482 339 542 566 588 606 626 646 525 1002 982 965 899 928 807 831 726 748 685 1148 1183 1265 1300 1388 1368 1351 1472 1507 1686 1594 1599 1607 1654 1057 1085 1206 1321 1411 1529 1746 1766 1788 1808 1830 1850 1727 1980 2020 2094 2132 2207 2246 2321 2360 2437 2478 1938 2054 2166 2280 2394 2512 1919 2766 2802 2588 2606 2639 2668 2698 2729 2774 2569 2967 2949 2933 2918 2898 2883 2868 2837 3097 3080 3112 3152 3041 3058 3121 3018 3229 3187 3198 98 0 0 0 0 0 0 0 0 16 8 8 8 8 8 56 0 0 0 0 0 0 0 0 0 0 0 1 1 4 0 0 0 0 2 0 0 0 0 0 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 56 16 7 8 7 7 2 56 103 0 23 23 23 75 98 98 98 92 92 92 7 15 92 7 114 14 2 14 13 lib/tables.ml 207 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2555 2513 2524 2602 2592 2908 2926 2899 2847 2939 2779 2793 2728 2752 2693 2643 3204 3240 3225 3195 3106 3135 3071 3065 3039 3000 3400 3419 3340 3372 3317 3283 3593 3613 3545 3566 3522 3486 3742 3762 3708 3723 3685 3874 3981 3814 3829 4086 4322 4185 4253 4218 4263 4144 4839 4877 4789 4735 4725 4644 4951 4612 4567 4591 4496 4397 4429 4376 5334 5382 5442 5596 5554 5565 5659 5633 5995 6041 6059 6082 5921 5913 5940 5970 5849 5869 5767 5801 5729 5745 5698 6584 6527 6518 6548 6570 6398 6406 6460 6452 6433 6490 6310 6330 6228 6262 6202 6171 6130 6652 6642 6620 6794 6763 6780 6724 6740 6693 6914 6897 6930 6885 6951 6994 6986 6975 6847 8155 8091 8062 7976 8009 7922 7876 7847 7828 7792 8119 8141 7641 7623 7556 7668 7430 7456 7510 7287 7311 7218 7109 7141 7088 7050 8394 8257 8325 8290 8335 8216 207 57 100 4 0 46 5 0 48 7 0 41 8 0 35 14 0 5 46 0 104 51 55 49 49 51 0 359 0 359 57 359 416 0 55 347 347 524 263 84 787 55 347 0 22 8 1 30 0 34 10 34 8 8 1 1 1 1 0 0 1 0 1 1 1 9 9 9 9 0 9 9 9 9 9 12 0 0 12 12 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 395 123 46 654 100 654 50 50 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 46 46 46 46 46 46 46 46 46 46 46 46 46 0 46 46 46 46 16 13 16 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 178 1 177 711 534 178 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 650 650 650 650 47 34 2 34 1 33 1 1 33 34 0 1 1 3 5 33 36 35 34 34 5 37 170 7 1 177 178 1 37 2 179 399 218 218 218 45 45 1 1 2 46 95 49 49 41 41 36 32 32 37 1 220 42 219 1 42 1 220 487 263 263 263 1 42 1 1 43 89 45 1 0 0 0 0 0 1 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 2 8 30 12 12 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 45 49 1 12 15 2 218 263 125 606 \ No newline at end of file diff --git a/bisect666521526.coverage b/bisect666521526.coverage new file mode 100644 index 0000000..d6ceaf1 --- /dev/null +++ b/bisect666521526.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1136 1180 1210 1056 1092 964 1239 943 1420 1438 1328 1345 1302 1604 1524 1588 1552 1623 1498 1837 1775 1805 1723 40 6 0 2 2 6 44 44 1 1 1 45 2 2 2 72 49 121 2 1 1 1 2 3 0 3 2 2 2 2 4 1 0 1 1 0 1 38 1 38 39 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 22 11 12 11 11 11 78 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 4 78 22 10 11 10 10 4 78 145 2 38 40 40 98 138 138 138 130 130 130 8 23 130 8 161 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 50 89 3 0 42 4 0 44 5 0 39 5 0 36 8 0 5 41 0 92 46 49 44 44 46 0 321 0 321 50 321 371 1 47 307 309 535 241 68 776 48 309 0 22 8 1 30 0 416 141 47 701 111 701 53 53 3 3 3 3 3 3 3 3 3 3 0 3 3 3 3 47 47 47 47 47 47 47 48 48 47 47 48 48 0 48 48 48 48 20 15 20 1 1 1 1 1 1 8 8 8 8 10 10 10 10 10 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 184 2 182 733 551 184 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file diff --git a/lib/cli.mli b/lib/cli.mli index 08d874e..90c154f 100644 --- a/lib/cli.mli +++ b/lib/cli.mli @@ -17,8 +17,15 @@ val main : unit -> unit module type CliHandler = sig val parse_input : string -> string + (**[parse_input input] takes the string [input] and uses the internal state to produce an output string, which is equivalent to what would be printed in a CLI. Modifies internal state accordingly*) + val get_response : string -> string + (**[get_response addr] reads the responses json, giving a response string for a response string + Raises [Not_found] if [addr] is an invalid response*) + val reset : unit -> unit + (**[reset] changes the internal state to have an empty database and default internal state + *) end module CLI : CliHandler diff --git a/lib/database.mli b/lib/database.mli index 27a624a..8aaf534 100644 --- a/lib/database.mli +++ b/lib/database.mli @@ -12,15 +12,36 @@ module Database (Table : Table) : sig type database val empty : database + (** [empty] is a table containing no elements*) + val add_table : database -> table -> string -> database + (** [add_table database table name] adds table to [database] + Raises: [IndexExists] when the value associated with [name] exists + *) + val build_table : database -> entry list -> string -> database + (** [build_table database lst name] builds a new table inside [database] using [lst] as a header + Raises [IndexExists] if the name is already in use*) + val drop_table : string -> database -> database + (** [drop_table name database] returns a database with the table [name] removed*) + val get_table : string -> database -> table option + (** [get_table name database] returns table option containing table [name], if it exists in [database]*) + val get_reference : entry -> database -> entry list * entry option list option + (** [get_reference id database] returns a tuple containing the header of the table [id] refers to and the row in the table it describes, if that row exists + Raises [Not_found] if the table referenced doesn't exist + Raises [TypeMismatch] if id is not an entry Id*) + val db_to_string : database -> string + (** [db_to_string database] returns a string representation of database*) val add_entry : string -> entry list -> database -> unit (** [add_entry s lst db] Adds an entry to the table given by id. Raises [Not_found] if the table cannot be found*) val add_named_entry : string -> (string * entry) list -> database -> unit + (** [add_named_entry table lst database] adds the lst to the table specified, where the list is tuples containing the name of the field wishing to be filled and the entry to fill it with + Raises [Not_found] if the table does not exist + Raises [TypeMismatch] if any of the entries do not match the type of their fields*) end diff --git a/lib/tables.mli b/lib/tables.mli index ab98294..25ce707 100644 --- a/lib/tables.mli +++ b/lib/tables.mli @@ -2,6 +2,7 @@ open Utils module type Table = sig type t + (** Type representation of the table*) val empty : entry list -> t (** [empty lst] Creates a new table given a list of type definitions. Raises [TypeMismatch] if the list provided is not types**) @@ -11,13 +12,19 @@ module type Table = sig Raises [IndexExists] if the index provided is already in the table. Raises [TypeMismatch] if the new row fits the type definition*) - (* Adds a new set of entries to the table, in the columns that the ids identify. Any non-entered rows will be a none + val insert_named : t -> (string * entry) list -> t + (** Adds a new set of entries to the table, in the columns that the ids identify. Any non-entered rows will be a none Raises [IndexExists] if the index provided is already in the table. Raises [TypeMismatch] if the new row fits the type definition*) - val insert_named : t -> (string * entry) list -> t + val at : t -> entry -> entry option list + (** [at t id] returns a list of entry options representing all entries [id] in the [t]*) + val delete : t -> entry -> t + (** [delete t id] removes the entire row in [t] containing [id]. It returns the updated table.*) + val table_to_string : t -> string + (** [table_to_string t] returns a string representation of [t]*) (* Processes a given list of constraints Raises [Not_found] if a constraint isn't found diff --git a/lib/utils.ml b/lib/utils.ml index a44c8e9..8610a05 100644 --- a/lib/utils.ml +++ b/lib/utils.ml @@ -13,16 +13,6 @@ type entry = | Id of (string * entry) | Type of (string * types) -let name_map_entry t = - match t with - | String _ -> "string" - | Float _ -> "float" - | Int _ -> "int" - | Char _ -> "char" - | Bool _ -> "bool" - | Id _ -> "id" - | Type _ -> "type" - let name_map_types t = match t with | Strings -> "string" @@ -32,18 +22,6 @@ let name_map_types t = | Bools -> "bool" | Ids -> "id" -let guess_entry input = - match float_of_string_opt input with - | Some v -> Float v - | None -> ( - match int_of_string_opt input with - | Some v -> Int v - | None -> ( - match bool_of_string_opt input with - | Some v -> Bool v - | None -> - if String.length input = 1 then Char input.[0] else String input)) - let process_entry input = function | Strings -> String input | Floats -> ( @@ -60,10 +38,7 @@ let process_entry input = function match bool_of_string_opt input with | None -> raise TypeMismatch | Some v -> Bool v) - | Ids -> ( - match String.split_on_char '@' input with - | [] | [ _ ] | _ :: _ :: _ :: _ -> raise TypeMismatch - | [ hd; tl ] -> Id (hd, guess_entry tl)) + | _ -> raise TypeMismatch let make_compare cmp lhs rhs = match cmp with diff --git a/lib/utils.mli b/lib/utils.mli index 0b026ab..9727813 100644 --- a/lib/utils.mli +++ b/lib/utils.mli @@ -1,8 +1,24 @@ -type types = Strings | Floats | Ints | Chars | Bools | Ids -type comparison = LT | LTE | EQ | NEQ | GT | GTE +type types = + | Strings + | Floats + | Ints + | Chars + | Bools + | Ids (** Representation of the type of some field*) + +type comparison = + | LT + | LTE + | EQ + | NEQ + | GT + | GTE (** Representation of some comparison operation*) exception IndexExists +(** [IndexExists] occurs when trying to replace an index which already exists*) + exception TypeMismatch +(** [TypeMismatch] occurs when some typing error occurs, e.g. true > "cat"*) type entry = | String of string @@ -12,15 +28,27 @@ type entry = | Bool of bool | Id of (string * entry) | Type of (string * types) + (** The core of this project! The type holding every entry in every table*) -val name_map_entry : entry -> string - -(* Turns a string into the given entry type. - Raise [TypeMismatch] if this cannot occur*) val process_entry : string -> types -> entry +(** Turns a string into the given entry type. + Raises [TypeMismatch] if this cannot occur*) + val run_constraint : comparison -> entry -> entry -> bool +(**[run_constraint cmp rhs lhs] returns a bool equal to lhs (cmp) rhs + Raises [TypeMismatch] if type of lhs != rhs*) + val name_map_types : types -> string +(** [name_map_types t] maps each [t] to a string.*) + val entry_to_string : entry -> string +(**[entry_to_string entry] converts [entry] into a string*) + val shorten : string -> string +(** [shorten inp] shortens [inp] to a maximum of 16 characters*) + val build_row : entry option list -> string +(** [build_row entlist] converts [entlist] into a string, using shorten to limit the length of each entry.*) + val optionize : entry list -> entry option list +(** [optionize] wraps them in Some constructors*) diff --git a/test/main.ml b/test/main.ml index f66a826..641ae9c 100644 --- a/test/main.ml +++ b/test/main.ml @@ -678,6 +678,12 @@ let at_tests = "test at statement with out of range column number", "at Type ID1 10", get_response "err_at_column_out_of_range" ); + ( true, + "test at statement with out of range column number", + "at Type ID1", + "string ID\tint i\t\tfloat f\t\tchar c\t\tbool b\t\tstring s\tid \ + d\t\t\n\n\n\ + ID1\t\t10\t\t3.14\t\ta\t\ttrue\t\thello there\t\t\t\n\n" ); ( true, "test at statement on no entry column", "at Type ID1 6", From e5019d8c6ec4ba122e67aee468251c40a31041f7 Mon Sep 17 00:00:00 2001 From: Thomas McFarland Date: Mon, 15 May 2023 00:47:28 -0400 Subject: [PATCH 22/24] We're done (in theory) --- _coverage/lib/cli.ml.html | 272 +++++++++--------- _coverage/lib/database.ml.html | 91 +++--- _coverage/lib/tables.ml.html | 168 +++++------ _coverage/lib/utils.ml.html | 84 +++--- ...50425.coverage => bisect038465248.coverage | 2 +- bisect421601976.coverage | 1 + bisect633276292.coverage | 1 + bisect666521526.coverage | 1 - bisect774541772.coverage | 1 + ...40087.coverage => bisect907500956.coverage | 2 +- cs3110project.yaml | 7 +- lib/database.ml | 1 - lib/database.mli | 5 +- lib/dune | 1 + lib/tables.mli | 6 +- lib/utils.mli | 6 +- test/main.ml | 2 +- 17 files changed, 328 insertions(+), 323 deletions(-) rename bisect214350425.coverage => bisect038465248.coverage (92%) create mode 100644 bisect421601976.coverage create mode 100644 bisect633276292.coverage delete mode 100644 bisect666521526.coverage create mode 100644 bisect774541772.coverage rename bisect401940087.coverage => bisect907500956.coverage (80%) diff --git a/_coverage/lib/cli.ml.html b/_coverage/lib/cli.ml.html index b7e8eee..7fcfe40 100644 --- a/_coverage/lib/cli.ml.html +++ b/_coverage/lib/cli.ml.html @@ -683,270 +683,270 @@

98.32%

let file_name = "data/responses.json" let get_response response = - let file = Yojson.Basic.from_file file_name in - file |> to_assoc |> List.assoc response |> to_string + let file = Yojson.Basic.from_file file_name in + file |> to_assoc |> List.assoc response |> to_string let reset () = - current_state := Default; + current_state := Default; db := DB.empty let parse_value v = function - | Strings -> String v - | Ints -> ( + | Strings -> String v + | Ints -> ( match int_of_string_opt v with - | Some i -> Int i - | None -> raise ParseError) - | Floats -> ( + | Some i -> Int i + | None -> raise ParseError) + | Floats -> ( match float_of_string_opt v with - | Some f -> Float f - | None -> raise ParseError) - | Bools -> ( + | Some f -> Float f + | None -> raise ParseError) + | Bools -> ( match bool_of_string_opt v with - | Some b -> Bool b - | None -> raise ParseError) - | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) - | Ids -> + | Some b -> Bool b + | None -> raise ParseError) + | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError) + | Ids -> Id - (match v |> String.split_on_char '@' |> List.map String.trim with - | [] | [ _ ] | _ :: _ :: _ :: _ -> raise ParseError - | [ hd; tl ] -> (hd, String tl)) + (match v |> String.split_on_char '@' |> List.map String.trim with + | [] | [ _ ] | _ :: _ :: _ :: _ -> raise ParseError + | [ hd; tl ] -> (hd, String tl)) let rec build_instance (name, table, vals) input = - match - input |> String.split_on_char '=' |> List.map String.trim - |> List.filter (fun s -> s <> "") + match + input |> String.split_on_char '=' |> List.map String.trim + |> List.filter (fun s -> s <> "") with - | [] -> + | [] -> DB.add_named_entry name vals !db; - current_state := Default; + current_state := Default; get_response "indent_end" (* "| <|\n|> " *) - | [ n ] -> + | [ n ] -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_no_value" (* "Please input a variable and a value\n| " *) - | n :: v :: tl -> ( + | n :: v :: tl -> ( match List.assoc_opt n vals with - | None -> ( + | None -> ( match Tbl.exists table n with - | exception TypeMismatch -> + | exception TypeMismatch -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_DNE" (* "That field does not exist in this type\n| " *) - | t -> ( + | t -> ( match parse_value v t with - | x -> + | x -> current_state := BuildInstance (name, table, (n, x) :: vals); get_response "indent" (* "| " *) - | exception ParseError -> + | exception ParseError -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_wrong_type" (* "That value does not match the type of the field\n| " *) )) - | Some _ -> + | Some _ -> current_state := BuildInstance (name, table, vals); get_response "err_create_field_already_entered" (* "This field has already been entered\n| " *)) let process_assign input = - match input |> List.map String.trim |> List.filter (fun s -> s <> "") with - | [] -> + match input |> List.map String.trim |> List.filter (fun s -> s <> "") with + | [] -> get_response "err_assign_empty" (* "Please input a type name and id\n|> " *) - | [ name ] -> + | [ name ] -> get_response "err_assign_no_id" (* "Please input an id for this instance\n|> " *) - | name :: id :: tl -> ( + | name :: id :: tl -> ( match DB.get_table name !db with - | Some t -> + | Some t -> current_state := BuildInstance ( name, t, [ ( (match Tbl.header t with - | Type (n, _) :: tl -> n + | Type (n, _) :: tl -> n | _ -> failwith "impossible" [@coverage off]), String id ); ] ); get_response "indent" - | None -> get_response "err_assign_DNE") + | None -> get_response "err_assign_DNE") (* "That type does not exist\n|> " *) let parse_type (typ, name) = - match typ with - | "int" -> Type (name, Ints) - | "float" -> Type (name, Floats) - | "string" -> Type (name, Strings) - | "bool" -> Type (name, Bools) - | "char" -> Type (name, Chars) - | "id" -> Type (name, Ids) - | _ -> raise ParseError + match typ with + | "int" -> Type (name, Ints) + | "float" -> Type (name, Floats) + | "string" -> Type (name, Strings) + | "bool" -> Type (name, Bools) + | "char" -> Type (name, Chars) + | "id" -> Type (name, Ids) + | _ -> raise ParseError let rec build_type (name, id, types) input = - match + match String.split_on_char ' ' input - |> List.map String.trim - |> List.filter (fun s -> s <> "") + |> List.map String.trim + |> List.filter (fun s -> s <> "") with - | [] -> - db := DB.build_table !db (Type (id, Strings) :: types) name; + | [] -> + db := DB.build_table !db (Type (id, Strings) :: types) name; current_state := Default; get_response "indent_end" (* "| <|\n|> " *) - | [ typ ] -> get_response "err_defn_no_name" + | [ typ ] -> get_response "err_defn_no_name" (* "Please enter a name for this field\n| " *) - | typ :: field_name :: tl -> ( + | typ :: field_name :: tl -> ( match parse_type (typ, field_name) with - | Type _ as t -> + | Type _ as t -> current_state := BuildType (name, id, types @ [ t ]); get_response "indent" (* "| " *) - | exception ParseError -> + | exception ParseError -> current_state := BuildType (name, id, types); get_response "err_defn_invalid_type" (* "Not a recognized type\n| " *) | _ -> raise (Failure "Should be impossible") [@coverage off]) let process_type input = - match List.filter (fun s -> s <> "") input with - | [] -> get_response "err_defn_needs_type_name" + match List.filter (fun s -> s <> "") input with + | [] -> get_response "err_defn_needs_type_name" (* "Please enter a type name for the definition\n|> " *) - | [ name ] -> + | [ name ] -> get_response "err_defn_needs_ID_name" (* "Please enter a name for the ID of this type\n|> " *) - | name :: id :: tl -> ( + | name :: id :: tl -> ( match DB.get_table name !db with - | Some _ -> + | Some _ -> get_response "err_defn_already_exists" (* "\n Type already defined\n|> " *) - | None -> + | None -> current_state := BuildType (name, id, []); get_response "indent" (* "| " *)) let process_at input = - match input |> List.map String.trim |> List.filter (fun s -> s <> "") with - | [] -> + match input |> List.map String.trim |> List.filter (fun s -> s <> "") with + | [] -> get_response "err_at_empty" (* "Please enter what the type and id of which to get an instance\n|> " *) - | [ name ] -> + | [ name ] -> get_response "err_at_no_id" (* "Please enter an id of the instance you which to get\n|> " *) - | [ name; id ] -> ( + | [ name; id ] -> ( match DB.get_table name !db with - | Some x -> ( + | Some x -> ( try - (x |> Tbl.header |> optionize |> build_row) + (x |> Tbl.header |> optionize |> build_row) ^ "\n" - ^ (String id |> Tbl.at x |> build_row) - with Not_found -> get_response "err_at_id_DNE") - | None -> + ^ (String id |> Tbl.at x |> build_row) + with Not_found -> get_response "err_at_id_DNE") + | None -> get_response "err_at_invalid_type" (* "No type of that name" *)) - | name :: id :: col :: tl -> ( + | name :: id :: col :: tl -> ( match DB.get_table name !db with - | Some x -> ( + | Some x -> ( try let row = Tbl.at x (String id) in - match int_of_string_opt col with - | None -> - get_response "err_at_column_not_int" + match int_of_string_opt col with + | None -> + get_response "err_at_column_not_int" (* "Column number should be an int" *) - | Some i -> ( + | Some i -> ( match List.nth_opt row i with - | Some e -> ( + | Some e -> ( match e with - | None -> get_response "no_entry" - | Some e -> ( + | None -> get_response "no_entry" + | Some e -> ( match e with - | Id (name, row) -> - (entry_to_string e ^ "=" + | Id (name, row) -> + (entry_to_string e ^ "=" ^ match DB.get_reference e !db with | exception Not_found -> get_response "unbound_type" - | l, r -> ( + | l, r -> ( "\n" - ^ build_row (optionize l) + ^ build_row (optionize l) ^ match r with - | None -> get_response "unbound_val" - | Some v -> build_row v)) + | None -> get_response "unbound_val" + | Some v -> build_row v)) ^ "\n|> " - | _ -> entry_to_string e ^ "\n|> ")) - | None -> get_response "err_at_column_out_of_range") - with Not_found -> get_response "err_at_id_DNE") - | None -> get_response "err_at_invalid_type") + | _ -> entry_to_string e ^ "\n|> ")) + | None -> get_response "err_at_column_out_of_range") + with Not_found -> get_response "err_at_id_DNE") + | None -> get_response "err_at_invalid_type") let split_on_substring sub str = - let idxs = ref [ 0 ] in + let idxs = ref [ 0 ] in let sub_len = String.length sub in - for i = 0 to String.length str - sub_len do - if String.sub str i sub_len = sub then - idxs := !idxs @ [ i; i + String.length sub ] - else () + for i = 0 to String.length str - sub_len do + if String.sub str i sub_len = sub then + idxs := !idxs @ [ i; i + String.length sub ] + else () done; - idxs := !idxs @ [ String.length str ]; + idxs := !idxs @ [ String.length str ]; let rec create_lst idxs sub_len str = - match idxs with - | [] -> [] - | s :: e :: t -> String.sub str s (e - s) :: create_lst t sub_len str + match idxs with + | [] -> [] + | s :: e :: t -> String.sub str s (e - s) :: create_lst t sub_len str | _ -> failwith "odd" [@coverage off] in create_lst !idxs sub_len str let parse_compare_exp str = - let str_lst = String.split_on_char ' ' str in - if List.length str_lst <> 3 then raise InvalidExpr + let str_lst = String.split_on_char ' ' str in + if List.length str_lst <> 3 then raise InvalidExpr else - match str_lst with - | [ var; compare; value ] -> + match str_lst with + | [ var; compare; value ] -> ( var, (match compare with - | "=" -> EQ - | "<>" -> NEQ - | ">" -> GT - | "<" -> LT - | "<=" -> LTE - | ">=" -> GTE - | _ -> raise InvalidComparison), + | "=" -> EQ + | "<>" -> NEQ + | ">" -> GT + | "<" -> LT + | "<=" -> LTE + | ">=" -> GTE + | _ -> raise InvalidComparison), value ) | _ -> failwith "should be impossible" [@coverage off] let process_find lst = - let cleaned_lst = - lst |> List.map String.trim |> List.filter (fun s -> s <> "") + let cleaned_lst = + lst |> List.map String.trim |> List.filter (fun s -> s <> "") in - if cleaned_lst = [] then get_response "err_find_missing_type" + if cleaned_lst = [] then get_response "err_find_missing_type" else - match DB.get_table (List.hd cleaned_lst) !db with - | None -> get_response "err_find_invalid_type" - | Some type_table -> ( + match DB.get_table (List.hd cleaned_lst) !db with + | None -> get_response "err_find_invalid_type" + | Some type_table -> ( try cleaned_lst |> List.tl - |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" - |> split_on_substring "and" |> List.map String.trim - |> List.filter (fun s -> s <> "") - |> (fun lst -> if lst = [] then raise InvalidExpr else lst) - |> List.map parse_compare_exp - |> Tbl.process_constraints type_table + |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) "" + |> split_on_substring "and" |> List.map String.trim + |> List.filter (fun s -> s <> "") + |> (fun lst -> if lst = [] then raise InvalidExpr else lst) + |> List.map parse_compare_exp + |> Tbl.process_constraints type_table with - | InvalidExpr -> get_response "err_find_invalid_expr" - | InvalidComparison -> get_response "err_find_invalid_comparison" - | TypeMismatch -> get_response "err_find_wrong_type" - | Not_found -> get_response "err_find_var_DNE") + | InvalidExpr -> get_response "err_find_invalid_expr" + | InvalidComparison -> get_response "err_find_invalid_comparison" + | TypeMismatch -> get_response "err_find_wrong_type" + | Not_found -> get_response "err_find_var_DNE") (** [parse_input input] takes in new input and determines the relevant command*) let parse_input input = - match !current_state with - | BuildInstance v -> build_instance v input - | BuildType v -> build_type v input - | Default -> ( + match !current_state with + | BuildInstance v -> build_instance v input + | BuildType v -> build_type v input + | Default -> ( match String.split_on_char ' ' input with | "quit" :: tl -> exit 0 [@coverage off] - | "help" :: tl -> get_response "help_message" - | "def" :: tl -> process_type tl - | "assign" :: tl -> process_assign tl - | "print" :: tl -> DB.db_to_string !db ^ "|> " - | "at" :: tl -> process_at tl - | "find" :: tl -> process_find tl - | _ -> + | "help" :: tl -> get_response "help_message" + | "def" :: tl -> process_type tl + | "assign" :: tl -> process_assign tl + | "print" :: tl -> DB.db_to_string !db ^ "|> " + | "at" :: tl -> process_at tl + | "find" :: tl -> process_find tl + | _ -> get_response "err_unknown_command" (* "Unknown command. Type help for a list of commands\n|> " *)) end diff --git a/_coverage/lib/database.ml.html b/_coverage/lib/database.ml.html index 20dc7a0..1ad27c6 100644 --- a/_coverage/lib/database.ml.html +++ b/_coverage/lib/database.ml.html @@ -18,7 +18,7 @@

97.50%

@@ -36,56 +36,55 @@

97.50%

- + - - + + - + - + - - + + - + - - + + - - + + - + - + - + - - + + - - - + + + - + - + - + - + - + - - +
@@ -152,14 +151,12 @@

97.50%

60 61 62 -63
open Utils
 open Tables
 
 module Database (Table : Table) = struct
   exception NoEntry
-  exception WrongType
   exception TableExists
 
   type table = Table.t
@@ -168,43 +165,43 @@ 

97.50%

let empty = [] let add_table database table name : database = - match - List.find (fun a -> match a with tname, t -> name = tname) database + match + List.find (fun a -> match a with tname, t -> name = tname) database with - | exception Not_found -> (name, ref table) :: database + | exception Not_found -> (name, ref table) :: database | _ -> raise TableExists let build_table database table name = - match + match List.find (fun a -> match a with tname, t -> name = tname) database with - | exception Not_found -> (name, ref (Table.empty table)) :: database + | exception Not_found -> (name, ref (Table.empty table)) :: database | _ -> raise TableExists let drop_table name database = List.filter (fun a -> match a with tname, t -> name <> tname) database let get_table name database = - match List.assoc_opt name database with Some x -> Some !x | None -> None + match List.assoc_opt name database with Some x -> Some !x | None -> None let get_reference ent database = - match ent with - | Id (tbl, id) -> ( + match ent with + | Id (tbl, id) -> ( let tbl = match get_table tbl database with | None -> raise Not_found - | Some v -> v + | Some v -> v in - ( Table.header tbl, - match Table.at tbl id with exception Not_found -> None | v -> Some v + ( Table.header tbl, + match Table.at tbl id with exception Not_found -> None | v -> Some v )) | _ -> raise TypeMismatch let rec db_to_string database = - match database with - | [] -> "\n" - | (name, x) :: xs -> - "Table: " ^ name ^ "\n\n" ^ Table.table_to_string !x ^ db_to_string xs + match database with + | [] -> "\n" + | (name, x) :: xs -> + "Table: " ^ name ^ "\n\n" ^ Table.table_to_string !x ^ db_to_string xs let rec add_entry table_name new_row database = match database with @@ -213,9 +210,9 @@

97.50%

| _ :: tl -> add_entry table_name new_row tl let add_named_entry table_name new_row database = - match List.assoc_opt table_name database with + match List.assoc_opt table_name database with | None -> raise Not_found - | Some x -> x := Table.insert_named !x new_row + | Some x -> x := Table.insert_named !x new_row end
diff --git a/_coverage/lib/tables.ml.html b/_coverage/lib/tables.ml.html index 8b5e802..a28027e 100644 --- a/_coverage/lib/tables.ml.html +++ b/_coverage/lib/tables.ml.html @@ -400,65 +400,65 @@

88.49%

open Utils
 
 let rec assert_types header a =
-  match header with
-  | [] -> if a = [] then [] else raise TypeMismatch [@coverage off]
-  | hd :: tl -> (
+  match header with
+  | [] -> if a = [] then [] else raise TypeMismatch [@coverage off]
+  | hd :: tl -> (
       match a with
       | [] -> raise TypeMismatch
-      | b :: c ->
+      | b :: c ->
           (match hd with
-          | Some (Type (_, Strings)) -> (
+          | Some (Type (_, Strings)) -> (
               match b with
-              | Some (String _) -> b
-              | None -> b
+              | Some (String _) -> b
+              | None -> b
               | _ -> raise TypeMismatch)
-          | Some (Type (_, Floats)) -> (
+          | Some (Type (_, Floats)) -> (
               match b with
-              | Some (Float _) -> b
-              | None -> b
+              | Some (Float _) -> b
+              | None -> b
               | _ -> raise TypeMismatch)
-          | Some (Type (_, Ints)) -> (
+          | Some (Type (_, Ints)) -> (
               match b with
-              | Some (Int _) -> b
-              | None -> b
+              | Some (Int _) -> b
+              | None -> b
               | _ -> raise TypeMismatch)
-          | Some (Type (_, Bools)) -> (
+          | Some (Type (_, Bools)) -> (
               match b with
-              | Some (Bool _) -> b
-              | None -> b
+              | Some (Bool _) -> b
+              | None -> b
               | _ -> raise TypeMismatch)
-          | Some (Type (_, Chars)) -> (
+          | Some (Type (_, Chars)) -> (
               match b with
-              | Some (Char _) -> b
-              | None -> b
+              | Some (Char _) -> b
+              | None -> b
               | _ -> raise TypeMismatch)
-          | Some (Type (_, Ids)) -> (
+          | Some (Type (_, Ids)) -> (
               match b with
-              | Some (Id _) -> b
-              | None -> b
+              | Some (Id _) -> b
+              | None -> b
               | _ -> raise TypeMismatch)
           | _ -> raise TypeMismatch)
-          :: assert_types tl c)
+          :: assert_types tl c)
 
 let rec reorder_list (a : (string * entry) list) = function
-  | [] -> if a = [] then [] else raise TypeMismatch
-  | Some (Type (name, v)) :: tl ->
+  | [] -> if a = [] then [] else raise TypeMismatch
+  | Some (Type (name, v)) :: tl ->
       let vl, rest =
         let rec extr_name acc = function
-          | [] -> (None, acc)
-          | (n, vr) :: rest ->
-              if n = name then (Some vr, acc @ rest)
-              else extr_name (acc @ [ (n, vr) ]) rest
+          | [] -> (None, acc)
+          | (n, vr) :: rest ->
+              if n = name then (Some vr, acc @ rest)
+              else extr_name (acc @ [ (n, vr) ]) rest
         in
-        extr_name [] a
+        extr_name [] a
       in
-      vl :: reorder_list rest tl
+      vl :: reorder_list rest tl
   | _ -> raise TypeMismatch
 
 let rec get_type_index cnt name = function
-  | [] -> raise Not_found
-  | Type (n, _) :: tl ->
-      if n = name then cnt else get_type_index (cnt + 1) name tl
+  | [] -> raise Not_found
+  | Type (n, _) :: tl ->
+      if n = name then cnt else get_type_index (cnt + 1) name tl
   | _ -> raise TypeMismatch
 
 module type Table = sig
@@ -484,44 +484,44 @@ 

88.49%

| None :: tl -> raise (Failure "Deoptionize on none") [@@coverage off] - let header = function HashTab (hd, _) -> hd - let hshtable = function HashTab (_, hsh) -> hsh + let header = function HashTab (hd, _) -> hd + let hshtable = function HashTab (_, hsh) -> hsh let deoptionize = function - | Some x -> x + | Some x -> x | None -> raise (Failure "Deoptionize on none") [@coverage off] - let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl - let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0) + let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl + let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0) let insert table entries = - match Hashtbl.find_opt (hshtable table) (List.hd entries) with + match Hashtbl.find_opt (hshtable table) (List.hd entries) with | Some x -> raise IndexExists - | None -> - let copy = Hashtbl.copy (hshtable table) in - let entrs = - assert_types (optionize (header table)) (optionize entries) + | None -> + let copy = Hashtbl.copy (hshtable table) in + let entrs = + assert_types (optionize (header table)) (optionize entries) in - HashTab - ( header table, - (Hashtbl.add copy (List.hd entries) (List.tl entrs); - copy) ) + HashTab + ( header table, + (Hashtbl.add copy (List.hd entries) (List.tl entrs); + copy) ) let insert_named table entries = - let name, value = List.hd entries in - match Hashtbl.find_opt (hshtable table) value with + let name, value = List.hd entries in + match Hashtbl.find_opt (hshtable table) value with | Some x -> raise IndexExists - | None -> - let copy = Hashtbl.copy (hshtable table) in - let reordered = + | None -> + let copy = Hashtbl.copy (hshtable table) in + let reordered = assert_types - (header table |> optionize) - (reorder_list entries (optionize (header table))) + (header table |> optionize) + (reorder_list entries (optionize (header table))) in - Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered); - HashTab (header table, copy) + Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered); + HashTab (header table, copy) - let at table id = Some id :: Hashtbl.find (hshtable table) id + let at table id = Some id :: Hashtbl.find (hshtable table) id let delete table id = let out = Hashtbl.copy (hshtable table) in @@ -529,51 +529,51 @@

88.49%

HashTab (header table, out) let rec table_to_string table = - Hashtbl.fold - (fun id ent acc -> acc ^ shorten (entry_to_string id) ^ build_row ent) - (hshtable table) - (build_row (optionize (header table))) + Hashtbl.fold + (fun id ent acc -> acc ^ shorten (entry_to_string id) ^ build_row ent) + (hshtable table) + (build_row (optionize (header table))) let rec process_constraints tbl lst = - let newHash = Hashtbl.create 0 in - match lst with - | [] -> table_to_string tbl - | hd :: tl -> + let newHash = Hashtbl.create 0 in + match lst with + | [] -> table_to_string tbl + | hd :: tl -> process_constraints (match hd with - | name, cmp, vl -> - let ind = get_type_index 0 name (header tbl) in - let cmp_func = + | name, cmp, vl -> + let ind = get_type_index 0 name (header tbl) in + let cmp_func = match List.find (function - | Type (n, t) -> n = name | _ -> failwith "Impossible") - (header tbl) + | Type (n, t) -> n = name | _ -> failwith "Impossible") + (header tbl) with - | Type (n, t) -> ( - match process_entry vl t with e -> run_constraint cmp e) + | Type (n, t) -> ( + match process_entry vl t with e -> run_constraint cmp e) | _ -> raise (Failure "Impossible") in Hashtbl.iter (fun a b -> - if ind = 0 then + if ind = 0 then if cmp_func a then Hashtbl.add newHash a b else () else - match List.nth b (ind - 1) with + match List.nth b (ind - 1) with | None -> () - | Some v -> - if cmp_func v then Hashtbl.add newHash a b else ()) - (hshtable tbl); - HashTab (header tbl, newHash)) + | Some v -> + if cmp_func v then Hashtbl.add newHash a b else ()) + (hshtable tbl); + HashTab (header tbl, newHash)) tl let exists table name = - let rec follow_header = function - | [] -> raise TypeMismatch - | Type (n, t) :: tl when n = name -> t - | _ :: tl -> follow_header tl + let rec follow_header = function + | [] -> raise TypeMismatch + | Type (n, t) :: tl when n = name -> t + | _ :: tl -> follow_header tl in - follow_header (header table) + follow_header (header table) end
diff --git a/_coverage/lib/utils.ml.html b/_coverage/lib/utils.ml.html index 435e212..b1d62ca 100644 --- a/_coverage/lib/utils.ml.html +++ b/_coverage/lib/utils.ml.html @@ -257,58 +257,58 @@

73.33%

| Type of (string * types) let name_map_types t = - match t with - | Strings -> "string" - | Floats -> "float" - | Ints -> "int" - | Chars -> "char" - | Bools -> "bool" - | Ids -> "id" + match t with + | Strings -> "string" + | Floats -> "float" + | Ints -> "int" + | Chars -> "char" + | Bools -> "bool" + | Ids -> "id" let process_entry input = function | Strings -> String input - | Floats -> ( + | Floats -> ( match float_of_string_opt input with | None -> raise TypeMismatch - | Some v -> Float v) - | Ints -> ( + | Some v -> Float v) + | Ints -> ( match int_of_string_opt input with - | None -> raise TypeMismatch - | Some v -> Int v) + | None -> raise TypeMismatch + | Some v -> Int v) | Chars -> if String.length input = 1 then Char input.[0] else raise TypeMismatch - | Bools -> ( + | Bools -> ( match bool_of_string_opt input with | None -> raise TypeMismatch - | Some v -> Bool v) + | Some v -> Bool v) | _ -> raise TypeMismatch let make_compare cmp lhs rhs = - match cmp with + match cmp with | LT -> lhs < rhs - | LTE -> lhs <= rhs - | EQ -> lhs = rhs - | NEQ -> lhs <> rhs + | LTE -> lhs <= rhs + | EQ -> lhs = rhs + | NEQ -> lhs <> rhs | GT -> lhs > rhs - | GTE -> lhs >= rhs + | GTE -> lhs >= rhs let run_constraint (cmp : comparison) rhs lhs = - match rhs with - | Float r -> ( + match rhs with + | Float r -> ( match lhs with - | Float l -> make_compare cmp l r + | Float l -> make_compare cmp l r | _ -> failwith "Typing error") - | Int r -> ( + | Int r -> ( match lhs with - | Int l -> make_compare cmp l r + | Int l -> make_compare cmp l r | _ -> failwith "Typing error") | Char r -> ( match lhs with | Char l -> make_compare cmp l r | _ -> failwith "Typing error") - | Bool r -> ( + | Bool r -> ( match lhs with - | Bool l -> make_compare cmp l r + | Bool l -> make_compare cmp l r | _ -> failwith "Typing error") | String r -> ( match lhs with @@ -317,28 +317,28 @@

73.33%

| _ -> raise TypeMismatch let rec entry_to_string ent = - match ent with - | String x -> x - | Float x -> string_of_float x - | Int x -> string_of_int x - | Char x -> String.make 1 x - | Bool x -> string_of_bool x - | Id (a, b) -> a ^ "@" ^ entry_to_string b - | Type (a, b) -> name_map_types b ^ " " ^ a + match ent with + | String x -> x + | Float x -> string_of_float x + | Int x -> string_of_int x + | Char x -> String.make 1 x + | Bool x -> string_of_bool x + | Id (a, b) -> a ^ "@" ^ entry_to_string b + | Type (a, b) -> name_map_types b ^ " " ^ a let shorten inp = - let str = String.trim inp in - if String.length str < 8 then str ^ "\t\t" - else if String.length str < 16 then str ^ "\t" + let str = String.trim inp in + if String.length str < 8 then str ^ "\t\t" + else if String.length str < 16 then str ^ "\t" else String.sub str 0 16 let rec build_row entlist = - match entlist with - | [] -> "\n\n" - | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs - | None :: xs -> "\t\t" ^ build_row xs + match entlist with + | [] -> "\n\n" + | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs + | None :: xs -> "\t\t" ^ build_row xs -let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl +let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl diff --git a/bisect214350425.coverage b/bisect038465248.coverage similarity index 92% rename from bisect214350425.coverage rename to bisect038465248.coverage index 153bbd9..9519eee 100644 --- a/bisect214350425.coverage +++ b/bisect038465248.coverage @@ -1 +1 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1136 1180 1210 1056 1092 964 1239 943 1420 1438 1328 1345 1302 1604 1524 1588 1552 1623 1498 1837 1775 1805 1723 40 5 0 1 1 5 43 43 0 0 0 43 0 0 0 71 47 118 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 38 0 38 38 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 18 9 9 9 9 9 63 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 63 18 8 9 8 8 2 63 116 0 26 26 26 85 111 111 111 105 105 105 8 17 105 8 130 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 48 87 3 0 41 4 0 42 5 0 38 5 0 35 8 0 4 41 0 90 45 47 43 43 45 0 313 0 313 48 313 361 0 47 307 307 533 241 66 774 47 307 0 22 8 1 30 0 405 126 47 668 102 668 51 51 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 47 47 47 47 47 47 47 47 47 47 47 47 47 0 47 47 47 47 17 14 17 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 183 1 182 731 549 183 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file +BISECT-COVERAGE-4 4 15 lib/database.ml 40 344 403 294 281 249 611 566 639 516 503 471 735 722 700 848 868 808 1114 1158 1188 1034 1070 942 1217 921 1398 1416 1306 1323 1280 1582 1502 1566 1530 1601 1476 1815 1753 1783 1701 40 5 0 1 1 5 43 43 0 0 0 43 0 0 0 71 47 118 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 38 0 38 38 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 18 9 9 9 9 9 63 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 63 18 8 9 8 8 2 63 116 0 26 26 26 85 111 111 111 105 105 105 8 17 105 8 130 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 48 87 3 0 41 4 0 42 5 0 38 5 0 35 8 0 4 41 0 90 45 47 43 43 45 0 313 0 313 48 313 361 0 47 307 307 533 241 66 774 47 307 0 22 8 1 30 0 405 126 47 668 102 668 51 51 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 47 47 47 47 47 47 47 47 47 47 47 47 47 0 47 47 47 47 17 14 17 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 183 1 182 731 549 183 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file diff --git a/bisect421601976.coverage b/bisect421601976.coverage new file mode 100644 index 0000000..046266f --- /dev/null +++ b/bisect421601976.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 344 403 294 281 249 611 566 639 516 503 471 735 722 700 848 868 808 1114 1158 1188 1034 1070 942 1217 921 1398 1416 1306 1323 1280 1582 1502 1566 1530 1601 1476 1815 1753 1783 1701 40 5 1 2 2 6 43 43 1 1 1 44 1 1 1 72 47 119 2 1 1 0 2 2 0 2 2 2 2 2 4 1 0 1 1 0 1 38 0 38 38 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 20 9 10 9 9 9 66 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 66 18 8 9 8 8 2 66 119 0 28 28 28 86 114 114 114 108 108 108 8 19 108 8 135 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 49 88 3 0 41 4 0 43 5 0 38 5 0 35 8 0 4 41 0 91 45 48 43 43 45 0 315 0 315 49 315 364 1 47 307 309 535 241 68 776 48 309 0 22 8 1 30 0 411 135 47 677 107 677 51 51 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 47 47 47 47 47 47 47 48 48 47 47 48 48 0 48 48 48 48 18 15 18 1 1 1 1 1 1 6 6 6 6 8 8 8 8 8 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 183 1 182 731 549 183 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file diff --git a/bisect633276292.coverage b/bisect633276292.coverage new file mode 100644 index 0000000..6992e6e --- /dev/null +++ b/bisect633276292.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 344 403 294 281 249 611 566 639 516 503 471 735 722 700 848 868 808 1114 1158 1188 1034 1070 942 1217 921 1398 1416 1306 1323 1280 1582 1502 1566 1530 1601 1476 1815 1753 1783 1701 40 6 0 1 1 6 44 44 0 0 0 44 1 1 1 71 49 120 2 1 1 1 2 3 0 3 1 1 2 1 3 0 0 0 0 0 0 38 0 38 38 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 18 9 9 9 9 9 63 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 63 18 8 9 8 8 2 63 116 0 26 26 26 85 111 111 111 105 105 105 8 17 105 8 130 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 48 87 3 0 41 4 0 42 5 0 38 5 0 35 8 0 4 41 0 90 45 47 43 43 45 0 313 0 313 48 313 361 0 47 307 307 533 241 66 774 47 307 0 22 8 1 30 0 406 130 47 668 102 668 52 52 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 47 47 47 47 47 47 47 47 47 47 47 47 47 1 47 48 48 48 18 14 18 1 1 1 1 1 1 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 183 1 182 731 549 183 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file diff --git a/bisect666521526.coverage b/bisect666521526.coverage deleted file mode 100644 index d6ceaf1..0000000 --- a/bisect666521526.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1136 1180 1210 1056 1092 964 1239 943 1420 1438 1328 1345 1302 1604 1524 1588 1552 1623 1498 1837 1775 1805 1723 40 6 0 2 2 6 44 44 1 1 1 45 2 2 2 72 49 121 2 1 1 1 2 3 0 3 2 2 2 2 4 1 0 1 1 0 1 38 1 38 39 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 22 11 12 11 11 11 78 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 4 78 22 10 11 10 10 4 78 145 2 38 40 40 98 138 138 138 130 130 130 8 23 130 8 161 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 50 89 3 0 42 4 0 44 5 0 39 5 0 36 8 0 5 41 0 92 46 49 44 44 46 0 321 0 321 50 321 371 1 47 307 309 535 241 68 776 48 309 0 22 8 1 30 0 416 141 47 701 111 701 53 53 3 3 3 3 3 3 3 3 3 3 0 3 3 3 3 47 47 47 47 47 47 47 48 48 47 47 48 48 0 48 48 48 48 20 15 20 1 1 1 1 1 1 8 8 8 8 10 10 10 10 10 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 184 2 182 733 551 184 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file diff --git a/bisect774541772.coverage b/bisect774541772.coverage new file mode 100644 index 0000000..a78691b --- /dev/null +++ b/bisect774541772.coverage @@ -0,0 +1 @@ +BISECT-COVERAGE-4 4 15 lib/database.ml 40 344 403 294 281 249 611 566 639 516 503 471 735 722 700 848 868 808 1114 1158 1188 1034 1070 942 1217 921 1398 1416 1306 1323 1280 1582 1502 1566 1530 1601 1476 1815 1753 1783 1701 40 6 0 2 2 6 43 43 0 0 0 43 2 2 1 72 48 120 3 1 2 0 3 3 0 3 1 1 1 1 2 0 1 0 1 1 2 39 0 39 39 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 20 11 11 11 11 11 75 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 4 75 22 10 11 10 10 4 75 142 2 36 38 38 97 135 135 135 127 127 127 8 21 127 8 156 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 50 89 3 0 42 4 0 43 6 0 39 5 0 36 8 0 5 41 0 92 46 49 44 44 46 0 321 0 321 50 321 371 0 48 309 309 533 242 67 775 48 309 0 22 8 1 30 0 414 134 48 696 108 696 52 52 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 48 48 48 48 48 48 48 48 48 48 48 48 48 0 48 48 48 48 19 15 19 0 0 0 0 0 0 8 8 8 8 8 8 8 8 8 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 184 2 182 733 551 184 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file diff --git a/bisect401940087.coverage b/bisect907500956.coverage similarity index 80% rename from bisect401940087.coverage rename to bisect907500956.coverage index 8392594..7845dac 100644 --- a/bisect401940087.coverage +++ b/bisect907500956.coverage @@ -1 +1 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 366 425 316 303 271 633 588 661 538 525 493 757 744 722 870 890 830 1136 1180 1210 1056 1092 964 1239 943 1420 1438 1328 1345 1302 1604 1524 1588 1552 1623 1498 1837 1775 1805 1723 40 6 1 2 2 7 44 44 0 1 1 44 2 2 2 74 48 122 4 2 2 0 4 4 0 4 1 1 2 1 3 0 1 0 1 1 2 39 0 39 39 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 18 9 9 9 9 9 63 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 63 18 8 9 8 8 2 63 116 0 26 26 26 85 111 111 111 105 105 105 8 18 105 8 131 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 50 89 3 0 41 4 0 42 7 0 38 5 0 35 8 0 4 41 0 92 45 49 43 43 45 0 317 0 317 50 317 367 0 49 311 311 533 243 68 776 49 311 0 22 8 1 30 0 416 138 49 676 107 676 52 52 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 49 49 49 49 49 49 49 49 49 49 49 49 49 1 49 50 50 50 20 15 20 1 1 1 1 1 1 6 6 6 6 7 7 7 7 7 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 184 1 183 732 549 184 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file +BISECT-COVERAGE-4 4 15 lib/database.ml 40 344 403 294 281 249 611 566 639 516 503 471 735 722 700 848 868 808 1114 1158 1188 1034 1070 942 1217 921 1398 1416 1306 1323 1280 1582 1502 1566 1530 1601 1476 1815 1753 1783 1701 40 5 0 1 1 5 44 44 0 1 1 44 0 0 1 73 47 120 3 2 1 0 3 3 0 3 1 1 1 1 2 0 0 0 0 0 0 38 1 38 39 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 18 9 9 9 9 9 63 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 63 18 8 9 8 8 2 63 116 0 26 26 26 85 111 111 111 105 105 105 8 18 105 8 131 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 49 88 3 0 41 4 0 42 6 0 38 5 0 35 8 0 4 41 0 91 45 48 43 43 45 0 315 0 315 49 315 364 0 48 309 309 533 242 67 775 48 309 0 22 8 1 30 0 411 132 48 672 105 672 52 52 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 48 48 48 48 48 48 48 48 48 48 48 48 48 0 48 48 48 48 19 14 19 0 0 0 0 0 0 6 6 6 6 7 7 7 7 7 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 184 1 183 732 549 184 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file diff --git a/cs3110project.yaml b/cs3110project.yaml index 66630b6..ba8a5c4 100644 --- a/cs3110project.yaml +++ b/cs3110project.yaml @@ -21,8 +21,9 @@ git-repo: "https://github.com/tf-mac/CS3110-Final-Project" demo-video-url: "" # Write a short, attention-grabbing description of your project. desc: > - Our project is a relational database. We structure information in a table. - We can define custom types with OCaml primitives, assign them to - values, and display those types to the user. The user can access all the + Our project is a relational database. We structure information in either a + list table or hash table. We can define custom types with + OCaml primitives, assign them to values, display those types to the user, + and provide references to other entries. The user can access all the functionality through a command line interface that allows interaction with the database. diff --git a/lib/database.ml b/lib/database.ml index f1a45d1..08fd305 100644 --- a/lib/database.ml +++ b/lib/database.ml @@ -3,7 +3,6 @@ open Tables module Database (Table : Table) = struct exception NoEntry - exception WrongType exception TableExists type table = Table.t diff --git a/lib/database.mli b/lib/database.mli index 8aaf534..723b84f 100644 --- a/lib/database.mli +++ b/lib/database.mli @@ -5,11 +5,14 @@ module Database (Table : Table) : sig exception NoEntry (** Raised when an entry that does not exist is parsed. *) - exception WrongType exception TableExists + (** Raised when a table is attempted to be added which already exists*) type table = Table.t + (** Internal table of the database*) + type database + (** Internal database representation*) val empty : database (** [empty] is a table containing no elements*) diff --git a/lib/dune b/lib/dune index 65e11c2..c56ae5c 100644 --- a/lib/dune +++ b/lib/dune @@ -1,5 +1,6 @@ (library (name RelationalDatabase) (libraries yojson) + (public_name Database) (instrumentation (backend bisect_ppx))) diff --git a/lib/tables.mli b/lib/tables.mli index 25ce707..b7af0a7 100644 --- a/lib/tables.mli +++ b/lib/tables.mli @@ -26,15 +26,15 @@ module type Table = sig val table_to_string : t -> string (** [table_to_string t] returns a string representation of [t]*) - (* Processes a given list of constraints + (** Processes a given list of constraints Raises [Not_found] if a constraint isn't found Raises [TypeMismatch] if the comparison value doesn't match the header*) val process_constraints : t -> (string * comparison * string) list -> string - (* Returns the header of the table*) + (** Returns the header of the table*) val header : t -> entry list - (* Returns the type of the named column, if it exists. If not, raises [TypeMismatch]*) + (** Returns the type of the named column, if it exists. If not, raises [TypeMismatch]*) val exists : t -> string -> types end diff --git a/lib/utils.mli b/lib/utils.mli index 9727813..8b74000 100644 --- a/lib/utils.mli +++ b/lib/utils.mli @@ -4,7 +4,8 @@ type types = | Ints | Chars | Bools - | Ids (** Representation of the type of some field*) + | Ids + (** Representation of the type of some field*) type comparison = | LT @@ -12,7 +13,8 @@ type comparison = | EQ | NEQ | GT - | GTE (** Representation of some comparison operation*) + | GTE +(** Representation of some comparison operation*) exception IndexExists (** [IndexExists] occurs when trying to replace an index which already exists*) diff --git a/test/main.ml b/test/main.ml index 641ae9c..99a6320 100644 --- a/test/main.ml +++ b/test/main.ml @@ -335,7 +335,7 @@ module DatabaseTests (T : Table) = struct database_person_ent_list "Person" person_database; test_build_table "Testing Valid build_table on existing database" person_database database_airport_ent_list "Airport" large_database; - test_build_table_exception "Testing TableExists exception on build_table" + test_build_table_exception "Testing IndexExists exception on build_table" person_database database_person_ent_list "Person" PersonDB.TableExists; test_add_named_entry "Testing add_named_entry" "Person" [ ("name", String "location") ] From c18b45d9f9eabd2751cdb8b5d9af1da7fe517b71 Mon Sep 17 00:00:00 2001 From: JT Klenke Date: Mon, 15 May 2023 03:00:51 -0400 Subject: [PATCH 23/24] Final commit - checked yaml - checked make test - checked make doc - checked make run - checked install instructions --- INSTALL.txt | 7 +- _coverage/coverage.css | 500 ----------------- _coverage/coverage.js | 164 ------ _coverage/highlight.pack.js | 2 - _coverage/index.html | 53 -- _coverage/lib/cli.ml.html | 974 --------------------------------- _coverage/lib/database.ml.html | 222 -------- _coverage/lib/tables.ml.html | 583 -------------------- _coverage/lib/utils.ml.html | 347 ------------ bisect038465248.coverage | 1 - bisect421601976.coverage | 1 - bisect633276292.coverage | 1 - bisect774541772.coverage | 1 - bisect907500956.coverage | 1 - cs3110project.yaml | 13 +- lib/cli.ml | 1 + test/main.ml | 3 +- 17 files changed, 11 insertions(+), 2863 deletions(-) delete mode 100644 _coverage/coverage.css delete mode 100644 _coverage/coverage.js delete mode 100644 _coverage/highlight.pack.js delete mode 100644 _coverage/index.html delete mode 100644 _coverage/lib/cli.ml.html delete mode 100644 _coverage/lib/database.ml.html delete mode 100644 _coverage/lib/tables.ml.html delete mode 100644 _coverage/lib/utils.ml.html delete mode 100644 bisect038465248.coverage delete mode 100644 bisect421601976.coverage delete mode 100644 bisect633276292.coverage delete mode 100644 bisect774541772.coverage delete mode 100644 bisect907500956.coverage diff --git a/INSTALL.txt b/INSTALL.txt index 6cd5b39..97c10a0 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -4,9 +4,4 @@ How to Install 2. cd to the correct file path -3. Run "dune build" in terminal - -4. In Terminal run the command "_build/default/bin/main.exe". This will open up -the CLI in which you will interact with to create a table where you can define -custom types and assign them values. There are instructions in the CLI that will -help you to understand how to use our code. +3. Run "make run" in the terminal diff --git a/_coverage/coverage.css b/_coverage/coverage.css deleted file mode 100644 index 35bb22a..0000000 --- a/_coverage/coverage.css +++ /dev/null @@ -1,500 +0,0 @@ -:root, .light:root { - --main-background: #fff; - --code-background: transparent; - --line-numbers-background: rgba(0, 0, 0, 0.025); - --navbar-background: #eee; - - --meter-unvisited-color: #f9c3c3; - --meter-visited-color: #9ed09f; - --meter-separator-color: white; - - --color: #000; - --dirname-color: #bbb; - --stats-color: #aaa; - --underline-color: #ddd; - --visited-color: #eaffea; - --visited-number-color: rgba(64, 192, 64, 0.2); - --unvisited-color: #ffecec; - --unvisited-number-color: rgba(255, 128, 128, 0.5); - --somevisited-color: #ffd; - --highlight-color: #a0fbff; - --line-number-color: rgba(0, 0, 0, 0.4); - --unvisited-margin-color: #d69e9e; - --border: #eee; - --navbar-border: #ddd; - --code-color: #000; - --hljs-link: #6a737d; - --hljs-keyword: #d73a49; - --hljs-regexp: #032f62; - --hljs-title: #900; - --hljs-type: #6f42c1; - --hljs-meta: #22863a; - --hljs-variable: #005cc5; -} - -.dark:root { - --main-background: #202020; - --code-background: #222; - --line-numbers-background: rgba(0, 0, 0, 0.125); - --navbar-background: #202020; - - --meter-unvisited-color: #622; - --meter-visited-color: #252; - --meter-separator-color: black; - - --color: #bebebe; - --dirname-color: #666; - --stats-color: #555; - --underline-color: #444; - --visited-color: #002800; - --visited-number-color: #252; - --unvisited-color: #380000; - --unvisited-number-color: #822; - --somevisited-color: #303000; - --highlight-color: #303e3f; - --line-number-color: rgba(230, 230, 230, 0.3); - --unvisited-margin-color: #622; - --border: #333; - --navbar-border: #333; - --code-color: #ccc; - --hljs-link: #999; - --hljs-keyword: #cda869; - --hljs-regexp: #f9ee98; - --hljs-title: #dcdcaa; - --hljs-type: #ac885b; - --hljs-meta: #82aaff; - --hljs-variable: #cf6a4c; -} - -@media (prefers-color-scheme: dark) { - :root { - --main-background: #202020; - --code-background: #222; - --line-numbers-background: rgba(0, 0, 0, 0.125); - --navbar-background: #202020; - - --meter-unvisited-color: #622; - --meter-visited-color: #252; - --meter-separator-color: black; - - --color: #bebebe; - --dirname-color: #666; - --underline-color: #444; - --visited-color: #002800; - --visited-number-color: #252; - --unvisited-color: #380000; - --unvisited-number-color: #822; - --somevisited-color: #303000; - --highlight-color: #303e3f; - --line-number-color: rgba(230, 230, 230, 0.3); - --unvisited-margin-color: #622; - --border: #333; - --navbar-border: #333; - --code-color: #ccc; - --hljs-link: #999; - --hljs-keyword: #cda869; - --hljs-regexp: #f9ee98; - --hljs-title: #dcdcaa; - --hljs-type: #ac885b; - --hljs-meta: #82aaff; - --hljs-variable: #cf6a4c; - } -} - -body { - margin: 0; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 16px; - line-height: 1.5em; - background-color: var(--main-background); -} - -pre { - margin: 0; - font-family: "Fira Code", "Cascadia Code", Consolas, "Liberation Mono", Menlo, Courier, monospace; - font-size: 13px; - color: var(--code-color); - cursor: text; -} - -code { - font-family: inherit; -} - -a { - text-decoration: none; - color: inherit; -} - -a:visited { - color: inherit; -} - -#header { - color: var(--color); -} - -h1 { - display: inline-block; - margin: 1.5em 1.5em 0.75em 1.5em; -} - -.dirname { - color: var(--dirname-color); -} - -h2 { - display: inline-block; - position: relative; - top: -1px; -} - -#footer { - margin: 1em 0 1em 4em; - color: #aaa; - font-size: 12px; -} - -#footer a { - color: #666; - border-bottom: 1px solid #ccc; -} - -#footer a:visited { - color: #666; -} - -#navbar { - position: fixed; - top: 0; - left: 0; - width: 1em; - height: 100%; - background-color: var(--navbar-background); - border-right: 1px solid var(--navbar-border); - cursor: pointer; -} - -#navbar span { - display: block; - position: absolute; - width: 100%; - height: 5px; -} - -#navbar .unvisited, #navbar .some-visited { - background-color: var(--unvisited-margin-color); -} - -#report { - border-top: 1px solid var(--border); - border-bottom: 1px solid var(--border); - overflow: hidden; -} - -#lines-layer { - position: absolute; - z-index: -100; - width: 100%; - background-color: var(--code-background); -} - -#lines-layer span { - display: inline-block; - width: 100%; -} - -a[id] { - display: block; - position: relative; - top: -5.5em; -} - -#lines-layer .unvisited { - background-color: var(--unvisited-color); -} - -#lines-layer .visited { - background-color: var(--visited-color); -} - -#lines-layer .some-visited { - background-color: var(--somevisited-color); -} - -a[id]:target + span { - -webkit-animation: highlight-blank 0.5s; - -moz-animation: highlight-blank 0.5s; - -o-animation: highlight-blank 0.5s; - animation: highlight-blank 0.5s; -} - -a[id]:target + .unvisited { - -webkit-animation: highlight-unvisited 0.5s; - -moz-animation: highlight-unvisited 0.5s; - -o-animation: highlight-unvisited 0.5s; - animation: highlight-unvisited 0.5s; -} - -a[id]:target + .visited { - -webkit-animation: highlight-visited 0.5s; - -moz-animation: highlight-visited 0.5s; - -o-animation: highlight-visited 0.5s; - animation: highlight-visited 0.5s; -} - -a[id]:target + .some-visited { - -webkit-animation: highlight-some-visited 0.5s; - -moz-animation: highlight-some-visited 0.5s; - -o-animation: highlight-some-visited 0.5s; - animation: highlight-some-visited 0.5s; -} - -@-webkit-keyframes highlight-blank { - from { background-color: var(--highlight-color); } - to { background-color: transparent; } -} - -@-moz-keyframes highlight-blank { - from { background-color: var(--highlight-color); } - to { background-color: transparent; } -} - -@-o-keyframes highlight-blank { - from { background-color: var(--highlight-color); } - to { background-color: transparent; } -} - -@keyframes highlight-blank { - from { background-color: var(--highlight-color); } - to { background-color: transparent; } -} - -@-webkit-keyframes highlight-unvisited { - from { background-color: var(--highlight-color); } - to { background-color: var(--unvisited-color); } -} - -@-moz-keyframes highlight-unvisited { - from { background-color: var(--highlight-color); } - to { background-color: var(--unvisited-color); } -} - -@-o-keyframes highlight-unvisited { - from { background-color: var(--highlight-color); } - to { background-color: var(--unvisited-color); } -} - -@keyframes highlight-unvisited { - from { background-color: var(--highlight-color); } - to { background-color: var(--unvisited-color); } -} - -@-webkit-keyframes highlight-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--visited-color); } -} - -@-moz-keyframes highlight-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--visited-color); } -} - -@-o-keyframes highlight-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--visited-color); } -} - -@keyframes highlight-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--visited-color); } -} - -@-webkit-keyframes highlight-some-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--somevisited-color); } -} - -@-moz-keyframes highlight-some-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--somevisited-color); } -} - -@-o-keyframes highlight-some-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--somevisited-color); } -} - -@keyframes highlight-some-visited { - from { background-color: var(--highlight-color); } - to { background-color: var(--somevisited-color); } -} - -#line-numbers { - float: left; - border-right: 1px solid var(--border); - margin-right: 1em; - color: var(--line-number-color); - background-color: var(--line-numbers-background); - text-align: right; -} - -#line-numbers a { - display: inline-block; - padding-left: 2.35em; - padding-right: 1em; - text-decoration: none; - color: var(--line-number-color); -} - -#line-numbers .unvisited { - background-color: var(--unvisted-number-color); -} - -#line-numbers .visited { - background-color: var(--visted-number-color); -} - -code span[data-count] { - background-color: var(--visited-number-color); -} - -code span[data-count="0"] { - background-color: var(--unvisited-number-color); -} - -#tool-tip { - display: none; - position: fixed; - padding: 0 0.25em; - background-color: black; - color: white; -} - -#tool-tip.visible { - display: block; -} - -#files { - padding: 1.5em 4em; - background-color: var(--code-background); - border-top: 1px solid var(--border); - border-bottom: 1px solid var(--border); -} - -.meter { - display: inline-block; - position: relative; - top: 3px; - width: 5em; - height: 1em; - background-color: var(--meter-unvisited-color); -} - -.covered { - display: inline-block; - position: absolute; - width: 50%; - height: 100%; - background-color: var(--meter-visited-color); - border-right: 1px solid var(--meter-separator-color); -} - -#files div { - display: flex; -} - -summary { - cursor: pointer; - display: flex; -} - -.summary-indicator { - display: inline-block; - width: 1em; - color: var(--color); -} - -/* Adds indentation to the directory tree */ -details > details, details > div { - margin-left: 1em; -} - -details > summary > .summary-indicator { - text-align: center; - font-weight: bold; -} - -details > summary > .summary-indicator::before { - content: "+"; -} - -details[open] > summary > .summary-indicator::before { - content: "-"; -} - -.percentage { - display: inline-block; - min-width: 7.5em; - margin: 0 0.5em; - font-size: 90%; - color: var(--color); -} - -.stats { - display: inline-block; - font-size: 70%; - color: var(--stats-color); -} - -#files a { - text-decoration: none; - border-bottom: 1px solid var(--underline-color); - color: var(--color); -} - -.hljs-link, -.hljs-comment, -.hljs-quote { - color: var(--hljs-link); -} - -.hljs-built_in, -.hljs-builtin-name, -.hljs-keyword, -.hljs-selector-tag, -.hljs-subst { - color: var(--hljs-keyword); -} - -.hljs-number, -.hljs-literal, -.hljs-variable, -.hljs-template-variable, -.hljs-tag .hljs-attr { - color: var(--hljs-variable); -} - -.hljs-regexp, -.hljs-string, -.hljs-doctag { - color: var(--hljs-regexp); -} - -.hljs-title, -.hljs-section, -.hljs-selector-id { - color: var(--hljs-title); -} - -.hljs-type, -.hljs-class .hljs-title { - color: var(--hljs-type); -} - -.hljs-meta, -.hljs-tag, -.hljs-name, -.hljs-attribute { - color: var(--hljs-meta); -} diff --git a/_coverage/coverage.js b/_coverage/coverage.js deleted file mode 100644 index ef27254..0000000 --- a/_coverage/coverage.js +++ /dev/null @@ -1,164 +0,0 @@ -function tool_tip_element() -{ - var element = document.querySelector("#tool-tip"); - if (element === null) { - element = document.createElement("div"); - element.id = "tool-tip"; - document.querySelector("body").appendChild(element); - } - - return element; -}; - -var tool_tip = tool_tip_element(); -var html = document.getElementsByTagName("html")[0]; - -function attach_tool_tip() -{ - document.querySelector("body").onmousemove = function (event) - { - var element = event.target; - if (element.dataset.count === undefined) - element = event.target.parentNode; - - if (element.dataset.count && element.dataset.count !== "0") { - tool_tip.textContent = element.dataset.count; - tool_tip.classList.add("visible"); - - if (event.clientY < html.clientHeight - 48) - tool_tip.style.top = event.clientY + 7 + "px"; - else - tool_tip.style.top = event.clientY - 32 + "px"; - - tool_tip.style.left = event.clientX + 7 + "px"; - } - else - tool_tip.classList.remove("visible"); - } -}; - -attach_tool_tip(); - -function move_line_to_cursor(cursor_y, line_number) -{ - var id = "L" + line_number; - - var line_anchor = - document.querySelector("a[id=" + id + "] + span"); - if (line_anchor === null) - return; - - var line_y = line_anchor.getBoundingClientRect().top + 18; - - var y = window.scrollY; - window.location = "#" + id; - window.scrollTo(0, y + line_y - cursor_y); -}; - -function handle_navbar_clicks() -{ - var line_count = document.querySelectorAll("a[id]").length; - var navbar = document.querySelector("#navbar"); - - if (navbar === null) - return; - - navbar.onclick = function (event) - { - event.preventDefault(); - - var line_number = - Math.floor(event.clientY / navbar.clientHeight * line_count + 1); - - move_line_to_cursor(event.clientY, line_number); - }; -}; - -handle_navbar_clicks(); - -function handle_line_number_clicks() -{ - document.querySelector("body").onclick = function (event) - { - if (event.target.tagName != "A") - return; - - var line_number_location = event.target.href.search(/#L[0-9]+\$/); - if (line_number_location === -1) - return; - - var anchor = event.target.href.slice(line_number_location); - - event.preventDefault(); - - var y = window.scrollY; - window.location = anchor; - window.scrollTo(0, y); - }; -}; - -handle_line_number_clicks(); - -function handle_collapsible_click() -{ - document.querySelectorAll("summary").forEach( - function (summary) - { - summary.onclick = function (event) - { - var details = summary.parentElement; - - var all_open = function (sub_details) { - var all_are_open = true; - for (let details of sub_details) { - all_are_open = - all_are_open && - details.hasAttribute('open'); - } - return all_are_open; - }; - - var all_toggle = function (sub_details, toggle) { - for (let details of sub_details) { - if (toggle) - details.removeAttribute('open'); - else - details.setAttribute('open', ''); - } - }; - - // ctrl-click toggles the state of the folder and all sub-folders, recursively: - // - if all sub-folders are opened, then all sub-folders are closed - // - if at least one sub-folder is closed (or the folder itself), - // then all sub-folders are opened - if (event.ctrlKey) { - var sub_details = Array.prototype.slice.call( - details.querySelectorAll("details") - ); - sub_details.push(details); - all_toggle(sub_details, all_open(sub_details)); - return false; - } - - // shift-click toggles the state of all immediate sub-folders: - // - if the folder is closed, just open it - // - if the folder is opened: - // - if all sub-folders are opened, then all sub-folders are closed - // - if at least one sub-folder is closed, then all sub-folders are opened - if (event.shiftKey && details.hasAttribute('open')) { - details.setAttribute('open', ''); - var sub_details = - Array.prototype.filter.call( - details.querySelectorAll("details"), - function (sub_details) { - return sub_details.parentNode === details; - } - ); - all_toggle(sub_details, all_open(sub_details)); - return false; - } - }; - }); -} - -handle_collapsible_click(); diff --git a/_coverage/highlight.pack.js b/_coverage/highlight.pack.js deleted file mode 100644 index 2e55d49..0000000 --- a/_coverage/highlight.pack.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! highlight.js v9.15.8 | BSD3 License | git.io/hljslicense */ -!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(a){var f=[],u=Object.keys,N={},c={},n=/^(no-?highlight|plain|text)$/i,s=/\blang(?:uage)?-([\w-]+)\b/i,t=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,r={case_insensitive:"cI",lexemes:"l",contains:"c",keywords:"k",subLanguage:"sL",className:"cN",begin:"b",beginKeywords:"bK",end:"e",endsWithParent:"eW",illegal:"i",excludeBegin:"eB",excludeEnd:"eE",returnBegin:"rB",returnEnd:"rE",relevance:"r",variants:"v",IDENT_RE:"IR",UNDERSCORE_IDENT_RE:"UIR",NUMBER_RE:"NR",C_NUMBER_RE:"CNR",BINARY_NUMBER_RE:"BNR",RE_STARTERS_RE:"RSR",BACKSLASH_ESCAPE:"BE",APOS_STRING_MODE:"ASM",QUOTE_STRING_MODE:"QSM",PHRASAL_WORDS_MODE:"PWM",C_LINE_COMMENT_MODE:"CLCM",C_BLOCK_COMMENT_MODE:"CBCM",HASH_COMMENT_MODE:"HCM",NUMBER_MODE:"NM",C_NUMBER_MODE:"CNM",BINARY_NUMBER_MODE:"BNM",CSS_NUMBER_MODE:"CSSNM",REGEXP_MODE:"RM",TITLE_MODE:"TM",UNDERSCORE_TITLE_MODE:"UTM",COMMENT:"C",beginRe:"bR",endRe:"eR",illegalRe:"iR",lexemesRe:"lR",terminators:"t",terminator_end:"tE"},b="",h={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function _(e){return e.replace(/&/g,"&").replace(//g,">")}function E(e){return e.nodeName.toLowerCase()}function v(e,n){var t=e&&e.exec(n);return t&&0===t.index}function l(e){return n.test(e)}function g(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function R(e){var a=[];return function e(n,t){for(var r=n.firstChild;r;r=r.nextSibling)3===r.nodeType?t+=r.nodeValue.length:1===r.nodeType&&(a.push({event:"start",offset:t,node:r}),t=e(r,t),E(r).match(/br|hr|img|input/)||a.push({event:"stop",offset:t,node:r}));return t}(e,0),a}function i(e){if(r&&!e.langApiRestored){for(var n in e.langApiRestored=!0,r)e[n]&&(e[r[n]]=e[n]);(e.c||[]).concat(e.v||[]).forEach(i)}}function m(o){function s(e){return e&&e.source||e}function c(e,n){return new RegExp(s(e),"m"+(o.cI?"i":"")+(n?"g":""))}!function n(t,e){if(!t.compiled){if(t.compiled=!0,t.k=t.k||t.bK,t.k){function r(t,e){o.cI&&(e=e.toLowerCase()),e.split(" ").forEach(function(e){var n=e.split("|");a[n[0]]=[t,n[1]?Number(n[1]):1]})}var a={};"string"==typeof t.k?r("keyword",t.k):u(t.k).forEach(function(e){r(e,t.k[e])}),t.k=a}t.lR=c(t.l||/\w+/,!0),e&&(t.bK&&(t.b="\\b("+t.bK.split(" ").join("|")+")\\b"),t.b||(t.b=/\B|\b/),t.bR=c(t.b),t.endSameAsBegin&&(t.e=t.b),t.e||t.eW||(t.e=/\B|\b/),t.e&&(t.eR=c(t.e)),t.tE=s(t.e)||"",t.eW&&e.tE&&(t.tE+=(t.e?"|":"")+e.tE)),t.i&&(t.iR=c(t.i)),null==t.r&&(t.r=1),t.c||(t.c=[]),t.c=Array.prototype.concat.apply([],t.c.map(function(e){return function(n){return n.v&&!n.cached_variants&&(n.cached_variants=n.v.map(function(e){return g(n,{v:null},e)})),n.cached_variants||n.eW&&[g(n)]||[n]}("self"===e?t:e)})),t.c.forEach(function(e){n(e,t)}),t.starts&&n(t.starts,e);var i=t.c.map(function(e){return e.bK?"\\.?(?:"+e.b+")\\.?":e.b}).concat([t.tE,t.i]).map(s).filter(Boolean);t.t=i.length?c(function(e,n){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i')+n+(t?"":b):n}function o(){E+=null!=l.sL?function(){var e="string"==typeof l.sL;if(e&&!N[l.sL])return _(g);var n=e?C(l.sL,g,!0,f[l.sL]):O(g,l.sL.length?l.sL:void 0);return 0")+'"');return g+=n,n.length||1}var s=B(e);if(!s)throw new Error('Unknown language: "'+e+'"');m(s);var a,l=t||s,f={},E="";for(a=l;a!==s;a=a.parent)a.cN&&(E=c(a.cN,"",!0)+E);var g="",R=0;try{for(var d,p,M=0;l.t.lastIndex=M,d=l.t.exec(n);)p=r(n.substring(M,d.index),d[0]),M=d.index+p;for(r(n.substr(M)),a=l;a.parent;a=a.parent)a.cN&&(E+=b);return{r:R,value:E,language:e,top:l}}catch(e){if(e.message&&-1!==e.message.indexOf("Illegal"))return{r:0,value:_(n)};throw e}}function O(t,e){e=e||h.languages||u(N);var r={r:0,value:_(t)},a=r;return e.filter(B).filter(M).forEach(function(e){var n=C(e,t,!1);n.language=e,n.r>a.r&&(a=n),n.r>r.r&&(a=r,r=n)}),a.language&&(r.second_best=a),r}function d(e){return h.tabReplace||h.useBR?e.replace(t,function(e,n){return h.useBR&&"\n"===e?"
":h.tabReplace?n.replace(/\t/g,h.tabReplace):""}):e}function o(e){var n,t,r,a,i,o=function(e){var n,t,r,a,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=s.exec(i))return B(t[1])?t[1]:"no-highlight";for(n=0,r=(i=i.split(/\s+/)).length;n/g,"\n"):n=e,i=n.textContent,r=o?C(o,i,!0):O(i),(t=R(n)).length&&((a=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=r.value,r.value=function(e,n,t){var r=0,a="",i=[];function o(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function u(e){a+=""}function s(e){("start"===e.event?c:u)(e.node)}for(;e.length||n.length;){var l=o();if(a+=_(t.substring(r,l[0].offset)),r=l[0].offset,l===e){for(i.reverse().forEach(u);s(l.splice(0,1)[0]),(l=o())===e&&l.length&&l[0].offset===r;);i.reverse().forEach(c)}else"start"===l[0].event?i.push(l[0].node):i.pop(),s(l.splice(0,1)[0])}return a+_(t.substr(r))}(t,R(a),i)),r.value=d(r.value),e.innerHTML=r.value,e.className=function(e,n,t){var r=n?c[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}(e.className,o,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function p(){if(!p.called){p.called=!0;var e=document.querySelectorAll("pre code");f.forEach.call(e,o)}}function B(e){return e=(e||"").toLowerCase(),N[e]||N[c[e]]}function M(e){var n=B(e);return n&&!n.disableAutodetect}return a.highlight=C,a.highlightAuto=O,a.fixMarkup=d,a.highlightBlock=o,a.configure=function(e){h=g(h,e)},a.initHighlighting=p,a.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",p,!1),addEventListener("load",p,!1)},a.registerLanguage=function(n,e){var t=N[n]=e(a);i(t),t.aliases&&t.aliases.forEach(function(e){c[e]=n})},a.listLanguages=function(){return u(N)},a.getLanguage=B,a.autoDetection=M,a.inherit=g,a.IR=a.IDENT_RE="[a-zA-Z]\\w*",a.UIR=a.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",a.NR=a.NUMBER_RE="\\b\\d+(\\.\\d+)?",a.CNR=a.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",a.BNR=a.BINARY_NUMBER_RE="\\b(0b[01]+)",a.RSR=a.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",a.BE=a.BACKSLASH_ESCAPE={b:"\\\\[\\s\\S]",r:0},a.ASM=a.APOS_STRING_MODE={cN:"string",b:"'",e:"'",i:"\\n",c:[a.BE]},a.QSM=a.QUOTE_STRING_MODE={cN:"string",b:'"',e:'"',i:"\\n",c:[a.BE]},a.PWM=a.PHRASAL_WORDS_MODE={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},a.C=a.COMMENT=function(e,n,t){var r=a.inherit({cN:"comment",b:e,e:n,c:[]},t||{});return r.c.push(a.PWM),r.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),r},a.CLCM=a.C_LINE_COMMENT_MODE=a.C("//","$"),a.CBCM=a.C_BLOCK_COMMENT_MODE=a.C("/\\*","\\*/"),a.HCM=a.HASH_COMMENT_MODE=a.C("#","$"),a.NM=a.NUMBER_MODE={cN:"number",b:a.NR,r:0},a.CNM=a.C_NUMBER_MODE={cN:"number",b:a.CNR,r:0},a.BNM=a.BINARY_NUMBER_MODE={cN:"number",b:a.BNR,r:0},a.CSSNM=a.CSS_NUMBER_MODE={cN:"number",b:a.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},a.RM=a.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[a.BE,{b:/\[/,e:/\]/,r:0,c:[a.BE]}]},a.TM=a.TITLE_MODE={cN:"title",b:a.IR,r:0},a.UTM=a.UNDERSCORE_TITLE_MODE={cN:"title",b:a.UIR,r:0},a.METHOD_GUARD={b:"\\.\\s*"+a.UIR,r:0},a});hljs.registerLanguage("ocaml",function(e){return{aliases:["ml"],k:{keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref",literal:"true false"},i:/\/\/|>>/,l:"[a-z_]\\w*!?",c:[{cN:"literal",b:"\\[(\\|\\|)?\\]|\\(\\)",r:0},e.C("\\(\\*","\\*\\)",{c:["self"]}),{cN:"symbol",b:"'[A-Za-z_](?!')[\\w']*"},{cN:"type",b:"`[A-Z][\\w']*"},{cN:"type",b:"\\b[A-Z][\\w']*",r:0},{b:"[a-z_]\\w*'[\\w']*",r:0},e.inherit(e.ASM,{cN:"string",r:0}),e.inherit(e.QSM,{i:null}),{cN:"number",b:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",r:0},{b:/[-=]>/}]}});hljs.registerLanguage("reasonml",function(r){var e="~?[a-z$_][0-9a-zA-Z$_]*",a="`?[A-Z$_][0-9a-zA-Z$_]*",c="("+["||","&&","++","**","+.","*","/","*.","/.","...","|>"].map(function(r){return r.split("").map(function(r){return"\\"+r}).join("")}).join("|")+"|==|===)",n="\\s+"+c+"\\s+",t={keyword:"and as asr assert begin class constraint do done downto else end exception externalfor fun function functor if in include inherit initializerland lazy let lor lsl lsr lxor match method mod module mutable new nonrecobject of open or private rec sig struct then to try type val virtual when while with",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 ref string unit ",literal:"true false"},i="\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",s={cN:"number",r:0,v:[{b:i},{b:"\\(\\-"+i+"\\)"}]},b={cN:"operator",r:0,b:c},o=[{cN:"identifier",r:0,b:e},b,s],l=[r.QSM,b,{cN:"module",b:"\\b"+a,rB:!0,e:".",c:[{cN:"identifier",b:a,r:0}]}],u=[{cN:"module",b:"\\b"+a,rB:!0,e:".",r:0,c:[{cN:"identifier",b:a,r:0}]}],_={cN:"function",r:0,k:t,v:[{b:"\\s(\\(\\.?.*?\\)|"+e+")\\s*=>",e:"\\s*=>",rB:!0,r:0,c:[{cN:"params",v:[{b:e},{b:"~?[a-z$_][0-9a-zA-Z$_]*(s*:s*[a-z$_][0-9a-z$_]*((s*('?[a-z$_][0-9a-z$_]*s*(,'?[a-z$_][0-9a-z$_]*)*)?s*))?)?(s*:s*[a-z$_][0-9a-z$_]*((s*('?[a-z$_][0-9a-z$_]*s*(,'?[a-z$_][0-9a-z$_]*)*)?s*))?)?"},{b:/\(\s*\)/}]}]},{b:"\\s\\(\\.?[^;\\|]*\\)\\s*=>",e:"\\s=>",rB:!0,r:0,c:[{cN:"params",r:0,v:[{b:e,e:"(,|\\n|\\))",r:0,c:[b,{cN:"typing",b:":",e:"(,|\\n)",rB:!0,r:0,c:u}]}]}]},{b:"\\(\\.\\s"+e+"\\)\\s*=>"}]};l.push(_);var N={cN:"constructor",b:a+"\\(",e:"\\)",i:"\\n",k:t,c:[r.QSM,b,{cN:"params",b:"\\b"+e}]},d={cN:"pattern-match",b:"\\|",rB:!0,k:t,e:"=>",r:0,c:[N,b,{r:0,cN:"constructor",b:a}]},z={cN:"module-access",k:t,rB:!0,v:[{b:"\\b("+a+"\\.)+"+e},{b:"\\b("+a+"\\.)+\\(",e:"\\)",rB:!0,c:[_,{b:"\\(",e:"\\)",skip:!0}].concat(l)},{b:"\\b("+a+"\\.)+{",e:"}"}],c:l};return u.push(z),{aliases:["re"],k:t,i:"(:\\-|:=|\\${|\\+=)",c:[r.C("/\\*","\\*/",{i:"^(\\#,\\/\\/)"}),{cN:"character",b:"'(\\\\[^']+|[^'])'",i:"\\n",r:0},r.QSM,{cN:"literal",b:"\\(\\)",r:0},{cN:"literal",b:"\\[\\|",e:"\\|\\]",r:0,c:o},{cN:"literal",b:"\\[",e:"\\]",r:0,c:o},N,{cN:"operator",b:n,i:"\\-\\->",r:0},s,r.CLCM,d,_,{cN:"module-def",b:"\\bmodule\\s+"+e+"\\s+"+a+"\\s+=\\s+{",e:"}",rB:!0,k:t,r:0,c:[{cN:"module",r:0,b:a},{b:"{",e:"}",skip:!0}].concat(l)},z]}}); \ No newline at end of file diff --git a/_coverage/index.html b/_coverage/index.html deleted file mode 100644 index 7a65d79..0000000 --- a/_coverage/index.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Coverage report - - - - - -
-
- - - - 98% (176 / 179) - - lib/cli.ml - -
-
- - - - 97% (39 / 40) - - lib/database.ml - -
-
- - - - 88% (123 / 139) - - lib/tables.ml - -
-
- - - - 73% (55 / 75) - - lib/utils.ml - -
-
- - diff --git a/_coverage/lib/cli.ml.html b/_coverage/lib/cli.ml.html deleted file mode 100644 index 7fcfe40..0000000 --- a/_coverage/lib/cli.ml.html +++ /dev/null @@ -1,974 +0,0 @@ - - - - - cli.ml — Coverage report - - - - - - - - -
-
-
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
-
-
-
-
-  1
-  2
-  3
-  4
-  5
-  6
-  7
-  8
-  9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-
-
module type CliHandler = sig
-  val parse_input : string -> string
-  val get_response : string -> string
-  val reset : unit -> unit
-end
-
-module CLI = struct
-  open Utils
-  open Database
-  open Tables
-  module Tbl = Tables.HashTable
-  module DB = Database (Tbl)
-  open Yojson.Basic.Util
-
-  let db = ref DB.empty
-
-  type state =
-    | Default
-    | BuildInstance of (string * Tbl.t * (string * entry) list)
-    | BuildType of (string * string * entry list)
-
-  exception ParseError
-  exception InvalidExpr
-  exception InvalidComparison
-
-  let current_state = ref Default
-  let file_name = "data/responses.json"
-
-  let get_response response =
-    let file = Yojson.Basic.from_file file_name in
-    file |> to_assoc |> List.assoc response |> to_string
-
-  let reset () =
-    current_state := Default;
-    db := DB.empty
-
-  let parse_value v = function
-    | Strings -> String v
-    | Ints -> (
-        match int_of_string_opt v with
-        | Some i -> Int i
-        | None -> raise ParseError)
-    | Floats -> (
-        match float_of_string_opt v with
-        | Some f -> Float f
-        | None -> raise ParseError)
-    | Bools -> (
-        match bool_of_string_opt v with
-        | Some b -> Bool b
-        | None -> raise ParseError)
-    | Chars -> Char (if String.length v = 1 then v.[0] else raise ParseError)
-    | Ids ->
-        Id
-          (match v |> String.split_on_char '@' |> List.map String.trim with
-          | [] | [ _ ] | _ :: _ :: _ :: _ -> raise ParseError
-          | [ hd; tl ] -> (hd, String tl))
-
-  let rec build_instance (name, table, vals) input =
-    match
-      input |> String.split_on_char '=' |> List.map String.trim
-      |> List.filter (fun s -> s <> "")
-    with
-    | [] ->
-        DB.add_named_entry name vals !db;
-        current_state := Default;
-        get_response "indent_end" (* "|    <|\n|> " *)
-    | [ n ] ->
-        current_state := BuildInstance (name, table, vals);
-        get_response "err_create_field_no_value"
-        (* "Please input a variable and a value\n|    " *)
-    | n :: v :: tl -> (
-        match List.assoc_opt n vals with
-        | None -> (
-            match Tbl.exists table n with
-            | exception TypeMismatch ->
-                current_state := BuildInstance (name, table, vals);
-                get_response "err_create_field_DNE"
-                (* "That field does not exist in this type\n|    " *)
-            | t -> (
-                match parse_value v t with
-                | x ->
-                    current_state := BuildInstance (name, table, (n, x) :: vals);
-                    get_response "indent" (* "|    " *)
-                | exception ParseError ->
-                    current_state := BuildInstance (name, table, vals);
-                    get_response "err_create_field_wrong_type"
-                    (* "That value does not match the type of the field\n|    " *)
-                ))
-        | Some _ ->
-            current_state := BuildInstance (name, table, vals);
-            get_response "err_create_field_already_entered"
-            (* "This field has already been entered\n|    " *))
-
-  let process_assign input =
-    match input |> List.map String.trim |> List.filter (fun s -> s <> "") with
-    | [] ->
-        get_response "err_assign_empty"
-        (* "Please input a type name and id\n|> " *)
-    | [ name ] ->
-        get_response "err_assign_no_id"
-        (* "Please input an id for this instance\n|> " *)
-    | name :: id :: tl -> (
-        match DB.get_table name !db with
-        | Some t ->
-            current_state :=
-              BuildInstance
-                ( name,
-                  t,
-                  [
-                    ( (match Tbl.header t with
-                      | Type (n, _) :: tl -> n
-                      | _ -> failwith "impossible" [@coverage off]),
-                      String id );
-                  ] );
-            get_response "indent"
-        | None -> get_response "err_assign_DNE")
-  (* "That type does not exist\n|> " *)
-
-  let parse_type (typ, name) =
-    match typ with
-    | "int" -> Type (name, Ints)
-    | "float" -> Type (name, Floats)
-    | "string" -> Type (name, Strings)
-    | "bool" -> Type (name, Bools)
-    | "char" -> Type (name, Chars)
-    | "id" -> Type (name, Ids)
-    | _ -> raise ParseError
-
-  let rec build_type (name, id, types) input =
-    match
-      String.split_on_char ' ' input
-      |> List.map String.trim
-      |> List.filter (fun s -> s <> "")
-    with
-    | [] ->
-        db := DB.build_table !db (Type (id, Strings) :: types) name;
-        current_state := Default;
-        get_response "indent_end" (* "|    <|\n|> " *)
-    | [ typ ] -> get_response "err_defn_no_name"
-    (* "Please enter a name for this field\n|    " *)
-    | typ :: field_name :: tl -> (
-        match parse_type (typ, field_name) with
-        | Type _ as t ->
-            current_state := BuildType (name, id, types @ [ t ]);
-            get_response "indent" (* "|    " *)
-        | exception ParseError ->
-            current_state := BuildType (name, id, types);
-            get_response
-              "err_defn_invalid_type" (* "Not a recognized type\n|    " *)
-        | _ -> raise (Failure "Should be impossible") [@coverage off])
-
-  let process_type input =
-    match List.filter (fun s -> s <> "") input with
-    | [] -> get_response "err_defn_needs_type_name"
-    (* "Please enter a type name for the definition\n|> " *)
-    | [ name ] ->
-        get_response "err_defn_needs_ID_name"
-        (* "Please enter a name for the ID of this type\n|> " *)
-    | name :: id :: tl -> (
-        match DB.get_table name !db with
-        | Some _ ->
-            get_response "err_defn_already_exists"
-            (* "\n Type already defined\n|> " *)
-        | None ->
-            current_state := BuildType (name, id, []);
-            get_response "indent" (* "|    " *))
-
-  let process_at input =
-    match input |> List.map String.trim |> List.filter (fun s -> s <> "") with
-    | [] ->
-        get_response "err_at_empty"
-        (* "Please enter what the type and id of which to get an instance\n|> " *)
-    | [ name ] ->
-        get_response "err_at_no_id"
-        (* "Please enter an id of the instance you which to get\n|> " *)
-    | [ name; id ] -> (
-        match DB.get_table name !db with
-        | Some x -> (
-            try
-              (x |> Tbl.header |> optionize |> build_row)
-              ^ "\n"
-              ^ (String id |> Tbl.at x |> build_row)
-            with Not_found -> get_response "err_at_id_DNE")
-        | None ->
-            get_response "err_at_invalid_type" (* "No type of that name" *))
-    | name :: id :: col :: tl -> (
-        match DB.get_table name !db with
-        | Some x -> (
-            try
-              let row = Tbl.at x (String id) in
-              match int_of_string_opt col with
-              | None ->
-                  get_response "err_at_column_not_int"
-                  (* "Column number should be an int" *)
-              | Some i -> (
-                  match List.nth_opt row i with
-                  | Some e -> (
-                      match e with
-                      | None -> get_response "no_entry"
-                      | Some e -> (
-                          match e with
-                          | Id (name, row) ->
-                              (entry_to_string e ^ "="
-                              ^
-                              match DB.get_reference e !db with
-                              | exception Not_found ->
-                                  get_response "unbound_type"
-                              | l, r -> (
-                                  "\n"
-                                  ^ build_row (optionize l)
-                                  ^
-                                  match r with
-                                  | None -> get_response "unbound_val"
-                                  | Some v -> build_row v))
-                              ^ "\n|> "
-                          | _ -> entry_to_string e ^ "\n|> "))
-                  | None -> get_response "err_at_column_out_of_range")
-            with Not_found -> get_response "err_at_id_DNE")
-        | None -> get_response "err_at_invalid_type")
-
-  let split_on_substring sub str =
-    let idxs = ref [ 0 ] in
-    let sub_len = String.length sub in
-    for i = 0 to String.length str - sub_len do
-      if String.sub str i sub_len = sub then
-        idxs := !idxs @ [ i; i + String.length sub ]
-      else ()
-    done;
-    idxs := !idxs @ [ String.length str ];
-    let rec create_lst idxs sub_len str =
-      match idxs with
-      | [] -> []
-      | s :: e :: t -> String.sub str s (e - s) :: create_lst t sub_len str
-      | _ -> failwith "odd" [@coverage off]
-    in
-    create_lst !idxs sub_len str
-
-  let parse_compare_exp str =
-    let str_lst = String.split_on_char ' ' str in
-    if List.length str_lst <> 3 then raise InvalidExpr
-    else
-      match str_lst with
-      | [ var; compare; value ] ->
-          ( var,
-            (match compare with
-            | "=" -> EQ
-            | "<>" -> NEQ
-            | ">" -> GT
-            | "<" -> LT
-            | "<=" -> LTE
-            | ">=" -> GTE
-            | _ -> raise InvalidComparison),
-            value )
-      | _ -> failwith "should be impossible" [@coverage off]
-
-  let process_find lst =
-    let cleaned_lst =
-      lst |> List.map String.trim |> List.filter (fun s -> s <> "")
-    in
-    if cleaned_lst = [] then get_response "err_find_missing_type"
-    else
-      match DB.get_table (List.hd cleaned_lst) !db with
-      | None -> get_response "err_find_invalid_type"
-      | Some type_table -> (
-          try
-            cleaned_lst |> List.tl
-            |> List.fold_left (fun s1 s2 -> s1 ^ " " ^ s2) ""
-            |> split_on_substring "and" |> List.map String.trim
-            |> List.filter (fun s -> s <> "")
-            |> (fun lst -> if lst = [] then raise InvalidExpr else lst)
-            |> List.map parse_compare_exp
-            |> Tbl.process_constraints type_table
-          with
-          | InvalidExpr -> get_response "err_find_invalid_expr"
-          | InvalidComparison -> get_response "err_find_invalid_comparison"
-          | TypeMismatch -> get_response "err_find_wrong_type"
-          | Not_found -> get_response "err_find_var_DNE")
-
-  (** [parse_input input] takes in new input and determines the relevant command*)
-  let parse_input input =
-    match !current_state with
-    | BuildInstance v -> build_instance v input
-    | BuildType v -> build_type v input
-    | Default -> (
-        match String.split_on_char ' ' input with
-        | "quit" :: tl -> exit 0 [@coverage off]
-        | "help" :: tl -> get_response "help_message"
-        | "def" :: tl -> process_type tl
-        | "assign" :: tl -> process_assign tl
-        | "print" :: tl -> DB.db_to_string !db ^ "|> "
-        | "at" :: tl -> process_at tl
-        | "find" :: tl -> process_find tl
-        | _ ->
-            get_response "err_unknown_command"
-            (* "Unknown command. Type help for a list of commands\n|> " *))
-end
-
-(** [main ()] prompts for the script to start, then starts it. *)
-
-let main () =
-  let file_name = "data/responses.json" in
-  let welcom_string =
-    let file = Yojson.Basic.from_file file_name in
-    file |> Yojson.Basic.Util.to_assoc |> List.assoc "welcome"
-    |> Yojson.Basic.Util.to_string
-  in
-  print_string welcom_string;
-  print_string "|> ";
-  while true do
-    read_line () |> CLI.parse_input |> print_string
-  done
-  [@@coverage off]
-
-
-
- - - diff --git a/_coverage/lib/database.ml.html b/_coverage/lib/database.ml.html deleted file mode 100644 index 1ad27c6..0000000 --- a/_coverage/lib/database.ml.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - database.ml — Coverage report - - - - - - - - -
-
-
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
-
-
-
-
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-
-
open Utils
-open Tables
-
-module Database (Table : Table) = struct
-  exception NoEntry
-  exception TableExists
-
-  type table = Table.t
-  type database = (string * table ref) list
-
-  let empty = []
-
-  let add_table database table name : database =
-    match
-      List.find (fun a -> match a with tname, t -> name = tname) database
-    with
-    | exception Not_found -> (name, ref table) :: database
-    | _ -> raise TableExists
-
-  let build_table database table name =
-    match
-      List.find (fun a -> match a with tname, t -> name = tname) database
-    with
-    | exception Not_found -> (name, ref (Table.empty table)) :: database
-    | _ -> raise TableExists
-
-  let drop_table name database =
-    List.filter (fun a -> match a with tname, t -> name <> tname) database
-
-  let get_table name database =
-    match List.assoc_opt name database with Some x -> Some !x | None -> None
-
-  let get_reference ent database =
-    match ent with
-    | Id (tbl, id) -> (
-        let tbl =
-          match get_table tbl database with
-          | None -> raise Not_found
-          | Some v -> v
-        in
-        ( Table.header tbl,
-          match Table.at tbl id with exception Not_found -> None | v -> Some v
-        ))
-    | _ -> raise TypeMismatch
-
-  let rec db_to_string database =
-    match database with
-    | [] -> "\n"
-    | (name, x) :: xs ->
-        "Table: " ^ name ^ "\n\n" ^ Table.table_to_string !x ^ db_to_string xs
-
-  let rec add_entry table_name new_row database =
-    match database with
-    | [] -> raise Not_found
-    | (a, b) :: tl when a = table_name -> b := Table.insert !b new_row
-    | _ :: tl -> add_entry table_name new_row tl
-
-  let add_named_entry table_name new_row database =
-    match List.assoc_opt table_name database with
-    | None -> raise Not_found
-    | Some x -> x := Table.insert_named !x new_row
-end
-
-
-
- - - diff --git a/_coverage/lib/tables.ml.html b/_coverage/lib/tables.ml.html deleted file mode 100644 index a28027e..0000000 --- a/_coverage/lib/tables.ml.html +++ /dev/null @@ -1,583 +0,0 @@ - - - - - tables.ml — Coverage report - - - - - - - - -
-
-
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
-
-
-
-
-  1
-  2
-  3
-  4
-  5
-  6
-  7
-  8
-  9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-
-
open Utils
-
-let rec assert_types header a =
-  match header with
-  | [] -> if a = [] then [] else raise TypeMismatch [@coverage off]
-  | hd :: tl -> (
-      match a with
-      | [] -> raise TypeMismatch
-      | b :: c ->
-          (match hd with
-          | Some (Type (_, Strings)) -> (
-              match b with
-              | Some (String _) -> b
-              | None -> b
-              | _ -> raise TypeMismatch)
-          | Some (Type (_, Floats)) -> (
-              match b with
-              | Some (Float _) -> b
-              | None -> b
-              | _ -> raise TypeMismatch)
-          | Some (Type (_, Ints)) -> (
-              match b with
-              | Some (Int _) -> b
-              | None -> b
-              | _ -> raise TypeMismatch)
-          | Some (Type (_, Bools)) -> (
-              match b with
-              | Some (Bool _) -> b
-              | None -> b
-              | _ -> raise TypeMismatch)
-          | Some (Type (_, Chars)) -> (
-              match b with
-              | Some (Char _) -> b
-              | None -> b
-              | _ -> raise TypeMismatch)
-          | Some (Type (_, Ids)) -> (
-              match b with
-              | Some (Id _) -> b
-              | None -> b
-              | _ -> raise TypeMismatch)
-          | _ -> raise TypeMismatch)
-          :: assert_types tl c)
-
-let rec reorder_list (a : (string * entry) list) = function
-  | [] -> if a = [] then [] else raise TypeMismatch
-  | Some (Type (name, v)) :: tl ->
-      let vl, rest =
-        let rec extr_name acc = function
-          | [] -> (None, acc)
-          | (n, vr) :: rest ->
-              if n = name then (Some vr, acc @ rest)
-              else extr_name (acc @ [ (n, vr) ]) rest
-        in
-        extr_name [] a
-      in
-      vl :: reorder_list rest tl
-  | _ -> raise TypeMismatch
-
-let rec get_type_index cnt name = function
-  | [] -> raise Not_found
-  | Type (n, _) :: tl ->
-      if n = name then cnt else get_type_index (cnt + 1) name tl
-  | _ -> raise TypeMismatch
-
-module type Table = sig
-  type t
-
-  val empty : entry list -> t
-  val insert : t -> entry list -> t
-  val insert_named : t -> (string * entry) list -> t
-  val at : t -> entry -> entry option list
-  val delete : t -> entry -> t
-  val table_to_string : t -> string
-  val process_constraints : t -> (string * comparison * string) list -> string
-  val header : t -> entry list
-  val exists : t -> string -> types
-end
-
-module HashTable = struct
-  type t = HashTab of entry list * (entry, entry option list) Hashtbl.t
-
-  let rec deoptionize_list = function
-    | [] -> []
-    | Some x :: tl -> x :: deoptionize_list tl
-    | None :: tl -> raise (Failure "Deoptionize on none")
-    [@@coverage off]
-
-  let header = function HashTab (hd, _) -> hd
-  let hshtable = function HashTab (_, hsh) -> hsh
-
-  let deoptionize = function
-    | Some x -> x
-    | None -> raise (Failure "Deoptionize on none") [@coverage off]
-
-  let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl
-  let empty (ex : entry list) = HashTab (ex, Hashtbl.create 0)
-
-  let insert table entries =
-    match Hashtbl.find_opt (hshtable table) (List.hd entries) with
-    | Some x -> raise IndexExists
-    | None ->
-        let copy = Hashtbl.copy (hshtable table) in
-        let entrs =
-          assert_types (optionize (header table)) (optionize entries)
-        in
-        HashTab
-          ( header table,
-            (Hashtbl.add copy (List.hd entries) (List.tl entrs);
-             copy) )
-
-  let insert_named table entries =
-    let name, value = List.hd entries in
-    match Hashtbl.find_opt (hshtable table) value with
-    | Some x -> raise IndexExists
-    | None ->
-        let copy = Hashtbl.copy (hshtable table) in
-        let reordered =
-          assert_types
-            (header table |> optionize)
-            (reorder_list entries (optionize (header table)))
-        in
-        Hashtbl.add copy (deoptionize (List.hd reordered)) (List.tl reordered);
-        HashTab (header table, copy)
-
-  let at table id = Some id :: Hashtbl.find (hshtable table) id
-
-  let delete table id =
-    let out = Hashtbl.copy (hshtable table) in
-    Hashtbl.remove (hshtable table) id;
-    HashTab (header table, out)
-
-  let rec table_to_string table =
-    Hashtbl.fold
-      (fun id ent acc -> acc ^ shorten (entry_to_string id) ^ build_row ent)
-      (hshtable table)
-      (build_row (optionize (header table)))
-
-  let rec process_constraints tbl lst =
-    let newHash = Hashtbl.create 0 in
-    match lst with
-    | [] -> table_to_string tbl
-    | hd :: tl ->
-        process_constraints
-          (match hd with
-          | name, cmp, vl ->
-              let ind = get_type_index 0 name (header tbl) in
-              let cmp_func =
-                match
-                  List.find
-                    (function
-                      | Type (n, t) -> n = name | _ -> failwith "Impossible")
-                    (header tbl)
-                with
-                | Type (n, t) -> (
-                    match process_entry vl t with e -> run_constraint cmp e)
-                | _ -> raise (Failure "Impossible")
-              in
-              Hashtbl.iter
-                (fun a b ->
-                  if ind = 0 then
-                    if cmp_func a then Hashtbl.add newHash a b else ()
-                  else
-                    match List.nth b (ind - 1) with
-                    | None -> ()
-                    | Some v ->
-                        if cmp_func v then Hashtbl.add newHash a b else ())
-                (hshtable tbl);
-              HashTab (header tbl, newHash))
-          tl
-
-  let exists table name =
-    let rec follow_header = function
-      | [] -> raise TypeMismatch
-      | Type (n, t) :: tl when n = name -> t
-      | _ :: tl -> follow_header tl
-    in
-    follow_header (header table)
-end
-
-
-
- - - diff --git a/_coverage/lib/utils.ml.html b/_coverage/lib/utils.ml.html deleted file mode 100644 index b1d62ca..0000000 --- a/_coverage/lib/utils.ml.html +++ /dev/null @@ -1,347 +0,0 @@ - - - - - utils.ml — Coverage report - - - - - - - - -
-
-
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
-
-
-
-
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-
-
type types = Strings | Floats | Ints | Chars | Bools | Ids
-type comparison = LT | LTE | EQ | NEQ | GT | GTE
-
-exception IndexExists
-exception TypeMismatch
-
-type entry =
-  | String of string
-  | Float of float
-  | Int of int
-  | Char of char
-  | Bool of bool
-  | Id of (string * entry)
-  | Type of (string * types)
-
-let name_map_types t =
-  match t with
-  | Strings -> "string"
-  | Floats -> "float"
-  | Ints -> "int"
-  | Chars -> "char"
-  | Bools -> "bool"
-  | Ids -> "id"
-
-let process_entry input = function
-  | Strings -> String input
-  | Floats -> (
-      match float_of_string_opt input with
-      | None -> raise TypeMismatch
-      | Some v -> Float v)
-  | Ints -> (
-      match int_of_string_opt input with
-      | None -> raise TypeMismatch
-      | Some v -> Int v)
-  | Chars ->
-      if String.length input = 1 then Char input.[0] else raise TypeMismatch
-  | Bools -> (
-      match bool_of_string_opt input with
-      | None -> raise TypeMismatch
-      | Some v -> Bool v)
-  | _ -> raise TypeMismatch
-
-let make_compare cmp lhs rhs =
-  match cmp with
-  | LT -> lhs < rhs
-  | LTE -> lhs <= rhs
-  | EQ -> lhs = rhs
-  | NEQ -> lhs <> rhs
-  | GT -> lhs > rhs
-  | GTE -> lhs >= rhs
-
-let run_constraint (cmp : comparison) rhs lhs =
-  match rhs with
-  | Float r -> (
-      match lhs with
-      | Float l -> make_compare cmp l r
-      | _ -> failwith "Typing error")
-  | Int r -> (
-      match lhs with
-      | Int l -> make_compare cmp l r
-      | _ -> failwith "Typing error")
-  | Char r -> (
-      match lhs with
-      | Char l -> make_compare cmp l r
-      | _ -> failwith "Typing error")
-  | Bool r -> (
-      match lhs with
-      | Bool l -> make_compare cmp l r
-      | _ -> failwith "Typing error")
-  | String r -> (
-      match lhs with
-      | String l -> make_compare cmp l r
-      | _ -> failwith "Typing error")
-  | _ -> raise TypeMismatch
-
-let rec entry_to_string ent =
-  match ent with
-  | String x -> x
-  | Float x -> string_of_float x
-  | Int x -> string_of_int x
-  | Char x -> String.make 1 x
-  | Bool x -> string_of_bool x
-  | Id (a, b) -> a ^ "@" ^ entry_to_string b
-  | Type (a, b) -> name_map_types b ^ " " ^ a
-
-let shorten inp =
-  let str = String.trim inp in
-  if String.length str < 8 then str ^ "\t\t"
-  else if String.length str < 16 then str ^ "\t"
-  else String.sub str 0 16
-
-let rec build_row entlist =
-  match entlist with
-  | [] -> "\n\n"
-  | Some x :: xs -> shorten (entry_to_string x) ^ build_row xs
-  | None :: xs -> "\t\t" ^ build_row xs
-
-let rec optionize = function [] -> [] | hd :: tl -> Some hd :: optionize tl
-
-
-
- - - diff --git a/bisect038465248.coverage b/bisect038465248.coverage deleted file mode 100644 index 9519eee..0000000 --- a/bisect038465248.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 344 403 294 281 249 611 566 639 516 503 471 735 722 700 848 868 808 1114 1158 1188 1034 1070 942 1217 921 1398 1416 1306 1323 1280 1582 1502 1566 1530 1601 1476 1815 1753 1783 1701 40 5 0 1 1 5 43 43 0 0 0 43 0 0 0 71 47 118 2 1 1 0 2 2 0 2 1 1 1 1 2 0 0 0 0 0 0 38 0 38 38 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 18 9 9 9 9 9 63 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 63 18 8 9 8 8 2 63 116 0 26 26 26 85 111 111 111 105 105 105 8 17 105 8 130 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 48 87 3 0 41 4 0 42 5 0 38 5 0 35 8 0 4 41 0 90 45 47 43 43 45 0 313 0 313 48 313 361 0 47 307 307 533 241 66 774 47 307 0 22 8 1 30 0 405 126 47 668 102 668 51 51 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 47 47 47 47 47 47 47 47 47 47 47 47 47 0 47 47 47 47 17 14 17 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 183 1 182 731 549 183 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file diff --git a/bisect421601976.coverage b/bisect421601976.coverage deleted file mode 100644 index 046266f..0000000 --- a/bisect421601976.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 344 403 294 281 249 611 566 639 516 503 471 735 722 700 848 868 808 1114 1158 1188 1034 1070 942 1217 921 1398 1416 1306 1323 1280 1582 1502 1566 1530 1601 1476 1815 1753 1783 1701 40 5 1 2 2 6 43 43 1 1 1 44 1 1 1 72 47 119 2 1 1 0 2 2 0 2 2 2 2 2 4 1 0 1 1 0 1 38 0 38 38 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 20 9 10 9 9 9 66 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 66 18 8 9 8 8 2 66 119 0 28 28 28 86 114 114 114 108 108 108 8 19 108 8 135 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 49 88 3 0 41 4 0 43 5 0 38 5 0 35 8 0 4 41 0 91 45 48 43 43 45 0 315 0 315 49 315 364 1 47 307 309 535 241 68 776 48 309 0 22 8 1 30 0 411 135 47 677 107 677 51 51 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 47 47 47 47 47 47 47 48 48 47 47 48 48 0 48 48 48 48 18 15 18 1 1 1 1 1 1 6 6 6 6 8 8 8 8 8 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 183 1 182 731 549 183 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file diff --git a/bisect633276292.coverage b/bisect633276292.coverage deleted file mode 100644 index 6992e6e..0000000 --- a/bisect633276292.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 344 403 294 281 249 611 566 639 516 503 471 735 722 700 848 868 808 1114 1158 1188 1034 1070 942 1217 921 1398 1416 1306 1323 1280 1582 1502 1566 1530 1601 1476 1815 1753 1783 1701 40 6 0 1 1 6 44 44 0 0 0 44 1 1 1 71 49 120 2 1 1 1 2 3 0 3 1 1 2 1 3 0 0 0 0 0 0 38 0 38 38 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 18 9 9 9 9 9 63 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 63 18 8 9 8 8 2 63 116 0 26 26 26 85 111 111 111 105 105 105 8 17 105 8 130 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 48 87 3 0 41 4 0 42 5 0 38 5 0 35 8 0 4 41 0 90 45 47 43 43 45 0 313 0 313 48 313 361 0 47 307 307 533 241 66 774 47 307 0 22 8 1 30 0 406 130 47 668 102 668 52 52 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 47 47 47 47 47 47 47 47 47 47 47 47 47 1 47 48 48 48 18 14 18 1 1 1 1 1 1 6 6 6 6 6 6 6 6 6 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 183 1 182 731 549 183 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file diff --git a/bisect774541772.coverage b/bisect774541772.coverage deleted file mode 100644 index a78691b..0000000 --- a/bisect774541772.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 344 403 294 281 249 611 566 639 516 503 471 735 722 700 848 868 808 1114 1158 1188 1034 1070 942 1217 921 1398 1416 1306 1323 1280 1582 1502 1566 1530 1601 1476 1815 1753 1783 1701 40 6 0 2 2 6 43 43 0 0 0 43 2 2 1 72 48 120 3 1 2 0 3 3 0 3 1 1 1 1 2 0 1 0 1 1 2 39 0 39 39 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 20 11 11 11 11 11 75 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 4 75 22 10 11 10 10 4 75 142 2 36 38 38 97 135 135 135 127 127 127 8 21 127 8 156 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 50 89 3 0 42 4 0 43 6 0 39 5 0 36 8 0 5 41 0 92 46 49 44 44 46 0 321 0 321 50 321 371 0 48 309 309 533 242 67 775 48 309 0 22 8 1 30 0 414 134 48 696 108 696 52 52 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 48 48 48 48 48 48 48 48 48 48 48 48 48 0 48 48 48 48 19 15 19 0 0 0 0 0 0 8 8 8 8 8 8 8 8 8 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 184 2 182 733 551 184 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file diff --git a/bisect907500956.coverage b/bisect907500956.coverage deleted file mode 100644 index 7845dac..0000000 --- a/bisect907500956.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 4 15 lib/database.ml 40 344 403 294 281 249 611 566 639 516 503 471 735 722 700 848 868 808 1114 1158 1188 1034 1070 942 1217 921 1398 1416 1306 1323 1280 1582 1502 1566 1530 1601 1476 1815 1753 1783 1701 40 5 0 1 1 5 44 44 0 1 1 44 0 0 1 73 47 120 3 2 1 0 3 3 0 3 1 1 1 1 2 0 0 0 0 0 0 38 1 38 39 12 lib/utils.ml 75 356 380 402 420 440 460 339 603 638 720 755 843 823 806 927 962 512 540 661 776 866 984 1061 1081 1103 1123 1145 1165 1042 1295 1335 1409 1447 1522 1561 1636 1675 1752 1793 1253 1369 1481 1595 1709 1827 1234 2081 2117 1903 1921 1954 1983 2013 2044 2089 1884 2282 2264 2248 2233 2213 2198 2183 2152 2412 2395 2427 2467 2356 2373 2436 2333 2544 2502 2513 75 18 9 9 9 9 9 63 0 1 1 4 0 0 0 0 2 0 1 5 0 2 0 0 2 6 2 0 2 12 2 0 8 0 0 0 2 0 0 0 2 8 0 2 0 0 12 2 63 18 8 9 8 8 2 63 116 0 26 26 26 85 111 111 111 105 105 105 8 18 105 8 131 21 3 21 13 lib/tables.ml 139 89 330 367 393 502 538 564 671 705 731 839 874 900 1008 1043 1069 1175 1208 1234 257 430 601 768 937 1106 1271 1320 177 210 68 136 46 1422 1414 1772 1733 1671 1630 1550 1580 1393 1445 1786 1937 1928 1858 1884 1974 2716 2764 2824 2978 2936 2947 3041 3015 3377 3423 3441 3464 3303 3295 3322 3352 3231 3251 3149 3183 3111 3127 3080 3966 3909 3900 3930 3952 3780 3788 3842 3834 3815 3872 3692 3712 3610 3644 3584 3553 3512 4034 4024 4002 4176 4145 4162 4106 4122 4075 4296 4279 4312 4267 4333 4376 4368 4357 4229 5537 5473 5444 5358 5391 5304 5258 5229 5210 5174 5501 5523 5023 5005 4938 5050 4812 4838 4892 4669 4693 4600 4491 4523 4470 4432 5776 5639 5707 5672 5717 5598 139 49 88 3 0 41 4 0 42 6 0 38 5 0 35 8 0 4 41 0 91 45 48 43 43 45 0 315 0 315 49 315 364 0 48 309 309 533 242 67 775 48 309 0 22 8 1 30 0 411 132 48 672 105 672 52 52 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 48 48 48 48 48 48 48 48 48 48 48 48 48 0 48 48 48 48 19 14 19 0 0 0 0 0 0 6 6 6 6 7 7 7 7 7 7 5 7 0 12 12 0 0 0 12 7 7 7 7 8 0 23 0 8 9 8 9 5 9 14 14 184 1 183 732 549 184 10 lib/cli.ml 179 713 736 693 642 768 936 962 1057 1085 1178 1205 1291 1280 1267 1421 1426 1434 1483 1383 851 877 994 1117 1237 1315 1753 2456 2617 2158 2388 2092 2888 1697 1840 2023 1673 1621 1651 1572 3698 3495 3892 3201 3306 3422 3181 3159 3120 4028 4061 4098 4137 4172 4207 4238 4007 4473 4800 4939 4440 4610 4713 4416 4364 4394 4312 5593 5713 5278 5391 5520 5252 5224 6440 6325 6338 6346 6412 6420 6263 6493 8057 6840 7109 7288 7494 7647 7636 7790 7860 7771 7842 7426 7543 7953 7225 7934 7090 7146 8008 7019 7989 6803 6939 6754 6664 8110 5936 6067 6194 6584 5916 5894 5855 8583 8611 8542 8559 8518 8461 8414 8395 8358 8323 8311 8286 8261 8194 8979 9003 9029 9053 9077 9103 9129 8889 8862 8829 8809 8796 8746 9989 10053 10129 10192 9865 9842 9825 9789 9670 9641 9703 9731 9767 9813 9885 9927 9949 9503 9556 9471 9445 9393 9348 9326 9368 9271 10766 10594 10648 10689 10735 10790 10828 10870 10384 10432 10472 10352 179 665 665 665 665 48 35 2 35 1 34 1 1 34 35 0 1 1 3 5 34 37 36 35 35 5 38 175 7 1 182 183 1 38 2 184 410 224 224 224 46 46 1 1 2 47 97 50 50 42 42 37 33 33 38 1 226 43 225 1 43 1 226 500 270 270 270 1 43 1 1 44 91 46 1 1 1 1 1 1 2 1 1 1 1 2 0 2 2 1 1 1 1 0 2 1 2 1 1 3 1 4 1 1 5 6 7 1 1 1 3 8 32 13 13 20 20 13 20 33 13 113 7 7 120 120 13 13 13 5 1 1 1 3 1 2 14 14 3 17 17 17 4 2 1 1 12 1 13 20 57 13 13 13 13 13 12 7 5 1 13 14 14 1 81 15 15 15 1 1 46 50 1 13 15 2 224 270 128 622 \ No newline at end of file diff --git a/cs3110project.yaml b/cs3110project.yaml index ba8a5c4..e881654 100644 --- a/cs3110project.yaml +++ b/cs3110project.yaml @@ -21,9 +21,10 @@ git-repo: "https://github.com/tf-mac/CS3110-Final-Project" demo-video-url: "" # Write a short, attention-grabbing description of your project. desc: > - Our project is a relational database. We structure information in either a - list table or hash table. We can define custom types with - OCaml primitives, assign them to values, display those types to the user, - and provide references to other entries. The user can access all the - functionality through a command line interface that allows interaction - with the database. + Our project is a relational database. We structure information in a + hash table. We can define custom types with OCaml primitives, + assign them to values, display those types to the user, and provide + references to other entries. The user can find values that match + certain expressions. The user can access all the functionality + through a command line interface that allows interaction with the + database. diff --git a/lib/cli.ml b/lib/cli.ml index 8ca976c..00d0a83 100644 --- a/lib/cli.ml +++ b/lib/cli.ml @@ -180,6 +180,7 @@ module CLI = struct (x |> Tbl.header |> optionize |> build_row) ^ "\n" ^ (String id |> Tbl.at x |> build_row) + ^ "\n|> " with Not_found -> get_response "err_at_id_DNE") | None -> get_response "err_at_invalid_type" (* "No type of that name" *)) diff --git a/test/main.ml b/test/main.ml index 99a6320..eab0abf 100644 --- a/test/main.ml +++ b/test/main.ml @@ -683,7 +683,8 @@ let at_tests = "at Type ID1", "string ID\tint i\t\tfloat f\t\tchar c\t\tbool b\t\tstring s\tid \ d\t\t\n\n\n\ - ID1\t\t10\t\t3.14\t\ta\t\ttrue\t\thello there\t\t\t\n\n" ); + ID1\t\t10\t\t3.14\t\ta\t\ttrue\t\thello there\t\t\t\n\n\n\ + |> " ); ( true, "test at statement on no entry column", "at Type ID1 6", From de2996dc07312019f03c94f02f2c53e7eaef935e Mon Sep 17 00:00:00 2001 From: JT Klenke Date: Mon, 15 May 2023 12:22:36 -0400 Subject: [PATCH 24/24] Final final check - made sure make test runs - made sure that everything required exists - test methodology comment - module descriptions - made sure that make run works - made sure that make doc works - made sure installation instructions are correct - made sure yaml file is correct - made sure LOC >1200 --- lib/cli.mli | 14 ++------------ lib/database.mli | 3 +++ lib/tables.mli | 9 ++++++--- lib/utils.mli | 24 +++++++----------------- test/main.ml | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 52 insertions(+), 32 deletions(-) diff --git a/lib/cli.mli b/lib/cli.mli index 90c154f..fd8a538 100644 --- a/lib/cli.mli +++ b/lib/cli.mli @@ -1,15 +1,5 @@ -(*type input = Empty | Malformed | Valid of string list - - val user_defined_types : string list ref - val lst_to_string : string list -> string - val check_value_defn : string list -> input - val parse_value_defn : string -> input - val add_type : string -> unit - val print_state : string -> string - val read_value_defn : string -> string list list - val parse_constructor_defn : string list -> string list list - val read_make : string -> string -> string list - val read_input : string -> unit*) +(** This module handles the command line interface, it allows easy use of the backend infrastructure + for storing and retrieving new types and data.*) val main : unit -> unit (** [main ()] parses the user's input from the terminal using diff --git a/lib/database.mli b/lib/database.mli index 723b84f..83a8689 100644 --- a/lib/database.mli +++ b/lib/database.mli @@ -1,3 +1,6 @@ +(** This module handles the complete backend for data storage. It is able to handle multiple types + and build tables accordingly, data can be accessed and added to any type in various ways*) + open Utils open Tables diff --git a/lib/tables.mli b/lib/tables.mli index b7af0a7..3d20098 100644 --- a/lib/tables.mli +++ b/lib/tables.mli @@ -1,3 +1,6 @@ +(** This module handles the backend implementation for storing data. It holds information in a table + that can be accesess and modified in various ways.*) + open Utils module type Table = sig @@ -26,16 +29,16 @@ module type Table = sig val table_to_string : t -> string (** [table_to_string t] returns a string representation of [t]*) + val process_constraints : t -> (string * comparison * string) list -> string (** Processes a given list of constraints Raises [Not_found] if a constraint isn't found Raises [TypeMismatch] if the comparison value doesn't match the header*) - val process_constraints : t -> (string * comparison * string) list -> string - (** Returns the header of the table*) val header : t -> entry list + (** Returns the header of the table*) - (** Returns the type of the named column, if it exists. If not, raises [TypeMismatch]*) val exists : t -> string -> types + (** Returns the type of the named column, if it exists. If not, raises [TypeMismatch]*) end module HashTable : Table diff --git a/lib/utils.mli b/lib/utils.mli index 8b74000..7fef660 100644 --- a/lib/utils.mli +++ b/lib/utils.mli @@ -1,20 +1,10 @@ -type types = - | Strings - | Floats - | Ints - | Chars - | Bools - | Ids - (** Representation of the type of some field*) - -type comparison = - | LT - | LTE - | EQ - | NEQ - | GT - | GTE +(** This module holds utilities (both functions and types) that many other modules need.*) + +(** Representation of the type of some field*) +type types = Strings | Floats | Ints | Chars | Bools | Ids + (** Representation of some comparison operation*) +type comparison = LT | LTE | EQ | NEQ | GT | GTE exception IndexExists (** [IndexExists] occurs when trying to replace an index which already exists*) @@ -22,6 +12,7 @@ exception IndexExists exception TypeMismatch (** [TypeMismatch] occurs when some typing error occurs, e.g. true > "cat"*) +(** The core of this project! The type holding every entry in every table*) type entry = | String of string | Float of float @@ -30,7 +21,6 @@ type entry = | Bool of bool | Id of (string * entry) | Type of (string * types) - (** The core of this project! The type holding every entry in every table*) val process_entry : string -> types -> entry (** Turns a string into the given entry type. diff --git a/test/main.ml b/test/main.ml index eab0abf..6c18d21 100644 --- a/test/main.ml +++ b/test/main.ml @@ -1,3 +1,37 @@ +(* We tested our code primarily using OUnit with some manual testing + of the command line interface to ensure they were equivalently implemented. + All modules were tested in some form by OUnit, the Table module was tested + directly and the Utils module was tested indirectly by testing the modules + that used Util. + + The CLI and Database modules were tested with OUnit with at least 95% test + coverage using glass box testing (according to bisect excluding defensive code). + + The Database and Table modules were also tested using black box testing to test + edge cases from the specification. Those specifications were also tested to make + sure that any error they were supposed to throw worked correctly. The CLI module + was tested with OUnit to make sure that the correct messages were returned + depending on the internal state of CLI and the input message. + + The only part of the code that was tested manually was the ‘quit’ statement in + CLI (because it would have quit the program if we tested it in OUnit) and the + ‘main’ function that took in inputs from the terminal and printed the responses. + We tested this manually to make sure that the terminal inputs and outputs + behaved the same as the OUnit to ensure the command line interface worked + correctly. + + This testing strategy demonstrated that the system is correct because we + achieved over 90% coverage over all of our modules and they acted correctly. + Additionally, our most important modules (that depended on others) were tested to + >95% coverage which gives us additional confidence that the most important parts + of our system work correctly. + + This gives us a lot of confidence that the whole system is correct. + Additionally, we tested edge cases wherever possible which ensured that even + weird inputs worked according to specifications. Finally, the manual testing of + the command line interface ensured that the OUnit tests were correctly + transferred to an actual user using the program through the terminal. *) + open OUnit2 open RelationalDatabase.Tables open RelationalDatabase.Database