Packages

  • package root
    Definition Classes
    root
  • package provingground

    This is work towards automated theorem proving based on learning, using homotopy type theory (HoTT) as foundations and natural language processing.

    This is work towards automated theorem proving based on learning, using homotopy type theory (HoTT) as foundations and natural language processing.

    The implementation of homotopy type theory is split into:

    • the object HoTT with terms, types, functions and dependent functions, pairs etc
    • the package induction with general inductive types and recursion/induction on these.

    The learning package has the code for learning.

    Scala code, including the spire library, is integrated with homotopy type theory in the scalahott package

    We have implemented a functor based approach to translation in the translation package, used for nlp as well as serialization and parsing.

    The library package is contains basic structures implemented in HoTT.

    Definition Classes
    root
  • package andrewscurtis
    Definition Classes
    provingground
  • package examples
    Definition Classes
    provingground
  • package induction

    Much of the richness of HoTT is in the definitions of Inductive types (and their indexed counterparts) and of (dependent) functions on these by recursion and induction These are implemented using several layers of recursive definitions and diagonals (i.e., fixed points).

    Much of the richness of HoTT is in the definitions of Inductive types (and their indexed counterparts) and of (dependent) functions on these by recursion and induction These are implemented using several layers of recursive definitions and diagonals (i.e., fixed points). In HoTT, recursion and induction are applications of (dependent) functions rec_W,X and ind_W, Xs to the definition data.

    It is useful to capture information regarding inductive types and the recursion and induction functions in scala types. Our implementation is designed to do this.

    Inductive Type Definitions

    Inductive types are specified by introduction rules. Each introduction rule is specified in ConstructorShape (without specifying the type) and ConstructorTL including the specific type. The full definition is in ConstructorSeqTL.

    Recursion and Induction functions

    These are defined recursively, first for each introduction rule and then for the inductive type as a whole. A subtlety is that the scala type of the rec_W,X and induc_W, Xs functions depends on the scala type of the codomain X (or family Xs). To make these types visible, some type level calculations using implicits are done, giving traits ConstructorPatternMap and ConstructorSeqMap that have recursive definition of the recursion and induction functions, the former for the case of a single introduction rule. Traits ConstructorSeqMapper and ConstructorPatternMapper provide the lifts.

    Indexed Versions

    There are indexed versions of all these definitions, to work with indexed inductive type families.

    Definition Classes
    provingground
  • package interface
    Definition Classes
    provingground
  • package learning
    Definition Classes
    provingground
  • package library
    Definition Classes
    provingground
  • package scalahott
    Definition Classes
    provingground
  • package scratch
    Definition Classes
    provingground
  • package translation

    Translation primarily using a functorial framework - see Translator$, for natural language processing as well as serialization, formatted output, parsing, interface with formal languages etc.

    Translation primarily using a functorial framework - see Translator$, for natural language processing as well as serialization, formatted output, parsing, interface with formal languages etc.

    Besides the Translator framework and helper typeclasses is Functors, several structures for concrete languages including our implementation of HoTT are in this package.

    Definition Classes
    provingground
  • Base
  • Context
  • FiniteDistribution
  • Frankl
  • HoTT
  • JvmUtils
  • LinearStructure
  • MereProposition
  • PickledWeighted
  • ProbabilityDistribution
  • Subst
  • SubstImplicits
  • TermList
  • TermListImplicits
  • Utils
  • Weighted

final case class FiniteDistribution[T](pmf: Vector[Weighted[T]]) extends AnyVal with ProbabilityDistribution[T] with Product with Serializable

Finite distributions, often supposed to be probability distributions, but may also be tangents to this or intermediates.

pmf

probability mass function, may have same object split.

