blackfennec.type_system.interpretation package
Submodules
blackfennec.type_system.interpretation.coverage module
- class blackfennec.type_system.interpretation.coverage.Coverage(subject_node_count, type_node_count)[source]
Bases:
Comparable
Coverage calculated on a Type
Only two comparison operators are implemented(eq,lt) the rest is included via inheritance/mixin.
- COVERED = Coverage(1, 1)
- NOT_COVERED = Coverage(1, 0)
blackfennec.type_system.interpretation.interpretation module
- class blackfennec.type_system.interpretation.interpretation.Interpretation(structure: Structure, specification: Specification, types)[source]
Bases:
object
Interpretation Class.
Is produced by the InterpretationService. Contains the relevant structure and can create a view. Dispatches navigation requests to navigation_service.
Navigation dispatch.
Navigation request is dispatched to navigation_service. The sender is set to self.
- Parameters
destination (Structure) – where to navigate to
Set navigation service to be used.
- Parameters
navigation_service (NavigationService) – The navigation service. Must not be None.
- property specification: Specification
- property structure: Structure
structure getter
- Returns
the structure that is represented by this interpretation.
- Return type
- property types
blackfennec.type_system.interpretation.interpretation_service module
- class blackfennec.type_system.interpretation.interpretation_service.InterpretationService(type_registry: TypeRegistry)[source]
Bases:
object
Interpretation Service Class.
Is produced during the selection process and is the Creator of Interpretations
- interpret(structure: Structure, specification: Specification) Interpretation [source]
Interpret the given structure following the a specification
- Parameters
structure (Structure) – The structure to be interpreted
specification (Specification, optional) – The specification to be followed. Defaults to default constructed Specification.
- Returns
- Represents what black fennec believes to be
the meaning of the structure.
- Return type
blackfennec.type_system.interpretation.offer module
- class blackfennec.type_system.interpretation.offer.Offer(subject: Structure, type: Type)[source]
Bases:
Comparable
Offer that is sent to Auctioneer by StructureViewBidder.
Only two comparison operators are implemented(eq,lt) the rest is included via inheritance/mixin.
- _specificity
Describes inheritance hierarchy level
- Type
Int
- _view_factory
View Factory for corresponding type
- _type
structure that type can handle
- property coverage: Coverage
coverage getter
- Returns
coverage property set by constructor
- Return type
float
- property specificity: int
specificity getter
- Returns
specificity property set by constructor
- Return type
int
blackfennec.type_system.interpretation.specification module
- class blackfennec.type_system.interpretation.specification.Specification(request_preview: bool = False)[source]
Bases:
object
Specification, specifies which interpretation is desired.
- This allows the manipulation of the interpreter such that the result
better suites the envisioned use case of the interpretation. For example, the callee of the interpretation service can request previews.
- property is_request_for_preview: bool
Property to query if this specification requests a preview.
- Returns
true iff a preview has been requested.
- Return type
bool