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. def *(sc: Double): FiniteDistribution[T]
  2. def +(elem: T, prob: Double): FiniteDistribution[T]
  3. def ++(that: FiniteDistribution[T]): FiniteDistribution[T]
  4. def --(that: FiniteDistribution[T]): FiniteDistribution[T]
  5. 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
  6. 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
  7. 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
  8. 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.

  9. def apply(label: T): Double

    weight of the label.

  10. def collect[S](f: PartialFunction[T, S]): FiniteDistribution[S]
  11. def condMap[S](f: (T) => Option[S]): FiniteDistribution[S]
  12. def conditioned(p: (T) => Boolean): FiniteDistribution[T]
  13. def dot(that: FiniteDistribution[T]): Double
  14. def entropy(elem: T): Double
  15. def entropyVec: Vector[Weighted[T]]
  16. def entropyView: Vector[Weighted[String]]
  17. def expectation(implicit ls: VectorSpace[T, Double]): T
  18. def fibProduct[Q, B](quot: (T) => Q, fibers: (Q) => ProbabilityDistribution[B]): FiberProduct[T, Q, B]
    Definition Classes
    ProbabilityDistribution
  19. def filter(p: (T) => Boolean): FiniteDistribution[T]
  20. 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
  21. def flatMap[S](f: (T) => FiniteDistribution[S]): FiniteDistribution[S]
  22. def flatMap[B](f: (T) => ProbabilityDistribution[B]): ProbabilityDistribution[B]
    Definition Classes
    ProbabilityDistribution
  23. def flatten: FiniteDistribution[T]
  24. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  25. def getsum(label: T): Double
  26. def inRatioBall(that: FiniteDistribution[T], ratio: Double): Boolean
  27. def innerProduct(that: FiniteDistribution[T]): Double
  28. def integral(f: (T) => Double): Double
  29. def invmap[S](f: (S) => T, support: Iterable[S]): FiniteDistribution[S]
  30. def invmapOpt[S](f: (S) => Option[T], support: Iterable[S]): FiniteDistribution[S]
  31. def klDivergence(that: FiniteDistribution[T]): Double
  32. def map[S](f: (T) => S): FiniteDistribution[S]
  33. def mapOpt[S](f: (T) => Option[S]): FiniteDistribution[S]
  34. def memo: Map[T, Double]
  35. 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
  36. def norm: Double

    l1-norm

  37. def normalized(t: Double = 0.0): FiniteDistribution[T]
  38. def pickle: List[(String, Double)]
  39. val pmf: Vector[Weighted[T]]
  40. def pmfVec: Vector[(T, Double)]
  41. def posmf(t: Double = 0.0): Vector[Weighted[T]]

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

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

    total of the positive weights

  43. def product[B](that: ProbabilityDistribution[B]): Product[T, B]
    Definition Classes
    ProbabilityDistribution
  44. def productElementNames: Iterator[String]
    Definition Classes
    Product
  45. def pruneMap[S](f: => (T) => S, epsilon: Double): FiniteDistribution[S]
  46. def prunedPMF(epsilon: Double): Vector[Weighted[T]]
  47. def purge(epsilon: Double): FiniteDistribution[T]
  48. def randomVariable: Iterator[T]
    Definition Classes
    ProbabilityDistribution
  49. 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

  50. def restrict(s: Set[T]): FiniteDistribution[T]
  51. def safeNormalized: FiniteDistribution[T]

    normalize if possible, otherwise empty.

  52. 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

  53. def sort: FiniteDistribution[T]
  54. def split(groups: Int): Map[Int, FiniteDistribution[T]]
  55. def supp: Vector[T]
  56. def support: Set[T]
  57. def toMap: Map[T, Double]
  58. def toString(): String
    Definition Classes
    FiniteDistribution → Any
  59. def total: Double
  60. def zip[S](that: FiniteDistribution[S]): FiniteDistribution[(T, S)]