Linear Supertypes
Serializable, Product, Equals, ProbabilityDistribution[T], AnyVal, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FiniteDistribution
  2. Serializable
  3. Product
  4. Equals
  5. ProbabilityDistribution
  6. AnyVal
  7. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new FiniteDistribution(pmf: Vector[Weighted[T]])

    pmf

    probability mass function, may have same object split.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##: Int
    Definition Classes
    Any
  3. def *(sc: Double): FiniteDistribution[T]
  4. def +(elem: T, prob: Double): FiniteDistribution[T]
  5. def ++(that: FiniteDistribution[T]): FiniteDistribution[T]
  6. def --(that: FiniteDistribution[T]): FiniteDistribution[T]
  7. def ->[B](y: B): (FiniteDistribution[T], B)
    Implicit
    This member is added by an implicit conversion from FiniteDistribution[T] toArrowAssoc[FiniteDistribution[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  8. def <++>(components: => Vector[Weighted[ProbabilityDistribution[T]]]): Mixture[T]

    mix in weighted distributions; the mixed in distributions are called by name, so can depend on this distribution.

    mix in weighted distributions; the mixed in distributions are called by name, so can depend on this distribution.

    Definition Classes
    ProbabilityDistribution
  9. def <+>(mixin: => ProbabilityDistribution[T], weight: Double): Mixin[T]

    generates from the mixed in distribution with probability _weight_, otherwise defaults to this distribution; as the mixed in distribution is called by name, it may depend on the present one.

    generates from the mixed in distribution with probability _weight_, otherwise defaults to this distribution; as the mixed in distribution is called by name, it may depend on the present one.

    Definition Classes
    ProbabilityDistribution
  10. def <+?>(mixin: => ProbabilityDistribution[Option[T]], weight: Double): MixinOpt[T]

    generates from the mixed in optional valued distribution with probability weight, otherwise, or if the optional returns None, defaults to this distribution; the mixed in distribution is call by name, so may depend on this distribution.

    generates from the mixed in optional valued distribution with probability weight, otherwise, or if the optional returns None, defaults to this distribution; the mixed in distribution is call by name, so may depend on this distribution.

    Definition Classes
    ProbabilityDistribution
  11. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  12. def KLfeedback(baseweights: (T) => Double, strictness: Double = 1.0): FiniteDistribution[T]

    gradient w.r.t.

    gradient w.r.t. inner product scaled by presentation weights, perpendicular to the gradient (w.r.t. same inner product) of the "total weight" function.

  13. def apply(label: T): Double

    weight of the label.

  14. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  15. def collect[S](f: PartialFunction[T, S]): FiniteDistribution[S]
  16. def condMap[S](f: (T) => Option[S]): FiniteDistribution[S]
  17. def conditioned(p: (T) => Boolean): FiniteDistribution[T]
  18. def dot(that: FiniteDistribution[T]): Double
  19. def ensuring(cond: (FiniteDistribution[T]) => Boolean, msg: => Any): FiniteDistribution[T]
    Implicit
    This member is added by an implicit conversion from FiniteDistribution[T] toEnsuring[FiniteDistribution[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. def ensuring(cond: (FiniteDistribution[T]) => Boolean): FiniteDistribution[T]
    Implicit
    This member is added by an implicit conversion from FiniteDistribution[T] toEnsuring[FiniteDistribution[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  21. def ensuring(cond: Boolean, msg: => Any): FiniteDistribution[T]
    Implicit
    This member is added by an implicit conversion from FiniteDistribution[T] toEnsuring[FiniteDistribution[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  22. def ensuring(cond: Boolean): FiniteDistribution[T]
    Implicit
    This member is added by an implicit conversion from FiniteDistribution[T] toEnsuring[FiniteDistribution[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  23. def entropy(elem: T): Double
  24. def entropyVec: Vector[Weighted[T]]
  25. def entropyView: Vector[Weighted[String]]
  26. def expectation(implicit ls: VectorSpace[T, Double]): T
  27. def fibProduct[Q, B](quot: (T) => Q, fibers: (Q) => ProbabilityDistribution[B]): FiberProduct[T, Q, B]
    Definition Classes
    ProbabilityDistribution
  28. def filter(p: (T) => Boolean): FiniteDistribution[T]
  29. def findFut(p: (T) => Boolean, maxloops: Long): Future[Option[T]]

    Find element satisfying predicate, runs concurrently, returning future

    Find element satisfying predicate, runs concurrently, returning future

    Definition Classes
    ProbabilityDistribution
  30. def flatMap[S](f: (T) => FiniteDistribution[S]): FiniteDistribution[S]
  31. def flatMap[B](f: (T) => ProbabilityDistribution[B]): ProbabilityDistribution[B]
    Definition Classes
    ProbabilityDistribution
  32. def flatten: FiniteDistribution[T]
  33. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from FiniteDistribution[T] toStringFormat[FiniteDistribution[T]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  34. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  35. def getsum(label: T): Double
  36. def inRatioBall(that: FiniteDistribution[T], ratio: Double): Boolean
  37. def innerProduct(that: FiniteDistribution[T]): Double
  38. def integral(f: (T) => Double): Double
  39. def invmap[S](f: (S) => T, support: Iterable[S]): FiniteDistribution[S]
  40. def invmapOpt[S](f: (S) => Option[T], support: Iterable[S]): FiniteDistribution[S]
  41. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  42. def klDivergence(that: FiniteDistribution[T]): Double
  43. def map[S](f: (T) => S): FiniteDistribution[S]
  44. def mapOpt[S](f: (T) => Option[S]): FiniteDistribution[S]
  45. def memo: Map[T, Double]
  46. def next: T

    next instance of a random variable with the given distribution

    next instance of a random variable with the given distribution

    Definition Classes
    FiniteDistributionProbabilityDistribution
  47. def norm: Double

    l1-norm

  48. def normalized(t: Double = 0.0): FiniteDistribution[T]
  49. def pickle: List[(String, Double)]
  50. val pmf: Vector[Weighted[T]]
  51. def pmfVec: Vector[(T, Double)]
  52. def posmf(t: Double = 0.0): Vector[Weighted[T]]

    objects with positive probability (or bounded below by a threshhold)

  53. def postotal(t: Double = 0.0): Double

    total of the positive weights

  54. def product[B](that: ProbabilityDistribution[B]): Product[T, B]
    Definition Classes
    ProbabilityDistribution
  55. def productElementNames: Iterator[String]
    Definition Classes
    Product
  56. def pruneMap[S](f: => (T) => S, epsilon: Double): FiniteDistribution[S]
  57. def prunedPMF(epsilon: Double): Vector[Weighted[T]]
  58. def purge(epsilon: Double): FiniteDistribution[T]
  59. def randomVariable: Iterator[T]
    Definition Classes
    ProbabilityDistribution
  60. def rawfeedback(baseweights: (T) => Double, damp: Double = 0.1, strictness: Double = 1.0): FiniteDistribution[T]

    entropy feedback for the finite distribution to move in the direction of the base distribution, however values outside support are ignored.

    entropy feedback for the finite distribution to move in the direction of the base distribution, however values outside support are ignored. warning: should come after ++ to ensure implementation choice.

    baseweights

    base weights

  61. def restrict(s: Set[T]): FiniteDistribution[T]
  62. def safeNormalized: FiniteDistribution[T]

    normalize if possible, otherwise empty.

  63. def smoothedFeedback(baseweights: (T) => Double, damp: Double = 0.1, strictness: Double = 1.0): FiniteDistribution[T]

    entropy feedback for the finite distribution to move in the direction of the base distribution, however values outside support are ignored.

    entropy feedback for the finite distribution to move in the direction of the base distribution, however values outside support are ignored. smoothed to ensure at most proportional to the target probability warning: should come after ++ to ensure implementation choice.

    baseweights

    base weights

  64. def sort: FiniteDistribution[T]
  65. def split(groups: Int): Map[Int, FiniteDistribution[T]]
  66. def supp: Vector[T]
  67. def support: Set[T]
  68. def toMap: Map[T, Double]
  69. def toString(): String
    Definition Classes
    FiniteDistribution → Any
  70. def total: Double
  71. def zip[S](that: FiniteDistribution[S]): FiniteDistribution[(T, S)]

Shadowed Implicit Value Members

  1. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from FiniteDistribution[T] toany2stringadd[FiniteDistribution[T]] performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (finiteDistribution: any2stringadd[FiniteDistribution[T]]).+(other)
    Definition Classes
    any2stringadd

Deprecated Value Members

  1. def [B](y: B): (FiniteDistribution[T], B)
    Implicit
    This member is added by an implicit conversion from FiniteDistribution[T] toArrowAssoc[FiniteDistribution[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from ProbabilityDistribution[T]

Inherited from AnyVal

Inherited from Any

Inherited by implicit conversion any2stringadd fromFiniteDistribution[T] to any2stringadd[FiniteDistribution[T]]

Inherited by implicit conversion StringFormat fromFiniteDistribution[T] to StringFormat[FiniteDistribution[T]]

Inherited by implicit conversion Ensuring fromFiniteDistribution[T] to Ensuring[FiniteDistribution[T]]

Inherited by implicit conversion ArrowAssoc fromFiniteDistribution[T] to ArrowAssoc[FiniteDistribution[T]]

Ungrouped