(* $Id: orderings.ml 9869 2009-06-11 22:52:38Z denes $ *)
+
+module B(C : NCicBlob.NCicContext): Orderings.Blob
+ with type t = NCic.term and type input = NCic.term
+ = Orderings.LPO(NCicBlob.NCicBlob(C))
+
+module NCicParamod(C : NCicBlob.NCicContext) = Paramod.Paramod(B(C))
+
let nparamod rdb metasenv subst context t table =
- let module C =
- struct
+ let module C =
+ struct
let metasenv = metasenv
let subst = subst
- let context = context
- end
- in
- let module B : Orderings.Blob
- with type t = NCic.term and type input = NCic.term
- = Orderings.LPO(NCicBlob.NCicBlob(C))
+ let context = context
+ end
in
- let module P = Paramod.Paramod(B) in
+ let module B = B(C) in
+ let module P = NCicParamod(C) in
let module Pp = Pp.Pp(B) in
let bag, maxvar = Terms.empty_bag, 0 in
let (bag,maxvar), goals =
sig
type t
type input
+ type state
type szsontology =
| Unsatisfiable of (t Terms.bag * int * int list) list
| GaveUp
| Error of string
| Timeout of int * t Terms.bag
type bag = t Terms.bag * int
+ val empty_state : state
val mk_passive : bag -> input * input -> bag * t Terms.unit_clause
val mk_goal : bag -> input * input -> bag * t Terms.unit_clause
+ val forward_infer_step :
+ state ->
+ t Terms.unit_clause ->
+ int ->
+ state
val paramod :
useage:bool ->
max_steps:int ->
end
module Paramod (B : Orderings.Blob) = struct
- type t = B.t
- type input = B.input
- type szsontology =
- | Unsatisfiable of (B.t Terms.bag * int * int list) list
- | GaveUp
- | Error of string
- | Timeout of int * B.t Terms.bag
- exception Stop of szsontology
- type bag = B.t Terms.bag * int
module Pp = Pp.Pp (B)
module FU = FoUnif.Founif(B)
module IDX = Index.Index(B)
module WeightPassiveSet = Set.Make(WeightOrderedPassives)
module AgePassiveSet = Set.Make(AgeOrderedPassives)
+ type t = B.t
+ type input = B.input
+ type state =
+ B.t Terms.bag
+ * int
+ * Index.Index(B).active_set
+ * (WeightPassiveSet.t * AgePassiveSet.t)
+ * B.t Terms.unit_clause list
+ * (WeightPassiveSet.t * AgePassiveSet.t)
+ type szsontology =
+ | Unsatisfiable of (B.t Terms.bag * int * int list) list
+ | GaveUp
+ | Error of string
+ | Timeout of int * B.t Terms.bag
+ exception Stop of szsontology
+ type bag = B.t Terms.bag * int
+
+ let empty_state =
+ Terms.empty_bag,
+ 0,
+ ([],IDX.DT.empty),
+ (WeightPassiveSet.empty,AgePassiveSet.empty),
+ [],
+ (WeightPassiveSet.empty,AgePassiveSet.empty)
+;;
+
let add_passive_clause ?(no_weight=false) (passives_w,passives_a) cl =
let cl = if no_weight then (0,cl)
else Utils.mk_passive_clause cl in
(add_passive_goals g_passives new_goals)
;;
- let forward_infer_step bag maxvar actives passives g_actives
- g_passives current iterno =
+ let forward_infer_step (bag,maxvar,actives,passives,g_actives,g_passives)
+ current iterno =
(* forward step *)
(* e = select P *
in
bag,maxvar,actives,passives,g_actives,g_passives
else
- forward_infer_step bag maxvar actives passives
- g_actives g_passives current iterno
+ forward_infer_step
+ (bag,maxvar,actives,passives,g_actives,g_passives)
+ current iterno
in