reorganized files for parsing and decided libraries
This commit is contained in:
parent
0f39cb7fa3
commit
2dc7624ede
12 changed files with 31 additions and 17 deletions
|
|
@ -7,9 +7,9 @@
|
|||
(source
|
||||
(github username/reponame))
|
||||
|
||||
(authors "Author Name")
|
||||
(authors "William Ball")
|
||||
|
||||
(maintainers "Maintainer Name")
|
||||
(maintainers "William Ball")
|
||||
|
||||
(license LICENSE)
|
||||
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
(name proof_checker)
|
||||
(synopsis "A short synopsis")
|
||||
(description "A longer description")
|
||||
(depends ocaml dune)
|
||||
(depends ocaml dune fmlib_parse sedlex)
|
||||
(tags
|
||||
(topics "to describe" your project)))
|
||||
|
||||
|
|
|
|||
3
lib/dune
3
lib/dune
|
|
@ -1,2 +1,3 @@
|
|||
(library
|
||||
(name proof_checker))
|
||||
(name proof_checker)
|
||||
(libraries kernel pfparser))
|
||||
|
|
|
|||
2
lib/kernel/dune
Normal file
2
lib/kernel/dune
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(library
|
||||
(name kernel))
|
||||
|
|
@ -85,11 +85,11 @@ let to_string formula =
|
|||
match formula with
|
||||
| Relation (r, terms) ->
|
||||
sprintf "%s(%s)" r
|
||||
(String.concat ", " (List.map (Term.to_string ~binders) terms))
|
||||
(String.concat ", " (List.map (Term.to_string binders) terms))
|
||||
| Equal (t1, t2) ->
|
||||
sprintf "%s = %s"
|
||||
(Term.to_string ~binders t1)
|
||||
(Term.to_string ~binders t2)
|
||||
(Term.to_string binders t1)
|
||||
(Term.to_string binders t2)
|
||||
| Bottom -> "⊥"
|
||||
| Neg f -> sprintf "¬%s" (aux depth binders Negation f)
|
||||
| Conj (f1, f2) -> sprintf "%s ∧ %s" (step f1) (step f2)
|
||||
|
|
@ -10,6 +10,16 @@ type t =
|
|||
| Forall of t
|
||||
| Exists of t
|
||||
|
||||
type precedence =
|
||||
| Atomic
|
||||
| Negation
|
||||
| Conjunction
|
||||
| Disjunction
|
||||
| Implication
|
||||
| Biconditional
|
||||
| Quantifier
|
||||
|
||||
val precedence_of : t -> precedence
|
||||
val match_term : Term.t -> t -> t -> Term.match_result
|
||||
val occurs : Term.t -> t -> bool
|
||||
val to_string : t -> string
|
||||
|
|
@ -41,12 +41,10 @@ let rec occurs t = function
|
|||
| Function (_, ts) -> List.exists (occurs t) ts
|
||||
| s -> t = s
|
||||
|
||||
exception UnboundVariable
|
||||
|
||||
let to_string ~binders =
|
||||
let to_string binders =
|
||||
let open Format in
|
||||
let rec aux = function
|
||||
| Var v -> ( try List.nth binders v with _ -> raise UnboundVariable)
|
||||
| Var v -> List.nth binders v
|
||||
| Const c -> c
|
||||
| Free f -> f
|
||||
| Function (f, args) ->
|
||||
|
|
@ -12,7 +12,4 @@ val merge_result : match_result -> match_result -> match_result
|
|||
val match_term : t -> t -> t -> match_result
|
||||
val inc_var : t -> t
|
||||
val occurs : t -> t -> bool
|
||||
|
||||
exception UnboundVariable
|
||||
|
||||
val to_string : binders:string list -> t -> string
|
||||
val to_string : string list -> t -> string
|
||||
3
lib/parser/dune
Normal file
3
lib/parser/dune
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
(library
|
||||
(name pfparser)
|
||||
(libraries kernel sedlex fmlib_parse))
|
||||
1
lib/parser/parser.ml
Normal file
1
lib/parser/parser.ml
Normal file
|
|
@ -0,0 +1 @@
|
|||
let x = 3
|
||||
|
|
@ -2,8 +2,8 @@
|
|||
opam-version: "2.0"
|
||||
synopsis: "A short synopsis"
|
||||
description: "A longer description"
|
||||
maintainer: ["Maintainer Name"]
|
||||
authors: ["Author Name"]
|
||||
maintainer: ["William Ball"]
|
||||
authors: ["William Ball"]
|
||||
license: "LICENSE"
|
||||
tags: ["topics" "to describe" "your" "project"]
|
||||
homepage: "https://github.com/username/reponame"
|
||||
|
|
@ -12,6 +12,8 @@ bug-reports: "https://github.com/username/reponame/issues"
|
|||
depends: [
|
||||
"ocaml"
|
||||
"dune" {>= "3.16"}
|
||||
"fmlib_parse"
|
||||
"sedlex"
|
||||
"odoc" {with-doc}
|
||||
]
|
||||
build: [
|
||||
|
|
|
|||
Loading…
Reference in a new issue