package logtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Int_lit.FocusSource

focus on a term in one of the two monomes

Sourceval mk_left : op -> Z.t Monome.Focus.t -> Z.t Monome.t -> t
Sourceval mk_right : op -> Z.t Monome.t -> Z.t Monome.Focus.t -> t
Sourceval mk_div : ?sign:bool -> Z.t -> power:int -> Z.t Monome.Focus.t -> t
Sourceval get : lit -> Position.t -> t option
Sourceval get_exn : lit -> Position.t -> t
Sourceval focus_term : lit -> term -> t option

Attempt to focus on the given atomic term, if it occurs directly under the arith literal

Sourceval focus_term_exn : lit -> term -> t
Sourceval replace : t -> Z.t Monome.t -> lit

replace a m replaces mf.coeff × mf.term with m where mf is the focused monome in a, and return the resulting literal

Sourceval term : t -> term

Focused term

Sourceval focused_monome : t -> Z.t Monome.Focus.t

The focused monome

Sourceval opposite_monome : t -> Z.t Monome.t option

The opposite monome (in Left and Right), if any.

Sourceval opposite_monome_exn : t -> Z.t Monome.t

Unsafe version of opposite_monome.

Sourceval is_max : ord:Ordering.t -> t -> bool

Is the focused term maximal in the literal?

Sourceval is_strictly_max : ord:Ordering.t -> t -> bool

Is the focused term maximal in the literal, ie is it greater than all the other terms?

Sourceval map_lit : f_m:(Z.t Monome.t -> Z.t Monome.t) -> f_mf:(Z.t Monome.Focus.t -> Z.t Monome.Focus.t) -> t -> t

Apply a function to the monomes and focused monomes

Sourceval product : t -> Z.t -> t

Product by a constant

Sourceval scale : t -> t -> t * t

Multiply the two literals by some constant so that their focused literals have the same coefficient

Sourceval scale_power : t -> int -> t

For a "divides" literal, bring it to the given power.

  • raises Invalid_argument

    if the current power is strictly greater than the argument (cannot scale down), or if the literal is not a Div

Sourceval apply_subst : Subst.Renaming.t -> Subst.t -> t Scoped.t -> t

Apply a substitution

Sourceval unify : ?subst:Unif_subst.t -> t Scoped.t -> t Scoped.t -> (t * t * Unif_subst.t) Iter.t

Unify the two focused terms, and possibly other terms of their respective focused monomes; yield the new literals accounting for the unification along with the unifier

Sourceval fold_terms : ?pos:Position.t -> lit -> (t * Position.t) Iter.t

Fold on focused terms in the literal, one by one, with the position of the focused term

Sourceval op : t -> [ `Binary of op | `Divides ]
Sourceval unfocus : t -> lit

Conversion back to a literal

Sourceval to_string : t -> string