Documentation
¶
Overview ¶
Package semantics provides the derived semantic model that validation depth-C constraint checks rely on: a specialization/typing graph (with cycle detection), and — in later increments — inherited-member resolution, multiplicity extraction, and a bounded model-level expression evaluator.
All results are memoized in side tables keyed by *symbols.Symbol, consistent with the project rule that semantic information lives outside the immutable AST. A Model is built per resolution session over an existing symbol index and name resolver.
Index ¶
- Constants
- Variables
- func AcceptPayload(sym *symbols.Symbol) bool
- func ActionDeclaration(decl ast.Node) bool
- func AnnotationScope(sym *symbols.Symbol) *symbols.Scope
- func ChainCallee(e *ast.InvocationExpr) *ast.FeatureChainExpr
- func CompareInt(a, b Value) int
- func CompareIntReal(a Value, r float64) int
- func CompareMagnitudes(left, right Quantity) (int, error)
- func CompareQuantities(op ast.OperatorKind, left, right Quantity) (bool, error)
- func CompareRat(a, b Value) int
- func CompareReal(v Value, r float64) int
- func ConjugateDirection(d ast.FeatureDirection) ast.FeatureDirection
- func ConnectorEndMetaclassName(sym *symbols.Symbol) string
- func ConvertMagnitude(magnitude float64, from, to Scale) float64
- func CrossSubsettings(sym *symbols.Symbol) []*ast.Relationship
- func DeclaredNonunique(sym *symbols.Symbol) bool
- func DeclaredOrdered(sym *symbols.Symbol) bool
- func DeclaresEndFeature(sym *symbols.Symbol) bool
- func DeclaresFunction(decl ast.Node) bool
- func DeclaresRedefinition(sym *symbols.Symbol) bool
- func DeclaresVariant(sym *symbols.Symbol) bool
- func DeclaresVariation(sym *symbols.Symbol) bool
- func EnumerationDefinitionOwning(sym *symbols.Symbol) *symbols.Symbol
- func EnumerationOwning(sym *symbols.Symbol) *symbols.Symbol
- func EqualQuantities(op ast.OperatorKind, left, right Quantity) (bool, error)
- func ExtentTypeName(node ast.Node) *ast.QualifiedName
- func FormatConst(c Value) string
- func FormatReal(f float64) string
- func FormatScaleTerm(f float64) string
- func FunctionLike(sym *symbols.Symbol) bool
- func GeneralizationKind(k ast.RelationshipKind) bool
- func ImplicitSubsettingCandidates(u NestedUsage, owner NestedOwner) []string
- func ImpliedEndReference(end *ast.ConnectorEnd) ast.Node
- func IncludeUseCaseEcho(rels []*ast.Relationship, i int) bool
- func IntegerSizeExceeded(bits, maxBits int64) error
- func InvocationArgs(e *ast.InvocationExpr) []ast.Node
- func IsActorUsage(sym *symbols.Symbol) bool
- func IsAnything(sym *symbols.Symbol) bool
- func IsBehaviorParameter(sym *symbols.Symbol) bool
- func IsCollection(sym *symbols.Symbol) bool
- func IsDataKind(sym *symbols.Symbol) bool
- func IsDataValue(sym *symbols.Symbol) bool
- func IsElementType(sym *symbols.Symbol) bool
- func IsEnumeration(sym *symbols.Symbol) bool
- func IsExtentExpr(node ast.Node) bool
- func IsHexColor(s string) bool
- func IsLayoutFQN(fqn string) bool
- func IsMetadataType(sym *symbols.Symbol) bool
- func IsObjectiveUsage(sym *symbols.Symbol) bool
- func IsOutputParameter(sym *symbols.Symbol) bool
- func IsParameter(sym *symbols.Symbol) bool
- func IsReferenceUsage(sym *symbols.Symbol) bool
- func IsReflectiveEnumeration(sym *symbols.Symbol) bool
- func IsResultExpression(node ast.Node) bool
- func IsShapeFeature(sym *symbols.Symbol) bool
- func IsStateActivity(sym *symbols.Symbol) bool
- func IsSubjectUsage(sym *symbols.Symbol) bool
- func IsType(sym *symbols.Symbol) bool
- func IsValueType(sym *symbols.Symbol) bool
- func IsVariant(sym *symbols.Symbol) bool
- func IsVariation(sym *symbols.Symbol) bool
- func IsView(sym *symbols.Symbol) bool
- func IsViewpoint(sym *symbols.Symbol) bool
- func IsViewpointSatisfy(sat *symbols.Symbol) bool
- func LiteralValue(sym *symbols.Symbol) ast.Node
- func MultiplicityMetaclassName(sym *symbols.Symbol) string
- func NotYetMember(sym, declaring *symbols.Symbol) bool
- func OrderSatisfies(op ast.OperatorKind, order int) (res, ok bool)
- func ParseReal(text string) (float64, error)
- func PrimConforms(from, to PrimType) bool
- func RationalSizeExceeded(bits, maxBits int64) error
- func ReadOnlyViolation(text string, sym *symbols.Symbol, ro ReadOnly) string
- func RealArith(op ast.OperatorKind, a, b float64) (float64, bool)
- func ReflectiveDirection(sym *symbols.Symbol) (ast.FeatureDirection, bool)
- func RelationshipsOf(sym *symbols.Symbol) []*ast.Relationship
- func ResultParameterOwnerValid(sym *symbols.Symbol) bool
- func RunDecidedMetadataFeature(def, feature *symbols.Symbol) bool
- func ScalarFQN(prim PrimType) string
- func ScalarTypeName(kind ValueKind) string
- func SimpleSymbolName(sym *symbols.Symbol) string
- func StatesOwnCondition(sym *symbols.Symbol) bool
- func TimeEventType(t *ast.TimeEvent) string
- func UnboundedOrder(l, r Value) (order int, ok bool)
- func UnevaluableClassification(reason string, span source.Span) error
- func UniquenessViolation(text string, first, second int) string
- func UnitExprText(node ast.Node) string
- func UnitNameText(qn *ast.QualifiedName) string
- func UsageDeclIsComposite(usage *ast.Usage) bool
- func UsageIsComposite(sym *symbols.Symbol) bool
- func UsageIsReferential(sym *symbols.Symbol) bool
- func UsageMultiplicityOf(sym *symbols.Symbol) *ast.Multiplicity
- func VariantValue(sym *symbols.Symbol) ast.Node
- func VariationOwning(sym *symbols.Symbol) *symbols.Symbol
- type AboutIndex
- type ActionSuccession
- type ActionSuccessionEnd
- type AnnotationSite
- type Argument
- type ArgumentTyper
- type BehaviorParameter
- type Bound
- type Canvas
- type CollectionElement
- type ComposedFrame
- type ConcernCheck
- type ConcernConformance
- type ConcernEvaluator
- type Conformance
- type ConformanceViolation
- type ConformanceViolationKind
- type ConnectorEndAttachment
- type ConnectorEndPath
- type DepthProblem
- type Dimension
- type ElementMetadata
- type FilterError
- type FilterProblem
- type FilterProblemKind
- type FlowEndAttachment
- type HiddenCompartments
- type InvocationSelection
- type Layout
- type LayoutProblem
- type LayoutSite
- type MetadataAnnotation
- type MetadataBinding
- type Model
- func (m *Model) AboutAnnotatedElementViolations(scope *symbols.Scope, typeRef *ast.QualifiedName, about []*ast.QualifiedName) []string
- func (m *Model) AboutAnnotatedSymbols() []*symbols.Symbol
- func (m *Model) AboutAnnotationFactsOf(sym *symbols.Symbol) *symbols.AnnotationFacts
- func (m *Model) AboutBuilding() bool
- func (m *Model) ActionSuccessions(sym *symbols.Symbol) []ActionSuccession
- func (m *Model) ActorsOf(sym *symbols.Symbol) (owned, inherited []*symbols.Symbol)
- func (m *Model) AdmittedMeasurementRefs(typ *symbols.Symbol) []*symbols.Symbol
- func (m *Model) AllDeclaredSupertypes(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) AllRedefinedFeatures(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) AllSupertypes(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) AnnotatedElementViolation(annotated *symbols.Symbol, scope *symbols.Scope, typeRef *ast.QualifiedName) (string, bool)
- func (m *Model) AnnotatedElementsOf(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) AnnotatingRelationships(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) AnnotationFactsOf(sym *symbols.Symbol) []symbols.AnnotationFacts
- func (m *Model) AnnotationSitesOf(sym *symbols.Symbol) []AnnotationSite
- func (m *Model) BaseTypeFacts(def *symbols.Symbol) (base *symbols.Symbol, bound, unconditional bool)
- func (m *Model) BehaviorParametersOf(sym *symbols.Symbol) []BehaviorParameter
- func (m *Model) BehaviorSuccessionFeaturingType(owner *symbols.Symbol, paths [][]*symbols.Symbol, ends ...ast.Node) (*symbols.Symbol, bool)
- func (m *Model) BehaviorSuccessionOwner(owner *symbols.Symbol) bool
- func (m *Model) BinaryConnectorExcessEnds(sym *symbols.Symbol) ([]ast.Node, int)
- func (m *Model) BodyParameterElementTypes(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) BoundParameter(scope *symbols.Scope, callee *symbols.Symbol, name *ast.QualifiedName) (string, bool)
- func (m *Model) CallsCalc(sel *InvocationSelection) bool
- func (m *Model) CanvasOf(view *symbols.Symbol) (*LayoutSite, bool)
- func (m *Model) CastConformance(scope *symbols.Scope, e *ast.OperatorExpr) Conformance
- func (m *Model) ChainTargetPath(sym *symbols.Symbol, kind ast.RelationshipKind, target ast.Node) []*symbols.Symbol
- func (m *Model) ChainingFeatures(chain *symbols.Symbol) []*symbols.Symbol
- func (m *Model) CheckElementFilter(f symbols.ElementFilter) []FilterProblem
- func (m *Model) Classifies(target, typ *symbols.Symbol) bool
- func (m *Model) ClassifiesTypes(types []*symbols.Symbol, target *symbols.Symbol) TypeClassification
- func (m *Model) CoherentQuantity(q Quantity, declared *symbols.Symbol) (Quantity, error)
- func (m *Model) CoherentSpelling(q Quantity, declared *symbols.Symbol) Quantity
- func (m *Model) CoherentUnit(dim Dimension) (Unit, bool)
- func (m *Model) CoherentUnitFor(dim Dimension, declared *symbols.Symbol) (Unit, bool)
- func (m *Model) CollectionElements(scope *symbols.Scope, node ast.Node) ([]CollectionElement, bool)
- func (m *Model) CollectionHeldTypes(scope *symbols.Scope, node ast.Node) ([]*symbols.Symbol, bool)
- func (m *Model) CollectionResultTypes(scope *symbols.Scope, node ast.Node) ([]*symbols.Symbol, bool)
- func (m *Model) CollectionValues(scope *symbols.Scope, node ast.Node) (Range, bool)
- func (m *Model) CompileElementFilter(f symbols.ElementFilter) *symbols.FilterPredicate
- func (m *Model) ComposedFrameConforms(f ComposedFrame, want *symbols.Symbol) Conformance
- func (m *Model) ConcernEvaluationTarget(fc *symbols.Symbol) *symbols.Symbol
- func (m *Model) ConformanceViolations(sym *symbols.Symbol) []ConformanceViolation
- func (m *Model) Conforms(a, b *symbols.Symbol) bool
- func (m *Model) ConnectedPortsMismatch(connector, a, b *symbols.Symbol) (portA, portB *symbols.Symbol, mismatch bool)
- func (m *Model) ConnectorEndAttachments(sym *symbols.Symbol) []ConnectorEndAttachment
- func (m *Model) ConnectorEndCount(sym *symbols.Symbol) int
- func (m *Model) ConnectorEndFeaturePaths(sym *symbols.Symbol) [][]*symbols.Symbol
- func (m *Model) ConnectorEndMultiplicityIsOne(sym *symbols.Symbol, i int) bool
- func (m *Model) ConnectorEndPaths(sym *symbols.Symbol) []ConnectorEndPath
- func (m *Model) ConnectorObjectEnds(sym *symbols.Symbol) []ConnectorEndAttachment
- func (m *Model) ConstantFeatureValues(sym *symbols.Symbol, feature string) ([]symbols.FilterValue, bool, error)
- func (m *Model) ConstructibleFeatureFor(typ, feature *symbols.Symbol) *symbols.Symbol
- func (m *Model) ConstructibleFeatures(typ *symbols.Symbol) []*symbols.Symbol
- func (m *Model) Contributors(name string) ([]string, bool)
- func (m *Model) CoordinateFrameExprConformance(scope *symbols.Scope, e *ast.OperatorExpr, want *symbols.Symbol) (Conformance, bool)
- func (m *Model) CoordinateFrameExprType(scope *symbols.Scope, e *ast.OperatorExpr) *symbols.Symbol
- func (m *Model) CouldHold(sym *symbols.Symbol, prim PrimType) bool
- func (m *Model) CrossFeature(sym *symbols.Symbol) *symbols.Symbol
- func (m *Model) CrossedFeatureChain(sym *symbols.Symbol, rel *ast.Relationship) (base, cross *symbols.Symbol, ok bool)
- func (m *Model) DeclaredAnnotationFactsOf(sym *symbols.Symbol) []symbols.AnnotationFacts
- func (m *Model) DeclaredDirection(feature *symbols.Symbol) ast.FeatureDirection
- func (m *Model) DeclaredFeatureTypes(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) DeclaredFeatureValues(sym *symbols.Symbol, feature string) ([]symbols.FilterValue, bool, error)
- func (m *Model) DeclaredSuccessionEndName(sym *symbols.Symbol, i int) string
- func (m *Model) DeclaredSuccessions(scope *symbols.Scope, owner *symbols.Symbol, members []ast.Node) []ActionSuccession
- func (m *Model) DeclaredSupertypes(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) DeclaredTypes(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) DeclaredUnitProduct(sym *symbols.Symbol, name string) UnitProduct
- func (m *Model) DeclaresKerMLClassifier(sym *symbols.Symbol) bool
- func (m *Model) DeclaresResolvedType(sym *symbols.Symbol, prim PrimType) bool
- func (m *Model) DefaultMultiplicityOf(sym *symbols.Symbol) Range
- func (m *Model) DescribesReference(typ, member *symbols.Symbol) bool
- func (m *Model) DifferencingTypes(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) DimensionFactsOf(sym *symbols.Symbol, idx *symbols.Index) *symbols.DimensionFacts
- func (m *Model) DimensionOfExpr(scope *symbols.Scope, node ast.Node) (Dimension, bool)
- func (m *Model) DimensionOfFeature(sym *symbols.Symbol) (Dimension, bool)
- func (m *Model) DimensionOfType(sym *symbols.Symbol) (Dimension, bool)
- func (m *Model) DimensionOfUnit(unit UnitTerm) (Dimension, bool)
- func (m *Model) DirectMemberSources(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) DirectRedefinedFeatures(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) DirectSupertypes(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) DocumentationOf(sym *symbols.Symbol) []string
- func (m *Model) EffectiveDirection(owner, feature *symbols.Symbol) ast.FeatureDirection
- func (m *Model) EffectiveIsComposite(sym *symbols.Symbol) bool
- func (m *Model) EffectiveMultiplicityOf(sym *symbols.Symbol) Range
- func (m *Model) EffectiveNameOf(sym *symbols.Symbol) string
- func (m *Model) EffectiveParameterRange(sym *symbols.Symbol) Range
- func (m *Model) EffectiveParameterRangeAlong(chain []*symbols.Symbol) Range
- func (m *Model) EffectiveShortNameOf(sym *symbols.Symbol) string
- func (m *Model) ElementMetadataOf(sym *symbols.Symbol) []ElementMetadata
- func (m *Model) EndFeatures(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) EndMultiplicityIsOne(sym *symbols.Symbol) bool
- func (m *Model) EnumeratedValuesOf(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) Eval(n ast.Node) (Value, bool)
- func (m *Model) EvalClassification(scope *symbols.Scope, e *ast.OperatorExpr, elem *symbols.Symbol) (bool, error)
- func (m *Model) EvalElementFilter(f symbols.ElementFilter, cand *symbols.Symbol) (bool, error)
- func (m *Model) EvalIn(scope *symbols.Scope, n ast.Node) (Value, bool)
- func (m *Model) EvalQuantity(scope *symbols.Scope, n ast.Node) (Quantity, bool)
- func (m *Model) EvalWithin(n ast.Node, maxBits int64) (Value, bool)
- func (m *Model) Evaluates(sym *symbols.Symbol) bool
- func (m *Model) ExposedElements(view *symbols.Symbol) ([]*symbols.Symbol, error)
- func (m *Model) ExposedMembers(view *symbols.Symbol) ([]*symbols.Symbol, error)
- func (m *Model) ExprConformsTo(scope *symbols.Scope, node ast.Node, want *symbols.Symbol) Conformance
- func (m *Model) ExprConformsToLibrary(scope *symbols.Scope, node ast.Node, fqn string) Conformance
- func (m *Model) ExprResultType(scope *symbols.Scope, node ast.Node) *symbols.Symbol
- func (m *Model) ExprResultTypes(scope *symbols.Scope, node ast.Node) []*symbols.Symbol
- func (m *Model) ExpressionArguments(expr *symbols.Symbol) []*symbols.Symbol
- func (m *Model) ExpressionChainFeature(expr *symbols.Symbol) *symbols.Symbol
- func (m *Model) ExpressionParameters(expr *symbols.Symbol) []*symbols.Symbol
- func (m *Model) ExpressionResult(expr *symbols.Symbol) *symbols.Symbol
- func (m *Model) ExtentOperand(scope *symbols.Scope, node ast.Node) (*symbols.Symbol, bool)
- func (m *Model) ExtentType(scope *symbols.Scope, node ast.Node) *symbols.Symbol
- func (m *Model) FeatureBaseFQN(sym *symbols.Symbol) (string, bool)
- func (m *Model) FeatureIsConstant(sym *symbols.Symbol) bool
- func (m *Model) FeatureIsVariable(sym *symbols.Symbol) bool
- func (m *Model) FeatureReadOnly(sym *symbols.Symbol) ReadOnly
- func (m *Model) FeatureTypeSet(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) FeatureTypeSetWithImplied(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) FeatureTypes(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) FeaturingTypes(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) FixedDimensions(sym *symbols.Symbol) ([]int64, bool)
- func (m *Model) FixesMeasurementReference(sym *symbols.Symbol) bool
- func (m *Model) FlowEndAttachments(sym *symbols.Symbol) []FlowEndAttachment
- func (m *Model) FrameFeature(sym *symbols.Symbol) bool
- func (m *Model) FrameRoot(typ, sym *symbols.Symbol) bool
- func (m *Model) FramedConcernTarget(fc *symbols.Symbol) *symbols.Symbol
- func (m *Model) FramedConcernsOf(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) FramedQuantityConformance(scope *symbols.Scope, n *ast.IndexExpr, want *symbols.Symbol) (Conformance, bool)
- func (m *Model) FunctionTypes(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) GeneralizationTargetOf(sym *symbols.Symbol, rel *ast.Relationship) *symbols.Symbol
- func (m *Model) GoverningMultiplicityOf(sym *symbols.Symbol) Range
- func (m *Model) GoverningMultiplicitySource(sym *symbols.Symbol) (*symbols.Symbol, bool)
- func (m *Model) HasArgumentTyper() bool
- func (m *Model) HasMember(sym, member *symbols.Symbol) bool
- func (m *Model) HasSpecializationCycle(sym *symbols.Symbol) bool
- func (m *Model) HeldByValue(sym *symbols.Symbol) bool
- func (m *Model) HoldsSet(feat, typeSym *symbols.Symbol) bool
- func (m *Model) ImplicitBases(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) ImplicitEndRedefinitions(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) ImplicitGenerals(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) ImplicitMultiplicityApplies(sym *symbols.Symbol) bool
- func (m *Model) ImplicitParameterRedefinitions(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) ImplicitRelationships(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) ImplicitRoleRedefinitions(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) ImplicitSubsettings(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) ImplicitlyDeclaresOne(sym *symbols.Symbol) bool
- func (m *Model) ImpliedBaseFQNs(node ast.Node, kind source.Kind) []string
- func (m *Model) ImpliedBaseFQNsForMetaclass(metaclass string, kind source.Kind) []string
- func (m *Model) ImpliedBaseFeatures(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) ImpliedEndName(kind ast.UsageKind, i int) string
- func (m *Model) InheritanceMasked(sym, candidate *symbols.Symbol) bool
- func (m *Model) InheritanceMaskedRedefining(sym, candidate *symbols.Symbol) bool
- func (m *Model) InputParametersOf(behavior *symbols.Symbol) []*symbols.Symbol
- func (m *Model) InstanceOf(cand, metaclass *symbols.Symbol) bool
- func (m *Model) InterfaceEndPortMismatch(sym *symbols.Symbol) (a, b *symbols.Symbol, mismatch bool)
- func (m *Model) IntersectingTypes(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) IsAngularMeasureUnit(sym *symbols.Symbol) bool
- func (m *Model) IsAssociationOrConnector(sym *symbols.Symbol) bool
- func (m *Model) IsBehaviorType(sym *symbols.Symbol) bool
- func (m *Model) IsBinaryConnector(sym *symbols.Symbol) bool
- func (m *Model) IsConjugated(sym *symbols.Symbol) bool
- func (m *Model) IsConnectorObjectUsage(sym *symbols.Symbol) bool
- func (m *Model) IsConnectorUsage(sym *symbols.Symbol) bool
- func (m *Model) IsCoordinateFrame(typ *symbols.Symbol) bool
- func (m *Model) IsDataType(sym *symbols.Symbol) bool
- func (m *Model) IsDescribedReference(typ *symbols.Symbol) bool
- func (m *Model) IsFlowPayload(sym *symbols.Symbol) bool
- func (m *Model) IsIdentityUnit(sym *symbols.Symbol) bool
- func (m *Model) IsKerMLFeature(sym *symbols.Symbol) bool
- func (m *Model) IsLayoutAnnotation(sym *symbols.Symbol) bool
- func (m *Model) IsMeasurementScale(sym *symbols.Symbol) bool
- func (m *Model) IsMeasurementUnit(sym *symbols.Symbol) bool
- func (m *Model) IsMigrationAnnotation(sym *symbols.Symbol) bool
- func (m *Model) IsOptionalParameter(usage *ast.Usage) bool
- func (m *Model) IsSelf(sym *symbols.Symbol) bool
- func (m *Model) IsSubrequirement(sym *symbols.Symbol) bool
- func (m *Model) IsUnique(sym *symbols.Symbol) bool
- func (m *Model) IsVariationFeature(sym *symbols.Symbol) bool
- func (m *Model) IsVectorReference(sym *symbols.Symbol) bool
- func (m *Model) KindBaseFQNs(sym *symbols.Symbol, isKerML bool) []string
- func (m *Model) LayoutOf(view, elem *symbols.Symbol) (*LayoutSite, bool)
- func (m *Model) LayoutSiteDeclaredBy(sym *symbols.Symbol) (*LayoutSite, *symbols.Symbol)
- func (m *Model) LayoutSitesOf(sym *symbols.Symbol) []*LayoutSite
- func (m *Model) LiteralConforms(sym, expected *symbols.Symbol) bool
- func (m *Model) LiteralsOf(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) LookupBinding(scope *symbols.Scope, typ *symbols.Symbol, name *ast.QualifiedName) (*symbols.Symbol, bool)
- func (m *Model) LookupContributedMember(sym *symbols.Symbol, name string) (*symbols.Symbol, bool)
- func (m *Model) LookupContributedMembers(sym *symbols.Symbol, name string) []*symbols.Symbol
- func (m *Model) LookupMember(sym *symbols.Symbol, name string) (*symbols.Symbol, bool)
- func (m *Model) MaskingRedefinedFeatures(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) MayShareValues(target, typ *symbols.Symbol) bool
- func (m *Model) MeasurementRefConforms(typ *symbols.Symbol, unit UnitTerm, want *symbols.Symbol) Conformance
- func (m *Model) MeasurementRefExprConformance(scope *symbols.Scope, e *ast.OperatorExpr, want *symbols.Symbol) (Conformance, bool)
- func (m *Model) MeasurementRefExprType(scope *symbols.Scope, e *ast.OperatorExpr) *symbols.Symbol
- func (m *Model) MeasurementRefFeatureType(sym *symbols.Symbol) *symbols.Symbol
- func (m *Model) MeasurementScaleOf(term UnitTerm) (*symbols.Symbol, bool)
- func (m *Model) MeasurementUnitOf(sym *symbols.Symbol) (*symbols.Symbol, bool)
- func (m *Model) MemberLayoutOf(view, owner *symbols.Symbol, name string) (*LayoutSite, bool)
- func (m *Model) MemberLayoutOwner(site *LayoutSite, member *symbols.Symbol) *symbols.Symbol
- func (m *Model) MemberNotesOf(view, owner *symbols.Symbol, name string) []*LayoutSite
- func (m *Model) MemberSources(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) MemberSourcesStable(sym *symbols.Symbol) bool
- func (m *Model) MemberStyleOf(view, owner *symbols.Symbol, name string) (*LayoutSite, bool)
- func (m *Model) MembersOf(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) MembersOfDeclaring(sym, declaring *symbols.Symbol) []*symbols.Symbol
- func (m *Model) MembersOfIncludingRedefined(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) MemoSize() int
- func (m *Model) Metaclass(name string) *symbols.Symbol
- func (m *Model) MetaclassConforms(cand *symbols.Symbol, typeFQN string) bool
- func (m *Model) MetaclassOf(sym *symbols.Symbol) *symbols.Symbol
- func (m *Model) MetadataBodyInevaluableValues(scope *symbols.Scope, prefix *ast.PrefixMetadata, runDecided bool) []ast.Node
- func (m *Model) MetadataBodyInevaluableValuesOf(def *symbols.Symbol, scope *symbols.Scope, body []ast.Node, runDecided bool) []ast.Node
- func (m *Model) MetadataBodyTargetOf(owner *symbols.Symbol, scope *symbols.Scope, usage *ast.Usage) *symbols.Symbol
- func (m *Model) MetadataBodyViolations(scope *symbols.Scope, prefix *ast.PrefixMetadata) []ast.Node
- func (m *Model) MetadataBodyViolationsOf(def *symbols.Symbol, scope *symbols.Scope, body []ast.Node) []ast.Node
- func (m *Model) MetadataDefaultOf(sym *symbols.Symbol) ([]symbols.FilterValue, bool)
- func (m *Model) ModelLevelEvaluable(scope *symbols.Scope, expr ast.Node) bool
- func (m *Model) MultiplicityFactsOf(sym *symbols.Symbol) *symbols.MultiplicityFacts
- func (m *Model) MultiplicityOf(sym *symbols.Symbol) (Range, bool)
- func (m *Model) NameSynthesized(sym *symbols.Symbol) bool
- func (m *Model) NamesFeaturingReference(sym *symbols.Symbol) bool
- func (m *Model) NamingFeature(sym *symbols.Symbol) *symbols.Symbol
- func (m *Model) NamingFeatureOf(sym *symbols.Symbol) *symbols.Symbol
- func (m *Model) NamingRedefiner(sym, masked *symbols.Symbol) *symbols.Symbol
- func (m *Model) NamingRedefinerRedefining(sym, masked *symbols.Symbol) *symbols.Symbol
- func (m *Model) NestedRedefinitionsOf(sym *symbols.Symbol) []NestedRedefinition
- func (m *Model) NestedViews(view *symbols.Symbol) ([]*symbols.Symbol, error)
- func (m *Model) NotesOf(view, elem *symbols.Symbol) []*LayoutSite
- func (m *Model) ObjectivesOf(sym *symbols.Symbol) (owned, inherited []*symbols.Symbol)
- func (m *Model) OperatorFunction(op ast.OperatorKind) *symbols.Symbol
- func (m *Model) OperatorFunctionNamed(name string) *symbols.Symbol
- func (m *Model) OperatorInputAt(op ast.OperatorKind, index int) *symbols.Symbol
- func (m *Model) OperatorInputNamedAt(name string, index int) *symbols.Symbol
- func (m *Model) OptionalParameter(sym *symbols.Symbol) bool
- func (m *Model) OwnFeatureValues(sym *symbols.Symbol) ([]symbols.FilterValue, bool, error)
- func (m *Model) OwnNamingRedefiner(sym, masked *symbols.Symbol) *symbols.Symbol
- func (m *Model) OwnRedefinitionMasked(sym, candidate *symbols.Symbol) bool
- func (m *Model) OwnedAnnotations(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) OwnedConnectorEnds(sym *symbols.Symbol) ([]*symbols.Symbol, bool)
- func (m *Model) OwnedCrossFeature(sym *symbols.Symbol) *symbols.Symbol
- func (m *Model) OwnedImports(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) OwnedMemberships(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) OwnedRelationships(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) OwnerAnnotatedElementViolation(scope *symbols.Scope, typeRef *ast.QualifiedName) (string, bool)
- func (m *Model) OwningMembership(sym *symbols.Symbol) *symbols.Symbol
- func (m *Model) OwningRelationship(sym *symbols.Symbol) *symbols.Symbol
- func (m *Model) ParameterDefault(sym *symbols.Symbol) (ast.Node, *symbols.Scope)
- func (m *Model) ParameterRedefinitionChain(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) Performable(p Performs, sym *symbols.Symbol) bool
- func (m *Model) PicturesOf(view *symbols.Symbol) []*LayoutSite
- func (m *Model) PortFeatures(sym *symbols.Symbol) []PortFeature
- func (m *Model) PortsConform(a, b *symbols.Symbol) bool
- func (m *Model) PrimTypeOf(sym *symbols.Symbol) PrimType
- func (m *Model) QuantityConforms(unit UnitTerm, want *symbols.Symbol) Conformance
- func (m *Model) RangeIn(scope *symbols.Scope, mult *ast.Multiplicity) (Range, bool)
- func (m *Model) RangeOf(mult *ast.Multiplicity) (Range, bool)
- func (m *Model) ReadsValuelessFeature(scope *symbols.Scope, n ast.Node) bool
- func (m *Model) RecordedRelationshipTargets(sym *symbols.Symbol, kind ast.RelationshipKind) []*symbols.Symbol
- func (m *Model) RedefinedFeatures(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) ReferencedFeature(sym *symbols.Symbol) *symbols.Symbol
- func (m *Model) ReferentialParameter(sym *symbols.Symbol) bool
- func (m *Model) ReflectiveElements(sym *symbols.Symbol, feature string) ([]*symbols.Symbol, bool)
- func (m *Model) ReflectiveFeatureValue(sym *symbols.Symbol, feature string) (symbols.FilterValue, bool)
- func (m *Model) ReflectiveFeatureValues(sym *symbols.Symbol, feature string) ([]symbols.FilterValue, bool)
- func (m *Model) Regather(docs map[string]bool) []string
- func (m *Model) RelatedFeatureCount(sym *symbols.Symbol) int
- func (m *Model) RelationshipEdgesOf(sym *symbols.Symbol, kind RelationshipKind) []RelationshipEdge
- func (m *Model) RelationshipTarget(sym *symbols.Symbol, rel *ast.Relationship) *symbols.Symbol
- func (m *Model) RenderingTarget(member *symbols.Symbol) (*symbols.Symbol, string)
- func (m *Model) RestatesFeaturingReference(typ, feature *symbols.Symbol) bool
- func (m *Model) ResultExpressionConflict(sym *symbols.Symbol) *ResultExpressionConflict
- func (m *Model) ResultExpressionMemberships(sym *symbols.Symbol) []ResultExpression
- func (m *Model) ResultExpressionsOf(sym *symbols.Symbol) []ResultExpression
- func (m *Model) ResultParameterOf(sym *symbols.Symbol) *symbols.Symbol
- func (m *Model) RouteOf(view, elem *symbols.Symbol) (*LayoutSite, bool)
- func (m *Model) SatisfiesElementFilter(f symbols.ElementFilter, cand *symbols.Symbol) bool
- func (m *Model) SatisfyMembersOf(view *symbols.Symbol) []*symbols.Symbol
- func (m *Model) SatisfyTarget(sat *symbols.Symbol) (*symbols.Symbol, string)
- func (m *Model) ScalarLatticeElement(sym *symbols.Symbol) (PrimType, bool)
- func (m *Model) ScalarSymbol(prim PrimType) *symbols.Symbol
- func (m *Model) SelectAmongArguments(scope *symbols.Scope, named []*symbols.Symbol, args []Argument, ...) *InvocationSelection
- func (m *Model) SelectCall(scope *symbols.Scope, e *ast.InvocationExpr, performs Performs) *InvocationSelection
- func (m *Model) SelectCallAmong(scope *symbols.Scope, e *ast.InvocationExpr, named []*symbols.Symbol, ...) *InvocationSelection
- func (m *Model) SelectInvocation(scope *symbols.Scope, e *ast.InvocationExpr, args []Argument, ...) *InvocationSelection
- func (m *Model) SelectsVariantOf(sym, variant *symbols.Symbol) bool
- func (m *Model) SemanticMetadataBases(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) SentScalarTypes(scope *symbols.Scope, node ast.Node) []string
- func (m *Model) SetArgumentTyper(t ArgumentTyper)
- func (m *Model) SetSourceFile(locate source.Locate)
- func (m *Model) SetSourceText(text source.Lookup)
- func (m *Model) ShapeFeatures(typ *symbols.Symbol) []ShapeFeature
- func (m *Model) ShareAbout(shared *AboutIndex)
- func (m *Model) SignatureParametersOf(callee *symbols.Symbol) []SignatureParameter
- func (m *Model) SourceFileOf(origin symbols.Origin) string
- func (m *Model) SourceText() source.Lookup
- func (m *Model) SpecializationRouteOf(view, elem, general *symbols.Symbol) (*LayoutSite, bool)
- func (m *Model) StandIn(sym *symbols.Symbol) bool
- func (m *Model) StatedMultiplicityOf(sym *symbols.Symbol) (Range, bool)
- func (m *Model) StyleOf(view, elem *symbols.Symbol) (*LayoutSite, bool)
- func (m *Model) SubjectParameterOf(sym *symbols.Symbol) *symbols.Symbol
- func (m *Model) SubjectsOf(sym *symbols.Symbol) (owned, inherited []*symbols.Symbol)
- func (m *Model) SubsettedMultiplicity(sym *symbols.Symbol) *symbols.Symbol
- func (m *Model) SuccessionEndPath(scope *symbols.Scope, owner *symbols.Symbol, target ast.Node) []*symbols.Symbol
- func (m *Model) SupertypesProvisional(sym *symbols.Symbol) bool
- func (m *Model) SymbolDeclaring(scope *symbols.Scope, decl ast.Node) (*symbols.Symbol, bool)
- func (m *Model) TimeEventConforms(scope *symbols.Scope, t *ast.TimeEvent) Conformance
- func (m *Model) UnaddressableBoundIn(scope *symbols.Scope, mult *ast.Multiplicity) (Value, bool)
- func (m *Model) UnioningTypes(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) UnitOfExpr(scope *symbols.Scope, node ast.Node) (Unit, error)
- func (m *Model) UnitOperandConformance(scope *symbols.Scope, unit ast.Node) Conformance
- func (m *Model) UnitProductOfExpr(scope *symbols.Scope, node ast.Node) (UnitProduct, error)
- func (m *Model) UnitProductOfExprBy(node ast.Node, lookup UnitLookup) (UnitProduct, error)
- func (m *Model) UnitTermOf(sym *symbols.Symbol) (UnitTerm, error)
- func (m *Model) UnitTermOfExpr(scope *symbols.Scope, node ast.Node) (UnitTerm, error)
- func (m *Model) UnmatchedConnectorEnds(sym *symbols.Symbol) (*symbols.Symbol, []*symbols.Symbol)
- func (m *Model) UsageIsComposite(sym *symbols.Symbol) bool
- func (m *Model) UsageIsReferential(sym *symbols.Symbol) bool
- func (m *Model) UsageMayTimeVary(sym *symbols.Symbol) bool
- func (m *Model) UsageMayTimeVaryForOwningType(sym, owner *symbols.Symbol) bool
- func (m *Model) UsageMayTimeVaryUnder(owner *symbols.Symbol) bool
- func (m *Model) UsageMayTimeVaryUnderKind(kind ast.UsageKind) bool
- func (m *Model) UsageMayTimeVaryUnderLibraryFeature(fqn string) bool
- func (m *Model) ValueExpression(sym *symbols.Symbol) *symbols.Symbol
- func (m *Model) ValueHeld(sym *symbols.Symbol) bool
- func (m *Model) ValuesHeldBy(scope *symbols.Scope, node ast.Node) (Range, bool)
- func (m *Model) VariantOf(sym *symbols.Symbol, name string) (*symbols.Symbol, bool)
- func (m *Model) VariantsOf(sym *symbols.Symbol) []*symbols.Symbol
- func (m *Model) VariationPointOwning(sym *symbols.Symbol) *symbols.Symbol
- func (m *Model) ViewConformance(view *symbols.Symbol, eval ConcernEvaluator) (*ViewConformance, error)
- func (m *Model) ViewDepth(view *symbols.Symbol) int
- func (m *Model) ViewDepthProblems(view *symbols.Symbol) []DepthProblem
- func (m *Model) ViewExposureConditions(view *symbols.Symbol) []symbols.ElementFilter
- func (m *Model) ViewRenderings(view *symbols.Symbol) ([]ViewRendering, error)
- type NestedOwner
- type NestedRedefinition
- type NestedUsage
- type Note
- type Packed
- type PartyBinding
- type Performs
- type Picture
- type PortFeature
- type PrimType
- type Quantity
- func AddQuantities(op ast.OperatorKind, left, right Quantity, maxBits int64) (Quantity, error)
- func ComposedQuantity(num Value, product UnitProduct, term UnitTerm) (Quantity, error)
- func ConvertQuantity(q Quantity, unit Unit) (Quantity, error)
- func InUnit(num Value, unit Unit) (Quantity, error)
- func NegateQuantity(q Quantity) (Quantity, error)
- func PowQuantity(base Quantity, exponent Value, maxBits int64) (Quantity, error)
- func QuantityBinary(op ast.OperatorKind, left, right Quantity) (Quantity, error)
- func QuantityOf(v symbols.FilterValue) (*Quantity, bool)
- func QuantityUnary(op ast.OperatorKind, q Quantity) (Quantity, error)
- func ScaleQuantities(op ast.OperatorKind, left, right Quantity, maxBits int64) (Quantity, error)
- type Range
- func (r Range) AdmitsMore(count int64) bool
- func (r Range) AllowsNone() bool
- func (r Range) AtMostOne() bool
- func (r Range) CountViolation(count int64) string
- func (r Range) Covering(o Range) Range
- func (r Range) Exactly() (int64, bool)
- func (r Range) HasBounds(lower, upper int64) (holds bool, ok bool)
- func (r Range) HeldViolation(held Range) string
- func (r Range) Intersect(o Range) Range
- func (r Range) LowerLeUpper() (valid bool, ok bool)
- func (r Range) MayAdmitMore(count int64) bool
- func (r Range) Plus(o Range) Range
- func (r Range) Text() string
- func (r Range) Times(o Range) Range
- type ReadOnly
- type ReadOnlyKind
- type RelationshipEdge
- type RelationshipKind
- type ResultExpression
- type ResultExpressionConflict
- type Route
- type SatisfyEnds
- type Scale
- type ShadowedUnitError
- type ShapeFeature
- type SignatureParameter
- type Style
- type TypeClassification
- type Unit
- type UnitFactor
- type UnitLookup
- type UnitPower
- type UnitProduct
- func (p UnitProduct) AllPowers() []UnitPower
- func (p UnitProduct) Clone() UnitProduct
- func (p UnitProduct) DividedBy(q UnitProduct) UnitProduct
- func (p UnitProduct) Equal(q UnitProduct) bool
- func (p UnitProduct) IsEmpty() bool
- func (p UnitProduct) NamesDimensionOne() bool
- func (p UnitProduct) Pow(exp float64) UnitProduct
- func (p UnitProduct) Root(n float64) (UnitProduct, bool)
- func (p UnitProduct) ShortSpelling() UnitProduct
- func (p UnitProduct) String() string
- func (p UnitProduct) Times(q UnitProduct) UnitProduct
- type UnitTerm
- func (t UnitTerm) BaseProduct() UnitProduct
- func (t UnitTerm) Clone() UnitTerm
- func (t UnitTerm) Commensurable(other UnitTerm) bool
- func (t UnitTerm) DimensionKey() string
- func (t UnitTerm) Dimensionless() bool
- func (t UnitTerm) DividedBy(other UnitTerm) UnitTerm
- func (t UnitTerm) Normalized() UnitTerm
- func (t UnitTerm) Pow(exp float64) UnitTerm
- func (t UnitTerm) Same(other UnitTerm) bool
- func (t UnitTerm) String() string
- func (t UnitTerm) Times(other UnitTerm) UnitTerm
- type Value
- func BigIntValue(b *big.Int) Value
- func CanonicalRational(numerator, denominator string) (Value, bool)
- func EvalBinary(op ast.OperatorKind, l, r Value) (Value, bool)
- func EvalConst(n ast.Node) (Value, bool)
- func EvalUnary(op ast.OperatorKind, v Value) (Value, bool)
- func ExactConversion(magnitude Value, from, to Scale, maxBits int64) (Value, bool, error)
- func FilterInteger(v symbols.FilterValue) Value
- func FilterNumber(v symbols.FilterValue) (Value, bool)
- func FracValue(num, den int64) (Value, bool)
- func IntAbs(v Value) Value
- func IntArith(op ast.OperatorKind, a, b Value, maxBits int64) (Value, error)
- func IntDivTrunc(a, b Value) (Value, bool)
- func IntNeg(v Value) Value
- func IntPow(a, n Value, maxBits int64) (Value, error)
- func IntRem(a, b Value) (Value, bool)
- func IntValue(i int64) Value
- func IntegerOfReal(r float64) (Value, bool)
- func LowestTermsRational(numerator, denominator string) (Value, bool)
- func MagnitudeArith(op ast.OperatorKind, left, right Value, maxBits int64) (Value, error)
- func ParseInteger(text string) (Value, bool)
- func ParseRational(text string, maxBits int64) (Value, error)
- func ParseRationalText(text string, maxBits int64) (Value, error)
- func Pow(l, r Value, maxBits int64) (Value, error)
- func RatAbs(v Value) Value
- func RatArith(op ast.OperatorKind, a, b Value, maxBits int64) (Value, error)
- func RatFloor(v Value) Value
- func RatNeg(v Value) Value
- func RatOf(v Value) Value
- func RatPow(base, n Value, maxBits int64) (Value, error)
- func RatRound(v Value) Value
- func RatTrunc(v Value) Value
- func RatValue(r *big.Rat) Value
- func RationalOfReal(r float64) (Value, bool)
- func RealOf(v Value) (Value, error)
- func RealResult(x float64) (Value, error)
- func (v Value) AsReal() float64
- func (v Value) BigInt() *big.Int
- func (v Value) BigIntView() *big.Int
- func (v Value) BinaryExact() (float64, bool)
- func (v Value) Equal(w Value) bool
- func (v Value) FormatInt() string
- func (v Value) FormatRational() string
- func (v Value) Int64() (int64, bool)
- func (v Value) IntBitLen() int64
- func (v Value) IntSign() int
- func (v Value) IsBigInt() bool
- func (v Value) IsExact() bool
- func (v Value) IsNumeric() bool
- func (v Value) IsRational() bool
- func (v Value) IsUnbounded() bool
- func (v Value) Pack() Packed
- func (v Value) Rat() *big.Rat
- func (v Value) RatBitLen() int64
- func (v Value) RatDenom() Value
- func (v Value) RatIsWhole() bool
- func (v Value) RatNumer() Value
- func (v Value) RatSign() int
- func (v Value) WholeNumber() (int64, bool)
- type ValueKind
- type Verdict
- type ViewConformance
- type ViewRendering
- type ViewpointConformance
- type ViolationReporter
- type Waypoint
Constants ¶
const ( LayoutFQN = "DiagramLayout::Layout" RouteFQN = "DiagramLayout::Route" CanvasFQN = "DiagramLayout::Canvas" StyleFQN = "DiagramLayout::Style" NoteFQN = "DiagramLayout::Note" PictureFQN = "DiagramLayout::Picture" )
Qualified names of the DiagramLayout metadata definitions in the bundled library.
const ( ProbabilityFQN = "Stochastic::Probability" ProbabilityFeature = "p" )
ProbabilityFQN names the OpenSysML metadata type by which a model weights the successions out of a decision node; ProbabilityFeature is the weight it binds.
const ( FQNDurationValue = "ISQBase::DurationValue" FQNTimeInstantValue = "Time::TimeInstantValue" FQNBoolean = "ScalarValues::Boolean" )
Library types an expression's value is classified against, and the scalar types a literal is of.
const AppliedStereotypeFQN = "MigrationMetadata::AppliedStereotype"
AppliedStereotypeFQN is the qualified name of the metadata definition in the bundled library that records a source stereotype a migrated element's form does not carry.
const BinaryConnectorBaseFQN = binaryConnectorBaseFQN
BinaryConnectorBaseFQN is the library base every binary association and connector conforms to.
const DefaultMaxIntegerBits int64 = 1 << 20
DefaultMaxIntegerBits bounds the magnitude of one Integer an evaluation computes, in bits: 2^20 bits is 315,653 decimal digits and 128KiB of memory. The mathematical Integers have no bound; this one stops an exponentiation or a product from exhausting memory or time instead of reporting.
const DepthAttribute = "depth"
DepthAttribute is the name of the attribute that states a view's depth.
const MinMaxIntegerBits int64 = 64
MinMaxIntegerBits is the least Integer size budget: every int64 fits within it, so machine-word arithmetic never consults the budget.
const StandInFQN = "MigrationMetadata::StandIn"
StandInFQN is the qualified name of the metadata definition in the bundled library that marks a member a migration made up which stands for no element of its source.
const StateActivityFQN = StateActivityPackage + "::isActive"
StateActivityFQN names the extension feature reading a state usage's activity.
const StateActivityPackage = "StateActivity"
StateActivityPackage is the OpenSysML extension library declaring isActive, which no standard library file (States.sysml, StatePerformances.kerml) does.
const StringTypeName = "String"
StringTypeName names the scalar type of a string value, as a sent signal's type.
const SynthesizedNameFQN = "MigrationMetadata::SynthesizedName"
SynthesizedNameFQN is the qualified name of the metadata definition in the bundled library that marks a name a migration made up for an element its source left anonymous.
Variables ¶
var ( // ErrArithmeticDomain reports operands an operation is not defined for, such // as a negative base raised to a fractional exponent. ErrArithmeticDomain = errors.New("arithmetic domain error") // ErrArithmeticOverflow reports a result outside the range of the kind it // would have: a non-finite Real. ErrArithmeticOverflow = errors.New("arithmetic overflow") // ErrRealNotation reports text that is not decimal Real notation, such as // NaN, an infinity or a hexadecimal float. ErrRealNotation = errors.New("not decimal Real notation") )
var ( // ErrFilterUnevaluable reports a filter condition outside the subset of // predicates the evaluator implements, or one naming something that does // not resolve. Such a condition selects nothing and rejects nothing: it is // reported, and the candidate is kept, so that an unevaluable filter never // silently hides model content. ErrFilterUnevaluable = errors.New("filter condition cannot be evaluated") // ErrFilterNotBoolean reports a filter condition that evaluates to // something other than a boolean, which cannot select elements. ErrFilterNotBoolean = errors.New("filter condition is not boolean-valued") )
var ( // ErrDivisionByZero reports a division or remainder with a zero divisor. ErrDivisionByZero = errors.New("division by zero") // ErrQuantityOperand reports an operator applied to operands it is not // defined on, such as a quantity exponent or `not` of a quantity. ErrQuantityOperand = errors.New("operator is not defined on these operands") )
var ( // ErrNotAUnit reports a feature used as a measurement reference that is not // one: it does not conform to MeasurementReferences::MeasurementUnit. ErrNotAUnit = errors.New("not a measurement unit") // ErrUnitExpr reports an expression in unit position that is not a product // of powers of measurement units. ErrUnitExpr = errors.New("not a measurement unit expression") // ErrUnitConversion reports a unit whose conversion to its reference unit is // declared but cannot be read as a number, so no factor can be derived. ErrUnitConversion = errors.New("undetermined unit conversion") // ErrUnitCycle reports a unit that is defined, directly or through other // units, in terms of itself. ErrUnitCycle = errors.New("cyclic unit definition") )
var ErrIncommensurableUnits = errors.New("incommensurable units")
ErrIncommensurableUnits reports an operation over quantities whose units measure different things, or whose conversion the library does not derive. It is never answered by comparing magnitudes.
var ErrIntegerSizeLimit = errors.New("integer size limit exceeded")
ErrIntegerSizeLimit reports an Integer result whose magnitude would need more bits than the evaluation's Integer size budget allows.
var ErrIntegerUnaddressable = errors.New("integer beyond the addressable range")
ErrIntegerUnaddressable is returned when an Integer serves as a position, count or bound of something held, and is beyond the 64-bit range any of those can take: Integers are unbounded, what they address is not.
var ErrNotAView = errors.New("not a view")
ErrNotAView is returned when the exposed set is asked of an element that is no view; only a view usage or a view definition exposes elements.
var ErrNotAViewpoint = errors.New("not a viewpoint")
ErrNotAViewpoint reports a `satisfy` in a view body whose target is no viewpoint, so it asserts no viewpoint conformance.
var ErrRationalSizeLimit = errors.New("rational size limit exceeded")
ErrRationalSizeLimit reports a Rational result whose numerator and denominator together would need more bits than the evaluation's numeric size budget allows. A Rational is never rounded to fit.
var LayoutFQNs = []string{LayoutFQN, RouteFQN, CanvasFQN, StyleFQN, NoteFQN, PictureFQN}
LayoutFQNs lists every DiagramLayout metadata definition.
Functions ¶
func AcceptPayload ¶ added in v0.9.2
AcceptPayload reports whether sym is the payload an accept node binds, which the nodes of one action body share (resolve.acceptPayloadsIn), so a sibling node's body reaches it under its bare name.
func ActionDeclaration ¶
ActionDeclaration reports whether decl declares an ActionDefinition or an ActionUsage (SysML v2 8.3.17), including the state, calculation, case, transition, and control-node kinds that specialize them.
func AnnotationScope ¶
AnnotationScope is where an annotation on sym names its type: sym's own scope, or the enclosing one when sym has none.
func ChainCallee ¶
func ChainCallee(e *ast.InvocationExpr) *ast.FeatureChainExpr
ChainCallee is the feature chain a call `x.f(a)` applies (KerMLExpressions InstantiatedTypeMember → OwnedFeatureChain), nil for `T(a)` and `x->T(a)`.
func CompareInt ¶ added in v0.10.0
CompareInt orders two Integers exactly: -1, 0 or 1.
func CompareIntReal ¶ added in v0.10.0
CompareIntReal orders the Integer a against the Real r exactly, neither rounded to the other: -1, 0 or 1. A NaN r is unordered; the caller decides it.
func CompareMagnitudes ¶
CompareMagnitudes orders two commensurable quantities: -1, 0 or 1. Integer magnitudes over whole scale ratios compare exactly, so neighbours above 2^53 stay distinct; otherwise the right one converts to the left unit as a float64. A bare zero is the null quantity of every dimension, so `length > 0` reads it in the other operand's unit.
func CompareQuantities ¶
func CompareQuantities(op ast.OperatorKind, left, right Quantity) (bool, error)
CompareQuantities orders two quantities, converting the right one into the left one's unit.
func CompareRat ¶ added in v0.10.0
CompareRat orders two exact numbers (Integers or Rationals) exactly.
func CompareReal ¶ added in v0.10.0
CompareReal orders the exact number v against the non-NaN Real r at Real precision: an Integer exactly, a Rational as its nearest binary64 (±Inf past the range).
func ConjugateDirection ¶
func ConjugateDirection(d ast.FeatureDirection) ast.FeatureDirection
ConjugateDirection returns the conjugate of a feature direction (§7.12.2): in and out are each other's conjugate, inout and none are their own.
func ConnectorEndMetaclassName ¶
ConnectorEndMetaclassName is the SysML metaclass of a connector end: a PortUsage as an interface's end, a ReferenceUsage otherwise (SysML.xtext).
func ConvertMagnitude ¶
ConvertMagnitude expresses a magnitude given over the scale factor from over the scale factor to, as one ratio so that no intermediate rounding enters.
func CrossSubsettings ¶
func CrossSubsettings(sym *symbols.Symbol) []*ast.Relationship
CrossSubsettings returns the `crosses` relationships sym declares, in order.
func DeclaredNonunique ¶
DeclaredNonunique reports whether a feature's own declaration says nonunique.
func DeclaredOrdered ¶
DeclaredOrdered reports whether a feature's own declaration says ordered.
func DeclaresEndFeature ¶ added in v0.12.0
DeclaresEndFeature reports whether a feature is a connector end or carries the `end` modifier.
func DeclaresFunction ¶ added in v0.10.0
DeclaresFunction reports whether decl declares a KerML Function or Expression or a SysML kind specializing one.
func DeclaresRedefinition ¶
DeclaresRedefinition reports whether sym carries a `redefines`/`:>>` clause, whether or not its target resolves.
func DeclaresVariant ¶
DeclaresVariant reports whether sym is declared with the `variant` keyword, which makes it one of the choices of the variation that owns it.
func DeclaresVariation ¶
DeclaresVariation reports whether sym is declared with the `variation` modifier, which makes it a variation point: an abstract classifier of the variants declared for it (SysML v2 §7.20, VariantMembership).
func EnumerationDefinitionOwning ¶
EnumerationDefinitionOwning returns the enumeration definition whose body declares sym, whatever sym is, or nil when its owner is not one.
func EnumerationOwning ¶
EnumerationOwning returns the enumeration sym is a literal of — an enum def's value (SysML v2 §7.6.4) or a reflective KerML DataType's member feature (KerML 1.1 §9.2.17) — else nil.
func EqualQuantities ¶
func EqualQuantities(op ast.OperatorKind, left, right Quantity) (bool, error)
EqualQuantities compares two quantities in the left one's unit; incommensurable units are an error, since neither `==` nor `!=` is an answer about them.
func ExtentTypeName ¶
func ExtentTypeName(node ast.Node) *ast.QualifiedName
ExtentTypeName is the name an extent expression `all T` names its type by: its one operand, which the grammar makes a type reference, not a value. Nil for any other node.
func FormatConst ¶
FormatConst renders a scalar constant using the user-facing numeric convention shared by the runtime and the query surfaces.
func FormatReal ¶
FormatReal renders a Real as the shortest decimal that reads back as the same float64, so no surface rounds a value away. A whole value keeps a ".0" so it is not mistaken for an Integer.
func FormatScaleTerm ¶ added in v0.10.0
FormatScaleTerm renders a scale's numerator or denominator, a whole one binary64 holds exactly in full.
func FunctionLike ¶
FunctionLike reports whether sym declares a function or an expression, the types whose bodies state a result expression.
func GeneralizationKind ¶
func GeneralizationKind(k ast.RelationshipKind) bool
GeneralizationKind reports whether a relationship kind forms a conformance ("is-a" / "conforms-to") edge for the specialization graph: specialization on definitions, and subsetting/redefinition/typing on usages.
Reference subsetting (`references`) is excluded even though KerML 8.3.3.3.9 makes it a kind of Subsetting: it contributes members through MemberSources instead, so that a referencing feature does not silently acquire the referenced feature's type for conformance and implicit-typing purposes. crosses is a feature-value edge, not generalization, and is excluded too.
func ImplicitSubsettingCandidates ¶ added in v0.9.2
func ImplicitSubsettingCandidates(u NestedUsage, owner NestedOwner) []string
ImplicitSubsettingCandidates lists, by declaration kinds alone, the library features a usage so declared may implicitly subset: the one the kind rules settle on, or the step fallback's three under an owner whose kind is an occurrence's, which of them depending on what the owner conforms to.
func ImpliedEndReference ¶ added in v0.10.0
func ImpliedEndReference(end *ast.ConnectorEnd) ast.Node
ImpliedEndReference is the feature a connector end attaches to without a `references` clause of its own saying so (`connect s.y to k.u`), which it reference-subsets all the same (SysML v2 8.2.2.13.1); nil when a clause does.
func IncludeUseCaseEcho ¶ added in v0.10.0
func IncludeUseCaseEcho(rels []*ast.Relationship, i int) bool
IncludeUseCaseEcho reports whether rels[i] is the `includes` the parser echoes for `include use case uc : UC`: a RelIncludes immediately followed by the RelTyping whose target it repeats node-for-node. The full form carries no ReferenceSubsetting (SysML.xtext IncludeUseCaseUsage), so the echo is no relationship object — but it still holds its ordinal.
func IntegerSizeExceeded ¶ added in v0.10.0
IntegerSizeExceeded reports an Integer result of bits magnitude bits beyond the maxBits an evaluation allows.
func InvocationArgs ¶
func InvocationArgs(e *ast.InvocationExpr) []ast.Node
InvocationArgs returns e's positional arguments, the receiver of `x->f(a)` first; the operand of a chain call `x.f(a)` is the calc applied, not an argument.
func IsActorUsage ¶ added in v0.10.0
IsActorUsage reports whether sym is an actor or stakeholder membership.
func IsAnything ¶
IsAnything reports whether sym is Base::Anything, the classifier every type specializes (KerML 8.3.2.1), whether or not the chain to it is declared.
func IsBehaviorParameter ¶
IsBehaviorParameter reports whether sym is a parameter a behavior or step owns; a port's directed feature (`in item cmd`) is a flow item of the port, not a parameter.
func IsCollection ¶
IsCollection reports whether sym is a Kernel Data Type Library collection shape, which the runtime reads as its elements; a type elsewhere specializing one (a quantity value) is its own kind.
func IsDataKind ¶ added in v0.9.2
IsDataKind reports whether sym is a value-kind usage: an attribute or an enumeration usage holds data, never an object of its own, regardless of typing.
func IsDataValue ¶ added in v0.10.0
IsDataValue reports whether sym is the library's Base::DataValue, the result every DataFunctions operator declares and so the type of nothing in particular.
func IsElementType ¶
IsElementType reports whether sym is KerML::Root::Element, the metaclass every model element is an instance of, so a parameter it types takes the element any argument names.
func IsEnumeration ¶ added in v0.12.1
IsEnumeration reports whether sym is an enumeration: an enumeration definition, or a DataType of the reflective KerML model, whose literals are its only values.
func IsExtentExpr ¶
IsExtentExpr reports whether node is an extent expression `all T` (KerML 1.0 §7.4.9.2).
func IsHexColor ¶ added in v0.9.2
IsHexColor reports whether s is a colour written #RRGGBB.
func IsLayoutFQN ¶ added in v0.9.2
IsLayoutFQN reports whether fqn names a DiagramLayout metadata definition.
func IsMetadataType ¶
IsMetadataType reports whether a symbol is a metadata definition or a KerML metaclass — the types an annotation can have.
func IsObjectiveUsage ¶ added in v0.10.0
IsObjectiveUsage reports whether sym is an objective membership.
func IsOutputParameter ¶ added in v0.11.0
IsOutputParameter reports whether sym is a parameter a behavior answers with: an `out` or `inout` parameter, or a `return` result.
func IsParameter ¶
IsParameter reports whether sym is a directed or result parameter of a behavior.
func IsReferenceUsage ¶ added in v0.9.2
IsReferenceUsage reports a usage declared `ref` or with a `references` relationship (SysML v2 §7.6.2: Usage::isReference), which owns none of the objects it holds.
func IsReflectiveEnumeration ¶ added in v0.12.1
IsReflectiveEnumeration reports whether sym is a DataType of the library's reflective KerML model, into which KerML 1.1 §9.2.17 maps only MOF enumerations.
func IsResultExpression ¶
IsResultExpression reports whether a body member states its owner's result: a bare expression, or the bare condition of a constraint body. A nested assertion is a constraint of its own, not its owner's result.
func IsShapeFeature ¶
IsShapeFeature reports whether sym is a kind of feature an object carries a value of (an attribute, part, port, action…), as opposed to a nested type, a calculation or an enumeration.
func IsStateActivity ¶ added in v0.10.0
IsStateActivity reports whether sym is the StateActivity::isActive feature.
func IsSubjectUsage ¶ added in v0.9.2
IsSubjectUsage reports whether sym is the subject parameter of a case.
func IsType ¶
IsType reports whether sym declares a KerML Type, which alone has an extent: a classifier or a feature (KerML 1.0 §8.3.3), never a package, relationship or comment.
func IsValueType ¶
IsValueType reports whether sym is a type whose instances are values rather than objects: an attribute or enumeration definition or usage.
func IsVariant ¶
IsVariant reports whether sym is a variant: declared `variant`, or an enumerated value, held by a variant membership (SysML v2 §7.6.4).
func IsVariation ¶
IsVariation reports whether sym is a variation: declared `variation`, or an enumeration definition, whose isVariation is always true (SysML v2 §8.3.9).
func IsView ¶
IsView reports whether sym is a view usage or a view definition, the two elements that own Expose relationships.
func IsViewpoint ¶
IsViewpoint reports whether sym is a viewpoint usage or definition.
func IsViewpointSatisfy ¶
IsViewpointSatisfy reports whether a satisfy member claims conformance to what it names — `satisfy vp;`. A satisfy stating a subject asserts its requirement of that subject instead (`satisfy requirement r by that;`, as the stdlib View does), which is no claim about the view.
func LiteralValue ¶
LiteralValue returns the value expression a literal declares, or nil when it declares none and is identified by itself: a literal of an enumeration specializing a scalar type — `enum def GradePoints :> Real { A = 4.0; }` — is a value of that type.
func MultiplicityMetaclassName ¶
MultiplicityMetaclassName is the metaclass of a named multiplicity: a range (`multiplicity m [1..2]`) is a MultiplicityRange, a subset a Multiplicity.
func NotYetMember ¶
NotYetMember reports whether a member of a namespace a declaration is being written in is that declaration: the one identified, or, when the caller cannot tell which it is, any redefinition the namespace declares (KerML 8.3.3.3.6).
func OrderSatisfies ¶
func OrderSatisfies(op ast.OperatorKind, order int) (res, ok bool)
OrderSatisfies applies an ordering operator to a comparison result of -1, 0 or 1. ok is false for an operator that is no ordering.
func ParseReal ¶
ParseReal reads decimal Real notation as a finite binary64 Real. Any other notation is ErrRealNotation; a magnitude that overflows to an infinity, or a nonzero one that underflows to zero, is ErrArithmeticOverflow.
func PrimConforms ¶
PrimConforms reports whether a value of type from is acceptable where to is expected. PrimUnknown on either side conforms, so partial information never produces a diagnostic.
func RationalSizeExceeded ¶ added in v0.10.0
RationalSizeExceeded reports a Rational result of bits numerator-plus- denominator bits beyond the maxBits an evaluation allows.
func ReadOnlyViolation ¶ added in v0.10.0
ReadOnlyViolation words a write to the read-only feature text names, for the static and runtime checks alike: why it is read-only, and the feature it is so by when that is another one it redefines or subsets.
func RealArith ¶
func RealArith(op ast.OperatorKind, a, b float64) (float64, bool)
RealArith is Real addition, subtraction, multiplication and division, reporting ok=false for an operator it does not define or a division by zero.
func ReflectiveDirection ¶
func ReflectiveDirection(sym *symbols.Symbol) (ast.FeatureDirection, bool)
ReflectiveDirection is the direction sym's feature declaration states (Feature::direction); ok is false where sym declares no feature.
func RelationshipsOf ¶
func RelationshipsOf(sym *symbols.Symbol) []*ast.Relationship
RelationshipsOf returns the declared relationships of a symbol's def/usage declaration, or nil for symbols that are not def/usage.
func ResultParameterOwnerValid ¶ added in v0.10.0
ResultParameterOwnerValid reports whether sym's owner is valid under KerML validateReturnParameterMembershipOwningType.
func RunDecidedMetadataFeature ¶
RunDecidedMetadataFeature reports a feature of the annotation type def whose value the run reads rather than the model: p of a Probability itself, which is read when its decision is reached. A subtype has no runtime reader, so none of its.
func ScalarFQN ¶
ScalarFQN is the qualified name of the library definition a lattice element stands for (`ScalarValues::Natural` for PrimNatural), or "" for none.
func ScalarTypeName ¶ added in v0.9.2
ScalarTypeName names the scalar type of a constant of kind, as a sent signal's type, or "" for a kind no sent value has.
func SimpleSymbolName ¶
SimpleSymbolName is a symbol's own name, without the qualification an indexed symbol's name may carry.
func StatesOwnCondition ¶ added in v0.11.0
StatesOwnCondition reports whether sym's own body states a condition a check evaluates: a result expression or a nested `assert`/`assume constraint` member.
func TimeEventType ¶
TimeEventType names the library type a time trigger's argument must be a value of: a DurationValue after `after`, a TimeInstantValue after `at`.
func UnboundedOrder ¶
UnboundedOrder compares l and r where at least one is the unbounded `*`: `*` exceeds every finite number and equals itself. ok is false when the other operand is neither a number nor `*`, since nothing orders it against one.
func UnevaluableClassification ¶
UnevaluableClassification reports a classification whose subject the caller could not settle — an expression denoting no element — as the same ErrFilterUnevaluable a filter condition outside the evaluable subset reports.
func UniquenessViolation ¶
UniquenessViolation words a value written twice to a unique feature, for the static and runtime checks alike; first and second are 1-based positions.
func UnitExprText ¶
UnitExprText renders an expression in unit position as written, so a diagnostic, a printed value or an exported type fact names the unit the model used rather than its reduction. Grouping and quoting the text needs to read back are kept: `'A/m'` is one unit, `A/m` a quotient of two.
func UnitNameText ¶
func UnitNameText(qn *ast.QualifiedName) string
UnitNameText renders a unit's qualified name as the notation spells it, a segment that is not a basic name in quotes: `SI::'A/m'`.
func UsageDeclIsComposite ¶ added in v0.10.0
UsageDeclIsComposite derives SysML Usage::isComposite (SysML v2 §7.6.2) for a usage declaration.
func UsageIsComposite ¶
UsageIsComposite derives SysML Usage::isComposite (SysML v2 §7.6.2) for the usage sym declares: the objects it holds are portions of the object holding it. A symbol declaring no usage is not.
func UsageIsReferential ¶ added in v0.11.0
UsageIsReferential reports whether a usage is a reference rather than composition.
func UsageMultiplicityOf ¶
func UsageMultiplicityOf(sym *symbols.Symbol) *ast.Multiplicity
UsageMultiplicityOf returns the multiplicity a usage, subject, cross feature or owned constraint symbol declares as its own, or nil; an end's `end [m]` is its cross feature's.
func VariantValue ¶
VariantValue returns the value expression a variant declares, or nil when it declares none and stands for an object of itself.
Types ¶
type AboutIndex ¶ added in v0.9.2
type AboutIndex struct {
// contains filtered or unexported fields
}
AboutIndex is the `about` annotation index built once and read by every model sharing it, so concurrent models over one index need not each build their own.
func NewAboutIndex ¶ added in v0.9.2
func NewAboutIndex() *AboutIndex
NewAboutIndex is an about index no model has built yet.
type ActionSuccession ¶
type ActionSuccession struct {
// Decl is the syntax declaring the succession.
Decl ast.Node
// Owner is the action whose body declares Decl; nil for a body-local block
// such as a loop or branch, or for an action queried by body alone.
Owner *symbols.Symbol
// Source and Target are the two ends, in connector-end order.
Source, Target ActionSuccessionEnd
}
ActionSuccession is one Succession an action's body declares or inherits, with each end resolved to the member it attaches to. It is the KerML view a Feature's sourceConnector/targetConnector give of the successions written as `succession s first a then b`, `first a then b`, `then b`, a guarded `if`/`else` edge or `succession s first a if g then b` (a transition owning a succession), or `succession flow from a.x to b.y` (a flow that is a succession).
type ActionSuccessionEnd ¶
type ActionSuccessionEnd struct {
// Node is the declaration the end attaches to; nil when it names none the
// model declares (an implied `start`/`done`, or an unresolved name).
Node ast.Node
// Symbol declares Node when the end reached it by name; nil for an end
// bound by position, whose Node is a member of the succession's owner.
Symbol *symbols.Symbol
// Multiplicity is the multiplicity the end writes, nil when it writes none.
Multiplicity *ast.Multiplicity
// Span is the reference the end was resolved from; empty when the end is
// bound by position or implied, and so rests on no reference.
Span source.Span
}
ActionSuccessionEnd is one end of an ActionSuccession.
type AnnotationSite ¶
type AnnotationSite struct {
TypeFQN string
Node ast.Node
// Span locates the node stating the annotation, also when the annotation
// comes from a record and Node is nil.
Span source.Span
// Scope is where the annotating node is declared; for an `about`-form
// annotation that may be another document than the annotated element's.
Scope *symbols.Scope
About bool
Values []symbols.AnnotationValueFacts
}
AnnotationSite is one metadata annotation of an element together with the node stating it — a prefix/body annotation of the element itself, or a metadata usage annotating it from elsewhere with an `about` clause.
type Argument ¶
type Argument struct {
Prim PrimType
Type *symbols.Symbol // the declared type of the feature or result named, nil when none
Also []*symbols.Symbol // the further types a run's value is classified by, beside Type
Exact bool
Empty bool
Name *ast.QualifiedName // the name a named argument binds, as written; nil for positional
}
Argument is one invocation argument as the checker types it: Exact for a literal, Empty for `null` or `()`, which has no element to type and fits every candidate alike.
type ArgumentTyper ¶
type ArgumentTyper interface {
InvocationArguments(scope *symbols.Scope, e *ast.InvocationExpr) []Argument
}
ArgumentTyper types a call's arguments as the checker does, so a call read anywhere in the model selects the overload the checker selects.
type BehaviorParameter ¶
type BehaviorParameter struct {
Symbol *symbols.Symbol
Direction ast.FeatureDirection
IsResult bool
}
BehaviorParameter is one effective parameter of a behavior, in invocation order.
type Bound ¶
Bound is one end of a multiplicity range. Known is false when the bound expression is not model-level-evaluable (checks then skip it). Infinite marks the `*` unbounded upper.
type Canvas ¶
Canvas is the drawing surface one Canvas annotation binds: its unit, and its extent when both width and height were given.
type CollectionElement ¶
CollectionElement is one element a collection value may hold: the expression producing it, in its scope, or nil where a function's result parameter does; and its types, nil where unknown.
type ComposedFrame ¶
type ComposedFrame struct {
Dimensions []int64
HasDimensions bool
// AxisDimensions is one per axis, or the one every axis measures in when Uniform;
// nil when the axes are not statically known.
AxisDimensions []UnitTerm
Uniform bool
}
ComposedFrame is what a frame composed by 'CoordinateFrame*' or 'CoordinateFrame/' (`spatialCF / s`) is known to be: its dimensions and axis dimensions, when fixed.
type ConcernCheck ¶
ConcernCheck is the verdict of one framed concern against one exposed element.
type ConcernConformance ¶
type ConcernConformance struct {
// Concern is the viewpoint's framing and Target the concern it names, nil
// when the framing names nothing resolvable.
Concern *symbols.Symbol
Target *symbols.Symbol
// Name is how the framed concern is written, for reporting.
Name string
// Checks are the per-element verdicts, in exposed-element order.
Checks []ConcernCheck
Verdict Verdict
Reason string
}
ConcernConformance is what became of one concern the viewpoint frames.
type ConcernEvaluator ¶
ConcernEvaluator evaluates a framed concern's conditions with one exposed element bound as its subject. It is implemented over the runtime's requirement engine, which the semantic model cannot import.
type Conformance ¶
type Conformance struct {
Known bool
Holds bool
// Found describes what the value is, for a diagnostic when Holds is false.
Found string
// Untyped marks a value whose static type says nothing — a feature declaring
// no type, a result typed Anything — so a rule may leave it to evaluation.
Untyped bool
}
Conformance is the outcome of judging an expression's value against a type. A value whose type only evaluation determines is Known false, and a rule that consumes the judgement must then stay silent rather than guess.
type ConformanceViolation ¶
type ConformanceViolation struct {
Kind ConformanceViolationKind
// Feature is the subsetting or redefining feature.
Feature *symbols.Symbol
// Target is the subsetted or redefined feature.
Target *symbols.Symbol
// Ref is the node the diagnostic is reported at: the target reference of an
// explicit clause, or the declaration itself for an implicit redefinition.
Ref ast.Node
}
ConformanceViolation is one broken conformance rule: the relationship that breaks it, and the reference to report it at.
type ConformanceViolationKind ¶
type ConformanceViolationKind int
ConformanceViolationKind names the conformance rule a relationship breaks.
const ( // ViolationDirection: a redefining feature's direction differs from the // direction the redefined feature has in the owning type. ViolationDirection ConformanceViolationKind = iota // ViolationUniqueness: a nonunique feature subsets or redefines a unique one. ViolationUniqueness // ViolationConstancy: a variable feature subsets or redefines a constant one. ViolationConstancy )
type ConnectorEndAttachment ¶
type ConnectorEndAttachment struct {
// Name is the effective name of the end feature this position occupies: the
// name the end declares for itself, else the name of the end it implicitly
// redefines in the connector it specializes, else the name a binary
// connector's ends have in the library. It is empty when none of those
// answers a name — an end of an untyped connector with an arity other than
// two, whose ends are the participants of a link and are unnamed.
Name string
// Attachment is the expression naming the connected feature (`a.p`).
Attachment ast.Node
// Index is the expression an indexed end selects one element of Attachment's
// value with (`a.p#(1)`, an OpenSysML extension), nil for an end attaching the
// whole feature; Selection is then the whole `a.p#(1)` an evaluation reads.
Index, Selection ast.Node
// End is the syntax of the end itself, which carries its source location: the
// `connect` clause's end, or the body's `end` usage.
End ast.Node
// EndFeature is the end feature Name comes from, when a declaration in the
// model declares it: the end's own symbol, or the end it redefines. It is nil
// for a name taken from the library, whose declarations are indexed without
// bodies.
EndFeature *symbols.Symbol
// Declared is the end's own declaration, named or not, when the model
// registers one: what it subsets and redefines is declared there.
Declared *symbols.Symbol
}
ConnectorEndAttachment is one end of a connector usage as an object of that usage carries it: the name of the end feature the position occupies, and the node naming the feature the end attaches to. A connector end reference-subsets what it attaches to (KerML 1.0 §7.4.6, SysML v2 §7.13.2), so an object of the connector holds that very feature at the end rather than an object of the end's declared type.
type ConnectorEndPath ¶ added in v0.10.0
ConnectorEndPath is where one end of a connector usage attaches: the end's effective name, and the features its attachment names in order — the parts a chain `a.b.p` walks and the feature it ends on. Features is empty where the attachment resolves to nothing.
type DepthProblem ¶ added in v0.11.0
DepthProblem is a depth attribute whose value is not a non-negative integer literal, located at the value.
type Dimension ¶
type Dimension struct {
Term UnitTerm
// Unit is the unit as written or the operand's quantity type, for the
// diagnostic; empty for a computed dimension, described by Term alone.
Unit string
// Scale is the measurement scale the value is a point on (`[SI::'°C_abs']`);
// nil for a magnitude in a unit.
Scale *symbols.Symbol
// MaybePoint marks a feature's value, which its quantity value type leaves
// free to be a point on a scale or a magnitude in a unit of the dimension.
MaybePoint bool
}
Dimension is the quantity dimension of a measurement: a product of powers of base quantities (ISQ's L, M, T, ...), held as a UnitTerm over the base-quantity features so that UnitTerm.Commensurable — the same commensurability the runtime applies to units — decides whether two dimensions are comparable.
func (Dimension) IsMagnitude ¶
IsMagnitude reports a value known to be in a unit and on no scale.
type ElementMetadata ¶
type ElementMetadata struct {
Type *symbols.Symbol
Node ast.Node
// Doc is the document stating the annotation, which an `about` form states
// away from the element it annotates.
Doc string
About bool
Bindings []MetadataBinding
}
ElementMetadata is one metadata annotation of an element as `.metadata` reads it: the metadata type to materialize and the values its body binds. Values the body leaves unbound come from the type's own declarations.
type FilterError ¶
FilterError is why a filter condition could not decide a candidate. Reason describes the part at fault in the terms a diagnostic message uses, and Span locates it.
func (*FilterError) Error ¶
func (e *FilterError) Error() string
func (*FilterError) Unwrap ¶
func (e *FilterError) Unwrap() error
type FilterProblem ¶
type FilterProblem struct {
// Kind distinguishes a specification fault from an evaluator limitation.
Kind FilterProblemKind
Reason string
Span source.Span
}
FilterProblem is a fault in a filter condition itself, found without any candidate to evaluate it for: a part of it the evaluator cannot decide, or one that yields something other than a boolean where the condition needs a truth value. Reason describes the fault for a diagnostic message, and Span locates the part of the condition at fault.
type FilterProblemKind ¶
type FilterProblemKind uint8
FilterProblemKind classifies a filter condition fault.
const ( FilterProblemNotBoolean FilterProblemKind = iota FilterProblemNotEvaluable FilterProblemUnsupported )
type FlowEndAttachment ¶
FlowEndAttachment is one declared from/to target of a flow usage: the feature it names, and the index selecting one element of it when the end is indexed.
type HiddenCompartments ¶ added in v0.11.0
type HiddenCompartments struct {
Attributes, Parts, References, Ports, Constraints, Items, Actions bool
}
HiddenCompartments are the compartments of one symbol a Layout's show… switches turn off, one per switch bound false: showAttributes, showParts, showReferences, showPorts, showConstraints, showItems, showActions.
func (HiddenCompartments) Any ¶ added in v0.11.0
func (h HiddenCompartments) Any() bool
Any reports whether any compartment is hidden.
func (HiddenCompartments) Hides ¶ added in v0.11.0
func (h HiddenCompartments) Hides(compartment string) bool
Hides reports whether the compartment named as the graphical notation heads it ("attributes", "parts", "ports", …) is hidden; "references" is the `ref` rows, whichever compartment lists them.
type InvocationSelection ¶
type InvocationSelection struct {
Candidates []*symbols.Symbol // what the name denotes, in lookup order, aliases followed
Applicable []*symbols.Symbol // the candidates the arguments bind to
Selected *symbols.Symbol // the one called; nil when none applies or they tie
Ambiguous bool // several applicable candidates are equally specific
Tied []*symbols.Symbol // the applicable candidates none is more specific than, when Ambiguous
Undetermined bool // Ambiguous only because an argument's type is unknown; the values settle it
// contains filtered or unexported fields
}
InvocationSelection is which declaration an invocation calls, out of every declaration its written name is visible as.
func (*InvocationSelection) Called ¶
func (s *InvocationSelection) Called() *symbols.Symbol
Called is the declaration a call runs: the one selected, or when no candidate fits the first callable one (else the first at all), which then reports the mismatch; nil when none.
func (*InvocationSelection) Resolved ¶
func (s *InvocationSelection) Resolved() bool
Resolved reports whether the name denotes at least one declaration.
type Layout ¶
type Layout struct {
X, Y float64
Width, Height float64
// Unplaced marks an annotation binding no x and y: one that only folds
// (collapsed) or hides (the show… switches), leaving the place to the tool.
Unplaced bool
HasSize bool
Collapsed bool
// Hidden are the compartments the annotation's show… switches turn off
// for the element's symbol.
Hidden HiddenCompartments
}
Layout is the geometry one Layout annotation binds: the top-left corner of the annotated element in pixels, y down, and its size when both were given.
type LayoutProblem ¶
LayoutProblem is a binding of a DiagramLayout annotation that could not be read as the geometry it stands for, located at the node stating it.
type LayoutSite ¶
type LayoutSite struct {
// TypeFQN is LayoutFQN, RouteFQN, CanvasFQN, StyleFQN, NoteFQN or PictureFQN.
TypeFQN string
// Node states the annotation; Scope is where it is declared.
Node ast.Node
Scope *symbols.Scope
// About marks an annotation stated away from the element with an `about`
// clause.
About bool
// View is the view whose body states an `about` annotation or a Note, so
// the site applies in that view alone; nil for an inline annotation and for
// one stated outside every view, which apply in every view.
View *symbols.Symbol
// Via is the namespace an `about` clause named the element through, when
// qualified: `about Acquire::start` positions the start Acquire inherits.
Via *symbols.Symbol
// General is the element a Route names with `ref :>> general : G;`: the
// Route steers the edge drawn from the annotated element to G for its
// specialization, not an edge the element declares itself. Nil otherwise.
General *symbols.Symbol
// Exactly one of Layout, Route, Canvas, Style, Note and Picture is set when
// the annotation reads; all are nil when a binding it needs has a Problem.
Layout *Layout
Route *Route
Canvas *Canvas
Style *Style
Note *Note
Picture *Picture
// PointCount is the number of values a Route binds to points, whether or
// not they read as waypoints.
PointCount int
// Bindings are the features the annotation's body binds, in declaration order.
Bindings []MetadataBinding
// Problems are the bindings that could not be read: a value that is not a
// constant of the feature's type, a Route with an odd number of values.
Problems []LayoutProblem
}
LayoutSite is one DiagramLayout annotation of an element: where it was stated, the geometry it binds, and the bindings that could not be read.
func (*LayoutSite) Applies ¶
func (s *LayoutSite) Applies() bool
Applies reports whether the site carries geometry a rendering can use.
func (*LayoutSite) InView ¶
func (s *LayoutSite) InView(view *symbols.Symbol) bool
InView reports whether the site positions its element in view: an `about` annotation stated in the view's body, or one applying in every view.
func (*LayoutSite) Origin ¶ added in v0.9.2
func (s *LayoutSite) Origin() symbols.Origin
Origin is where the annotation is stated: the document its scope belongs to and the span of its node.
func (*LayoutSite) StatedInBodyOf ¶
func (s *LayoutSite) StatedInBodyOf(view *symbols.Symbol) bool
StatedInBodyOf reports whether the annotation is declared in the body of view or a namespace nested in it, inline or with an `about` clause.
type MetadataAnnotation ¶
type MetadataAnnotation struct {
Node *ast.PrefixMetadata
Prefix bool
}
MetadataAnnotation is a metadata feature annotating an element, written either as a prefix (`#A part p`) or as a member of the element's body (`@A;`).
func MetadataAnnotationsAboutOthers ¶
func MetadataAnnotationsAboutOthers(decl ast.Node) []MetadataAnnotation
MetadataAnnotationsAboutOthers returns the metadata features written on a declaration that annotate other elements (`@A about x`), in declaration order.
func MetadataAnnotationsOf ¶
func MetadataAnnotationsOf(decl ast.Node) []MetadataAnnotation
MetadataAnnotationsOf returns the metadata features annotating a declaration, in declaration order. `@A about x` annotates other elements, so it is not one.
func MetadataAnnotationsWritten ¶
func MetadataAnnotationsWritten(decl ast.Node) []MetadataAnnotation
MetadataAnnotationsWritten returns every metadata feature written on decl, as prefixes then as members of its body, in declaration order.
type MetadataBinding ¶
type MetadataBinding struct {
Feature string
Value ast.Node
// Node is the body member stating the binding.
Node *ast.Usage
// Scope is where the value resolves names: the body's own scope, which sees
// the metadata type's members before those around the annotated element.
Scope *symbols.Scope
Nested []MetadataBinding
}
MetadataBinding is one feature an annotation body binds: the value it is bound to, if any, and the bindings its own body nests under it.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the derived semantic model over a symbol index. It memoizes the specialization graph computed from resolved def/usage relationships.
func NewModel ¶
NewModel creates a semantic model backed by the given name resolver. The resolver must already be associated with the index whose symbols will be queried. The model attaches itself to the resolver so name resolution sees inherited members, which a redefinition target may only be reachable through.
func (*Model) AboutAnnotatedElementViolations ¶
func (m *Model) AboutAnnotatedElementViolations(scope *symbols.Scope, typeRef *ast.QualifiedName, about []*ast.QualifiedName) []string
AboutAnnotatedElementViolations names, in order, the metaclass of each element an `about` clause names that the metadata type typeRef names may not annotate.
func (*Model) AboutAnnotatedSymbols ¶
AboutAnnotatedSymbols returns every element an `about` metadata usage annotates, in the deterministic order the index is built in — bundled library elements a workspace annotation targets included.
func (*Model) AboutAnnotationFactsOf ¶ added in v0.9.2
func (m *Model) AboutAnnotationFactsOf(sym *symbols.Symbol) *symbols.AnnotationFacts
AboutAnnotationFactsOf is the annotation a metadata usage with an `about` clause states on the elements it names — its type and bound values — as an interface record keeps it; nil for any other symbol.
func (*Model) AboutBuilding ¶ added in v0.12.0
AboutBuilding reports whether the `about` index is being built, when what the model answers about annotations — and the filters reading them — is partial.
func (*Model) ActionSuccessions ¶
func (m *Model) ActionSuccessions(sym *symbols.Symbol) []ActionSuccession
ActionSuccessions returns the successions of an action definition or usage: those inherited from what it specializes or is typed by, most general first, then its own in declaration order. A redefined inherited succession is masked.
func (*Model) ActorsOf ¶ added in v0.10.0
ActorsOf returns the actors and stakeholders a case owns and inherits.
func (*Model) AdmittedMeasurementRefs ¶
AdmittedMeasurementRefs is what a quantity value type's `mRef` is typed by: the references a quantity of that type may be written in; nil where it declares none.
func (*Model) AllDeclaredSupertypes ¶ added in v0.11.0
AllDeclaredSupertypes returns the transitive closure of DeclaredSupertypes, nearest first, leaving out every implied kind base along the way.
func (*Model) AllRedefinedFeatures ¶
AllRedefinedFeatures returns every feature sym redefines, directly or through the features those redefine: explicit clauses and the implicit redefinitions of parameters, connector ends and case roles alike. sym itself is excluded.
func (*Model) AllSupertypes ¶
AllSupertypes returns the transitive closure of DirectSupertypes, excluding sym itself, in a deterministic order (breadth-first over declaration order). It is safe on cyclic graphs. The result is memoized.
func (*Model) AnnotatedElementViolation ¶
func (m *Model) AnnotatedElementViolation(annotated *symbols.Symbol, scope *symbols.Scope, typeRef *ast.QualifiedName) (string, bool)
AnnotatedElementViolation names the metaclass of annotated when the metadata type typeRef names may not annotate it (validateMetadataFeatureAnnotatedElement).
func (*Model) AnnotatedElementsOf ¶ added in v0.9.2
AnnotatedElementsOf returns the elements a metadata usage annotates through its `about` clause, resolved; nil for any other symbol.
func (*Model) AnnotatingRelationships ¶ added in v0.11.0
AnnotatingRelationships returns the Annotations the annotating element sym owns for the elements its `about` clause names, in clause order (KerML 8.3.2.3.2 AnnotatingElement::ownedAnnotatingRelationship); a name resolving to nothing is a resolver diagnostic, not an annotation.
func (*Model) AnnotationFactsOf ¶
func (m *Model) AnnotationFactsOf(sym *symbols.Symbol) []symbols.AnnotationFacts
AnnotationFactsOf states the metadata annotating sym as names and constants, so that how an element filter classifies it can be compared across loads. The values an annotation binds are reported as read; a binding whose value is not constant is reported with an unknown value, which a condition reading it reports as unevaluable rather than silently treating as absent.
func (*Model) AnnotationSitesOf ¶
func (m *Model) AnnotationSitesOf(sym *symbols.Symbol) []AnnotationSite
AnnotationSitesOf returns the metadata annotating sym with the nodes stating it, inline annotations first and `about`-form ones after, each in declaration order. An annotation a recorded document states, on its own declaration or `about` an element elsewhere, has no node: its record carries the type, values and span, not the tree.
func (*Model) BaseTypeFacts ¶ added in v0.9.2
func (m *Model) BaseTypeFacts(def *symbols.Symbol) (base *symbols.Symbol, bound, unconditional bool)
BaseTypeFacts is what def's own body binds baseType to, for its record: the type, whether the body binds baseType at all, and whether the binding is the same for every annotated element, which a conditional binding is not.
func (*Model) BehaviorParametersOf ¶
func (m *Model) BehaviorParametersOf(sym *symbols.Symbol) []BehaviorParameter
BehaviorParametersOf returns a behavior's inherited and declared parameters.
func (*Model) BehaviorSuccessionFeaturingType ¶ added in v0.10.0
func (m *Model) BehaviorSuccessionFeaturingType(owner *symbols.Symbol, paths [][]*symbols.Symbol, ends ...ast.Node) (*symbols.Symbol, bool)
BehaviorSuccessionFeaturingType derives the featuring type of an outside-body succession.
func (*Model) BehaviorSuccessionOwner ¶ added in v0.10.0
BehaviorSuccessionOwner reports whether a scope may own an executable behavior order.
func (*Model) BinaryConnectorExcessEnds ¶
BinaryConnectorExcessEnds returns the ends past the second of a connector or association that conforms to Links::BinaryLink yet has more than two effective ends (KerML 1.1 validateAssociationBinarySpecialization, validateConnectorBinarySpecialization), with the effective end count. Each node is an owned end beyond position two, or the declaration itself when only inherited ends take the count past two.
func (*Model) BodyParameterElementTypes ¶
BodyParameterElementTypes is the element types of the collection a collection function binds an untyped body parameter to (KerML 8.3.4.8); nothing where those cannot be typed, nor for a reducer's first parameter unless the reducer's result feeds back as an element.
func (*Model) BoundParameter ¶
func (m *Model) BoundParameter(scope *symbols.Scope, callee *symbols.Symbol, name *ast.QualifiedName) (string, bool)
BoundParameter is the input parameter of callee a named argument binds, by the name callee's signature gives it — what a runtime keys its bindings by; false when none.
func (*Model) CallsCalc ¶ added in v0.9.2
func (m *Model) CallsCalc(sel *InvocationSelection) bool
CallsCalc reports whether a call selecting sel calls a calculation, whose value a send sends, rather than naming a signal: the selected declaration evaluates, or the choice is left to the arguments' values, which only a calculation reads.
func (*Model) CanvasOf ¶
func (m *Model) CanvasOf(view *symbols.Symbol) (*LayoutSite, bool)
CanvasOf resolves the Canvas of view: the first Canvas annotation stated in the view's body. One stated elsewhere sizes nothing; the layout pass reports it.
func (*Model) CastConformance ¶
func (m *Model) CastConformance(scope *symbols.Scope, e *ast.OperatorExpr) Conformance
CastConformance judges `x as T`: sound when a type of x and T may share values (KerML validateOperatorExpressionCastConformance), which they do when either specializes the other or a type either is composed of does, and no type the operand is declared with is one the target subtracts.
func (*Model) ChainTargetPath ¶ added in v0.10.0
func (m *Model) ChainTargetPath(sym *symbols.Symbol, kind ast.RelationshipKind, target ast.Node) []*symbols.Symbol
ChainTargetPath is the features a relationship's chain target is written as, outermost first, as resolved for a relationship of kind owned by sym: an end's attachment resolves where its connector is declared, any other target where sym is. Nil when target is a name or a feature of the chain resolves to nothing.
func (*Model) ChainingFeatures ¶ added in v0.12.0
ChainingFeatures are the features a chain Feature chains, in order.
func (*Model) CheckElementFilter ¶
func (m *Model) CheckElementFilter(f symbols.ElementFilter) []FilterProblem
CheckElementFilter reports the faults of a filter condition, in the order they appear in it. It is what the validation pass reports: the same compiled predicate the enumeration evaluates is examined, so a condition diagnosed here is exactly one whose verdict is not trusted there.
Only faults that hold for every candidate are reported. Whether an annotation actually binds a feature is a property of the candidate, not of the condition, so it surfaces as an unevaluable verdict during enumeration rather than here.
func (*Model) Classifies ¶
Classifies reports whether every value of typ is one of target's.
func (*Model) ClassifiesTypes ¶
ClassifiesTypes reports how target classifies a value known to be of types.
func (*Model) CoherentQuantity ¶
CoherentQuantity folds a composed unit's scale into the magnitude and spells it by the coherent unit of its dimension, else over the base units; an unreducible unit is kept.
func (*Model) CoherentSpelling ¶
CoherentSpelling respells an already coherent unit by the unit the declared type's measurement reference admits; a named unit it admits is kept, the magnitude never changes.
func (*Model) CoherentUnit ¶
CoherentUnit is the coherent unit of dim in the library's system of units: the product of SI::si's base units raised to dim's exponents (`kg` for mass, `kg*m/s**2` for force). A dimensionless dim measures in the unit one. False when the library declares no base unit for one of dim's base quantities.
func (*Model) CoherentUnitFor ¶
CoherentUnitFor is the coherent unit of dim spelt by the declared unit the feature's type admits (`SI::m`, `SI::'m/s'`), else over the base units.
func (*Model) CollectionElements ¶
CollectionElements is each element a collection value may hold (a nested collection value by its own elements), and whether the value's arguments decide it rather than its declaration.
func (*Model) CollectionHeldTypes ¶
CollectionHeldTypes is the types every element a collection value holds has, and whether the value's arguments decide it; nil types where it holds nothing or they are unknown.
func (*Model) CollectionResultTypes ¶
func (m *Model) CollectionResultTypes(scope *symbols.Scope, node ast.Node) ([]*symbols.Symbol, bool)
CollectionResultTypes is the types every element of a collection value — `xs.{…}`, a call of a ControlFunctions collection function or an extent `all T` — has, and whether its arguments decide the value rather than the declared result alone; nil types where they are unknown or say nothing.
func (*Model) CollectionValues ¶
CollectionValues is how many values a collection value — `xs.{…}`, `xs.?{…}`, a call of a ControlFunctions collection function or an extent `all T` — holds, where the value is one and its size is known.
func (*Model) CompileElementFilter ¶
func (m *Model) CompileElementFilter(f symbols.ElementFilter) *symbols.FilterPredicate
CompileElementFilter returns the condition compiled to a predicate over a candidate element, by resolving the elements it names against the scope it was written in. Returns nil for an empty condition.
func (*Model) ComposedFrameConforms ¶
func (m *Model) ComposedFrameConforms(f ComposedFrame, want *symbols.Symbol) Conformance
ComposedFrameConforms judges a composed frame — a CoordinateFrame — against a declared type: by type, else, for a frame type, by its fixed dimensions and axes.
func (*Model) ConcernEvaluationTarget ¶
ConcernEvaluationTarget returns the element whose conditions answer a framing: the framing when it declares a concern of its own, else the concern it names, whose conditions a bare `frame <concern>;` does not restate.
func (*Model) ConformanceViolations ¶
func (m *Model) ConformanceViolations(sym *symbols.Symbol) []ConformanceViolation
ConformanceViolations returns the feature-conformance rules the declaration of sym breaks against the features it subsets and redefines, explicitly or as a parameter of its owning behavior.
func (*Model) Conforms ¶
Conforms reports whether a conforms to b: a == b, b is a (transitive) supertype of a, or a is the union of types that all conform to b. Symbols are compared as elements, so one declaration reached through two scope trees (a document's and the index's) conforms to itself.
func (*Model) ConnectedPortsMismatch ¶ added in v0.9.2
func (m *Model) ConnectedPortsMismatch(connector, a, b *symbols.Symbol) (portA, portB *symbols.Symbol, mismatch bool)
ConnectedPortsMismatch returns the port definitions typing the end features a and b the connector joins when they are incompatible: neither conforms to the other, they specialize no common definition of the model's own, and neither port's directed features all match the other's with conjugate directions and conforming types (§7.12.2). An end not typed by a port definition is not reported, nor is a connector typed by an interface whose two ends are typed by ports: that interface decides what they pair.
func (*Model) ConnectorEndAttachments ¶
func (m *Model) ConnectorEndAttachments(sym *symbols.Symbol) []ConnectorEndAttachment
ConnectorEndAttachments returns the ends of the connector usage sym in declaration order: those of its `connect` clause, else the attached `end`s of its body; nothing for a non-connector usage.
func (*Model) ConnectorEndCount ¶
ConnectorEndCount returns the number of effective ends of the connector sym.
func (*Model) ConnectorEndFeaturePaths ¶ added in v0.10.0
ConnectorEndFeaturePaths is the features each end of the connector object usage sym names, outermost first, in end order: resolved from its declaration, or read from its record. An end that resolves to nothing has a nil path.
func (*Model) ConnectorEndMultiplicityIsOne ¶
ConnectorEndMultiplicityIsOne is EndMultiplicityIsOne for the unnamed end at position i of connector sym (`connector c (a, b)`).
func (*Model) ConnectorEndPaths ¶ added in v0.10.0
func (m *Model) ConnectorEndPaths(sym *symbols.Symbol) []ConnectorEndPath
ConnectorEndPaths resolves each end of a connector object usage (a connect, binding or flow) prefix by prefix, in end order.
func (*Model) ConnectorObjectEnds ¶
func (m *Model) ConnectorObjectEnds(sym *symbols.Symbol) []ConnectorEndAttachment
ConnectorObjectEnds returns the ends of any connector object usage in declaration order: a connect clause, a binding, or a flow's from/to ends.
func (*Model) ConstantFeatureValues ¶
func (m *Model) ConstantFeatureValues(sym *symbols.Symbol, feature string) ([]symbols.FilterValue, bool, error)
ConstantFeatureValues returns a feature's ordered constant values. The error is a symbols.NeedsHydration when the value is written in a recorded document.
func (*Model) ConstructibleFeatureFor ¶
ConstructibleFeatureFor returns the constructible feature of typ standing for feature (itself, or one it redefines or is redefined by); nil when none does.
func (*Model) ConstructibleFeatures ¶
ConstructibleFeatures returns the features a constructor's positional arguments bind, in shape order: those declared or restated in the constructed type's own tier (the model's for a model type, a library's for one of its types), not the ones a more general library declares for every object of the kind. A redefinition and its target are one feature, so they take one position.
func (*Model) Contributors ¶ added in v0.9.2
Contributors names the workspace documents a reader of the shared state called name depends on — those whose gather it is built from — and false when name is no shared state of the model's. The scalar and base-unit tables are the library's alone and depend on no workspace document.
func (*Model) CoordinateFrameExprConformance ¶
func (m *Model) CoordinateFrameExprConformance(scope *symbols.Scope, e *ast.OperatorExpr, want *symbols.Symbol) (Conformance, bool)
CoordinateFrameExprConformance judges `cf * u` and `cf / u`, cf a coordinate frame and u a measurement unit, as the frame composed; false for another expression.
func (*Model) CoordinateFrameExprType ¶
CoordinateFrameExprType is the type of `cf * u` or `cf / u`, cf a coordinate frame and u a measurement unit: CoordinateFrame, as the calcs declare; else nil.
func (*Model) CouldHold ¶
CouldHold reports whether a feature of the given type could hold a value of the scalar type prim: either the type conforms to it, or it conforms to the type, as every value does to `Anything`.
func (*Model) CrossFeature ¶
CrossFeature returns Feature::crossFeature: the feature sym's first cross subsetting reaches, else the cross feature an end declares in its body, or nil.
func (*Model) CrossedFeatureChain ¶
func (m *Model) CrossedFeatureChain(sym *symbols.Symbol, rel *ast.Relationship) (base, cross *symbols.Symbol, ok bool)
CrossedFeatureChain resolves the two features a cross subsetting chains, the end it starts from and the feature it reaches; ok is false for any other shape.
func (*Model) DeclaredAnnotationFactsOf ¶ added in v0.9.2
func (m *Model) DeclaredAnnotationFactsOf(sym *symbols.Symbol) []symbols.AnnotationFacts
DeclaredAnnotationFactsOf is AnnotationFactsOf over the annotations sym's own declaration states — what its interface record carries; an `about` annotation stated elsewhere travels with the document stating it.
func (*Model) DeclaredDirection ¶ added in v0.11.0
func (m *Model) DeclaredDirection(feature *symbols.Symbol) ast.FeatureDirection
DeclaredDirection returns the direction stated on a feature declaration.
func (*Model) DeclaredFeatureTypes ¶
DeclaredFeatureTypes is FeatureTypes without the kind's base: the types a feature is written with, directly or through the features it specializes.
func (*Model) DeclaredFeatureValues ¶
func (m *Model) DeclaredFeatureValues(sym *symbols.Symbol, feature string) ([]symbols.FilterValue, bool, error)
DeclaredFeatureValues returns a declared member feature's ordered constant values, never answering reflective metaclass features of the same name. The error is a symbols.NeedsHydration when the value is written in a recorded document.
func (*Model) DeclaredSuccessionEndName ¶ added in v0.12.0
DeclaredSuccessionEndName names the end at i of a declared succession: the end of its declared connection type it redefines, else the end of Occurrences::happensBeforeLinks.
func (*Model) DeclaredSuccessions ¶
func (m *Model) DeclaredSuccessions(scope *symbols.Scope, owner *symbols.Symbol, members []ast.Node) []ActionSuccession
DeclaredSuccessions returns the successions members declare, in order, with end names resolved in scope; owner, which may be nil, is recorded on each.
func (*Model) DeclaredSupertypes ¶ added in v0.11.0
DeclaredSupertypes returns sym's direct supertypes without the generals its kind implies: what a declaration states, directly or through a chain it names.
func (*Model) DeclaredTypes ¶
DeclaredTypes are the types sym's own typing relationships name, in declaration order, each resolved in the scope that declares sym and followed through any alias; a typing that does not resolve to an element is left out.
func (*Model) DeclaredUnitProduct ¶ added in v0.9.2
func (m *Model) DeclaredUnitProduct(sym *symbols.Symbol, name string) UnitProduct
DeclaredUnitProduct is the product of the one unit sym declares, spelt name, flagged by what it reduces to: dimension one, and the identity where it is `one`.
func (*Model) DeclaresKerMLClassifier ¶
DeclaresKerMLClassifier reports whether sym is a KerML classifier declaration the symbol table records as a usage, such as `datatype D;` or `function F;`.
func (*Model) DeclaresResolvedType ¶
DeclaresResolvedType reports whether sym resolves a declared type — directly, via subsetting/redefinition, or an implicit kind base no prim value can be of (Part, not Anything).
func (*Model) DefaultMultiplicityOf ¶ added in v0.12.0
DefaultMultiplicityOf is the multiplicity of a feature that declares and inherits none: the usual default [0..*] (KerML 1.1 §7.4.12, §7.4.5.2; SysML v2 §7.6.3), or the implicit [1..1] of an eligible SysML usage (ImplicitMultiplicityApplies) and of an end feature — every SysML end (SysML v2 §7.13.1), and a KerML end of a binary association or connector, whose ends redefine the [1..1] ends of BinaryLink.
func (*Model) DescribesReference ¶
DescribesReference reports whether member, a library attribute of a described reference type, is kept in typ's shape although a value type declares it.
func (*Model) DifferencingTypes ¶
DifferencingTypes returns the targets of sym's `differences` relationships: the values of the first that are none of the rest are sym's (KerML 1.0 §8.3.3).
func (*Model) DimensionFactsOf ¶
DimensionFactsOf returns the dimension to record for a library symbol, or nil when it is undetermined or its base quantities have no qualified name to restore them by.
func (*Model) DimensionOfExpr ¶
DimensionOfExpr reports the dimension of an expression's value when the declarations it names determine it statically. A dimension that only evaluation determines — an untyped feature, parameter or result, an unresolved reference, an unbound redefinition — is reported as unknown rather than guessed.
func (*Model) DimensionOfFeature ¶
DimensionOfFeature reports the dimension a feature's values are measured in, as its declared quantity type fixes it.
func (*Model) DimensionOfType ¶
DimensionOfType reports the dimension a declared type fixes for the values it types, as DimensionOfFeature does for a feature's own declaration. A write target known only by the type it was declared with is judged through this.
func (*Model) DimensionOfUnit ¶
DimensionOfUnit reports the dimension a reduced unit measures in, so a value carrying a unit can be checked against the dimension a feature declares.
func (*Model) DirectMemberSources ¶
DirectMemberSources returns the symbols that contribute members to sym in one step, deduplicated: the edges MemberSources takes the closure of. A caller enumerating names needs the steps, not the closure, to tell which types a derivation traversed (KerML 8.2.3.5, inheritedMemberships' excluded types).
func (*Model) DirectRedefinedFeatures ¶ added in v0.11.0
DirectRedefinedFeatures returns the features sym itself redefines: by clause, then by position (parameter, connector end, case role), then by name in a metadata body.
func (*Model) DirectSupertypes ¶
DirectSupertypes returns the immediate supertype symbols of sym: the resolved targets of its generalization relationships. Unresolved or non-def/usage targets are skipped. The result is memoized and deterministic (declaration order, duplicates removed).
func (*Model) DocumentationOf ¶
DocumentationOf reads Element::documentation (KerML 1.1 §8.2.4) as display prose (source.CommentProse), one per `doc` the element owns in declaration order; Documentation::body itself is exact. A blank or unreadable body is left out.
func (*Model) EffectiveDirection ¶ added in v0.11.0
func (m *Model) EffectiveDirection(owner, feature *symbols.Symbol) ast.FeatureDirection
EffectiveDirection returns a feature's direction in the context of its owner.
func (*Model) EffectiveIsComposite ¶ added in v0.11.0
EffectiveIsComposite reports the modeled Feature::isComposite value.
func (*Model) EffectiveMultiplicityOf ¶
EffectiveMultiplicityOf returns the multiplicity governing a feature symbol: the one it declares, or its default (DefaultMultiplicityOf) when it declares none.
func (*Model) EffectiveNameOf ¶
EffectiveNameOf is Element::effectiveName: the declared name, or the one of the feature an unnamed feature takes its identifiers from (KerML 1.1 §8.2.4).
func (*Model) EffectiveParameterRange ¶ added in v0.9.2
EffectiveParameterRange is the multiplicity a parameter is held to (SysML v2 §7.6.3): what its redefinition chain and related features declare, the implicit [1..1] where it qualifies, else [0..*].
func (*Model) EffectiveParameterRangeAlong ¶ added in v0.9.2
EffectiveParameterRangeAlong is EffectiveParameterRange over an explicit redefinition chain; the ranges of all subsetted and redefined features intersect (KerML 1.0 §7.3.4.4, §7.3.4.5).
func (*Model) EffectiveShortNameOf ¶
EffectiveShortNameOf is Element::shortName: the declared short name, or, for a feature declaring neither identifier, that of the feature it takes its identifiers from (KerML 1.1 §8.2.4, §8.3.3.3).
func (*Model) ElementMetadataOf ¶
func (m *Model) ElementMetadataOf(sym *symbols.Symbol) []ElementMetadata
ElementMetadataOf returns the metadata annotating sym — the same side table an element filter classifies by — in textual order: by the document stating each annotation (in the index's document order), then by source position, so an `about` annotation written before an inline one comes first.
func (*Model) EndFeatures ¶
EndFeatures returns the end features of the type sym, its own in declaration order followed by those it inherits and does not redefine.
func (*Model) EndMultiplicityIsOne ¶
EndMultiplicityIsOne reports whether end feature sym declares, or takes from a general, the multiplicity 1..1 (KerML 1.1 §8.3.3.3); a SysML end defaults to it.
func (*Model) EnumeratedValuesOf ¶
EnumeratedValuesOf returns every literal an enumeration definition has, the unnamed ones (`enum def Size :> Real { = 60.0; }`) included, its own and those inherited from the enumerations it specializes: together they are its only instances.
func (*Model) Eval ¶
Eval attempts to evaluate n as a model-level constant. It returns ok=false for anything outside the supported subset (feature references, strings, null, unsupported operators, or arithmetic on infinity) — callers then skip the check, matching the pilot's model-level-evaluable gating.
func (*Model) EvalClassification ¶
func (m *Model) EvalClassification(scope *symbols.Scope, e *ast.OperatorExpr, elem *symbols.Symbol) (bool, error)
EvalClassification evaluates the classification `@T`/`@@T` that e writes against one element, for a caller that has settled which element the subject denotes — the runtime value evaluator, whose `@` has a subject expression a filter condition has no equivalent of. e's operand is not looked at here.
The type is resolved and the verdict decided by the same code a filter condition is compiled and run with, so a classification cannot answer one way in a filter and another in an expression. A condition outside the evaluable subset — a type that does not resolve — is a *FilterError wrapping ErrFilterUnevaluable, as it is at the model level.
func (*Model) EvalElementFilter ¶
EvalElementFilter evaluates a filter condition for one candidate element, returning whether the candidate is selected, or a *FilterError saying why no verdict is possible.
func (*Model) EvalIn ¶
EvalIn is Eval reading through the features n names, in scope, to the values they are bound to (`attribute one = 1;` then `[one]`).
func (*Model) EvalQuantity ¶
EvalQuantity folds a constant expression over quantities `magnitude [unit]`. A result whose unit cancels, or a comparison, is a bare value in UnitOne.
func (*Model) EvalWithin ¶ added in v0.10.0
EvalWithin is Eval under an Integer size budget of maxBits rather than the default: it declines a fold any of whose Integer results would need more, so the run evaluating the expression reports it under the budget it runs with.
func (*Model) Evaluates ¶
Evaluates reports whether calling sym yields a result: it is a calc (a KerML function), or a feature typed by one, which is what an expression evaluates.
func (*Model) ExposedElements ¶
ExposedElements returns what view exposes, in declaration order and once each: its own `expose` relationships followed by those of the views it specializes, since an Expose is protected; an inherited expose is admitted against this view's own conditions too. An empty set is no error, a non-view is ErrNotAView, and a nested view's own set is asked of it directly.
func (*Model) ExposedMembers ¶ added in v0.10.0
ExposedMembers returns ExposedElements plus the unnamed members its exposes reach, admitting each member through the same view filters.
func (*Model) ExprConformsTo ¶
func (m *Model) ExprConformsTo(scope *symbols.Scope, node ast.Node, want *symbols.Symbol) Conformance
ExprConformsTo reports whether an expression's value conforms to want, as far as the declarations the expression names determine it statically: a literal by its scalar type, a feature by its declared type, a quantity literal by the unit it is written in, an invocation by its result, an arithmetic expression by the dimension of its value, `null` as the empty Anything. A feature declared by nothing but a value is typed by that value (KerML checkFeatureValuationSpecialization); a declared type is never narrowed by the value.
func (*Model) ExprConformsToLibrary ¶
ExprConformsToLibrary is ExprConformsTo against the library type named by fqn, unknown when the library declaring it is not loaded.
func (*Model) ExprResultType ¶
ExprResultType is the type of an expression's result: that of the feature it names, else what its syntax declares (literal, operator, constructor); nil if unknown.
func (*Model) ExprResultTypes ¶
ExprResultTypes is every type an expression's result is declared with, where ExprResultType picks one; empty when not statically known.
func (*Model) ExpressionArguments ¶ added in v0.12.0
ExpressionArguments are the operands of the expression element expr, as expression elements; each is the value of the parameter at its position.
func (*Model) ExpressionChainFeature ¶ added in v0.12.0
ExpressionChainFeature is the Feature the expression element expr owns for the dotted name of its function or target feature; nil where the name is plain.
func (*Model) ExpressionParameters ¶ added in v0.12.0
ExpressionParameters are the `in` parameters of the expression element expr, one per operand and one per type argument, in the conversion's order.
func (*Model) ExpressionResult ¶ added in v0.12.0
ExpressionResult is the `out` parameter of the expression element expr, nil for an expression whose evaluation yields none (a literal, a reference).
func (*Model) ExtentOperand ¶
ExtentOperand is the element an extent expression `all T` names, an alias followed, whatever it is; false where node is no extent expression or the name resolves to nothing.
func (*Model) ExtentType ¶
ExtentType is the type an extent expression `all T` names. Nil where the name resolves to nothing or to an element that is no type, such as a package.
func (*Model) FeatureBaseFQN ¶
FeatureBaseFQN returns the standard-library base feature a feature declaration or usage kind subsets when it declares none.
func (*Model) FeatureIsConstant ¶ added in v0.10.0
FeatureIsConstant derives Feature::isConstant: declared `constant`, or implied for an end that may vary in time.
func (*Model) FeatureIsVariable ¶
FeatureIsVariable derives KerML Feature::isVariable (KerML 1.1 §8.3.3.1): declared by `var` or `const` in KerML, and redefined as Usage::mayTimeVary for a SysML usage. A cross feature's membership is no FeatureMembership, so it has no owningType.
func (*Model) FeatureReadOnly ¶ added in v0.10.0
FeatureReadOnly reports whether sym is a feature no behavior may write: declared `derived`, or redefining one that is, since a redefining feature has the same values as the feature it redefines (KerML 1.0 §7.3.4.5); else declared `constant`, or subsetting or redefining a feature that is (KerML 1.0 §8.3.3.3, validateSubsettingConstantConformance).
func (*Model) FeatureTypeSet ¶
FeatureTypeSet returns a feature's types as KerML §8.3.3.3 derives Feature::type: the declared types of the feature and of every feature it subsets, redefines or references, keeping only the most specific; a feature reaching none has the types of its kind's base feature, or that base itself when it is a definition.
func (*Model) FeatureTypeSetWithImplied ¶ added in v0.12.0
FeatureTypeSetWithImplied is FeatureTypeSet plus the types the implied specializations of sym's kind contribute (KerML §8.3.3.3.4 deriveFeatureType unions every subsetted feature's types).
func (*Model) FeatureTypes ¶
FeatureTypes returns a feature's effective types: those it declares, else those of the features it redefines or subsets (KerML §8.3.3.3), else its kind's base.
func (*Model) FeaturingTypes ¶ added in v0.10.0
FeaturingTypes are the types sym declares itself `featured by` (KerML 7.3.4.3), from the recorded facts of a cached library symbol or from its declaration.
func (*Model) FixedDimensions ¶
FixedDimensions is the `dimensions` sym fixes by a constant on Array's feature or a redefinition of it (`'3dCoordinateFrame'`: `:>> dimensions = 3`); else false.
func (*Model) FixesMeasurementReference ¶
FixesMeasurementReference reports whether a quantity type states a measurement reference of its own, so its values are exactly the quantities that reference measures; a subtype inheriting one narrows it by something else.
func (*Model) FlowEndAttachments ¶
func (m *Model) FlowEndAttachments(sym *symbols.Symbol) []FlowEndAttachment
FlowEndAttachments returns the declared from/to targets of a flow usage.
func (*Model) FrameFeature ¶
FrameFeature reports whether a library-declared member frames the object rather than describing it, so that the shape leaves it out.
func (*Model) FrameRoot ¶ added in v0.11.0
FrameRoot reports a Kernel member of typ the runtime answers itself rather than from the shape: a restatement of a frame root, a frame featuring, or what a frame root restates (`portions`).
func (*Model) FramedConcernTarget ¶
FramedConcernTarget returns the concern a `frame` member frames: the concern definition it is typed by, or the concern usage it references — the element named, not what that element in turn specializes, whose values it may mask. It is nil when the framing names no concern.
func (*Model) FramedConcernsOf ¶
FramedConcernsOf returns the `frame` concern usages a viewpoint declares followed by those it inherits, in declaration order and once each.
func (*Model) FramedQuantityConformance ¶
func (m *Model) FramedQuantityConformance(scope *symbols.Scope, n *ast.IndexExpr, want *symbols.Symbol) (Conformance, bool)
FramedQuantityConformance judges numbers written in a coordinate frame, named or composed (`(1, 2, 3) [cf]`, `(1, 2, 3) [cf / s]`), against want; false when the literal's index is not a frame.
func (*Model) FunctionTypes ¶ added in v0.12.0
FunctionTypes: the Functions among a feature's effective types (declared, inherited, or implied by its kind) — those typing an expression that instantiates it (KerML 8.3.4.7.3).
func (*Model) GeneralizationTargetOf ¶ added in v0.10.0
GeneralizationTargetOf is the supertype a generalization relationship of sym names, as DirectSupertypes reads it: a same-named subsetting targets the inherited feature; nil when the target does not resolve or is sym itself.
func (*Model) GoverningMultiplicityOf ¶ added in v0.9.2
GoverningMultiplicityOf returns the multiplicity governing a feature: the one it declares or inherits by redefinition, or its default where it has none.
func (*Model) GoverningMultiplicitySource ¶ added in v0.10.0
GoverningMultiplicitySource returns the alias-resolved feature whose declared multiplicity governs sym: sym itself when it declares one, else the first feature it redefines that does. Subsetting alone does not inherit multiplicity.
func (*Model) HasArgumentTyper ¶
HasArgumentTyper reports whether the checker's argument typing is installed, so SelectCall selects what the checker selects rather than by arity and names alone.
func (*Model) HasMember ¶
HasMember reports whether member is among MembersOf(sym), without enumerating the members past it.
func (*Model) HasSpecializationCycle ¶
HasSpecializationCycle reports whether sym participates in a specialization cycle: sym is reachable from itself through one or more generalization edges (including a direct self-specialization). AllSupertypes excludes its own starting node, so sym is detected via a back-edge from one of its supertypes.
func (*Model) HeldByValue ¶
HeldByValue reports a member the value of a value-held library type carries itself (`num`, `mRefs`, a constraint); a stated (`isBound default false`) or record-typed one is its object's.
func (*Model) HoldsSet ¶
HoldsSet reports whether a multi-valued feature of typeSym holds a set rather than a sequence: `elements` of a library Collection whose own redefinition of it is unique and not ordered — Set's and Map's, not Bag's, which inherits the nonunique root, and not OrderedSet's or OrderedMap's — unless the feature itself is declared ordered or nonunique.
func (*Model) ImplicitBases ¶ added in v0.11.0
ImplicitBases returns the implicit base types and features for sym.
func (*Model) ImplicitEndRedefinitions ¶
ImplicitEndRedefinitions returns the ends of the types its owner specializes that sym redefines by occupying their position, whatever its `:>>` clauses name besides. The features it redefines are one feature with it, so an object holds one set of values under all their names.
func (*Model) ImplicitGenerals ¶
ImplicitGenerals returns the general types sym has by its kind rather than by declaration. A scope reached through a recursive import does not traverse them (KerML 8.2.3.5).
func (*Model) ImplicitMultiplicityApplies ¶ added in v0.9.2
ImplicitMultiplicityApplies reports whether a SysML usage metaclass takes [1..1] unless a subset, redefinition, reference, or cross-subsetting targets a type-owned feature.
func (*Model) ImplicitParameterRedefinitions ¶
ImplicitParameterRedefinitions returns the features sym implicitly redefines as a parameter of its owning behavior or step: the parameter at the same position of each general behavior or step, or, for a result parameter, their result parameters. It returns nothing for a feature that is not a parameter, or whose declaration redefines something explicitly.
func (*Model) ImplicitRelationships ¶ added in v0.10.0
ImplicitRelationships returns the specialization-family relationship objects sym owns — the relationships written as notation on its declaration, each reflected as an element of its own (KerML 8.3.3) — in textual order. The objects are synthesized per model, memoized so every call returns the same pointers, and are never registered in a scope or index. Kinds outside the family still consume their ordinal, so AST and recorded owners enumerate alike.
func (*Model) ImplicitRoleRedefinitions ¶
ImplicitRoleRedefinitions returns the features sym redefines by its role: the library `viewRendering` for a view's `render` member, and the same-role features of the owner's generals that sym does not redefine by name: every one for a subject, each general's first for a first objective. An analysis case may state several objectives, and each one redefines the general's effective objective at the same position. An actor or stakeholder redefines each general's effective actor at its position (KerML §7.4.7.3).
func (*Model) ImplicitSubsettings ¶ added in v0.9.2
ImplicitSubsettings returns the feature of its owning type a nested usage implicitly subsets (SysML v2 §8.3: a composite part in an item is one of its `subparts`, an action in a part one of its `ownedActions`), or nothing.
func (*Model) ImplicitlyDeclaresOne ¶ added in v0.12.0
ImplicitlyDeclaresOne reports whether a feature declaring no multiplicity has the implicit [1..1] declared for it: an eligible SysML usage or an end feature.
func (*Model) ImpliedBaseFQNs ¶ added in v0.11.0
ImpliedBaseFQNs returns standard-library bases implied by an AST-backed declaration when its semantic symbol is unavailable.
func (*Model) ImpliedBaseFQNsForMetaclass ¶ added in v0.11.0
ImpliedBaseFQNsForMetaclass returns standard-library bases implied by a graph element's metaclass when its semantic symbol is unavailable.
func (*Model) ImpliedBaseFeatures ¶ added in v0.11.0
ImpliedBaseFeatures returns the implied generals of sym that are features: the base usage of its kind, or Base::things when its kind names none.
func (*Model) ImpliedEndName ¶ added in v0.12.0
ImpliedEndName names the end at i of a connector the notation mints with no declaration of its own: the end its kind's base declares there, else the binary name.
func (*Model) InheritanceMasked ¶
InheritanceMasked reports whether sym does not inherit candidate because one of its features redefines it. Callers enumerating or resolving inherited members ask here; resolving a redefinition target itself must not, as that reference names the masked feature (KerML 7.3.4.5).
func (*Model) InheritanceMaskedRedefining ¶
InheritanceMaskedRedefining is InheritanceMasked as a redefinition written in sym sees it: the redefinitions sym itself declares mask nothing, so the target it names stays resolvable, while inherited redefinitions still mask (KerML 8.3.3.3.6). Every other reference sees InheritanceMasked.
func (*Model) InputParametersOf ¶
InputParametersOf is a behavior's `in` and `inout` parameters, inherited and declared, in the order arguments bind them.
func (*Model) InstanceOf ¶ added in v0.12.0
InstanceOf reports whether a candidate's metaclass conforms to a metaclass Metaclass answered, so a PartUsage is an instance of Usage, Feature and Element.
func (*Model) InterfaceEndPortMismatch ¶
InterfaceEndPortMismatch returns the port types of the two ends of the interface sym when they do not match with conjugate directions (§7.12.2). Ends whose port type is not resolvable, and interfaces whose ends are not both declared, are not reported.
func (*Model) IntersectingTypes ¶
IntersectingTypes returns the targets of sym's `intersects` relationships: the types whose common values are sym's (KerML 1.0 §8.3.3), memoized.
func (*Model) IsAngularMeasureUnit ¶
IsAngularMeasureUnit reports whether sym is a unit of plane angle (rad, °, ′): one of the dimension-one units a trigonometric function may take.
func (*Model) IsAssociationOrConnector ¶ added in v0.11.0
IsAssociationOrConnector reports whether sym's declaration kind makes it an Association or a Connector (assoc, interaction, connector, flow, SysML connection kinds); no library is needed.
func (*Model) IsBehaviorType ¶ added in v0.10.0
IsBehaviorType reports whether sym is a behavior type, directly or through a specialization, including interactions and behavior-like library types.
func (*Model) IsBinaryConnector ¶
IsBinaryConnector reports whether sym conforms to the library's binary-link base, including through cached/index-only specialization edges.
func (*Model) IsConjugated ¶
IsConjugated reports whether sym's inherited features have reversed directions. Conjugation composes, so `~` of a conjugate is the original.
func (*Model) IsConnectorObjectUsage ¶
IsConnectorObjectUsage reports whether sym is materialized as a connector object from the features its ends name.
func (*Model) IsConnectorUsage ¶
IsConnectorUsage reports whether sym declares a connector usage that joins features it names — a `connection`/`interface`/`allocation`/`connector` usage with a `connect … to …` clause. Such a usage is materialized from the features its ends attach to, unlike a usage that only holds objects of its own.
func (*Model) IsCoordinateFrame ¶
IsCoordinateFrame reports whether typ is CoordinateFrame or a specialization: a frame, or a scale, since an IntervalScale is a one-dimensional frame.
func (*Model) IsDataType ¶
IsDataType reports whether sym is Base::DataValue or conforms to it, so its values are data (scalars, enumerations, attribute values) and never elements.
func (*Model) IsDescribedReference ¶
IsDescribedReference reports whether objects of typ carry their library members: a coordinate frame, a measurement scale, a coordinate transformation or a definitional value, but not a measurement unit.
func (*Model) IsFlowPayload ¶ added in v0.12.0
isAssertedConstraint reports a constraint usage written `assert constraint c` or `assert c` (SysML.xtext AssertConstraintUsage), from its declaration or record. IsFlowPayload reports the payload a flow declares with `of p : T`; a recorded symbol carries it as ModPayloadFeature.
func (*Model) IsIdentityUnit ¶ added in v0.9.2
IsIdentityUnit reports whether sym is the identity of unit products, as MeasurementReferences::one is: a unit of DimensionOneUnit itself — of no specialization of it, as an angular unit is — reducing to scale one, as a unit scaling `one` by convention (a percent) does not.
func (*Model) IsKerMLFeature ¶ added in v0.11.0
IsKerMLFeature reports whether sym is a KerML feature declaration.
func (*Model) IsLayoutAnnotation ¶
IsLayoutAnnotation reports whether sym is a metadata usage typed by one of the DiagramLayout definitions: a statement about a picture, not model content.
func (*Model) IsMeasurementScale ¶
IsMeasurementScale reports whether sym is a feature typed by a measurement scale (`Time::UTC`, `SI::'°C_abs'`): a scalar reference that is not a unit.
func (*Model) IsMeasurementUnit ¶
IsMeasurementUnit reports whether sym is a feature typed by a measurement unit, which is what may stand in the unit position of a quantity expression.
func (*Model) IsMigrationAnnotation ¶ added in v0.9.2
IsMigrationAnnotation reports whether sym is a metadata usage typed by SynthesizedName, StandIn or AppliedStereotype: a record of the migration, not model content.
func (*Model) IsOptionalParameter ¶
IsOptionalParameter reports whether a parameter may be left without an argument: its declared multiplicity admits no value (KerML 1.0 §7.4.7.2, an input parameter with lower bound 0). One declaring none holds one value.
func (*Model) IsSelf ¶
IsSelf reports whether sym is a thing's `self` feature: Base::Anything::self or a feature restating it, such as DataValue::self or a definition's own redefinition.
func (*Model) IsSubrequirement ¶ added in v0.12.0
IsSubrequirement reports whether sym is a subrequirement (SysML v2 §7.21.2): a composite requirement usage nested in a requirement definition or usage, a required constraint of its container.
func (*Model) IsUnique ¶
IsUnique reports whether a feature holds no two equal values (KerML 7.3.4.4): not if declared nonunique, else when every feature it redefines is (7.3.4.5), else yes.
func (*Model) IsVariationFeature ¶
IsVariationFeature reports whether sym is a variation point: a variation itself (declared, or an enumeration definition) or a usage specializing a declared one. A usage typed by an enumeration holds one of its values, as any attribute does.
func (*Model) IsVectorReference ¶
IsVectorReference reports whether sym is a VectorMeasurementReference and not a scalar one: a coordinate frame, but not a unit or a scale.
func (*Model) KindBaseFQNs ¶
KindBaseFQNs returns the standard-library bases every declaration of sym's kind conforms to, implicitly or through its declared chain: one for most kinds, an association and a behavior base for an interaction.
func (*Model) LayoutOf ¶
func (m *Model) LayoutOf(view, elem *symbols.Symbol) (*LayoutSite, bool)
LayoutOf resolves the Layout of elem as drawn in view: the first Layout annotation stated in the view's body, else the first one applying in every view. With no view — a rendering of elements outside any view — only the latter apply. The site is returned whether or not it reads as geometry, so what it could not read is reported rather than dropped.
func (*Model) LayoutSiteDeclaredBy ¶ added in v0.12.0
LayoutSiteDeclaredBy is the DiagramLayout annotation sym declares — a metadata usage, inline or with an `about` clause — as the site of the element it annotates, with that element; nil for any other symbol.
func (*Model) LayoutSitesOf ¶
func (m *Model) LayoutSitesOf(sym *symbols.Symbol) []*LayoutSite
LayoutSitesOf returns the DiagramLayout annotations of sym in the order AnnotationSitesOf lists them, memoized: inline ones first, then `about` ones, each in declaration order.
func (*Model) LiteralConforms ¶
LiteralConforms reports whether sym is an enumeration literal whose enumeration conforms to expected: a literal is a value of its enumeration.
func (*Model) LiteralsOf ¶
LiteralsOf returns the named literals an enumeration definition declares, including the ones it inherits from an enumeration it specializes.
func (*Model) LookupBinding ¶
func (m *Model) LookupBinding(scope *symbols.Scope, typ *symbols.Symbol, name *ast.QualifiedName) (*symbols.Symbol, bool)
LookupBinding resolves the name a named argument binds within typ: a single segment is looked up as a member of typ, a qualified name from scope; aliases resolve through.
func (*Model) LookupContributedMember ¶
LookupContributedMember is LookupMember without sym's own declarations: only the members contributed by what sym specializes, is typed by or reference-subsets. Callers that must not see a local binding — resolving a reference subsetting's target past the borrowed name it binds itself — ask for the contributed member instead.
func (*Model) LookupContributedMembers ¶
LookupContributedMembers is LookupContributedMember collecting the member each source contributes under name, in source order, without duplicates.
func (*Model) LookupMember ¶
LookupMember returns the member sym has under name, as MembersOf reports them: its own declaration, else an inherited member it does not redefine, else the feature of sym redefining that member and so answering to its name.
func (*Model) MaskingRedefinedFeatures ¶ added in v0.12.0
MaskingRedefinedFeatures returns the features sym redefines by clause or by case role: the ones its owner does not inherit (KerML 7.4.7).
func (*Model) MayShareValues ¶
MayShareValues reports whether a cast from a value of typ to target can select anything: either type classifies values of the other, or one is composed of a type that does — a value of `Wheeled unions Car, Truck` may well be a Car.
func (*Model) MeasurementRefConforms ¶
func (m *Model) MeasurementRefConforms(typ *symbols.Symbol, unit UnitTerm, want *symbols.Symbol) Conformance
MeasurementRefConforms judges a measurement reference against a declared type: by the type it is declared with (typ, DerivedUnit for a composed unit), or else by dimension when want is a unit definition fixing one, as `m*m` is an AreaUnit. A scale (TimeScale) fixes a dimension too, but no unit is a scale.
func (*Model) MeasurementRefExprConformance ¶
func (m *Model) MeasurementRefExprConformance(scope *symbols.Scope, e *ast.OperatorExpr, want *symbols.Symbol) (Conformance, bool)
MeasurementRefExprConformance judges a product, quotient or power of measurement units (`m * s`), the DerivedUnit such a composition is; false for any other expression.
func (*Model) MeasurementRefExprType ¶
MeasurementRefExprType is the type of a product, quotient or power of measurement units: DerivedUnit, a unit of powers of other units; nil for any other expression. A power by a Real not known statically is one too, of a dimension the runtime finds.
func (*Model) MeasurementRefFeatureType ¶
MeasurementRefFeatureType is the measurement unit type of a feature, declared or taken from its value (`attribute area = m * m;` is a DerivedUnit); nil for any other.
func (*Model) MeasurementScaleOf ¶
MeasurementScaleOf is the scale a unit term is a point on (`26.85 ['°C_abs']`): its one unscaled factor at power one, when that is a scale; false for a unit.
func (*Model) MeasurementUnitOf ¶
MeasurementUnitOf is the measurement unit sym names: sym itself, or the unit an alias such as SI::'m/s²' stands for; false for anything else.
func (*Model) MemberLayoutOf ¶ added in v0.9.2
MemberLayoutOf resolves the Layout of the member owner has under name, as drawn in view. A member is one element for every namespace inheriting it — the `start` and `done` every body has come from the library, the states a usage has from its definition — so the sites resolve among those naming it as owner's: `about Acquire::start`, or `about start` stated where Acquire is the nearest namespace having a start. An inheriting owner falls back to the declaring owner's sites: an inline Layout on the member, one qualified through the declaring owner, or one stated unqualified where no other namespace has the member. A site naming the member as another inheritor's is not owner's.
func (*Model) MemberLayoutOwner ¶ added in v0.9.2
MemberLayoutOwner is the namespace a Layout site positions member as a member of, by the rule MemberLayoutOf resolves by: the namespace a qualified `about` names it through, the referent of an unqualified one, else the declaring owner. Nil for an inline Layout, which every inheriting owner may fall back to.
func (*Model) MemberNotesOf ¶ added in v0.11.0
func (m *Model) MemberNotesOf(view, owner *symbols.Symbol, name string) []*LayoutSite
MemberNotesOf lists every Note of the member owner has under name, drawn in view: those naming the member as owner's, as MemberLayoutOf resolves them, then the declaring owner's; every one applying in view applies, as NotesOf.
func (*Model) MemberSources ¶
MemberSources returns the symbols whose scopes contribute members to sym, in deterministic breadth-first order and excluding sym itself: what sym specializes (DirectSupertypes) and what it reference-subsets (ReferencedFeature), transitively.
Reference subsetting is a kind of subsetting, and subsetting is a kind of specialization (KerML 8.3.3.3.9), so a referencing feature inherits the referenced feature's features: `perform action takePhoto references takePicture` makes takePicture's members reachable as `takePhoto.focus`. It is kept out of DirectSupertypes because that relation also drives conformance and implicit typing, which this implementation does not yet derive from reference subsetting — see docs/project/spec-compliance.md.
func (*Model) MemberSourcesStable ¶
MemberSourcesStable reports whether the last MemberSources answer for sym was complete and memoized, so a caller may memoize what it derived from it.
func (*Model) MemberStyleOf ¶ added in v0.11.0
MemberStyleOf resolves the Style of the member owner has under name, as drawn in view, as MemberLayoutOf resolves a Layout.
func (*Model) MembersOf ¶
MembersOf returns the members visible on sym: those declared directly in its owned scope plus members inherited from what it specializes and what it reference-subsets. Two maskings apply: a member declared closer to sym hides an inherited member of the same name, and a feature redefined by one of sym's features is not inherited at all (see masking.go). Results are deterministic: local members first (declaration order), then contributed members in MemberSources order.
func (*Model) MembersOfDeclaring ¶
MembersOfDeclaring returns the members of sym as a declaration being written in it sees them: that declaration is not yet a member of its own owner and the redefinition it carries masks nothing, so its target stays resolvable (KerML 8.3.3.3.6). Sym's other declarations, and the masks they cause, are present. A nil declaring — the caller cannot tell which declaration is being written — stands for every redefinition sym declares.
func (*Model) MembersOfIncludingRedefined ¶
MembersOfIncludingRedefined is MembersOf without redefinition masking: the members a type would have if none of its features redefined anything. A redefinition shares its target's feature value, so the runtime shape needs both.
func (*Model) Metaclass ¶ added in v0.9.2
Metaclass is the library element declaring the SysML or KerML metaclass of the simple name, or nil where the loaded libraries declare none.
func (*Model) MetaclassConforms ¶
MetaclassConforms reports whether a candidate's metaclass conforms to a type.
func (*Model) MetaclassOf ¶
MetaclassOf is the reflective metaclass classifying sym's declaration — the library element `x meta T` yields an instance of — or nil where none is known.
func (*Model) MetadataBodyInevaluableValues ¶
func (m *Model) MetadataBodyInevaluableValues(scope *symbols.Scope, prefix *ast.PrefixMetadata, runDecided bool) []ast.Node
MetadataBodyInevaluableValues returns the values written in the body of the annotation that are not model-level evaluable, at any nesting depth. A metadata feature is a model-level element, so its value must be one the model alone decides (KerML 7.4.7, Expression::isModelLevelEvaluable); runDecided admits features whose values a run reads by design.
func (*Model) MetadataBodyInevaluableValuesOf ¶
func (m *Model) MetadataBodyInevaluableValuesOf(def *symbols.Symbol, scope *symbols.Scope, body []ast.Node, runDecided bool) []ast.Node
MetadataBodyInevaluableValuesOf is MetadataBodyInevaluableValues for a body whose declarations are registered in scope, such as that of `metadata m : A { … }`; def is the metadata type, nil when it does not resolve; runDecided controls whether the run-decided feature exemption applies.
func (*Model) MetadataBodyTargetOf ¶ added in v0.9.2
func (m *Model) MetadataBodyTargetOf(owner *symbols.Symbol, scope *symbols.Scope, usage *ast.Usage) *symbols.Symbol
MetadataBodyTargetOf is the feature of the metadata type owner a body declaration restates, by `:>>` or by name; nil when owner is unknown or it restates none.
func (*Model) MetadataBodyViolations ¶
MetadataBodyViolations returns the declarations in the body of the annotation that redefine no feature of the metadata type it names, at any nesting depth. It returns nothing when the type does not resolve: an unresolved reference is reported by name resolution, and every name under it would be a false report.
func (*Model) MetadataBodyViolationsOf ¶
func (m *Model) MetadataBodyViolationsOf(def *symbols.Symbol, scope *symbols.Scope, body []ast.Node) []ast.Node
MetadataBodyViolationsOf is MetadataBodyViolations for a body whose metadata type is already resolved and whose declarations are registered in scope — the body of `metadata m : A { … }` as much as of `@A { … }`.
func (*Model) MetadataDefaultOf ¶ added in v0.9.2
MetadataDefaultOf returns the default a feature of a metadata definition or usage declares, one value per element of a sequence expression, as an annotation of that type reads it when it leaves the feature unbound; false for any other symbol.
func (*Model) ModelLevelEvaluable ¶
ModelLevelEvaluable reports whether an expression written in scope can be evaluated from the model alone (KerML 1.0 §7.4.9, Expression::isModelLevelEvaluable).
func (*Model) MultiplicityFactsOf ¶ added in v0.9.2
func (m *Model) MultiplicityFactsOf(sym *symbols.Symbol) *symbols.MultiplicityFacts
MultiplicityFactsOf states the multiplicity sym declares — as a usage or a definition does, or as a `multiplicity` member's range — as a record fact, nil when it declares none. A bound only the declaring scope evaluates is marked Named.
func (*Model) MultiplicityOf ¶
MultiplicityOf returns the extracted multiplicity range of a usage symbol, a subject or a requirement constraint included, or ok=false when the symbol is not a usage or declares none.
func (*Model) NameSynthesized ¶
NameSynthesized reports whether sym's name was made up by a migration: a SynthesizedName annotation applies to it, stated on it or about it.
func (*Model) NamesFeaturingReference ¶
NamesFeaturingReference reports a member restating one of referenceSelfRoots: the frame featuring a transformation, which its value answers rather than its object.
func (*Model) NamingFeature ¶ added in v0.11.0
NamingFeature returns the feature that gives sym its effective name.
func (*Model) NamingFeatureOf ¶ added in v0.10.1
namingFeature is Feature::namingFeature, the feature an unnamed feature takes its identifiers from: what a member named by its reference references, else the first feature it redefines, by clause or by position (KerML 1.1 §8.3.3.3; SysML ConstraintUsage::namingFeature for assume/require/verify members). NamingFeatureOf is the feature sym takes its name and short name from when it declares neither (KerML 8.3.3.3 namingFeature): referenced, else first redefined.
func (*Model) NamingRedefiner ¶
NamingRedefiner returns the feature sym has in place of masked, which it does not inherit: the feature, own or inherited, named by redefining masked, and so answering to masked's identifiers (KerML 8.2.4). Nil when there is none.
func (*Model) NamingRedefinerRedefining ¶
NamingRedefinerRedefining is NamingRedefiner as a redefinition written in sym sees it: only inherited redefinitions mask, so only they substitute.
func (*Model) NestedRedefinitionsOf ¶ added in v0.9.2
func (m *Model) NestedRedefinitionsOf(sym *symbols.Symbol) []NestedRedefinition
NestedRedefinitionsOf lists the nested redefinitions declared directly by sym's body (own members only; inherited ones are found through the type's generals by callers).
func (*Model) NestedViews ¶
NestedViews returns the views declared in view's body, in declaration order, so a caller can walk a view tree.
func (*Model) NotesOf ¶ added in v0.9.2
func (m *Model) NotesOf(view, elem *symbols.Symbol) []*LayoutSite
NotesOf lists every Note of elem drawn in view, in declaration order: those stated in the view's body and those applying in every view. Unlike a Layout, every Note applies; an element may carry several. With a nil view only the latter apply. A view's own notes are free notes.
func (*Model) ObjectivesOf ¶
ObjectivesOf returns the objectives a case owns and the inherited ones that no owned or inherited objective redefines, by clause or by role.
func (*Model) OperatorFunction ¶
func (m *Model) OperatorFunction(op ast.OperatorKind) *symbols.Symbol
OperatorFunction is the library function an operator expression invokes: the first of BaseFunctions, DataFunctions and ControlFunctions declaring the operator's name; nil when the loaded library declares none.
func (*Model) OperatorFunctionNamed ¶ added in v0.11.0
OperatorFunctionNamed is the library function the Kernel Function Library associates with an operator spelling.
func (*Model) OperatorInputAt ¶ added in v0.11.0
OperatorInputAt is the function input bound to an operator operand position.
func (*Model) OperatorInputNamedAt ¶ added in v0.11.0
OperatorInputNamedAt is the function input bound at an operator operand position.
func (*Model) OptionalParameter ¶
OptionalParameter reports whether a call may omit the parameter: it or a parameter it redefines declares a default, or its effective multiplicity admits no value.
func (*Model) OwnFeatureValues ¶ added in v0.11.0
OwnFeatureValues returns the ordered constant values a feature's own valuation binds (KerML Feature::valuation): what its declaration writes, or what the features it redefines write when it writes none. Not a feature: ok is false. The error is a symbols.NeedsHydration for a recorded declaration.
func (*Model) OwnNamingRedefiner ¶
OwnNamingRedefiner returns the feature sym declares in place of masked, named by redefining it, which sym's specializations inherit under masked's names.
func (*Model) OwnRedefinitionMasked ¶
OwnRedefinitionMasked reports whether a feature sym declares redefines candidate, so that what specializes sym does not inherit candidate through sym, whatever sym's own generals still offer along another path.
func (*Model) OwnedAnnotations ¶ added in v0.11.0
OwnedAnnotations returns the Annotations sym owns as their annotated element (KerML 8.3.2.1 Element::ownedAnnotation), each owning its annotating element: one per `#M` prefix metadata feature, and one per annotating element in a relationship body (KerML 8.2.3.3.1 OwnedAnnotation). An annotating element in a namespace body is owned through a membership and annotates the namespace through no Annotation (8.3.2.3.2 deriveAnnotatingElementAnnotatedElement).
func (*Model) OwnedConnectorEnds ¶ added in v0.9.2
OwnedConnectorEnds is ownedEnds for a connector, and false for any other symbol: the end signature an interface record keeps of it.
func (*Model) OwnedCrossFeature ¶
OwnedCrossFeature returns the end's inline cross feature, else the first `member` feature KerML 1.1 Feature::ownedCrossFeature keeps: `reject(oclIsKindOf(Multiplicity) or oclIsKindOf(MetadataFeature) or oclIsKindOf(BindingConnector))`.
func (*Model) OwnedImports ¶ added in v0.11.0
OwnedImports returns the Import objects the namespace sym declares, in declaration order (KerML 8.3.2.5 Namespace::ownedImport).
func (*Model) OwnedMemberships ¶ added in v0.11.0
OwnedMemberships returns the Membership objects through which the namespace sym owns its members, in declaration order (KerML 8.3.2.5 Namespace:: ownedMembership): a synthesized OwningMembership — or the SysML membership kind the member's declaration implies — per owned member, and an alias as itself, since `alias` declares a Membership. An element owned through an Annotation (prefix metadata, a relationship body's annotating element) has no membership (KerML 8.2.3.3.1 OwnedAnnotation).
func (*Model) OwnedRelationships ¶ added in v0.11.0
OwnedRelationships returns the relationships sym owns (KerML 8.3.2.1 Element::ownedRelationship): the Annotations of its prefix metadata, the relationship clauses written on it, and its body's imports, memberships and `about` annotations in source order.
func (*Model) OwnerAnnotatedElementViolation ¶
func (m *Model) OwnerAnnotatedElementViolation(scope *symbols.Scope, typeRef *ast.QualifiedName) (string, bool)
OwnerAnnotatedElementViolation judges an `about`-less annotation written in scope against scope's owner: a document root is a Namespace, an annotation body its metadata feature.
func (*Model) OwningMembership ¶ added in v0.11.0
OwningMembership returns the Membership through which sym's owner owns it, or nil for an element owned through no membership: a root element, an alias or other relationship owned directly, a prefix metadata feature, or a reflected relationship object.
func (*Model) OwningRelationship ¶ added in v0.11.0
OwningRelationship returns the relationship that owns sym (KerML 8.3.2.1 Element::owningRelationship): its owning membership, the Annotation that owns a prefix metadata feature or a relationship body's annotating element, or the relationship whose chain target it denotes; nil for an element owned directly, such as a membership or alias, and for a root element.
func (*Model) ParameterDefault ¶
ParameterDefault is the value the parameter takes when a call binds none: the nearest declared along its redefinitions, with the scope it resolves in. Nil when none is.
func (*Model) ParameterRedefinitionChain ¶
ParameterRedefinitionChain is sym followed by the parameters it redefines, explicitly or by position, nearest first; each declares a usage or a subject.
func (*Model) Performable ¶
Performable reports whether a call site of kind p can run sym: a behavior, or for an evaluated call a feature typed by one, which performs that behavior.
func (*Model) PicturesOf ¶ added in v0.9.2
func (m *Model) PicturesOf(view *symbols.Symbol) []*LayoutSite
PicturesOf lists every Picture of view in declaration order, those in its body and those applying in every view; one on anything but a view draws nothing.
func (*Model) PortFeatures ¶
func (m *Model) PortFeatures(sym *symbols.Symbol) []PortFeature
PortFeatures returns the features of the port sym, declared and inherited, with the direction each has as seen through sym. A closer declaration masks an inherited feature of the same name.
func (*Model) PortsConform ¶
PortsConform reports whether every feature of port a matches one on port b (§7.12.2): conforming types, and conjugate or absent directions.
func (*Model) PrimTypeOf ¶
PrimTypeOf classifies sym against the scalar lattice. A definition is classified by itself or its nearest scalar supertype; a usage by the type it is typed by (typing is a generalization edge, so the same walk covers both). Symbols with no scalar ancestor are PrimUnknown.
func (*Model) QuantityConforms ¶
func (m *Model) QuantityConforms(unit UnitTerm, want *symbols.Symbol) Conformance
QuantityConforms judges a value in a reduced unit against a declared type: a quantity value type by dimension, any other type as a ScalarQuantityValue.
func (*Model) RangeIn ¶
RangeIn is RangeOf evaluating bounds that name valued features in scope; a nil scope evaluates constants only.
func (*Model) RangeOf ¶
func (m *Model) RangeOf(mult *ast.Multiplicity) (Range, bool)
RangeOf extracts the multiplicity range declared on a usage node, or ok=false when it declares none.
func (*Model) ReadsValuelessFeature ¶ added in v0.10.0
ReadsValuelessFeature reports whether evaluating n in scope reaches a feature with no value, directly or through the values of the features it reads.
func (*Model) RecordedRelationshipTargets ¶ added in v0.9.2
func (m *Model) RecordedRelationshipTargets(sym *symbols.Symbol, kind ast.RelationshipKind) []*symbols.Symbol
RecordedRelationshipTargets restores what the relationships of one kind a recorded symbol's declaration wrote resolved to, dropping those that resolved to nothing.
func (*Model) RedefinedFeatures ¶
RedefinedFeatures returns the features sym redefines: the resolved target of each explicit `redefines`/`:>>` clause. Alias targets are resolved through, so the result names elements rather than the bindings that reach them. The implicit redefinitions of parameters, connector ends and metadata body declarations are not declared, and are reported by DirectSupertypes only. Memoized.
func (*Model) ReferencedFeature ¶
ReferencedFeature returns the feature sym reference-subsets: the target of the single `references` / `::>` edge its declaration may carry (KerML 8.3.3.3.9, "A Feature can have at most one ownedReferenceSubsetting"), or nil when it has none or the target does not resolve.
The `perform` and `event` shorthands declare that edge without the keyword: `perform providePower.generateTorque` is a perform action usage whose performed action is related to it by reference subsetting (SysML 7.17.6).
The result is memoized. Resolution of the target runs member lookup, which consults this relation in turn, so a symbol already being resolved yields nil rather than recursing.
func (*Model) ReferentialParameter ¶ added in v0.9.2
ReferentialParameter reports whether a behavior parameter holds no object of its own: an object flows into it, so nothing below it is owned. A data-typed parameter — an attribute or enumeration usage, or one typed by a data type — keeps the value bound to it and is not referential.
func (*Model) ReflectiveElements ¶
ReflectiveElements reads an element-valued metaclass feature of sym as the elements it holds, in model order; ok is false where the feature is not derived.
func (*Model) ReflectiveFeatureValue ¶
func (m *Model) ReflectiveFeatureValue(sym *symbols.Symbol, feature string) (symbols.FilterValue, bool)
ReflectiveFeatureValue reads a metaclass feature derived from the candidate's declaration; ok is false where none is derived.
func (*Model) ReflectiveFeatureValues ¶
func (m *Model) ReflectiveFeatureValues(sym *symbols.Symbol, feature string) ([]symbols.FilterValue, bool)
ReflectiveFeatureValues is ReflectiveFeatureValue for a feature that may hold several values: Element::documentation reads one per `doc` body, in order.
func (*Model) Regather ¶
Regather implements resolve.Regatherer: it collects the gathers of the documents that changed anew and names the shared frames whose indexes they were built into, for the resolver to drop with their dependents.
func (*Model) RelatedFeatureCount ¶
RelatedFeatureCount returns how many features the ends of the connector sym reference (KerML 1.1 Connector::relatedFeature): the ends of its `connect`, `from`/`to` and binding clauses, its owned end features with a reference clause, and the inherited ends it does not redefine that reference one.
func (*Model) RelationshipEdgesOf ¶ added in v0.10.0
func (m *Model) RelationshipEdgesOf(sym *symbols.Symbol, kind RelationshipKind) []RelationshipEdge
RelationshipEdgesOf returns the resolved edges sym's declaration states, in declaration order.
func (*Model) RelationshipTarget ¶
RelationshipTarget resolves the element rel names from sym's scope.
func (*Model) RenderingTarget ¶
RenderingTarget returns the rendering a `render`/`rendering` member names and the reference as written: the rendering it references (`render asTreeDiagram;`) or the rendering definition it is typed by (`render rendering r : AsTree;`).
func (*Model) RestatesFeaturingReference ¶
RestatesFeaturingReference reports whether typ's member for feature is one NamesFeaturingReference accepts: `target` read through a frame's transformation.
func (*Model) ResultExpressionConflict ¶
func (m *Model) ResultExpressionConflict(sym *symbols.Symbol) *ResultExpressionConflict
ResultExpressionConflict describes sym's result expression memberships when it has more than one; nil when it has at most one.
func (*Model) ResultExpressionMemberships ¶
func (m *Model) ResultExpressionMemberships(sym *symbols.Symbol) []ResultExpression
ResultExpressionMemberships lists the result expressions sym owns or inherits as the memberships KerML counts, sym's own first: each expression of a calculation body is one, the conditions a constraint body lists are one together. A valid function or expression has at most one.
func (*Model) ResultExpressionsOf ¶
func (m *Model) ResultExpressionsOf(sym *symbols.Symbol) []ResultExpression
ResultExpressionsOf lists the result expressions sym owns or inherits, its own first and then those of every type contributing members to it — specialized or reference-subsetted — in breadth-first order (KerML 8.3.4.6 Expression::result, 8.3.4.8 Function::result). Each source contributes once, however many paths reach it; a body listing several conditions contributes each.
func (*Model) ResultParameterOf ¶
ResultParameterOf returns the result parameter of a behavior or step, inherited ones included, or nil when it has none.
func (*Model) RouteOf ¶
func (m *Model) RouteOf(view, elem *symbols.Symbol) (*LayoutSite, bool)
RouteOf resolves the Route of the element an edge is declared as — a connector, flow, transition or succession — as drawn in view, as LayoutOf resolves a Layout. A Route naming a general steers another edge and is passed over.
func (*Model) SatisfiesElementFilter ¶
SatisfiesElementFilter reports whether cand is selected by the filter condition. It is the form the symbol layer's enumeration installs (see symbols.Index.SetElementFilter): a condition that cannot be evaluated, or that is not boolean-valued, keeps the candidate rather than dropping it — the diagnostic is what reports it (see passes.checkElementFilters), because losing model content silently is worse than surfacing an element a filter meant to hide.
func (*Model) SatisfyMembersOf ¶
SatisfyMembersOf returns the viewpoint-claiming `satisfy` usages in a view's body followed by those of the views it specializes, in declaration order and once each: a satisfy is inherited the way an expose is.
func (*Model) SatisfyTarget ¶
SatisfyTarget returns the element a satisfy member names and the reference as written. A satisfy reference is recorded as a subsetting rather than a reference subsetting, so it has no effective name to read the target from.
func (*Model) ScalarLatticeElement ¶
ScalarLatticeElement is the lattice element sym is, as opposed to one it specializes; false for any type outside ScalarValues.
func (*Model) ScalarSymbol ¶
ScalarSymbol returns the library definition a lattice element stands for (`ScalarValues::Natural` for PrimNatural), or nil when none is loaded.
func (*Model) SelectAmongArguments ¶
func (m *Model) SelectAmongArguments(scope *symbols.Scope, named []*symbols.Symbol, args []Argument, performs Performs) *InvocationSelection
SelectAmongArguments selects among named, in that order, for arguments typed as given — how a run settles a call left Undetermined, by the values' types. Not memoized.
func (*Model) SelectCall ¶
func (m *Model) SelectCall(scope *symbols.Scope, e *ast.InvocationExpr, performs Performs) *InvocationSelection
SelectCall selects what e calls, its arguments typed as the checker types them; with no checker's typing installed the arguments are unknown, so arity and names alone decide.
func (*Model) SelectCallAmong ¶
func (m *Model) SelectCallAmong(scope *symbols.Scope, e *ast.InvocationExpr, named []*symbols.Symbol, performs Performs) *InvocationSelection
SelectCallAmong is SelectCall were e's name to denote named, in that order, as a trial spelling would: an alias stands for its target. Not memoized.
func (*Model) SelectInvocation ¶
func (m *Model) SelectInvocation(scope *symbols.Scope, e *ast.InvocationExpr, args []Argument, performs Performs) *InvocationSelection
SelectInvocation chooses the declaration e calls: the most specific candidate the arguments fit, a tie the types cannot break left Ambiguous. Memoized per node/scope.
func (*Model) SelectsVariantOf ¶
SelectsVariantOf reports whether variant is a variant sym may be bound to: one declared for sym itself, or for a variation sym specializes — a usage redefining a variation selects among the variants of what it redefines.
func (*Model) SemanticMetadataBases ¶ added in v0.11.0
semanticMetadataBases returns the types sym implicitly specializes because of the semantic metadata annotating it. SysML v2 §7.27.4 makes a user-defined keyword (`#cause part p`) a metadata annotation, and §7.27.3 gives the implicit specialization it contributes:
- a usage annotated with a usage baseType subsets that baseType;
- a definition annotated with a definition baseType subclassifies it;
- a definition annotated with a usage baseType subclassifies the types of that baseType.
Any other combination contributes nothing, as does an annotation whose type is undeclared: that is a diagnostic, and a guard-cut lookup is the resolver frames'. SemanticMetadataBases returns the baseTypes the semantic metadata annotating sym makes it specialize (SysML v2 §7.27.4): the usages a `#cause` usage subsets.
func (*Model) SentScalarTypes ¶ added in v0.9.2
SentScalarTypes names the scalar types a send of node's value may send, as the runtime names them: one when node's scalar type is known (a Rational also as a Real), Integer and Real for a number of unknown kind, and none when node's value is not a scalar.
func (*Model) SetArgumentTyper ¶
func (m *Model) SetArgumentTyper(t ArgumentTyper)
SetArgumentTyper installs the checker's argument typing on the model. Selections memoized under a different typing are dropped, so none outlives the typing it read; installing the typing already in place keeps them.
func (*Model) SetSourceFile ¶ added in v0.9.2
SetSourceFile tells the model which file on disk each of its documents' spans was read from, for a document joining several files. Nil: source.FileNamed.
func (*Model) SetSourceText ¶
SetSourceText gives the model the notation its documents were written in, which Element::documentation bodies are read from. Nil reads no bodies.
func (*Model) ShapeFeatures ¶
func (m *Model) ShapeFeatures(typ *symbols.Symbol) []ShapeFeature
ShapeFeatures returns the features an object of typ carries, in shape order: its own then its inherited members, less what is no feature, what frames every object, and the variants a variation offers.
func (*Model) ShareAbout ¶ added in v0.9.2
func (m *Model) ShareAbout(shared *AboutIndex)
ShareAbout has m read its `about` annotations from shared, building it if m is the first to ask. The models sharing an index must be over one and the same symbol index, which must not change while they share it: a model whose index changes drops the shared one and indexes on its own from then on.
func (*Model) SignatureParametersOf ¶
func (m *Model) SignatureParametersOf(callee *symbols.Symbol) []SignatureParameter
SignatureParametersOf lists callee's effective input parameters in signature order — what a positional argument list binds to, one parameter per position.
func (*Model) SourceFileOf ¶ added in v0.9.2
SourceFileOf is the file on disk the declaration at origin was read from, "" when it came from none.
func (*Model) SourceText ¶
SourceText is the notation lookup the model reads documentation from.
func (*Model) SpecializationRouteOf ¶ added in v0.11.0
func (m *Model) SpecializationRouteOf(view, elem, general *symbols.Symbol) (*LayoutSite, bool)
SpecializationRouteOf resolves the Route of the edge drawn from elem to general for the specialization, typing or subsetting elem states, as drawn in view: a Route about elem naming general, picked as RouteOf picks.
func (*Model) StandIn ¶ added in v0.9.2
StandIn reports whether sym stands for no element of a migration's source: a StandIn annotation applies to it, stated on it or about it.
func (*Model) StatedMultiplicityOf ¶ added in v0.12.0
StatedMultiplicityOf is the multiplicity stated for a feature: declared, inherited by redefinition, or the implicit [1..1]; not ok for one the usual default 0..* alone governs.
func (*Model) StyleOf ¶ added in v0.9.2
func (m *Model) StyleOf(view, elem *symbols.Symbol) (*LayoutSite, bool)
StyleOf resolves the Style of elem as drawn in view, as LayoutOf resolves a Layout.
func (*Model) SubjectParameterOf ¶
SubjectParameterOf returns the subject parameter of a requirement or case: its own, else the inherited one no other visible subject redefines, or nil when it has none.
func (*Model) SubjectsOf ¶
SubjectsOf is ObjectivesOf for the subjects of a requirement or case.
func (*Model) SubsettedMultiplicity ¶ added in v0.9.2
SubsettedMultiplicity is the multiplicity a `multiplicity` member subsets (`multiplicity m subsets n;`), resolved; nil for any other declaration.
func (*Model) SuccessionEndPath ¶ added in v0.10.0
func (m *Model) SuccessionEndPath(scope *symbols.Scope, owner *symbols.Symbol, target ast.Node) []*symbols.Symbol
SuccessionEndPath resolves an outside-body succession end from its owning scope.
func (*Model) SupertypesProvisional ¶
SupertypesProvisional reports whether sym's supertypes were last derived while a generalization target or metadata type had not resolved yet, so the answer may still change and must not be recorded as a fact.
func (*Model) SymbolDeclaring ¶
SymbolDeclaring returns the symbol registered for decl, so a node of a lowered graph is traced back to the element whose annotations position it. The subtree of scope is searched first, then every other document of the model: a lowered graph inherits content from definitions declared anywhere.
func (*Model) TimeEventConforms ¶
TimeEventConforms judges a time trigger's argument against TimeEventType, the one judgement validation and execution share.
func (*Model) UnaddressableBoundIn ¶ added in v0.10.0
UnaddressableBoundIn returns the first bound of mult that evaluates to an Integer beyond int64.
func (*Model) UnioningTypes ¶
UnioningTypes returns the resolved targets of sym's `unions` relationships: the types sym is declared to be the union of (KerML 1.0 §8.3.3). Unioning is not a generalization edge — a union is constrained by its members rather than inheriting from them — so it is resolved on its own. The result is memoized.
func (*Model) UnitOfExpr ¶
UnitOfExpr reads a unit expression as a quantity carries it: its text, the named units it is a product of, and its reduction to base units.
func (*Model) UnitOperandConformance ¶
UnitOperandConformance judges the unit of `x [unit]`, a TensorMeasurementReference (SysML validateOperatorExpressionQuantity).
func (*Model) UnitProductOfExpr ¶
UnitProductOfExpr reads a unit expression as the product of the named units it multiplies, divides and raises; it accepts and rejects exactly what UnitTermOfExpr does.
func (*Model) UnitProductOfExprBy ¶
func (m *Model) UnitProductOfExprBy(node ast.Node, lookup UnitLookup) (UnitProduct, error)
UnitProductOfExprBy reads a unit expression, identifying each named unit by what lookup resolves it to; a name lookup does not know is kept by its text.
func (*Model) UnitTermOf ¶
UnitTermOf reduces a measurement unit to base units. A unit declared with a conversion to a reference unit contributes that conversion's factor; a unit declared as an expression of other units, or by the power factors it lists, reduces through them; a unit of dimension one reduces to no base unit at all; and a unit that is declared in terms of nothing else is itself a base unit.
The reduction is memoized per symbol, and read from the facts installed for a library symbol rather than derived again.
func (*Model) UnitTermOfExpr ¶
UnitTermOfExpr reduces an expression in unit position — a measurement unit, or a product, quotient or power of them — resolving names in scope.
func (*Model) UnmatchedConnectorEnds ¶
UnmatchedConnectorEnds returns the ends the connector sym declares that redefine no end of a general connector, together with the general connector that has too few ends. A connector with no connector-like general — an untyped `connect a to b` — has none: there is nothing to match against.
func (*Model) UsageIsComposite ¶ added in v0.11.0
UsageIsComposite reports whether sym declares a composite usage.
func (*Model) UsageIsReferential ¶ added in v0.11.0
func (*Model) UsageMayTimeVary ¶
UsageMayTimeVary derives SysML Usage::mayTimeVary (SysML v2 §8.3.6.4).
func (*Model) UsageMayTimeVaryForOwningType ¶ added in v0.11.0
UsageMayTimeVaryForOwningType derives Usage::mayTimeVary for the owning type stated by Structure, or nil when the usage has no owning FeatureMembership.
func (*Model) UsageMayTimeVaryUnder ¶ added in v0.12.0
UsageMayTimeVaryUnder derives Usage::mayTimeVary for a referential usage that declares nothing of its own — a connector end, a parameter a transition or a satisfy's subject implies — whose owning type is owner (deriveUsageMayTimeVary).
func (*Model) UsageMayTimeVaryUnderKind ¶ added in v0.12.0
UsageMayTimeVaryUnderKind is UsageMayTimeVaryUnder for an owning usage declared by nothing but its kind, read through the kind's implicit library base.
func (*Model) UsageMayTimeVaryUnderLibraryFeature ¶ added in v0.12.0
UsageMayTimeVaryUnderLibraryFeature is UsageMayTimeVaryUnder for an owning feature the notation fixes as redefining the library feature fqn.
func (*Model) ValueExpression ¶ added in v0.12.0
ValueExpression is the expression element a feature's value is (KerML Feature::valuation.value), synthesized once per feature from the notation's expression node, as the RDF conversion writes it; nil for a feature without a value. The FeatureValue that owns it is among the feature's OwnedMemberships.
func (*Model) ValueHeld ¶
ValueHeld reports whether sym is held as a value, not an object: a scalar, an enumeration, or a TensorQuantityValue/TensorMeasurementReference by specialization (frames and scales included).
func (*Model) ValuesHeldBy ¶
ValuesHeldBy is how many values an expression holds wherever it is evaluated, as far as the declarations it reads fix that: see valuesHeldBy. Not ok where they leave it open.
func (*Model) VariantOf ¶
VariantOf returns the variant of sym named name, and whether sym offers one.
func (*Model) VariantsOf ¶
VariantsOf returns the variants sym offers, in declaration order: those declared for it and those it inherits from the variation it specializes, the enumerated values of an enumeration among them. A `variant` inherited from a type that is not a variation point offers no choice, so it is an ordinary member here too.
func (*Model) VariationPointOwning ¶
VariationPointOwning returns the variation point sym is a variant of, or nil when sym is not a variant of one: unlike VariationOwning it accepts an owner that is a variation by specialization without restating the modifier.
func (*Model) ViewConformance ¶
func (m *Model) ViewConformance(view *symbols.Symbol, eval ConcernEvaluator) (*ViewConformance, error)
ViewConformance checks every concern framed by a viewpoint the view satisfies against what the view exposes; a nil evaluator answers the structural question alone.
func (*Model) ViewDepth ¶ added in v0.11.0
ViewDepth is the depth view states: the depth attribute of the view itself, else of the nearest view it specializes that binds one. 0 when none does, and for a value that cannot be read (see ViewDepthProblems).
func (*Model) ViewDepthProblems ¶ added in v0.11.0
func (m *Model) ViewDepthProblems(view *symbols.Symbol) []DepthProblem
ViewDepthProblems is each depth attribute view itself binds to anything but a non-negative integer literal.
func (*Model) ViewExposureConditions ¶ added in v0.10.0
func (m *Model) ViewExposureConditions(view *symbols.Symbol) []symbols.ElementFilter
ViewExposureConditions returns every own or inherited element filter that governs the elements a view exposes.
func (*Model) ViewRenderings ¶
func (m *Model) ViewRenderings(view *symbols.Symbol) ([]ViewRendering, error)
ViewRenderings returns the rendering members of view: its own in declaration order, followed by those of the views it specializes, once each. A view stating no rendering returns none, which is no error; a non-view is ErrNotAView. An abstract member states no rendering — every view inherits the standard library's `abstract ref rendering viewRendering` — so it is left out.
type NestedOwner ¶ added in v0.9.2
type NestedOwner struct {
Usage ast.UsageKind
Def ast.DefinitionKind
IsDef bool
}
NestedOwner is the declaration kind of the type a usage nests in: a usage's kind, or a definition's when IsDef.
type NestedRedefinition ¶ added in v0.9.2
type NestedRedefinition struct {
Feature *symbols.Symbol // the redefining member
Path []string // chain segment names, e.g. ["mid","leaf","value"]
Target *symbols.Symbol // resolved last feature of the chain
}
NestedRedefinition is a member of a type redefining a feature below one or more of its composite features.
type NestedUsage ¶ added in v0.9.2
type NestedUsage struct {
Kind ast.UsageKind
Composite bool
Portion ast.PortionKind
// Performed, Exhibited and Included are the `perform action`, `exhibit
// state` and `include use case` forms; RequirementConstraint is a
// `require` or `assume` constraint, Assumed the `assume` one.
Performed, Exhibited, Included, RequirementConstraint, Assumed bool
// EntryExitAction is a state's `entry` or `exit` action: a subperformance of
// the state but no subaction, since `StateAction::subactions :> middle`.
EntryExitAction bool
}
NestedUsage is what a usage's declaration alone says of it to the implicit subsetting rules, for deciding them before the usage has a symbol.
type Note ¶ added in v0.9.2
Note is one Note annotation: a text box at X, Y, sized when HasSize, drawn anchored to the annotated element, or free when it annotates the view.
type Packed ¶ added in v0.10.0
Packed is an Integer, Rational, Real or Boolean Value in three words, for a holder that keeps or passes many; Unpack restores the Value it was packed from.
type PartyBinding ¶
type PartyBinding struct {
Party *symbols.Symbol
Kind string // "stakeholder" or "actor"
Name string
Owner *symbols.Symbol
Bound *symbols.Symbol
Reason string
}
PartyBinding is a stakeholder or actor of a viewpoint or view and what it is bound to. Reason is empty when the binding resolves.
type Performs ¶
type Performs int
Performs is what a call site does with the declaration it names, which decides the kinds of declaration it may select.
const ( // PerformsBehavior evaluates an expression: a calc answers; another behavior only // when no calc is named. PerformsBehavior Performs = iota // PerformsAction runs an action, as `action a = tag(x);` does: only actions answer. PerformsAction // PerformsOperation invokes a behavior by name on an object: every behavior // answers alike, the arguments alone selecting among calcs and actions. PerformsOperation )
type Picture ¶ added in v0.9.2
Picture is one Picture annotation: the file at Location (relative to the annotation's file) filling the box at X, Y, drawn over the elements when Above.
type PortFeature ¶
type PortFeature struct {
Symbol *symbols.Symbol
Name string
Direction ast.FeatureDirection
}
PortFeature is a feature of a port, with the direction it has as seen through the port that was queried.
type PrimType ¶
type PrimType int
PrimType classifies a symbol against the stdlib scalar value types (`ScalarValues`). It is the lattice the expression type checker reasons over; anything outside it (parts, items, enumerations, collections, unresolved names) is PrimUnknown and suppresses checking.
func PrimWiden ¶
PrimWiden returns the more general of two numeric types, or PrimUnknown if either is not numeric.
type Quantity ¶
type Quantity struct {
Num Value
Unit Unit
// Object is the object the quantity was read from, whose other members a
// chain through the quantity reads; 0 for a quantity no object states.
Object int64
}
Quantity is a scalar quantity value: a magnitude and the measurement reference it is expressed in (Quantities::ScalarQuantityValue is exactly a number `num` and a reference `mRef`). The unit travels with the value, so `1.5 [m/s]` is never mistaken for `1.5 [km/h]`.
func AddQuantities ¶
AddQuantities is a sum or difference in the left operand's unit; Integer magnitudes in one unit stay Integer, an exact magnitude converts between exact scales exactly, and any other conversion makes a Real.
func ComposedQuantity ¶
func ComposedQuantity(num Value, product UnitProduct, term UnitTerm) (Quantity, error)
ComposedQuantity is a result in the canonical form of its composed unit; a unit that cancels leaves a number unless it names a dimension-one unit (`rad`) or absorbed the identity (`one`), which is the unit again once the rest cancels.
func ConvertQuantity ¶
ConvertQuantity expresses a quantity in a commensurable unit, keeping an integral magnitude where the two units share one scale, and an exact one exact between exact scales: `3 [km]` in `m` is the Rational `3000.0 [m]`.
func NegateQuantity ¶
NegateQuantity negates a magnitude, keeping its unit and kind.
func PowQuantity ¶
PowQuantity raises a quantity to a constant exponent, its unit included.
func QuantityBinary ¶
func QuantityBinary(op ast.OperatorKind, left, right Quantity) (Quantity, error)
QuantityBinary applies a binary operator with the runtime's unit semantics: sums convert into the left unit, products compose units, comparisons convert.
func QuantityOf ¶
func QuantityOf(v symbols.FilterValue) (*Quantity, bool)
QuantityOf returns the quantity a FilterValueQuantity carries.
func QuantityUnary ¶
func QuantityUnary(op ast.OperatorKind, q Quantity) (Quantity, error)
QuantityUnary applies a unary operator to a quantity, keeping its unit.
func ScaleQuantities ¶
ScaleQuantities is a product or quotient whose unit is the product or quotient of the operands' units: `10 [m] / 2 [s]` is `5.0 [m/s]`.
func (*Quantity) BaseMagnitude ¶
BaseMagnitude is the quantity's magnitude expressed over the base units its unit reduces to, which is the form two commensurable quantities compare in.
func (*Quantity) ConvertTo ¶
ConvertTo expresses the quantity in unit, which requires the two units to be commensurable: their reductions must be over the same base units, or the magnitudes measure different things and no factor relates them.
func (*Quantity) TextWithMagnitude ¶
TextWithMagnitude renders the quantity from an already-rendered magnitude, so a caller with its own convention for numbers keeps it and still names the unit the same way. The stored magnitude is untouched.
type Range ¶
Range is an extracted multiplicity [lower..upper]. For the single-bound form `[n]`, Lower and Upper are both n, except for `[*]`, whose lower bound is 0 (KerML 1.0 §8.2.5.11, multiplicity textual notation).
func AssumedRange ¶
func AssumedRange() Range
AssumedRange is the implicit [1..1]: what SysML v2 §7.6.3 declares for an eligible usage and an end feature that state no multiplicity. It is not the default of a feature in general — that is DefaultMultiplicityOf.
func ExtentRange ¶
func ExtentRange() Range
ExtentRange is how many elements an extent holds: any number, as BaseFunctions::'all' declares its result `Object[0..*]`.
func UnboundedRange ¶ added in v0.9.2
func UnboundedRange() Range
UnboundedRange is the usual default multiplicity of a feature that declares and inherits none: [0..*] (KerML 1.1 §7.4.12, §7.4.5.2; SysML v2 §7.6.3).
func (Range) AdmitsMore ¶
AdmitsMore reports whether the range certainly admits more than count values.
func (Range) AllowsNone ¶
AllowsNone reports whether the range admits no value at all: a known lower bound of 0, as `[0..1]` and `[*]` declare.
func (Range) AtMostOne ¶
AtMostOne reports whether the range is known to admit no more than one value, as `[1]` and `[0..1]` do; an unknown or unbounded upper bound is not.
func (Range) CountViolation ¶
CountViolation returns why count values do not conform to the range, phrased for a diagnostic, or "" when they conform or a bound is not evaluable. It is the one wording for a count against a multiplicity, shared by the static check on a bound value and the runtime check on a materialized default.
func (Range) Covering ¶
Covering is the least range admitting every count either range admits: the lesser lower bound and the greater upper bound, the upper unknown where either is not evaluable.
func (Range) Exactly ¶
Exactly is the one count the range admits, ok where both bounds are that finite count.
func (Range) HasBounds ¶
HasBounds reports whether the range is exactly lower..upper — the spec's multiplicityHasBounds (SysML v2 8.3.3.1). ok is false when a bound is not evaluable, so callers can skip the check.
func (Range) HeldViolation ¶
HeldViolation is CountViolation for a value whose count is only bounded: reported where even its fewest values exceed the upper bound, or its most fall short of the lower.
func (Range) Intersect ¶
Intersect returns the range both ranges allow: the greater lower bound and the lesser upper bound, an unknown bound deferring to a known one.
func (Range) LowerLeUpper ¶
LowerLeUpper reports whether a range's lower bound does not exceed its upper bound. It returns ok=false when either bound is unknown (not evaluable), so callers can skip the check. An infinite upper always satisfies the ordering; an infinite lower is only valid when the upper is also infinite.
func (Range) MayAdmitMore ¶
MayAdmitMore reports whether the range does not certainly cap the values at count: it admits more, or its upper bound is not evaluable.
type ReadOnly ¶ added in v0.10.0
type ReadOnly struct {
Kind ReadOnlyKind
Declared *symbols.Symbol
// ImpliedByEnd marks Declared as constant as an end that may vary in time,
// not by `constant` (SysML 2.0 §8.4.2.2).
ImpliedByEnd bool
}
ReadOnly is a feature's write restriction and the feature declaring it, which is the feature itself or one it redefines or subsets.
type ReadOnlyKind ¶ added in v0.10.0
type ReadOnlyKind uint8
ReadOnlyKind is why a feature's values may not be written once its featuring occurrence is initialized.
const ( // Writable features may be written by a behavior. Writable ReadOnlyKind = iota // ReadOnlyConstant features keep one value over the lifetime of their featuring // occurrence (KerML Feature::isConstant). ReadOnlyConstant // ReadOnlyDerived features have values the model determines from other // features (KerML Feature::isDerived). ReadOnlyDerived )
func (ReadOnlyKind) String ¶ added in v0.10.0
func (k ReadOnlyKind) String() string
String names the restriction as its keyword.
type RelationshipEdge ¶ added in v0.10.0
RelationshipEdge is one resolved source-to-target relationship.
type RelationshipKind ¶ added in v0.10.0
type RelationshipKind string
RelationshipKind names a relationship represented by resolved source-target edges.
const ( RelationshipConnection RelationshipKind = "connection" RelationshipAllocation RelationshipKind = "allocation" RelationshipSatisfaction RelationshipKind = "satisfaction" RelationshipVerification RelationshipKind = "verification" RelationshipDerivation RelationshipKind = "derivation" RelationshipRefinement RelationshipKind = "refinement" RelationshipDependency RelationshipKind = "dependency" )
type ResultExpression ¶
type ResultExpression struct {
Owner *symbols.Symbol
Node ast.Node
// Condition marks a constraint body's condition, one of the several a body
// may list; a calculation body's expression is a result on its own.
Condition bool
}
ResultExpression is a result expression a function or expression owns (KerML 7.4.7): the trailing expression of a calculation body or the bare condition of a constraint body.
func OwnedResultExpressions ¶
func OwnedResultExpressions(sym *symbols.Symbol) []ResultExpression
OwnedResultExpressions lists the result expressions sym's own body states, in declaration order.
type ResultExpressionConflict ¶
type ResultExpressionConflict struct {
// Node anchors the fault: the body stated beyond one — a second in the
// same body or one over an inherited result — or the declaration inheriting two.
Node ast.Node
// Stated counts the memberships the type's own body states; the rest are inherited.
Stated int
// Owners are the types whose bodies state a membership, one per membership.
Owners []*symbols.Symbol
}
ResultExpressionConflict is a second result expression membership of a function or expression (KerML 8.3.4.6, 8.3.4.8), which allows at most one.
type Route ¶
type Route struct {
Points []Waypoint
}
Route is the waypoints one Route annotation binds, in the order written.
type SatisfyEnds ¶ added in v0.10.0
SatisfyEnds is what a satisfy usage relates, as written: the requirement it reference-subsets, or the one it declares itself, and its `by` subject.
func SatisfyEndsOf ¶ added in v0.10.0
func SatisfyEndsOf(sym *symbols.Symbol) (SatisfyEnds, bool)
SatisfyEndsOf reads the ends of a `satisfy` usage — satisfiedRequirement and satisfyingFeature — and reports false for any other element, a `verify` included. An end left unwritten is nil.
type Scale ¶
Scale is a unit's scale factor as a ratio kept unevaluated, so a conversion whose factor is exact stays exact: `5.4 [km/h]` is `5.4·1000/3600 = 1.5 [m/s]`, where evaluating 1000/3600 first would answer 1.4999999999999998 and make a requirement's `<=` at its boundary come out wrong.
func ScaleOfRat ¶ added in v0.10.0
ScaleOfRat is the Rational r as a ratio, exact when its lowest terms fit maxExactScaleTerm and otherwise the nearest float64 terms.
func (Scale) Exact ¶ added in v0.10.0
Exact is the ratio as a Rational, when both its terms are whole and within maxExactScaleTerm; a ratio past that bound was rounded and is not exact.
func (Scale) IsZero ¶
IsZero reports whether the ratio is zero or undefined, which no unit's scale factor is.
func (Scale) Pow ¶
Pow raises the ratio to an exponent, exactly for an exact ratio and a whole exponent. A negative exponent inverts the ratio rather than raising it to a negative power, which would evaluate it: `h^-1` stays 1/3600 instead of becoming 0.0002777777777777778.
type ShadowedUnitError ¶
type ShadowedUnitError struct {
Name string // the name as written in unit position
Resolved *symbols.Symbol // the declaration the name resolved to
Shadowed *symbols.Symbol // the measurement unit that declaration hid, or nil
// ShadowedName is the qualified name of Shadowed, which is how a message names
// a unit the model did not write.
ShadowedName string
Namespace string // qualified name of the namespace Resolved was declared in
Suggestion string // qualified spelling that names the shadowed unit
}
ShadowedUnitError reports a name in unit position that resolved to a declaration which is not a measurement unit, naming the unit it hid.
func (*ShadowedUnitError) Error ¶
func (e *ShadowedUnitError) Error() string
func (*ShadowedUnitError) Unwrap ¶
func (e *ShadowedUnitError) Unwrap() error
Unwrap reports the error as a not-a-unit error, which is the condition a caller tests for.
type ShapeFeature ¶
type ShapeFeature struct {
Name string
// Symbol is the last declaration of Name in the type's members, own then inherited.
Symbol *symbols.Symbol
// Declared is the first: the model's own restatement where it has one.
Declared *symbols.Symbol
}
ShapeFeature is one feature of an object's shape: the name it is held under and the declaration whose value it holds, which for a redefined name is the redefinition's target (a redefinition shares its target's value).
type SignatureParameter ¶
type SignatureParameter struct {
Name string // the name a runtime keys the binding by
Symbol *symbols.Symbol // the parameter as the callee, or a general of it, declares it
Type *symbols.Symbol // the declared type, nil when untyped or unresolved
Optional bool // may go without an argument: a default, or a multiplicity admitting none
Default bool // declares a default, itself or along what it redefines
}
SignatureParameter is one input parameter of a callee as a call binds it.
type Style ¶ added in v0.9.2
Style is how one Style annotation says its element is drawn: colours as "#RRGGBB", each "" when unstated; Font "" and FontSize 0 likewise.
type TypeClassification ¶
type TypeClassification uint8
TypeClassification is how far the types a value is of settle whether a target type classifies it, the question a CastExpression asks (KerML 1.1 §8.3.4.9).
const ( // ClassifiesNone is a target disjoint from every type the value is of, so no // value of those types is one of the target's. ClassifiesNone TypeClassification = iota // ClassifiesAll is a type of the value specializing the target, so every // value of that type is one of the target's. ClassifiesAll // ClassifiesSome is a target specializing a type of the value: some values of // that type are the target's and the value itself decides which. ClassifiesSome )
type Unit ¶
type Unit struct {
Text string
Product UnitProduct
Term UnitTerm
}
Unit is a measurement reference as a quantity carries it: its text as written or canonically composed, its product of named units, and its reduction to base units.
func UnitOne ¶
func UnitOne() Unit
UnitOne is the unit a bare number is read in: no named unit, scale one.
func (Unit) Composed ¶
Composed reports whether the unit is a product, quotient or power of named units (`N/kg`, `km**0.5`) rather than one named unit (`N`, `'m/s'`).
type UnitFactor ¶
UnitFactor is one base unit raised to an exponent.
type UnitLookup ¶
type UnitLookup func(qn *ast.QualifiedName) (*symbols.Symbol, bool)
UnitLookup resolves a unit name written in a unit expression to its declaration, reporting false for a name it does not know.
type UnitPower ¶
type UnitPower struct {
Unit *symbols.Symbol // the unit the name resolves to, nil where it resolves to none
Name string // the unit as the model wrote it, quoted where the notation must (`'A/m'`)
Exponent float64
DimensionOne bool // the unit reduces to no base unit: an angle, a ratio, a count
Identity bool // the unit is the identity of unit products (`one`): a plain DimensionOneUnit at scale one
Reduces *UnitTerm // what a unit resolving to none reduces to, where known; nil otherwise
}
UnitPower is a named measurement unit raised to an exponent: one factor of a unit product, `N*m` being the powers N¹ and m¹.
type UnitProduct ¶
type UnitProduct struct {
Powers []UnitPower
// Identity is the identity power (`one`) the product absorbed, kept apart from
// the powers so that it is the unit again once every other power cancels.
Identity *UnitPower
}
UnitProduct is a unit as a sorted product of powers of the units the model named, the canonical display form (`N*m`, `m**2`); UnitTerm, not this, decides conversion.
func NamedUnitProduct ¶
func NamedUnitProduct(unit *symbols.Symbol, name string, dimensionOne bool) UnitProduct
NamedUnitProduct is the product of one named unit to the first power, spelt as one name: text that is no name is quoted so the product reads back as itself.
func OpaqueUnitProduct ¶
func OpaqueUnitProduct(name string, reduces UnitTerm) UnitProduct
OpaqueUnitProduct is the product of one unit that resolves to no declaration, known by its text and what it reduces to; the reduction tells two so spelt apart.
func (UnitProduct) AllPowers ¶ added in v0.9.2
func (p UnitProduct) AllPowers() []UnitPower
AllPowers is the powers with the identity the product absorbed among them, where it did.
func (UnitProduct) Clone ¶
func (p UnitProduct) Clone() UnitProduct
Clone returns a product sharing no storage with p, its powers' reductions included.
func (UnitProduct) DividedBy ¶
func (p UnitProduct) DividedBy(q UnitProduct) UnitProduct
DividedBy returns the quotient of two unit products.
func (UnitProduct) Equal ¶
func (p UnitProduct) Equal(q UnitProduct) bool
Equal reports whether two products are the same units to the same exponents.
func (UnitProduct) IsEmpty ¶
func (p UnitProduct) IsEmpty() bool
IsEmpty reports whether the product names no unit, as a bare number does.
func (UnitProduct) NamesDimensionOne ¶
func (p UnitProduct) NamesDimensionOne() bool
NamesDimensionOne reports whether the product is a named dimension-one unit (`rad`, `°`, `sr`) rather than nothing or a ratio (`°/rad`) that cancels to a number.
func (UnitProduct) Pow ¶
func (p UnitProduct) Pow(exp float64) UnitProduct
Pow raises every power of the product to exp.
func (UnitProduct) Root ¶
func (p UnitProduct) Root(n float64) (UnitProduct, bool)
Root divides every power by n, reporting false where a power does not divide into a whole exponent: `m**2` has a square root `m`, `rad` and `km*m` have none; the identity `one` has every root, itself.
func (UnitProduct) ShortSpelling ¶
func (p UnitProduct) ShortSpelling() UnitProduct
ShortSpelling respells each declared unit by its short name (`km/h` for `SI::km/SI::h`), so the spelling does not depend on the scope that named it; an undeclared one keeps its text.
func (UnitProduct) String ¶
func (p UnitProduct) String() string
String renders the product as the notation reads it back: positive powers joined by `*`, negative ones grouped after one `/`, an exponent other than one as `**n`.
func (UnitProduct) Times ¶
func (p UnitProduct) Times(q UnitProduct) UnitProduct
Times returns the product of two unit products.
type UnitTerm ¶
type UnitTerm struct {
Scale Scale
Factors []UnitFactor
}
UnitTerm is a measurement unit reduced to a scale factor over base units: the product of Scale and each base unit raised to its exponent. `km/h` reduces to Scale 1000/3600 over `SI::m` and `SI::s^-1`, which is what makes two units comparable — they are commensurable when their factors agree, and a magnitude converts between them by the ratio of their scales.
Factors are ordered by base-unit qualified name and carry no zero exponents, so two terms over the same base units compare element-wise.
func (UnitTerm) BaseProduct ¶
func (t UnitTerm) BaseProduct() UnitProduct
BaseProduct is the term's base units as a product named by their symbols (`m`, `s`); a magnitude over it is the term's magnitude times the term's scale.
func (UnitTerm) Commensurable ¶
Commensurable reports whether both terms are expressed over the same base units with the same exponents, so a magnitude in one converts to the other.
func (UnitTerm) DimensionKey ¶
DimensionKey identifies the base units the term is over, exponents included but scale excluded: two terms share a key exactly when they are commensurable.
func (UnitTerm) Dimensionless ¶
Dimensionless reports whether the term has no base units, as a count or a ratio of like quantities has.
func (UnitTerm) Normalized ¶
Normalized restores the term's invariant: repeated base units summed, those that cancel dropped, the rest ordered by name. For a term built from outside.
func (UnitTerm) Same ¶
Same reports whether two terms are one reduction: commensurable at equal scale.
type Value ¶
type Value struct {
Kind ValueKind
Bool bool
Int int64
Real float64
// contains filtered or unexported fields
}
Value is a model-level-evaluated constant. Only the field selected by Kind is meaningful. This is a deliberately small subset: the constraint checks that need evaluation (multiplicity bounds, some guards) operate over integers, reals, booleans, and the infinity bound.
An Integer is unbounded. One within int64 is held in Int; any other is held as an immutable big.Int, with Int zero, so each Integer has one representation. Read an Integer through Int64, BigInt or the Int functions rather than through Int, which is meaningful only when IsBigInt is false.
A Rational is exact (rational.go): its numerator in Int and positive denominator in den when both fit int64, an immutable big.Rat otherwise. A Real is an IEEE 754 binary64.
func BigIntValue ¶ added in v0.10.0
BigIntValue is the Integer b, held in Int when it fits int64. The Value takes b over: the caller must not modify it afterwards.
func CanonicalRational ¶ added in v0.10.0
CanonicalRational is LowestTermsRational refusing a Rational a binary64 holds exactly, which the canonical wire form carries as a double; so no Rational a service sends has two spellings.
func EvalBinary ¶
func EvalBinary(op ast.OperatorKind, l, r Value) (Value, bool)
EvalBinary evaluates a binary operator on two constant values. Returns (result, true) if successful, (zero, false) otherwise.
func EvalConst ¶
EvalConst is Eval without a model: the value of an expression over literals and operators alone, which no feature's binding can change.
func EvalUnary ¶
func EvalUnary(op ast.OperatorKind, v Value) (Value, bool)
EvalUnary evaluates a unary operator on a constant value. Returns (result, true) if successful, (zero, false) otherwise.
func ExactConversion ¶ added in v0.10.0
ExactConversion is the exact magnitude given over the scale from expressed over the scale to, a Rational; ok=false when either scale is not exact.
func FilterInteger ¶ added in v0.10.0
func FilterInteger(v symbols.FilterValue) Value
FilterInteger is the Integer a FilterValueInt holds.
func FilterNumber ¶ added in v0.10.0
func FilterNumber(v symbols.FilterValue) (Value, bool)
FilterNumber is the number a FilterValueInt, FilterValueRational or FilterValueReal holds.
func FracValue ¶ added in v0.10.0
FracValue is the Rational num/den in lowest terms; ok=false for a zero den.
func IntArith ¶
IntArith is Integer addition, subtraction and multiplication, shared by the folder, the operators and the library functions. A result within int64 is computed there; any other is computed exactly, refused only when it would exceed maxBits.
func IntDivTrunc ¶ added in v0.10.0
IntDivTrunc is the quotient of a by b rounded toward zero; ok=false on a zero divisor.
func IntPow ¶ added in v0.10.0
IntPow is a**n for an Integer base and a non-negative Integer exponent, refused with ErrIntegerSizeLimit before it is computed when the result would need more than maxBits.
func IntRem ¶ added in v0.10.0
IntRem is the remainder of a truncated division of a by b, with a's sign as `mod` has it; ok=false on a zero divisor.
func IntegerOfReal ¶ added in v0.10.0
IntegerOfReal is the Integer a finite whole Real is, of any magnitude.
func LowestTermsRational ¶ added in v0.10.0
LowestTermsRational reads the Rational two decimals spell: a numerator over a positive denominator sharing no factor with it, which every Rational has once.
func MagnitudeArith ¶
MagnitudeArith combines two magnitudes as the bare operator does: Integer operands keep an Integer result except under `/`, within maxBits.
func ParseInteger ¶ added in v0.10.0
ParseInteger reads decimal Integer notation of any magnitude.
func ParseRational ¶ added in v0.10.0
ParseRational reads decimal notation — an optional sign, digits with an optional fraction and an optional decimal exponent — as the exact Rational it denotes: `0.1` is 1/10, `1.5e3` is 1500. Other notation is ErrRealNotation; a value whose terms exceed maxBits is ErrRationalSizeLimit.
func ParseRationalText ¶ added in v0.10.0
ParseRationalText reads a Rational as ToRational does: decimal notation, or the `numer/denom` form a non-terminating Rational prints as, each term an optionally signed decimal Integer and the denominator nonzero.
func Pow ¶
Pow evaluates l ** r (equivalently l ^ r) — the single implementation the constant folder and the runtime share, so a folded and an evaluated exponentiation agree. Integer operands with a non-negative exponent give an Integer, as IntegerFunctions::'**' declares, refused with ErrIntegerSizeLimit when it would need more than maxBits; an exact base with any other whole exponent gives the exact Rational RationalFunctions::'**' declares, refused with ErrRationalSizeLimit; every other numeric combination gives a Real, as RealFunctions::'**' does. A Real result that is not finite is an error rather than a NaN or an infinity: the folder declines on it, the runtime reports it.
func RatArith ¶ added in v0.10.0
RatArith is exact addition, subtraction, multiplication, division and truncated remainder over Integers and Rationals, as RationalFunctions declares them: the result is a Rational, whole or not. A zero divisor is ErrDivisionByZero; a result beyond maxBits is ErrRationalSizeLimit.
func RatPow ¶ added in v0.10.0
RatPow is base**n for an exact base and an Integer exponent, the Rational RationalFunctions::'**' declares. A negative exponent of zero is ErrArithmeticDomain; a result beyond maxBits is ErrRationalSizeLimit, refused before it is computed.
func RatRound ¶ added in v0.10.0
RatRound is the Integer nearest the exact number v, a half rounding away from zero as RealFunctions::round does over a Real.
func RatValue ¶ added in v0.10.0
RatValue is the Rational r, normalized. The Value takes r over: the caller must not modify it afterwards.
func RationalOfReal ¶ added in v0.10.0
RationalOfReal is the Rational a finite Real exactly is.
func RealOf ¶ added in v0.10.0
RealResult wraps a computed Real, reporting a NaN or an infinity instead of carrying it. RealOf is the exact number v held as a Real: its nearest binary64, refused where that is not finite or rounds a nonzero v to zero.
func RealResult ¶
func (Value) AsReal ¶
AsReal returns the number as a float64. An Integer or a Rational rounds to the nearest float64, ties to even, and one beyond the float64 range to the infinity of its sign: the one conversion mixed Rational/Real arithmetic makes.
func (Value) BigInt ¶ added in v0.10.0
BigInt returns the Integer v as a fresh big.Int the caller may modify.
func (Value) BigIntView ¶ added in v0.10.0
BigIntView is the Integer v's big.Int when it is beyond int64, nil otherwise; the Value shares it, so the caller must not modify it.
func (Value) BinaryExact ¶ added in v0.10.0
BinaryExact is the binary64 a Rational is exactly, when one is: 0.5 and 1800.0 are, 0.1 and 1 / 3 are not.
func (Value) Equal ¶ added in v0.10.0
Equal reports whether v and w are the same constant: of one kind, with equal payloads. An Integer equals another Integer of the same value however held.
func (Value) FormatRational ¶ added in v0.10.0
FormatRational renders the Rational v exactly. One whose denominator has no prime factor but 2 and 5 is a terminating decimal and prints as one, as a Real does (`0.1`, `2.0`, `1.5e-05`); any other prints as `numer/denom` (`1/3`), since no finite decimal is it.
func (Value) Int64 ¶ added in v0.10.0
Int64 returns v as an int64 when it is an Integer within that range.
func (Value) IntBitLen ¶ added in v0.10.0
IntBitLen is the number of bits of the Integer v's magnitude.
func (Value) IsBigInt ¶ added in v0.10.0
IsBigInt reports whether v is an Integer outside the int64 range.
func (Value) IsExact ¶ added in v0.10.0
IsExact reports whether v is an exact number: an Integer or a Rational.
func (Value) IsRational ¶ added in v0.10.0
IsRational reports whether v is an exact Rational (not an Integer).
func (Value) IsUnbounded ¶
IsUnbounded reports whether the value is the unbounded `*`.
func (Value) Rat ¶ added in v0.10.0
Rat returns the exact number v (Integer or Rational) as a fresh big.Rat the caller may modify.
func (Value) RatBitLen ¶ added in v0.10.0
RatBitLen is the size of the exact number v: the bits of its numerator's magnitude plus the bits of its denominator.
func (Value) RatDenom ¶ added in v0.10.0
RatDenom is the positive denominator, in lowest terms, of the exact number v.
func (Value) RatIsWhole ¶ added in v0.10.0
RatIsWhole reports whether the exact number v has no fractional part.
func (Value) RatNumer ¶ added in v0.10.0
RatNumer is the numerator, in lowest terms, of the exact number v.
func (Value) WholeNumber ¶
WholeNumber returns the value as an int64 when it is a whole number within that range: an integer, or a finite real with no fractional part (4 / 2 is 2.0).
type Verdict ¶
type Verdict int
Verdict is the outcome of a conformance question. A verdict is never guessed: what could not be evaluated is VerdictUnevaluable with a reason, never a pass.
const ( // VerdictConforms is a question answered in the affirmative. VerdictConforms Verdict = iota // VerdictViolated is a question answered in the negative: a condition that // evaluated to false of an exposed element. VerdictViolated // VerdictUnevaluable is a question no answer could be reached for. VerdictUnevaluable // VerdictNotEvaluated is a structurally conforming concern whose conditions // were not evaluated, because the caller supplied no evaluator. VerdictNotEvaluated )
type ViewConformance ¶
type ViewConformance struct {
View *symbols.Symbol
Exposed []*symbols.Symbol
Viewpoints []ViewpointConformance
Verdict Verdict
}
ViewConformance is a view's conformance to the viewpoints it satisfies.
type ViewRendering ¶
type ViewRendering struct {
// Member is the `render`/`rendering` member itself.
Member *symbols.Symbol
// Ref is the rendering as written, empty for a member naming none.
Ref string
// Rendering is what Ref resolves to, nil when it names nothing or does not
// resolve.
Rendering *symbols.Symbol
// DeclaredIn is the view declaring the member: the view itself, or one it
// specializes.
DeclaredIn *symbols.Symbol
}
ViewRendering is one rendering member of a view, and the rendering it names.
type ViewpointConformance ¶
type ViewpointConformance struct {
// Satisfy is the satisfy usage, Ref its target as written and Viewpoint the
// viewpoint it resolves to, nil when that is unresolved or no viewpoint.
Satisfy *symbols.Symbol
Ref string
Viewpoint *symbols.Symbol
// SatisfiedIn is the view declaring the satisfy: the view itself or one it
// specializes.
SatisfiedIn *symbols.Symbol
Concerns []ConcernConformance
Parties []PartyBinding
Verdict Verdict
Reason string
}
ViewpointConformance is what became of one `satisfy` in a view's body.
type ViolationReporter ¶
ViolationReporter tells whether an evaluator's error is a false verdict rather than a failure to evaluate. Without it, every error reads as a failure.
Source Files
¶
- accept.go
- action_succession.go
- annotated_element.go
- annotations.go
- binding.go
- bodyparam.go
- cast.go
- coherent_quantity.go
- coherent_unit.go
- collection.go
- conformance.go
- conjugation.go
- connector.go
- coordinate_frame.go
- crossing.go
- depth.go
- dimension.go
- documentation.go
- end_multiplicity.go
- enumeration.go
- eval.go
- evaluable.go
- expose.go
- exprtype.go
- extent.go
- filter.go
- gather.go
- implicit.go
- integer.go
- invocation.go
- layout.go
- lifecycle.go
- masking.go
- members.go
- metadata.go
- metadata_body.go
- model.go
- multiplicity.go
- nested.go
- nested_redefinition.go
- operator_conformance.go
- operator_function.go
- quantity.go
- quantity_eval.go
- rational.go
- read_only.go
- redefinition.go
- redefinition_conformance.go
- reference.go
- reflective_annotations.go
- reflective_expression_parts.go
- reflective_feature_value.go
- reflective_memberships.go
- reflective_parameters.go
- reflective_relationships.go
- reflective_requirements.go
- reflective_usages.go
- relationship_edges.go
- relationship_reflection.go
- rendering.go
- result_expression.go
- return_parameter.go
- roles.go
- satisfy.go
- shape.go
- state_activity.go
- stochastic.go
- succession_featuring.go
- synthesized_name.go
- uniqueness.go
- unit_product.go
- units.go
- usage.go
- valuetype.go
- variation.go