projects
/
tatoo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rework the formula predicates:
[tatoo.git]
/
src
/
auto
/
formula.ml
diff --git
a/src/auto/formula.ml
b/src/auto/formula.ml
index
70407cf
..
7128ba4
100644
(file)
--- a/
src/auto/formula.ml
+++ b/
src/auto/formula.ml
@@
-14,7
+14,7
@@
(***********************************************************************)
(*
(***********************************************************************)
(*
- Time-stamp: <Last modified on 2013-0
2-07 10:00:33
CET by Kim Nguyen>
+ Time-stamp: <Last modified on 2013-0
3-09 11:12:54
CET by Kim Nguyen>
*)
INCLUDE "utils.ml"
*)
INCLUDE "utils.ml"
@@
-26,28
+26,23
@@
open Utils
(** Implementation of hashconsed Boolean formulae *)
(** Implementation of hashconsed Boolean formulae *)
-type move = [ `Left | `Right | `Epsilon | `Up1 | `Up2 ]
-
-(** Direction for automata predicates *)
*)
*)
-module type
PREDICATE
=
+module type
ATOM
=
sig
type t
sig
type t
- type ctx
- val eval : ctx -> t -> bool
val neg : t -> t
include Hcons.Abstract with type t := t
val neg : t -> t
include Hcons.Abstract with type t := t
- include
Sigs.AUX
.Printable with type t := t
+ include
Common_sig
.Printable with type t := t
end
end
-type ('formula,'
pred
) expr =
+type ('formula,'
atom
) expr =
| False
| True
| Or of 'formula * 'formula
| And of 'formula * 'formula
| False
| True
| Or of 'formula * 'formula
| And of 'formula * 'formula
- | Atom of '
pred
+ | Atom of '
atom
-module Make (P:
PREDICATE
) =
+module Make (P:
ATOM
) =
struct
struct
@@
-61,7
+56,7
@@
struct
module rec Node : Hcons.S
with type data = Data.t = Hcons.Make (Data)
module rec Node : Hcons.S
with type data = Data.t = Hcons.Make (Data)
- and Data :
Hashtbl
.HashedType with type t = Node.t node =
+ and Data :
Common_sig
.HashedType with type t = Node.t node =
struct
type t = Node.t node
let equal x y =
struct
type t = Node.t node
let equal x y =
@@
-175,12
+170,4
@@
let and_ f1 f2 =
let of_bool = function true -> true_ | false -> false_
let of_bool = function true -> true_ | false -> false_
-let rec eval ctx f =
- match f.Node.node.pos with
- True -> true
- | False -> false
- | Atom p -> P.eval ctx p
- | And(f1, f2) -> eval ctx f1 && eval ctx f2
- | Or(f1, f2) -> eval ctx f1 || eval ctx f2
-
end
end