Module Schema


module Schema: sig .. end
Propositional schemata.

Includes propositional formulae: P_1, ~P_1, P_1 /\ P_2, P_1 \/ P_2, etc. (propositional variables must be indexed i.e. P,Q,R are forbidden, P_1,Q_1,R_1 are not).

And of course iterated schemata: /\i=1..n P_i, \/i=1..n P_i.
Author(s): Vincent Aravantinos


type t = private [< `Bot
| `It of [ `And | `Or ] * Variable.t * Indexes.t * Indexes.t * t
| `Lit of Literal.t
| `Op of [ `And | `Equiv | `Imply | `Or | `Xor ] * t * t
| `Top ]
Type of schemata. Private.

Constructors

val bot : t
val top : t
val pos_lit : Proposition.t -> Indexes.t -> t
val neg_lit : Proposition.t -> Indexes.t -> t
val conj : t -> t -> t
val disj : t -> t -> t
val xor : t -> t -> t
val equiv : t -> t -> t
val imply : t -> t -> t
val it_conj : Variable.t -> Indexes.t -> Indexes.t -> t -> t
val it_disj : Variable.t -> Indexes.t -> Indexes.t -> t -> t

Print stuff

val to_string : t -> string
val list_to_string : t list -> string
val print : t -> unit
val equal : t -> t -> bool
Comparison

val total_compare : t -> t -> int

Others

val max_bound : ?acc:Indexes.t option -> t -> Indexes.t option
Returns the maximal bound of iterations contained in the schema, returns None if no iteration.
acc : the maximum will be also checked against acc.
val contains_iterations : t -> bool
Returns true if the schema contains iterations, false else.
val neg : t -> t
Returns the negation of the schema.
val unfold_and_once : var:Variable.t -> sch:t -> t1:Indexes.t -> t2:Indexes.t -> t
Returns an iterated conjunction whose last rank is unfolded.
var : variable of the returned iteration.
t1 : lower bound of the returned iteration.
t2 : upper bound of the returned iteration.
val unfold_or_once : var:Variable.t -> sch:t -> t1:Indexes.t -> t2:Indexes.t -> t
Similar with disjunction.

Regularity of schemata

exception Non_regular
val get_param : t -> Variable.t option
Raises Non_regular if the schema has more than one parameter.
Returns the only parameter of the schema if any.
val is_regular : t -> bool
Returns true if the schema is regular.
val compute_schema : t -> int -> Formula.t
Raises Non_regular if the schema has more than one parameter.
Returns computes the propositional formula obtained by substituting the only parameter with a given number.
val expr_involving_param : t -> Indexes.t option
Returns the first expression (bound or index), if any, that involves the parameter of the schema. This is used to normalize lemmata. In this context, the input may only be an iteration or a literal so "the first expression" is actually the only expression.
include Purity.Purable
Purity


Substitution

include Substitution.Substituable
Standard substitution of parameters
module PropSubs: Substitution.Substituable  with type substituable = t and type term = Proposition.t and type variable = Proposition.t
"Propositional variable Substitution", a module to allow subtitution of propositional variables by other propositional variables.
module LoopingMap: Looping.LoopingMap  with type loopable = t
Looping