public class TypeHelper
extends java.lang.Object
Constructor and Description |
---|
TypeHelper() |
Modifier and Type | Method and Description |
---|---|
static java.util.Set<TypeJudgement> |
getDirectJudgements(java.util.Set<PConstraint> constraints,
IQueryMetaContext context)
Gets direct judgements reported by constraints.
|
static java.util.Map<PVariable,java.util.Set<TypeJudgement>> |
inferUnaryTypes(java.util.Set<PConstraint> constraints,
IQueryMetaContext context)
Infers unary type information for variables, based on the given constraints.
|
static java.util.Map<PVariable,java.util.Set<IInputKey>> |
inferUnaryTypesFor(java.lang.Iterable<PVariable> variables,
java.util.Map<PVariable,java.util.Set<TypeJudgement>> typeMap)
Collects the type constraints for the specified collection of variables.
|
static java.util.Map<PVariable,java.util.Set<IInputKey>> |
inferUnaryTypesFor(java.lang.Iterable<PVariable> variables,
java.util.Set<PConstraint> constraints,
IQueryMetaContext context)
Collects the type constraints for the specified collection of variables.
|
static java.util.Set<TypeJudgement> |
subsumeTypes(java.util.Set<TypeJudgement> subsumableTypes,
java.util.Set<TypeJudgement> subsumingTypes,
IQueryMetaContext context)
Calculates a remainder set of types from a larger set, that are not subsumed by a given set of subsuming types.
|
static java.util.Set<TypeJudgement> |
typeClosure(java.util.Set<TypeJudgement> typesToClose,
IQueryMetaContext context)
Calculates the closure of a set of type judgements, with respect to supertyping.
|
static java.util.Set<TypeJudgement> |
typeClosure(java.util.Set<TypeJudgement> preclosedBaseSet,
java.util.Set<TypeJudgement> delta,
IQueryMetaContext context)
Calculates the closure of a set of type judgements (with respect to supertyping), where the closure has been
calculated before for a given base set, but not for a separate delta set.
|
public static java.util.Map<PVariable,java.util.Set<IInputKey>> inferUnaryTypesFor(java.lang.Iterable<PVariable> variables, java.util.Set<PConstraint> constraints, IQueryMetaContext context)
variables
- the variables in questionconstraints
- the constraints in the pattern bodycontext
- the query meta contextpublic static java.util.Map<PVariable,java.util.Set<IInputKey>> inferUnaryTypesFor(java.lang.Iterable<PVariable> variables, java.util.Map<PVariable,java.util.Set<TypeJudgement>> typeMap)
TypeHelper.inferUnaryTypes
method. The purpose of this method is that the type map can be reused across
several calls to this method.variables
- the variables in questiontypeMap
- the type map of inference resultspublic static java.util.Map<PVariable,java.util.Set<TypeJudgement>> inferUnaryTypes(java.util.Set<PConstraint> constraints, IQueryMetaContext context)
constraints
- the set of constraints to extract type info frompublic static java.util.Set<TypeJudgement> getDirectJudgements(java.util.Set<PConstraint> constraints, IQueryMetaContext context)
public static java.util.Set<TypeJudgement> typeClosure(java.util.Set<TypeJudgement> typesToClose, IQueryMetaContext context)
public static java.util.Set<TypeJudgement> typeClosure(java.util.Set<TypeJudgement> preclosedBaseSet, java.util.Set<TypeJudgement> delta, IQueryMetaContext context)
Precondition: the set (typesToClose MINUS delta) is already closed w.r.t. supertyping.
public static java.util.Set<TypeJudgement> subsumeTypes(java.util.Set<TypeJudgement> subsumableTypes, java.util.Set<TypeJudgement> subsumingTypes, IQueryMetaContext context)
subsumableTypes
- a set of types from which some may be implied by the subsuming typessubsumingTypes
- a set of types that may imply some of the subsuming types