Class/Object

org.combinators.cls.inhabitation

FiniteCombinatoryLogic

Related Docs: object FiniteCombinatoryLogic | package inhabitation

Permalink

class FiniteCombinatoryLogic extends AnyRef

Type inhabitation for finite combinatory logic (FCL)

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FiniteCombinatoryLogic
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FiniteCombinatoryLogic(subtypes: SubtypeEnvironment, repository: Repository)

    Permalink

Type Members

  1. implicit class MinimalArguments extends Minimizable

    Permalink

    Typeclass instance to minimize an argument collection wrt.

    Typeclass instance to minimize an argument collection wrt. to its cardinality under the constraint that inhabitant sets remain equal. We have: forall argvect in args, exists argvect' in args.minimize, forall i, argvect(i) <= argvect'(i) Example: Seq(Seq('A :&: 'B, 'C), Seq('A, 'D), Seq('A :&: 'B, 'C :&: D)).minimize = Seq(Seq('A :&: 'B, 'C), Seq('A, 'D))

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def covers(tgt: Type with Organized, paths: Seq[(Seq[Type], Type with Path)]): Seq[Seq[Type]]

    Permalink

    Finds all piecewise intersections of argument sequences in paths, such that correspondingly intersected targets are subtypes of tgt.

    Finds all piecewise intersections of argument sequences in paths, such that correspondingly intersected targets are subtypes of tgt. Avoids selecting redundant paths and argument vectors. Assumes all argument sequences in paths are of equal length. Example: covers('A :&: 'B, (Seq('X, P), 'A) +: (Seq('Y, Q), 'A) +: (Seq('Z, P), 'B) +: Seq.empty) == Seq('X :&: 'Z, P) +: Seq('Y :&: 'Z, P) +: Seq.empty

  7. final def ensureTargetExistsIfEqualTypePresent(grammar: TreeGrammar, target: Type): TreeGrammar

    Permalink

    Ensures target is present as a left hand side of grammar, if a (subtype-)equal left hand side exists.

    Ensures target is present as a left hand side of grammar, if a (subtype-)equal left hand side exists. The preexisting left hand sides will be cloned. This is necessary, when inhabitStep substitutes equal types.

  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def findSmallerEntry(grammar: TreeGrammar, ty: Type): Option[(Type, Set[(String, Seq[Type])])]

    Permalink

    Finds an entries of grammar where the left hand side is a subtype of ty.

  12. final def findSupertypeEntries(grammar: TreeGrammar, ty: Type): TreeGrammar

    Permalink

    Finds all entries of grammar where the left hand side is a supertype of ty.

  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def groundTypesOf(grammar: TreeGrammar): Set[Type]

    Permalink

    Finds all productive left hand sides in grammar.

    Finds all productive left hand sides in grammar. A left hand side is productive, if any of its right hand sides only requires arguments, which are productive left hand sides of the grammar.

  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. def inhabit(targets: Type*): TreeGrammar

    Permalink

    Inhabits all types in targets and return a tree grammar to represent results.

    Inhabits all types in targets and return a tree grammar to represent results. The tree grammar will contain entries (sigma -> Seq((c, args), rhs)), where sigma is a target type, c is a combinator name, args are the argument types necessary for c to inhabit sigma and rhs are all possible other combinator name, argument type pairs for target sigma. The resulting tree grammar is pruned to eliminate unproductive derivation chains.

  17. final def inhabitRec(targets: Type*): Stream[(TreeGrammar, Stream[Stream[Type]])]

    Permalink

    Inhabits all elements of targets.

    Inhabits all elements of targets. Recursively performs inhabitation until there are now fresh targets. Continues with the next target on failure.

  18. final def inhabitSequentially(grammar: TreeGrammar, tgts: Stream[Type]): (TreeGrammar, Stream[Stream[Type]])

    Permalink

    Inhabits the arguments of a single combinator.

    Inhabits the arguments of a single combinator. Sequentially performs inhabitStep for each target in tgts. Aborts and rolls back, whenever a step along the way fails.

  19. final def inhabitSequentiallyContinueIfFailing(grammar: TreeGrammar, tgts: Stream[Stream[Type]]): (TreeGrammar, Stream[Stream[Type]])

    Permalink

    Inhabits the arguments of multiple combinators.

    Inhabits the arguments of multiple combinators. Sequentially performs inhabitSequentially for each target stream in tgts. Continues with the next stream when a step along the way fails.

  20. final def inhabitStep(result: TreeGrammar, tgt: Type): (TreeGrammar, Stream[Stream[Type]])

    Permalink

    Performs a single inhabitation step.

    Performs a single inhabitation step. Finds combinators which can inhabit tgt, adds their application as right hand sides for the left hand side tgt and returns a stream of new targets for each combinator that was used. Removes combinators depending on tgt if grammar contains a pair (sigma -> rhs), where sigma is a supertype of tgt and rhs is an empty set. Replaces all occurences of tgt if a (subtype-)equal left hand side is already present.

    result

    the tree grammar constructed so far.

    tgt

    the current target.

    returns

    an updated tree grammar and a stream of new targets for every new right hand side; empty target streams indicate failure, while Stream.empty #:: Stream.empty[Stream[Type]] indicates success without fresh targets.

  21. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. final def newProductionsAndTargets(results: Map[String, Iterable[Seq[Type]]]): (Set[(String, Seq[Type])], Stream[Stream[Type]])

    Permalink

    Rearranges intermediate results to a set of new grammar rules and recursive targets.

    Rearranges intermediate results to a set of new grammar rules and recursive targets. Input format: a map containing combinator names and alternative recursive targets to use that combinator. Output format: a set of combinator names with the respective parameter types to inhabit for using the combinator, and a collection of all parameter type collections to use the combinators in the set. Example: newProductionsAndTargets(Map("c" -> Seq(Seq('A, 'B), Seq('C), Seq('A, 'B))), "d" -> Seq(), "e" -> Seq(Seq())) == (Set(("c", Seq('A, 'B)), ("c", Seq('C)), ("e", Seq())), Stream.empty #:: ('C #:: Stream.empty) #:: ('A #:: 'B #:: Stream.empty) #:: Stream.empty

  24. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. def prune(grammar: TreeGrammar): TreeGrammar

    Permalink

    Removes all unproductive left hand sides in grammar.

    Removes all unproductive left hand sides in grammar.

    See also

    FiniteCombinatoryLogic.groundTypesOf(TreeGrammar) for a description of productivity.

  27. def removeEntriesWithArgument(grammar: TreeGrammar, arg: Type): TreeGrammar

    Permalink

    Removes all entries of grammar where arg occurs in a right hand side.

  28. val repository: Repository

    Permalink
  29. final def substituteArguments(grammar: TreeGrammar, oldType: Type, newType: Type): TreeGrammar

    Permalink

    Substitutes all right hand side occurences in grammar of oldType by newType.

  30. val subtypes: SubtypeEnvironment

    Permalink
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  33. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped