{"action":"created","comment":{"url":"https://api.github.com/repos/gitoleg/bil-verification/pulls/comments/61068662","id":61068662,"diff_hunk":"@@ -0,0 +1,230 @@\n+open Core_kernel.Std\n+open Graph\n+open Bap.Std\n+open Bap_traces.Std\n+open Regular.Std\n+\n+module Field = struct\n+  type t = string [@@deriving bin_io, compare, sexp]\n+  let of_string = ident\n+  let empty = \"\"\n+  let is_empty x = x = empty\n+end\n+\n+type field = Field.t [@@deriving bin_io, compare, sexp]\n+\n+module Rule = struct\n+  type action = Skip | Deny [@@deriving bin_io, compare, sexp]\n+\n+  type t = {\n+    action : action;\n+    insn   : field;\n+    left   : field;\n+    right  : field;\n+  } [@@deriving bin_io, compare, fields, sexp]\n+\n+  let skip = Skip\n+  let deny = Deny\n+\n+  let create ?insn ?left ?right action  = \n+    let of_opt = \n+      Option.value_map ~default:Field.empty ~f:ident in {\n+      action; \n+      insn  = of_opt insn; \n+      left  = of_opt left; \n+      right = of_opt right; \n+    }\n+\n+  type s = t [@@deriving bin_io, compare, sexp]\n+  include Regular.Make(struct\n+      type t = s [@@deriving bin_io, compare, sexp]\n+      let compare = compare\n+      let hash = Hashtbl.hash\n+      let module_name = Some \"Veri_policy.Rule\"\n+      let version = \"0.1\"\n+\n+      let pp fmt rule = \n+        let act = match rule.action with\n+          | Skip -> \"Skip\"\n+          | Deny -> \"Deny\" in\n+        Format.fprintf fmt \"%s : %s : %s : %s ;\" \n+          act rule.insn rule.left rule.right\n+    end)\n+end\n+\n+type event = Trace.event [@@deriving bin_io, sexp]\n+type events = Value.Set.t\n+type rule = Rule.t [@@deriving bin_io, compare, sexp]\n+type trial = Pcre.regexp\n+\n+type matched = ","path":"lib/veri_policy.ml","position":60,"original_position":60,"commit_id":"e3282074861f48d72726ebc8329b3fe37ee100bc","original_commit_id":"e3282074861f48d72726ebc8329b3fe37ee100bc","user":{"login":"ivg","id":2336698,"avatar_url":"https://avatars.githubusercontent.com/u/2336698?v=3","gravatar_id":"","url":"https://api.github.com/users/ivg","html_url":"https://github.com/ivg","followers_url":"https://api.github.com/users/ivg/followers","following_url":"https://api.github.com/users/ivg/following{/other_user}","gists_url":"https://api.github.com/users/ivg/gists{/gist_id}","starred_url":"https://api.github.com/users/ivg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivg/subscriptions","organizations_url":"https://api.github.com/users/ivg/orgs","repos_url":"https://api.github.com/users/ivg/repos","events_url":"https://api.github.com/users/ivg/events{/privacy}","received_events_url":"https://api.github.com/users/ivg/received_events","type":"User","site_admin":false},"body":"Or maybe I misunderstanding it. Please, comment the `matched` type. What is the meaning of the constructors","created_at":"2016-04-26T11:22:17Z","updated_at":"2016-04-26T11:22:17Z","html_url":"https://github.com/gitoleg/bil-verification/pull/5#discussion_r61068662","pull_request_url":"https://api.github.com/repos/gitoleg/bil-verification/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/gitoleg/bil-verification/pulls/comments/61068662"},"html":{"href":"https://github.com/gitoleg/bil-verification/pull/5#discussion_r61068662"},"pull_request":{"href":"https://api.github.com/repos/gitoleg/bil-verification/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/gitoleg/bil-verification/pulls/5","id":66735378,"html_url":"https://github.com/gitoleg/bil-verification/pull/5","diff_url":"https://github.com/gitoleg/bil-verification/pull/5.diff","patch_url":"https://github.com/gitoleg/bil-verification/pull/5.patch","issue_url":"https://api.github.com/repos/gitoleg/bil-verification/issues/5","number":5,"state":"open","locked":false,"title":"Veri-policy module","user":{"login":"gitoleg","id":10262570,"avatar_url":"https://avatars.githubusercontent.com/u/10262570?v=3","gravatar_id":"","url":"https://api.github.com/users/gitoleg","html_url":"https://github.com/gitoleg","followers_url":"https://api.github.com/users/gitoleg/followers","following_url":"https://api.github.com/users/gitoleg/following{/other_user}","gists_url":"https://api.github.com/users/gitoleg/gists{/gist_id}","starred_url":"https://api.github.com/users/gitoleg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitoleg/subscriptions","organizations_url":"https://api.github.com/users/gitoleg/orgs","repos_url":"https://api.github.com/users/gitoleg/repos","events_url":"https://api.github.com/users/gitoleg/events{/privacy}","received_events_url":"https://api.github.com/users/gitoleg/received_events","type":"User","site_admin":false},"body":"This PR introduces a first approach to `Veri_policy` module, that allows to write rules like `Action : Instruction : Event : Event`, where possible values for action is either `SKIP` either `DENY` and all other fields are regular expressions. ","created_at":"2016-04-16T11:19:30Z","updated_at":"2016-04-26T11:22:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d0bf6e4ef5ca2b4d8e8e943a51bf941ee093c37","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gitoleg/bil-verification/pulls/5/commits","review_comments_url":"https://api.github.com/repos/gitoleg/bil-verification/pulls/5/comments","review_comment_url":"https://api.github.com/repos/gitoleg/bil-verification/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gitoleg/bil-verification/issues/5/comments","statuses_url":"https://api.github.com/repos/gitoleg/bil-verification/statuses/e3282074861f48d72726ebc8329b3fe37ee100bc","head":{"label":"gitoleg:veri-policy-PR","ref":"veri-policy-PR","sha":"e3282074861f48d72726ebc8329b3fe37ee100bc","user":{"login":"gitoleg","id":10262570,"avatar_url":"https://avatars.githubusercontent.com/u/10262570?v=3","gravatar_id":"","url":"https://api.github.com/users/gitoleg","html_url":"https://github.com/gitoleg","followers_url":"https://api.github.com/users/gitoleg/followers","following_url":"https://api.github.com/users/gitoleg/following{/other_user}","gists_url":"https://api.github.com/users/gitoleg/gists{/gist_id}","starred_url":"https://api.github.com/users/gitoleg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitoleg/subscriptions","organizations_url":"https://api.github.com/users/gitoleg/orgs","repos_url":"https://api.github.com/users/gitoleg/repos","events_url":"https://api.github.com/users/gitoleg/events{/privacy}","received_events_url":"https://api.github.com/users/gitoleg/received_events","type":"User","site_admin":false},"repo":{"id":53398713,"name":"bil-verification","full_name":"gitoleg/bil-verification","owner":{"login":"gitoleg","id":10262570,"avatar_url":"https://avatars.githubusercontent.com/u/10262570?v=3","gravatar_id":"","url":"https://api.github.com/users/gitoleg","html_url":"https://github.com/gitoleg","followers_url":"https://api.github.com/users/gitoleg/followers","following_url":"https://api.github.com/users/gitoleg/following{/other_user}","gists_url":"https://api.github.com/users/gitoleg/gists{/gist_id}","starred_url":"https://api.github.com/users/gitoleg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitoleg/subscriptions","organizations_url":"https://api.github.com/users/gitoleg/orgs","repos_url":"https://api.github.com/users/gitoleg/repos","events_url":"https://api.github.com/users/gitoleg/events{/privacy}","received_events_url":"https://api.github.com/users/gitoleg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gitoleg/bil-verification","description":"bil verification tool","fork":false,"url":"https://api.github.com/repos/gitoleg/bil-verification","forks_url":"https://api.github.com/repos/gitoleg/bil-verification/forks","keys_url":"https://api.github.com/repos/gitoleg/bil-verification/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gitoleg/bil-verification/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gitoleg/bil-verification/teams","hooks_url":"https://api.github.com/repos/gitoleg/bil-verification/hooks","issue_events_url":"https://api.github.com/repos/gitoleg/bil-verification/issues/events{/number}","events_url":"https://api.github.com/repos/gitoleg/bil-verification/events","assignees_url":"https://api.github.com/repos/gitoleg/bil-verification/assignees{/user}","branches_url":"https://api.github.com/repos/gitoleg/bil-verification/branches{/branch}","tags_url":"https://api.github.com/repos/gitoleg/bil-verification/tags","blobs_url":"https://api.github.com/repos/gitoleg/bil-verification/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gitoleg/bil-verification/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gitoleg/bil-verification/git/refs{/sha}","trees_url":"https://api.github.com/repos/gitoleg/bil-verification/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gitoleg/bil-verification/statuses/{sha}","languages_url":"https://api.github.com/repos/gitoleg/bil-verification/languages","stargazers_url":"https://api.github.com/repos/gitoleg/bil-verification/stargazers","contributors_url":"https://api.github.com/repos/gitoleg/bil-verification/contributors","subscribers_url":"https://api.github.com/repos/gitoleg/bil-verification/subscribers","subscription_url":"https://api.github.com/repos/gitoleg/bil-verification/subscription","commits_url":"https://api.github.com/repos/gitoleg/bil-verification/commits{/sha}","git_commits_url":"https://api.github.com/repos/gitoleg/bil-verification/git/commits{/sha}","comments_url":"https://api.github.com/repos/gitoleg/bil-verification/comments{/number}","issue_comment_url":"https://api.github.com/repos/gitoleg/bil-verification/issues/comments{/number}","contents_url":"https://api.github.com/repos/gitoleg/bil-verification/contents/{+path}","compare_url":"https://api.github.com/repos/gitoleg/bil-verification/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gitoleg/bil-verification/merges","archive_url":"https://api.github.com/repos/gitoleg/bil-verification/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gitoleg/bil-verification/downloads","issues_url":"https://api.github.com/repos/gitoleg/bil-verification/issues{/number}","pulls_url":"https://api.github.com/repos/gitoleg/bil-verification/pulls{/number}","milestones_url":"https://api.github.com/repos/gitoleg/bil-verification/milestones{/number}","notifications_url":"https://api.github.com/repos/gitoleg/bil-verification/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gitoleg/bil-verification/labels{/name}","releases_url":"https://api.github.com/repos/gitoleg/bil-verification/releases{/id}","deployments_url":"https://api.github.com/repos/gitoleg/bil-verification/deployments","created_at":"2016-03-08T09:15:24Z","updated_at":"2016-04-08T13:33:38Z","pushed_at":"2016-04-25T10:33:17Z","git_url":"git://github.com/gitoleg/bil-verification.git","ssh_url":"git@github.com:gitoleg/bil-verification.git","clone_url":"https://github.com/gitoleg/bil-verification.git","svn_url":"https://github.com/gitoleg/bil-verification","homepage":null,"size":88,"stargazers_count":0,"watchers_count":0,"language":"OCaml","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"gitoleg:master","ref":"master","sha":"20ca54029d0a6ef07dc7b75cf6c5fa7c67294358","user":{"login":"gitoleg","id":10262570,"avatar_url":"https://avatars.githubusercontent.com/u/10262570?v=3","gravatar_id":"","url":"https://api.github.com/users/gitoleg","html_url":"https://github.com/gitoleg","followers_url":"https://api.github.com/users/gitoleg/followers","following_url":"https://api.github.com/users/gitoleg/following{/other_user}","gists_url":"https://api.github.com/users/gitoleg/gists{/gist_id}","starred_url":"https://api.github.com/users/gitoleg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitoleg/subscriptions","organizations_url":"https://api.github.com/users/gitoleg/orgs","repos_url":"https://api.github.com/users/gitoleg/repos","events_url":"https://api.github.com/users/gitoleg/events{/privacy}","received_events_url":"https://api.github.com/users/gitoleg/received_events","type":"User","site_admin":false},"repo":{"id":53398713,"name":"bil-verification","full_name":"gitoleg/bil-verification","owner":{"login":"gitoleg","id":10262570,"avatar_url":"https://avatars.githubusercontent.com/u/10262570?v=3","gravatar_id":"","url":"https://api.github.com/users/gitoleg","html_url":"https://github.com/gitoleg","followers_url":"https://api.github.com/users/gitoleg/followers","following_url":"https://api.github.com/users/gitoleg/following{/other_user}","gists_url":"https://api.github.com/users/gitoleg/gists{/gist_id}","starred_url":"https://api.github.com/users/gitoleg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitoleg/subscriptions","organizations_url":"https://api.github.com/users/gitoleg/orgs","repos_url":"https://api.github.com/users/gitoleg/repos","events_url":"https://api.github.com/users/gitoleg/events{/privacy}","received_events_url":"https://api.github.com/users/gitoleg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gitoleg/bil-verification","description":"bil verification tool","fork":false,"url":"https://api.github.com/repos/gitoleg/bil-verification","forks_url":"https://api.github.com/repos/gitoleg/bil-verification/forks","keys_url":"https://api.github.com/repos/gitoleg/bil-verification/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gitoleg/bil-verification/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gitoleg/bil-verification/teams","hooks_url":"https://api.github.com/repos/gitoleg/bil-verification/hooks","issue_events_url":"https://api.github.com/repos/gitoleg/bil-verification/issues/events{/number}","events_url":"https://api.github.com/repos/gitoleg/bil-verification/events","assignees_url":"https://api.github.com/repos/gitoleg/bil-verification/assignees{/user}","branches_url":"https://api.github.com/repos/gitoleg/bil-verification/branches{/branch}","tags_url":"https://api.github.com/repos/gitoleg/bil-verification/tags","blobs_url":"https://api.github.com/repos/gitoleg/bil-verification/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gitoleg/bil-verification/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gitoleg/bil-verification/git/refs{/sha}","trees_url":"https://api.github.com/repos/gitoleg/bil-verification/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gitoleg/bil-verification/statuses/{sha}","languages_url":"https://api.github.com/repos/gitoleg/bil-verification/languages","stargazers_url":"https://api.github.com/repos/gitoleg/bil-verification/stargazers","contributors_url":"https://api.github.com/repos/gitoleg/bil-verification/contributors","subscribers_url":"https://api.github.com/repos/gitoleg/bil-verification/subscribers","subscription_url":"https://api.github.com/repos/gitoleg/bil-verification/subscription","commits_url":"https://api.github.com/repos/gitoleg/bil-verification/commits{/sha}","git_commits_url":"https://api.github.com/repos/gitoleg/bil-verification/git/commits{/sha}","comments_url":"https://api.github.com/repos/gitoleg/bil-verification/comments{/number}","issue_comment_url":"https://api.github.com/repos/gitoleg/bil-verification/issues/comments{/number}","contents_url":"https://api.github.com/repos/gitoleg/bil-verification/contents/{+path}","compare_url":"https://api.github.com/repos/gitoleg/bil-verification/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gitoleg/bil-verification/merges","archive_url":"https://api.github.com/repos/gitoleg/bil-verification/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gitoleg/bil-verification/downloads","issues_url":"https://api.github.com/repos/gitoleg/bil-verification/issues{/number}","pulls_url":"https://api.github.com/repos/gitoleg/bil-verification/pulls{/number}","milestones_url":"https://api.github.com/repos/gitoleg/bil-verification/milestones{/number}","notifications_url":"https://api.github.com/repos/gitoleg/bil-verification/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gitoleg/bil-verification/labels{/name}","releases_url":"https://api.github.com/repos/gitoleg/bil-verification/releases{/id}","deployments_url":"https://api.github.com/repos/gitoleg/bil-verification/deployments","created_at":"2016-03-08T09:15:24Z","updated_at":"2016-04-08T13:33:38Z","pushed_at":"2016-04-25T10:33:17Z","git_url":"git://github.com/gitoleg/bil-verification.git","ssh_url":"git@github.com:gitoleg/bil-verification.git","clone_url":"https://github.com/gitoleg/bil-verification.git","svn_url":"https://github.com/gitoleg/bil-verification","homepage":null,"size":88,"stargazers_count":0,"watchers_count":0,"language":"OCaml","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gitoleg/bil-verification/pulls/5"},"html":{"href":"https://github.com/gitoleg/bil-verification/pull/5"},"issue":{"href":"https://api.github.com/repos/gitoleg/bil-verification/issues/5"},"comments":{"href":"https://api.github.com/repos/gitoleg/bil-verification/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/gitoleg/bil-verification/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/gitoleg/bil-verification/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gitoleg/bil-verification/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/gitoleg/bil-verification/statuses/e3282074861f48d72726ebc8329b3fe37ee100bc"}}}}