Documentation
¶
Overview ¶
Package repl implements an interactive SysML v2 read-eval-print loop as a thin frontend over model.Workspace (spec §13).
Index ¶
- Constants
- Variables
- func CompileCalc[P any](s *Session, name string, ...) (P, error)
- func ExpandHome(path string) string
- func FilterViews(views []model.ViewInfo, diagrams bool, kinds []view.Kind) []model.ViewInfo
- func KnownMeta(name string) bool
- func ListText(items []ListItem) []string
- func Loop(r LineReader, out io.Writer, s *Session) error
- func MetaArgs(line string) []string
- func RenderResult(r Result, v Verbosity) []string
- func SplitBehavior(spec string) (name string, performer []string)
- func ViewKindList() string
- func WriteListJSON(w io.Writer, items []ListItem) error
- func WriteListTSV(w io.Writer, items []ListItem) error
- type AmbiguousActionError
- type AmbiguousMachineError
- type AmbiguousNameError
- type AmbiguousSubjectError
- type Behavior
- type CompareOptions
- type Completion
- type DebugReport
- type Diagnostic
- type Edit
- type EnginesArgumentError
- type EvalResult
- type Evaluation
- type ExhibitorsError
- type ExploreAtPromptError
- type ExplorePreviewError
- type ExploredObjectError
- type FeatureListing
- type FeaturesReport
- type Fix
- type ImportOptions
- type InstanceReport
- type InstantiationReport
- type LineReader
- type ListItem
- type LoadReport
- type Member
- type NamedValue
- type NoEnginesError
- type NotInstantiatedError
- type ObjectPathError
- type ObjectRefError
- type ObservablePair
- type Origin
- type PerformersError
- type ReadError
- type RelatedObject
- type Rendered
- type RenderedDocument
- type ReservedNameError
- type Result
- type Session
- func (s *Session) Advance(duration float64) (DebugReport, error)
- func (s *Session) ApplyModelEdit(name string, ops []sedit.Operation) (*model.EditResult, error)
- func (s *Session) Budgets() runtime.Budgets
- func (s *Session) CheckAssume() []string
- func (s *Session) CheckBounds() (depth, states, unroll int, timeout time.Duration)
- func (s *Session) CheckConstraint(name string) Verdict
- func (s *Session) CheckDiverge() []string
- func (s *Session) CheckInputs() []string
- func (s *Session) CheckProperties() []string
- func (s *Session) CheckRequirement(name string) Verdict
- func (s *Session) CheckSatisfy(name string) []Verdict
- func (s *Session) CheckSolve(name string) []SolveReport
- func (s *Session) CheckWitnessDir() string
- func (s *Session) Clear() []string
- func (s *Session) ClearModelSeed()
- func (s *Session) ClockStep() float64
- func (s *Session) CompareResults(results *simresults.Results, opts CompareOptions) []Verdict
- func (s *Session) CompareResultsEach(results *simresults.Results, opts CompareOptions, report func(Verdict))
- func (s *Session) Complete(line string, pos int) Completion
- func (s *Session) ConfigureVariants(name string, args []string) []SolveReport
- func (s *Session) ConformanceMode() diag.ConformanceMode
- func (s *Session) DebugAction(name string, performer []string) (DebugReport, error)
- func (s *Session) DebugContinue() (DebugReport, error)
- func (s *Session) DebugState(name string, performer []string) (DebugReport, error)
- func (s *Session) DebugStatus() (DebugReport, bool)
- func (s *Session) DebugStep() (DebugReport, error)
- func (s *Session) DebugStop() ([]string, error)
- func (s *Session) Debugging() bool
- func (s *Session) DiagnosticLines() []string
- func (s *Session) Diagnostics() []diag.Diagnostic
- func (s *Session) DisabledLints() []string
- func (s *Session) Draws() runtime.DrawPolicy
- func (s *Session) EnabledLints() []string
- func (s *Session) Engine() analysis.Selection
- func (s *Session) Engines() []analysis.Listing
- func (s *Session) EvalBare(expr string) ([]string, error)
- func (s *Session) EvalExpr(expr string) ([]string, error)
- func (s *Session) Evaluate(expr string) (EvalResult, error)
- func (s *Session) EvaluateDocument(invocation string) (*docir.Document, error)
- func (s *Session) ExpandPaths(paths []string) ([]string, error)
- func (s *Session) Expecting() func()
- func (s *Session) ExplainSolve(name string) []SolveReport
- func (s *Session) Features(object string, l FeatureListing) (FeaturesReport, error)
- func (s *Session) Files() []string
- func (s *Session) Graphs(name string) ([]byte, error)
- func (s *Session) HasErrors() bool
- func (s *Session) ImportData(path string, opts ImportOptions) Verdict
- func (s *Session) Instances() ([]InstanceReport, []string)
- func (s *Session) InstantiateNamed(name string) ([]string, error)
- func (s *Session) InstantiateReport(name string) (InstantiationReport, error)
- func (s *Session) Interrupt()
- func (s *Session) Jobs() int
- func (s *Session) LibraryRoots() []string
- func (s *Session) List() []string
- func (s *Session) ListDocuments() []ListItem
- func (s *Session) ListViews(diagrams bool, kinds []view.Kind) []ListItem
- func (s *Session) LoadFile(path string) ([]string, error)
- func (s *Session) LoadFileSummary(path string) ([]string, error)
- func (s *Session) LoadFilesSummary(paths []string) ([]string, error)
- func (s *Session) LoadPaths(paths []string) ([]string, error)
- func (s *Session) LoadPathsReport(paths []string) (LoadReport, error)
- func (s *Session) LoadWarnings(paths []string) ([]Diagnostic, int)
- func (s *Session) Locate(res Result, diags []diag.Diagnostic) []Diagnostic
- func (s *Session) LocatedDiagnostics() []Diagnostic
- func (s *Session) MaterializationFailures() []error
- func (s *Session) ModelSeed() (uint64, bool)
- func (s *Session) OptimizeSolve(name string) []SolveReport
- func (s *Session) OverlaidViewRendering(name string, overlay view.Overlay, depth int) (*view.Rendering, error)
- func (s *Session) Print(name string) ([]string, error)
- func (s *Session) Query(text string) ([]string, error)
- func (s *Session) RecordAnalysis(invocation, into, command string) Verdict
- func (s *Session) RecordMonteCarlo(invocation string, count int64, seed *uint64, into, command string) Verdict
- func (s *Session) RecordSweep(invocation string, ranges []string, into, command string) Verdict
- func (s *Session) Render(args []string) (Rendered, error)
- func (s *Session) RenderDocument(invocation string, html bool) (lines []string, rendered bool, err error)
- func (s *Session) RenderDocumentAsciiDoc(invocation string, opts docrender.AsciiDocOptions) (string, error)
- func (s *Session) RenderDocumentHTML(invocation string, opts docrender.HTMLOptions) (string, error)
- func (s *Session) RenderDocumentMarkdown(invocation string, opts docrender.MarkdownOptions) (string, error)
- func (s *Session) RenderDocumentSetAsciiDoc(opts docrender.AsciiDocOptions) ([]RenderedDocument, error)
- func (s *Session) RenderDocumentSetHTML(opts docrender.HTMLOptions) ([]RenderedDocument, error)
- func (s *Session) RenderDocumentSetMarkdown(opts docrender.MarkdownOptions) ([]RenderedDocument, error)
- func (s *Session) ResolveSelfCheckPackages(pkgs []string) error
- func (s *Session) RunAction(name string, performer ...string) Verdict
- func (s *Session) RunActionWithInputs(name string, inputs []string, performer ...string) Verdict
- func (s *Session) RunAnalysis(invocation string) Verdict
- func (s *Session) RunCalc(invocation string) Verdict
- func (s *Session) RunDocumentQuery(invocation string) Verdict
- func (s *Session) RunFor(actions, states []Behavior, duration float64) []Verdict
- func (s *Session) RunMeta(line string) (out []string, quit bool, err error)
- func (s *Session) RunMonteCarlo(invocation string, count int64, seed *uint64) Verdict
- func (s *Session) RunOccurrence(name string) Verdict
- func (s *Session) RunRuns(name string, performer []string, count int64, seed *uint64, ...) Verdict
- func (s *Session) RunSamples(invocation string, ranges []string, count int64, seed uint64) Verdict
- func (s *Session) RunStateMachine(name string, performer ...string) Verdict
- func (s *Session) RunStateMachineFor(name string, duration float64, performer ...string) Verdict
- func (s *Session) RunSweep(invocation string, ranges []string) Verdict
- func (s *Session) RunTraceRendering(kind runtrace.Kind) (*view.Rendering, error)
- func (s *Session) Save(path string) ([]string, bool, error)
- func (s *Session) SavePreview(path string) ([]byte, []string, error)
- func (s *Session) Schedule() runtime.SchedulePolicy
- func (s *Session) SelfCheck() []Verdict
- func (s *Session) SelfCheckPackages(pkgs []string) ([]Verdict, error)
- func (s *Session) SendSignal(text string) ([]string, error)
- func (s *Session) SetBreakpoints(nodes []string, reset bool) (DebugReport, error)
- func (s *Session) SetBudgets(budgets runtime.Budgets) error
- func (s *Session) SetCheckAssume(names []string)
- func (s *Session) SetCheckBounds(depth, states, unroll int, timeout time.Duration)
- func (s *Session) SetCheckDiverge(features []string)
- func (s *Session) SetCheckInputs(features []string)
- func (s *Session) SetCheckProperties(names []string)
- func (s *Session) SetCheckWitnessDir(dir string)
- func (s *Session) SetClockStep(step float64) error
- func (s *Session) SetConformanceMode(mode diag.ConformanceMode) error
- func (s *Session) SetDisabledLints(codes []string) error
- func (s *Session) SetDraws(policy runtime.DrawPolicy)
- func (s *Session) SetEnabledLints(codes []string) error
- func (s *Session) SetEngine(text string) error
- func (s *Session) SetEngines(engines *analysis.Registry) error
- func (s *Session) SetFileGuard(guard func(path string, exempt []string) error)
- func (s *Session) SetFileWriter(write replext.FileWriter)
- func (s *Session) SetJobs(jobs int) error
- func (s *Session) SetLibraryRoots(roots []string)
- func (s *Session) SetModelSeed(seed uint64)
- func (s *Session) SetProgress(w io.Writer)
- func (s *Session) SetRecordCache(cache *libs.Cache)
- func (s *Session) SetRecording(on bool)
- func (s *Session) SetRenderWidth(width int)
- func (s *Session) SetSchedule(policy runtime.SchedulePolicy) error
- func (s *Session) SetToolVersion(tool string)
- func (s *Session) SetTracing(on bool)
- func (s *Session) SetVerbosity(v Verbosity)
- func (s *Session) SetWorkspaceRoot(dir string) error
- func (s *Session) SolveValues(name string) []SolveReport
- func (s *Session) Submit(src string) Result
- func (s *Session) SubmitAll(srcs []string) Result
- func (s *Session) SubmitFiles(files []SourceFile) Result
- func (s *Session) Suppress(accept func(file, code, message string) bool)
- func (s *Session) Suppressed() int
- func (s *Session) Text() string
- func (s *Session) ToolDryRun(target string) Verdict
- func (s *Session) Tracing() bool
- func (s *Session) ValidateObject(ref string) []Verdict
- func (s *Session) Verbosity() Verbosity
- func (s *Session) View(name string) ([]string, error)
- func (s *Session) ViewRendering(name string) (*view.Rendering, error)
- func (s *Session) ViewSites() (view.Sites, error)
- func (s *Session) Views() ([]model.ViewInfo, error)
- func (s *Session) Viz(args []string, fallback ...view.Form) ([]Rendered, error)
- func (s *Session) WorkspaceRoot() string
- type SolveReport
- type SolveStatus
- type SourceConverter
- type SourceFile
- type SweptArgumentError
- type SweptObjectError
- type TokenReport
- type UnknownObjectIDError
- type UnplannedObjectError
- type UsageError
- type Verbosity
- type Verdict
- type VerdictExploration
- type VerdictOutcome
- type VerdictRow
- type VerdictStatus
- type VerdictTable
- type VerdictTableRow
- type VerificationVerdict
Constants ¶
const ( ListDocument = "document" ListView = "view" ListPseudoView = "pseudo-view" )
The categories a listing item is of.
const ClockObservable = analysis.ClockObservable
ClockObservable names the observable every run of a Monte Carlo reports beside the action's features: the simulation clock when the action completed.
const SessionOrigin = sessionOrigin
SessionOrigin names the accumulated buffer in diagnostics, for callers that write the session's text as a document of their own.
const StandingPrefix = " standing: "
StandingPrefix opens the line that follows a verdict with its standing.
Variables ¶
var ErrEnginesArgument = errors.New("%engines takes `probe` or nothing")
ErrEnginesArgument is the typed error for a %engines argument other than `probe`.
var ErrInterrupt = errors.New("interrupt")
ErrInterrupt is returned by a LineReader, with the text typed so far, when the line is interrupted (Ctrl-C).
var ErrRunsReplay = errors.New("a Monte Carlo runs under a driving schedule, not a replay")
ErrRunsReplay is the refusal of a Monte Carlo while the schedule replays a witness: the witness fixes every draw, so the runs could not differ.
var ErrSelfCheckPackageNotFound = selfcheck.ErrPackageNotFound
ErrSelfCheckPackageNotFound is wrapped by SelfCheckPackages when a -self-check-package name resolves to no package.
Functions ¶
func CompileCalc ¶ added in v0.10.0
func CompileCalc[P any](s *Session, name string, compile func(*semantics.Model, *resolve.Resolver, *symbols.Symbol) (P, error)) (P, error)
CompileCalc compiles the named calc def and every calc it invokes with compile, the codegen compiler a caller links. The error names the construct that kept a calc from compiling.
func ExpandHome ¶ added in v0.11.0
ExpandHome expands a leading `~` or `~/` to the user's home directory, which the prompt is expected to understand even though no shell has been through the line; a host resolving paths for the prompt expands them the same way.
func FilterViews ¶ added in v0.10.0
FilterViews keeps the views of the kinds named, every kind when none is, and only the graph-shaped ones when diagrams is set.
func KnownMeta ¶ added in v0.10.0
KnownMeta reports whether name is a `%` command this build serves, so a caller can tell a command that printed guidance from one that was unknown.
func ListText ¶ added in v0.10.0
ListText writes items one per line, the columns aligned: `document <name>`, `view <kind> <name>`, an unsupported view followed by the reason.
func Loop ¶
func Loop(r LineReader, out io.Writer, s *Session) error
Loop runs until io.EOF (Ctrl-D) or an interrupt at an empty prompt (Ctrl-C); any other interrupt discards the line and the buffered continuation.
func MetaArgs ¶ added in v0.10.0
MetaArgs reads a meta command line as the prompt does: the command, then its arguments, a quoted one kept whole.
func RenderResult ¶ added in v0.10.0
RenderResult produces the lines the prompt prints for a submission at the given verbosity.
func SplitBehavior ¶
SplitBehavior splits a behavior spec as `%action` and `-action` take it: the name, then the words naming the performing object, a quoted name with spaces kept whole.
func ViewKindList ¶ added in v0.10.0
func ViewKindList() string
ViewKindList names the view kinds, as a refusal lists them.
func WriteListJSON ¶ added in v0.10.0
WriteListJSON writes items as a JSON array; nothing at all when there are none.
Types ¶
type AmbiguousActionError ¶ added in v0.11.0
type AmbiguousActionError struct {
Object string // the object, as objectMention prints it
Action string // the definition asked for, as typed
// Usages are the performed usages running it, in declaration order, as the
// prompt prints names; "" for one without a name.
Usages []string
}
AmbiguousActionError reports a definition an object performs as the body of several actions, so that naming it attaches to none of them.
func (*AmbiguousActionError) Error ¶ added in v0.11.0
func (e *AmbiguousActionError) Error() string
type AmbiguousMachineError ¶
type AmbiguousMachineError struct {
Object string // the object, as objectMention prints it
Machine string // the definition asked for, as typed
// Usages are the exhibited usages running it, in declaration order, as the
// prompt prints names; "" for one without a name.
Usages []string
}
AmbiguousMachineError reports a state definition an object exhibits as the body of several usages, so naming the definition names no one machine.
func (*AmbiguousMachineError) Error ¶
func (e *AmbiguousMachineError) Error() string
type AmbiguousNameError ¶
AmbiguousNameError reports a name that matched more than one declaration. It is distinct from a name found nowhere: a command may look elsewhere for the latter, but must never answer about one of several candidates.
func (*AmbiguousNameError) Error ¶
func (e *AmbiguousNameError) Error() string
type AmbiguousSubjectError ¶
AmbiguousSubjectError reports a feature or condition several of the session's objects carry, so which one an answer would be about is a question.
func (*AmbiguousSubjectError) Error ¶
func (e *AmbiguousSubjectError) Error() string
type Behavior ¶
Behavior names a behavior to run and, after it, the object performing it, as `-action`/`-state` take them: `Drive rover1`.
type CompareOptions ¶
type CompareOptions struct {
// Runs replaces every configuration's numberOfRuns when positive.
Runs int64
// Seed is the seed the runs derive theirs from; nil leaves it to the session's, if any.
Seed *uint64
// Draws replaces every configuration's durationSimulationMode when set.
Draws *runtime.DrawPolicy
// ClockStep replaces every configuration's clock step when set; 0 is a continuous clock.
ClockStep *float64
// Observe names the stored observables compared, each with the feature of the run that answers
// it; without any, every stored observable is read from the target's feature of its own name.
Observe []ObservablePair
// Only names the configurations compared, by qualified or simple name; all when empty.
Only []string
}
CompareOptions say how migrated run configurations are run beside the results their tool stored.
type Completion ¶
Completion answers a completion request: the words that can replace the one being typed, and the part of it already typed, which every candidate starts with.
type DebugReport ¶ added in v0.11.0
type DebugReport struct {
Kind string
Name string
Qualified string
Performer string
State string
Ended bool
Lines []string
// Action debugging.
PausedAt string
Breakpoints []string
Tokens []TokenReport
Results []NamedValue
// State machine debugging.
CurrentState string
ActiveStates []string
Time float64
LastEventAt float64
QueuedEvents int
SignalsInFlight []string
SuspendReason string
StateStack []string
StateData []NamedValue
}
DebugReport is where the session's debugging stands, for a caller driving the debuggers as data rather than through the prompt's text. Kind is "action" or "state" for the executor the report describes, "check" when the behavior was put to the check engine instead of stepped, and "" when no debugging session runs. The action fields are filled for an action, the state fields for a machine; Lines are what the prompt printed for the command.
type Diagnostic ¶
type Diagnostic struct {
Severity string
Message string
// File is the loaded file the finding is in, empty for typed input, and Line
// and Column place it within that file rather than within the session buffer.
File string
Line int
Column int
// UTF16Column is Column counted in UTF-16 code units, as SARIF counts.
UTF16Column int
// Pass names what produced the finding, and Code what it found.
Pass string
Code string
// Fixes are the edits that resolve the finding, when analysis knows them.
Fixes []Fix
}
Diagnostic is one finding about the session's model, located in it, for a caller reporting analysis as data rather than as the prompt's text.
type Edit ¶ added in v0.11.0
type Edit struct {
Line, Column int
EndLine, EndColumn int
// UTF16Column and UTF16EndColumn are the columns in UTF-16 code units.
UTF16Column, UTF16EndColumn int
NewText string
}
Edit replaces the text from Line:Column up to EndLine:EndColumn (exclusive, 1-based, within the diagnostic's file) with NewText; an insertion has an empty span.
type EnginesArgumentError ¶
type EnginesArgumentError struct {
Args []string
}
EnginesArgumentError reports what %engines was given instead.
func (*EnginesArgumentError) Error ¶
func (e *EnginesArgumentError) Error() string
Error names the arguments.
func (*EnginesArgumentError) Is ¶
func (e *EnginesArgumentError) Is(target error) bool
Is matches ErrEnginesArgument.
type EvalResult ¶ added in v0.11.0
type EvalResult struct {
Expression string
// Text is the value as the prompt prints it.
Text string
// Unset is a feature holding no value, printed `<unset>`; Value is then invalid.
Unset bool
Value runtime.Value
Context *runtime.Context
Index *symbols.Index
Lines []string
}
EvalResult is what an expression evaluated to, for a caller reporting the value as data beside the lines `%eval` prints: the value, the context it is read through, and the index naming the declarations it refers to.
type Evaluation ¶
type Evaluation struct {
Function string
Arguments []string
Result string
Error string
Selected bool
Tied bool
}
Evaluation is one application of a case's calc as a function value: what it was applied to, what it computed or failed with, and whether the case returned its argument (selected) or passed it over for one evaluating alike (tied).
type ExhibitorsError ¶
type ExhibitorsError struct {
Machine string // the machine asked for, as the prompt prints names
Types []string // the types declaring an exhibit of it, in declaration order, as the prompt prints names
Objects []RelatedObject // the held objects exhibiting it, in walk order; none when no object does
Fresh bool // the objects are an explored run's, not the session's
}
ExhibitorsError reports a machine `%state <machine>` alone cannot attach to: no held object exhibits it, or several do, so no one running performance is meant. Fresh reports the same of an explored run's objects, which -instantiate gives it.
func (*ExhibitorsError) Error ¶
func (e *ExhibitorsError) Error() string
type ExploreAtPromptError ¶
type ExploreAtPromptError struct {
Policy runtime.SchedulePolicy
}
ExploreAtPromptError reports `%schedule explore` at the prompt, whose debuggers step one run; exploration belongs to the CLI or the wire.
func (*ExploreAtPromptError) Error ¶
func (e *ExploreAtPromptError) Error() string
type ExplorePreviewError ¶ added in v0.9.2
type ExplorePreviewError struct {
Policy runtime.SchedulePolicy
}
ExplorePreviewError reports a tool preview under a schedule that explores: every linearization runs, while a preview shows only one run's first call.
func (*ExplorePreviewError) Error ¶ added in v0.9.2
func (e *ExplorePreviewError) Error() string
type ExploredObjectError ¶
type ExploredObjectError struct {
Ref string
}
ExploredObjectError reports an object reference an exploration cannot follow: every explored run creates its objects afresh, so an object of the session, named by id, is in no run.
func (*ExploredObjectError) Error ¶
func (e *ExploredObjectError) Error() string
type FeatureListing ¶ added in v0.11.0
FeatureListing is how far Features expands an object: every nested object when All is set, to Depth when it is non-negative, and bounded as the prompt bounds a plain %features otherwise.
type FeaturesReport ¶ added in v0.11.0
FeaturesReport is an object's feature values as %features lists them, and the object graph as the API's Instantiate writes it in JSON, which is nil when the build does not link the graph writer.
type Fix ¶ added in v0.11.0
Fix is one way to resolve a diagnostic: a set of edits to the file it is in.
type ImportOptions ¶ added in v0.10.0
ImportOptions are how ImportData reads its file: a mapping file, a format overriding the extension's, and whether the model is left as it was.
type InstanceReport ¶ added in v0.11.0
InstanceReport is one object the session holds: the name %instantiate created it under, its id, its type, and how its lifetime ended when it did. An object a later %instantiate of its name displaced has no Name and names what it was.
type InstantiationReport ¶
type InstantiationReport struct {
Lines []string
// FeatureValueErrors are the feature values that could not be materialized, in the order they
// were read: a default whose value count does not conform to the feature's
// multiplicity is one.
FeatureValueErrors []string
// Bounded is true when materialization stopped short — at its budget, or at
// nesting it does not descend into — so the feature values it did not reach were not
// checked rather than found clean.
Bounded bool
}
InstantiationReport is what creating an object produced: the lines a caller prints, and the diagnostics materializing the object's feature values reported.
type LineReader ¶
LineReader yields input lines; the prompt argument switches between primary and continuation prompts. Implemented by a readline adapter in cmd, and by a slice in tests. ReadLine returns io.EOF at end of input and ErrInterrupt when the line is interrupted.
type ListItem ¶ added in v0.10.0
type ListItem struct {
Category string `json:"category"`
Name string `json:"name"`
Kind view.Kind `json:"kind,omitempty"`
Supported *bool `json:"supported,omitempty"`
Reason string `json:"reason,omitempty"`
File string `json:"file,omitempty"`
Line int `json:"line,omitempty"`
}
ListItem is one document, view or pseudo-view a listing names. Name is the qualified name as the notation writes it, which -render-document and -render read back as the same element; File and Line locate the declaration.
func DocumentItems ¶ added in v0.10.0
func DocumentItems(defs []model.DocumentDefinition) []ListItem
DocumentItems lists document definitions as items, in the order given.
func PseudoViewItems ¶ added in v0.10.0
func PseudoViewItems() []ListItem
PseudoViewItems lists the pseudo-views a document is rendered through when it declares no view of its own.
type LoadReport ¶
type LoadReport struct {
Loaded []string // the files read, when more than one was, and what each notebook contributed
Found []string // diagnostics and the notes that belong with them
Declared []string // what the load declared, empty if the analysis errored
Errors bool // whether the analysis found an error
}
LoadReport is what a load produced, in parts so a caller can keep what the analysis found off the stream it prints results on.
type Member ¶ added in v0.9.2
Member is one top-level member of a session document; Offset is where the member begins in the buffer, a loaded file's document having offsets of its own.
type NamedValue ¶
type NamedValue struct {
Name string
Value string
// OrderDependent counts the run's unresolved choice points touching the
// value, which the prompt prints the marker of after it; 0 for a value
// nothing order-dependent wrote.
OrderDependent int
}
NamedValue is one value a check or a run produced, formatted as the prompt prints it: a calculation's result, an action's output, a machine's state.
func (NamedValue) Text ¶ added in v0.11.0
func (v NamedValue) Text() string
Text is the value as the prompt prints it, marked when order-dependent.
type NoEnginesError ¶
type NoEnginesError struct{}
NoEnginesError reports a session given no registry to put its questions to.
func (*NoEnginesError) Error ¶
func (e *NoEnginesError) Error() string
type NotInstantiatedError ¶
type NotInstantiatedError struct {
Name string // the name asked for, as the prompt prints names
// Definition is the definition the objects in Objects are of, "" when none.
Definition string
// Objects are the related objects, in carrier order.
Objects []RelatedObject
// UsageAsked reports that Name is a usage, so Objects are of its definition
// rather than of the usage; otherwise Name is a definition Objects are typed by.
UsageAsked bool
}
NotInstantiatedError reports a declared name no object has been created under. When objects of the definition that name is typed by (or, for a definition, objects of usages typed by it) exist, it says so and names what to instantiate.
func (*NotInstantiatedError) Error ¶
func (e *NotInstantiatedError) Error() string
type ObjectPathError ¶
An object reference is read and walked by objref; the REPL's own names for its parts and errors are kept, since every command reports them.
type ObjectRefError ¶
An object reference is read and walked by objref; the REPL's own names for its parts and errors are kept, since every command reports them.
type ObservablePair ¶
type ObservablePair = simresults.ObservablePair
ObservablePair is a stored observable and the feature of the run that answers it; an empty Feature is the target's feature of the observable's own name.
type Origin ¶
Origin locates one file of a submission in the buffer, so a diagnostic is reported against that file and its own line numbering.
type PerformersError ¶
type PerformersError struct {
Action string // the action asked for, as the prompt prints names
Objects []RelatedObject // the run's objects performing it, in walk order
Usages []string // with one object, the performed usages running it, as the prompt prints names; "" for one unnamed
}
PerformersError reports an action `-action <action>` alone cannot attach to under a fresh-run engine: several of the run's objects perform it, or one performs it as several usages, so no one performance is meant.
func (*PerformersError) Error ¶
func (e *PerformersError) Error() string
type ReadError ¶
ReadError is a file a load could not read, under the name it is reported by.
type RelatedObject ¶
RelatedObject names an object the session holds, by id and by the label it is reached under — "" for one only its id reaches.
type Rendered ¶ added in v0.10.0
Rendered is what %render wrote: the lines of the artifact, and the form they are in.
type RenderedDocument ¶
RenderedDocument is one document of a rendered multi-document set, rendered in one backend's form. Err is the error that kept the document from rendering, whose Content then is a page stating it; nil for a rendered document.
type ReservedNameError ¶ added in v0.9.2
type ReservedNameError struct {
Name string
}
ReservedNameError is a file a load refused because its name is the one the session keeps its typed text under, which a loaded file cannot share.
func (*ReservedNameError) Error ¶ added in v0.9.2
func (e *ReservedNameError) Error() string
type Result ¶
type Result struct {
Members []Member // top-level members of the session documents, in buffer order
Declared []string // names introduced by THIS submission
Diagnostics []diag.Diagnostic // eager analysis over the whole buffer
Source string // the full joined <repl> content (Task 6 caret rendering)
Offset int // byte offset in Source where THIS submission begins
Origins []Origin // the files of THIS submission, in buffer order
Notices []string // side effects of the submission, e.g. a debugging session it ended
// Refused is the *ReservedNameError a submission was refused for, nil when
// it was accepted; a refused submission changed nothing.
Refused error
// Blocked names the unresolved error that stopped the deeper checks from
// running over this submission, nil when they ran or when the session already
// reported that error.
Blocked *blocker
// contains filtered or unexported fields
}
Result is the outcome of one Submit: the top-level members of the session's documents (for the success summary), the names this submission declared, and any analysis diagnostics over the whole buffer.
func (Result) OwnDiagnostics ¶ added in v0.11.0
func (r Result) OwnDiagnostics(v Verbosity) []diag.Diagnostic
OwnDiagnostics are the diagnostics of the submission r reports, scoped as the verbosity scopes the prompt's report of it: errors alone when quiet.
func (Result) Rejected ¶ added in v0.11.0
Failed reports whether a submission was refused or had an error at the given verbosity: what the prompt prints for it reports a failure, not a declaration. Rejected reports whether the submission was refused or has an error of its own, whatever the verbosity: errors elsewhere in the model, which Failed counts at debug verbosity, do not reject a submission that joined it.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session accumulates submissions: what is typed into the transcript document, and each loaded file into a document of its own.
func NewSessionWithSourceConverter ¶ added in v0.10.0
func NewSessionWithSourceConverter(converter SourceConverter) *Session
NewSessionWithSourceConverter returns a fresh session that converts named source files before parsing them.
func (*Session) Advance ¶ added in v0.11.0
func (s *Session) Advance(duration float64) (DebugReport, error)
Advance moves the debuggers' clock by duration time units, as %advance does, and reports what ran with where the debuggers then stand. A failed step is the error, with the lines of what ran before it.
func (*Session) ApplyModelEdit ¶ added in v0.12.0
ApplyModelEdit applies ops to the session document named name, as the editor's panel applies its edits, and answers each document they rewrite.
func (*Session) CheckAssume ¶
CheckAssume returns the constraints and requirements a check assumes over the initial state.
func (*Session) CheckBounds ¶
CheckBounds returns the search bounds a check runs under: depth, states and unroll, 0 for the engines' defaults, and the timeout, 0 for none.
func (*Session) CheckConstraint ¶
CheckConstraint evaluates a constraint definition, against the object that carries it when one has been created, so the verdict is about concrete values. Arguments for its `in` parameters follow the name in parentheses and an object as its subject after them, as `Pkg::Fits(3.0, limit = 4.0) Pkg::part`.
func (*Session) CheckDiverge ¶
CheckDiverge returns the features a check compares the final values of; none compares every attribute of the action and of its performing object.
func (*Session) CheckInputs ¶
CheckInputs returns the features a check leaves free although the model binds them.
func (*Session) CheckProperties ¶
CheckProperties returns the constraints and requirements a check evaluates at every stable state.
func (*Session) CheckRequirement ¶
CheckRequirement evaluates a requirement definition, against the object that carries it when one has been created. It takes arguments and a subject as CheckConstraint does.
func (*Session) CheckSatisfy ¶
CheckSatisfy evaluates satisfaction assertions: every one the model states when name is empty, or, given a name, the ones the named element states — or that element itself, when it is a named satisfaction assertion. The usual `assert satisfy r by p;` is anonymous, so the element stating it is how a caller reaches it.
func (*Session) CheckSolve ¶
func (s *Session) CheckSolve(name string) []SolveReport
CheckSolve asks a solver whether the named constraint, requirement or satisfaction can be satisfied at all. Experimental: SysML v2 defines no solving.
func (*Session) CheckWitnessDir ¶
CheckWitnessDir returns where a check writes its witnesses, "" for nowhere.
func (*Session) Clear ¶
Clear resets the session, dropping all accumulated declarations. It returns the notices for what the reset took with it.
func (*Session) ClearModelSeed ¶
func (s *Session) ClearModelSeed()
ClearModelSeed unsets the seed SetModelSeed set.
func (*Session) ClockStep ¶
ClockStep returns the step the clock of runs started from here on ticks by, in seconds; 0 is a continuous clock.
func (*Session) CompareResults ¶
func (s *Session) CompareResults(results *simresults.Results, opts CompareOptions) []Verdict
CompareResults runs each configuration the sidecar indexes as its tool ran it — on its target, for its run count, under its draw policy — and reports the tool's distribution of every observable beside the runs', one verdict per configuration. Numbers are read as they are; nothing is scaled or tuned.
func (*Session) CompareResultsEach ¶ added in v0.9.2
func (s *Session) CompareResultsEach(results *simresults.Results, opts CompareOptions, report func(Verdict))
CompareResultsEach is CompareResults reporting each verdict to report as it is decided, in the order CompareResults lists them, so a caller prints a configuration's comparison while the next one runs.
func (*Session) Complete ¶
func (s *Session) Complete(line string, pos int) Completion
Complete offers the words that can continue line at byte offset pos: the meta commands where a command is being typed, file paths where %load and %save take one, and otherwise the names the session and the library declare.
func (*Session) ConfigureVariants ¶
func (s *Session) ConfigureVariants(name string, args []string) []SolveReport
ConfigureVariants answers about the variants an element's conditions permit: with no selection it synthesises a consistent one, with selections `variation=variant` it checks the ones given, and with `all` it enumerates consistent selections up to the bound (limit, when a count follows `all`). Experimental, and read-only: no object is created and no variant is bound.
func (*Session) ConformanceMode ¶
func (s *Session) ConformanceMode() diag.ConformanceMode
ConformanceMode reports the strictness the session judges notation at.
func (*Session) DebugAction ¶ added in v0.11.0
func (s *Session) DebugAction(name string, performer []string) (DebugReport, error)
DebugAction starts debugging an action, performed by the object performer names when it names one, as %action does. Under the check engine the action is checked instead, and the report's Kind is "check".
func (*Session) DebugContinue ¶ added in v0.11.0
func (s *Session) DebugContinue() (DebugReport, error)
DebugContinue runs the debugged action to completion, or to the first breakpoint a token reaches, as %continue does.
func (*Session) DebugState ¶ added in v0.11.0
func (s *Session) DebugState(name string, performer []string) (DebugReport, error)
DebugState starts debugging a state machine, or attaches to the one an object exhibits, as %state does. Under the check engine the machine is checked instead, and the report's Kind is "check".
func (*Session) DebugStatus ¶ added in v0.11.0
func (s *Session) DebugStatus() (DebugReport, bool)
DebugStatus reports the debugging session under way, with the lines %tokens and %current print for it; false when none runs.
func (*Session) DebugStep ¶ added in v0.11.0
func (s *Session) DebugStep() (DebugReport, error)
DebugStep advances the debugged action one token step, or the debugged machine one step, as %step does. A step that failed is the error, with the report of where the debugger stands beside it.
func (*Session) DebugStop ¶ added in v0.11.0
DebugStop ends the debugging session under way, returning the lines %stop prints; an error when none runs.
func (*Session) Debugging ¶ added in v0.11.0
Debugging reports whether an action or a state machine is being debugged.
func (*Session) DiagnosticLines ¶
DiagnosticLines reports the analysis of everything submitted so far as the prompt prints it: the source line each finding is on, under a position naming the file the finding is in, at the verbosity the session was asked for.
func (*Session) Diagnostics ¶
func (s *Session) Diagnostics() []diag.Diagnostic
Diagnostics reports the analysis of everything submitted so far, including the syntax errors of a submission masked out of the buffer for not closing its own text: a load whose file does not parse says why, and HasErrors is true, which is what a non-interactive run exits on.
func (*Session) DisabledLints ¶ added in v0.9.2
DisabledLints reports the codes of the lints the session leaves out of its diagnostics.
func (*Session) Draws ¶
func (s *Session) Draws() runtime.DrawPolicy
Draws returns the policy runs started from here on resolve their RandomFunctions draws under: at random from the seeded stream, or at each call's min, max or average.
func (*Session) EnabledLints ¶ added in v0.10.0
EnabledLints reports the codes of the opt-in lints the session keeps in its diagnostics.
func (*Session) Engine ¶
Engine returns the engine selection every question the session asks is made under.
func (*Session) Engines ¶
Engines lists the registered engines with their authority, the questions each answers and the state of its process, as `%engines` prints them.
func (*Session) EvalBare ¶
EvalBare evaluates a prompt line read as an expression, recording a failed materialization so a piped run's exit status reports it, as %eval does.
func (*Session) EvalExpr ¶
EvalExpr evaluates an expression and returns the lines `%eval` prints, with an error for one that could not be evaluated.
func (*Session) Evaluate ¶ added in v0.11.0
func (s *Session) Evaluate(expr string) (EvalResult, error)
Evaluate evaluates an expression as EvalExpr does and returns the value with the lines, with an error for one that could not be evaluated.
func (*Session) EvaluateDocument ¶
EvaluateDocument compiles the named document definition and evaluates its queries against the session's model, for a backend rendering the result.
func (*Session) ExpandPaths ¶ added in v0.11.0
ExpandPaths turns the paths a caller was given — files, directories to walk for .sysml/.kerml files and .ipynb notebooks, or glob patterns — into the sources to load, in a deterministic order and without duplicates. A directory holding a project interchange file stands for the project's own files and those of the installed projects it uses, found under the session's library roots.
func (*Session) Expecting ¶ added in v0.11.0
func (s *Session) Expecting() func()
Expecting tells the session a host is about to run commands on it, so an Interrupt that arrives before the first one begins stops that command at its first step instead of finding nothing to stop. Call the function returned once the commands are done.
func (*Session) ExplainSolve ¶
func (s *Session) ExplainSolve(name string) []SolveReport
ExplainSolve asks a solver which of an element's conditions conflict, for a constraint, requirement or satisfaction. Experimental: SysML v2 defines no solving, and the runtime evaluator remains normative.
func (*Session) Features ¶ added in v0.11.0
func (s *Session) Features(object string, l FeatureListing) (FeaturesReport, error)
Features lists an object's feature values and what its behaviors are doing, as %features does; object is an object reference. An object the session does not hold is the error.
func (*Session) Files ¶ added in v0.11.0
Files returns the path of every file loaded into the session, in load order.
func (*Session) Graphs ¶ added in v0.10.0
Graphs exports the lowered graph of the named action or state machine, and of every behavior it performs, as the canonical graphs:1 JSON an external engine is sent. A name that is no behavior is modelform.ErrGraphsSubject.
func (*Session) HasErrors ¶
HasErrors reports whether the session found the model wrong: something analysis found, or a feature value a command could not materialize. It is what a non-interactive run exits on.
func (*Session) ImportData ¶ added in v0.10.0
func (s *Session) ImportData(path string, opts ImportOptions) Verdict
ImportData sets the feature values a CSV, TSV, JSON or JSON Lines file assigns, one row per element, as one edit of the model's source: a value the model refuses leaves every other row unapplied too.
func (*Session) Instances ¶ added in v0.11.0
func (s *Session) Instances() ([]InstanceReport, []string)
Instances lists the objects the session holds, as %instances does, with the lines it prints.
func (*Session) InstantiateNamed ¶
InstantiateNamed creates an object of the named definition and keeps it, so a later check about that name is a check about this object. It returns the lines `%instantiate` prints, and an error for a name the session cannot resolve or an instantiation the runtime rejected.
func (*Session) InstantiateReport ¶
func (s *Session) InstantiateReport(name string) (InstantiationReport, error)
InstantiateReport creates the named object and materializes its feature values, so a non-interactive caller reports what materialization found rather than leaving it to whoever reads a feature value next. An object that cannot be created at all is an error; a feature value that cannot be materialized is a finding about the model. The object is also given to the fresh-run engines: each of their runs creates one of its declaration first, one per call as the session holds one per call, where %instantiate's object is the session's alone.
func (*Session) Interrupt ¶ added in v0.10.0
func (s *Session) Interrupt()
Interrupt stops the command under way: the run it drives fails at its next step with runtime.ErrInterrupted, and a plan it put to the engines is cancelled. It is safe to call from another goroutine while a command runs, which is what it is for; the next command starts unaffected. A command requested but still waiting for the session is stopped at its first step. A command that is not running anything — a declaration being analysed, a file being read — ends on its own, and with no command under way or waiting there is nothing to stop.
func (*Session) LibraryRoots ¶ added in v0.11.0
LibraryRoots reports the directories installed projects are looked for under.
func (*Session) ListDocuments ¶ added in v0.10.0
ListDocuments lists the document definitions the session's model declares.
func (*Session) ListViews ¶ added in v0.10.0
ListViews lists the views the session's model declares, those of the kinds named when any are, and only the graph-shaped ones when diagrams is set.
func (*Session) LoadFile ¶
LoadFile submits path and the files beside and below it that declare a root namespace it references as one submission, returning the lines `%load` prints. A lone "-" reads standard input; the error is a file it could not read or one named as the transcript is.
func (*Session) LoadFileSummary ¶
LoadFileSummary submits the contents of path and returns only what it declared, without what analysis has found so far. A caller loading a model that spans several files reports the analysis once every file is in, a reference from one file to another resolving only then.
func (*Session) LoadFilesSummary ¶
LoadFilesSummary is LoadFileSummary over every path as one submission, each file a document of its own, indexed together and each summarized on its own; a read failure is a *ReadError and a file named as the transcript is a *ReservedNameError. Files beside and below the paths that declare a root namespace they reference load too.
func (*Session) LoadPaths ¶
LoadPaths loads model files into the session. Each path names a file, a directory to walk for .sysml/.kerml files, a glob pattern, or standard input as a lone "-", whose contents are reported as <stdin>. A root namespace the analysis leaves unresolved — an import's or a qualified name's — that none of the files or the library declares is looked for in the model files beside and below them, and each file declaring it is loaded too, its own unresolved references followed the same way. Every file is accepted before the buffer is analyzed, so the order files are loaded in does not affect name resolution: a file may reference a declaration another file loaded after it makes. Diagnostics name the file they belong to and count lines from its start.
func (*Session) LoadPathsReport ¶
func (s *Session) LoadPathsReport(paths []string) (LoadReport, error)
LoadPathsReport loads model files as LoadPaths does, reporting what the analysis found apart from what the load declared.
func (*Session) LoadWarnings ¶ added in v0.12.0
func (s *Session) LoadWarnings(paths []string) ([]Diagnostic, int)
LoadWarnings reports what the projects and archives a load of paths touched fell short of as warnings located at their file (code project.load), less and counting the suppressed.
func (*Session) Locate ¶ added in v0.11.0
func (s *Session) Locate(res Result, diags []diag.Diagnostic) []Diagnostic
Locate places diags, a Result's diagnostics, in the submissions they are about as LocatedDiagnostics does — in the buffer they were reported over, if res left it.
func (*Session) LocatedDiagnostics ¶
func (s *Session) LocatedDiagnostics() []Diagnostic
LocatedDiagnostics reports the analysis of everything submitted so far, each finding placed in the submission it is about: the file it was loaded from, at the line and column that file has it on.
func (*Session) MaterializationFailures ¶
MaterializationFailures reports the feature values the session's commands could not materialize, in the order they were reported: a command that rendered one answered nothing about that feature value.
func (*Session) ModelSeed ¶
ModelSeed returns the seed runs started from here on draw their modeled randomness — weighted decisions, RandomFunctions — from, and whether one is set.
func (*Session) OptimizeSolve ¶
func (s *Session) OptimizeSolve(name string) []SolveReport
OptimizeSolve asks a solver for the best values an analysis case's objectives admit, over the conditions the case requires or assumes. Experimental: SysML v2 defines no solving, and the runtime evaluator remains normative.
func (*Session) OverlaidViewRendering ¶ added in v0.10.0
func (s *Session) OverlaidViewRendering(name string, overlay view.Overlay, depth int) (*view.Rendering, error)
OverlaidViewRendering is ViewRendering with an overlay drawn over the view's structure. The verdict overlay runs the verification cases verifying each requirement drawn in a runtime of its own, so the session's runtime, its objects and any debugging session in progress stay untouched.
func (*Session) Print ¶ added in v0.11.0
Print returns the session's model as SysML notation, whole when name is empty and the named element with its body otherwise, as %print prints it. A name the session does not declare is the error.
func (*Session) Query ¶
Query evaluates OSLC element-identification query text and renders one matched element per line for the interactive frontend.
func (*Session) RecordAnalysis ¶
RecordAnalysis runs the invocation as %analysis does and records the run into the model as AnalysisRecords elements, into the package named or a Records package beside the case's. command is the invocation text the record's provenance carries.
func (*Session) RecordMonteCarlo ¶
func (s *Session) RecordMonteCarlo(invocation string, count int64, seed *uint64, into, command string) Verdict
RecordMonteCarlo runs the invocation count times as RunMonteCarlo does and records each completed run, numbered by its run number.
func (*Session) RecordSweep ¶
RecordSweep runs the invocation once per row of the ranges as RunSweep does and records each completed row, numbered in table order.
func (*Session) Render ¶ added in v0.10.0
Render runs %render with its arguments and answers what it wrote, with the form the lines are in. A usage problem is a *UsageError holding what the prompt prints; a view that could not be rendered is an error.
func (*Session) RenderDocument ¶ added in v0.10.0
func (s *Session) RenderDocument(invocation string, html bool) (lines []string, rendered bool, err error)
RenderDocument runs %render-document with its arguments for a front end showing rich output: the Markdown the prompt prints, as lines, or with html the same document as an HTML fragment for a host page. A usage problem is a *UsageError holding what the prompt prints; a document that could not be rendered is an error.
func (*Session) RenderDocumentAsciiDoc ¶ added in v0.12.0
func (s *Session) RenderDocumentAsciiDoc(invocation string, opts docrender.AsciiDocOptions) (string, error)
RenderDocumentAsciiDoc compiles the named document definition, evaluates its queries against the session's model, and renders the result as AsciiDoc, its cross-document references pointing at the files a set of the model's documents writes.
func (*Session) RenderDocumentHTML ¶
RenderDocumentHTML compiles the named document definition, evaluates its queries against the session's model, and renders the result as HTML, its cross-document links pointing at the files a set of the model's documents writes.
func (*Session) RenderDocumentMarkdown ¶
func (s *Session) RenderDocumentMarkdown(invocation string, opts docrender.MarkdownOptions) (string, error)
RenderDocumentMarkdown compiles the named document definition, evaluates its queries against the session's model, and renders the result as Markdown. A document binds its queries' parameters in the model, so the invocation is the document's name alone. Its cross-document links point at the files a set of the model's documents writes.
func (*Session) RenderDocumentSetAsciiDoc ¶ added in v0.12.0
func (s *Session) RenderDocumentSetAsciiDoc(opts docrender.AsciiDocOptions) ([]RenderedDocument, error)
RenderDocumentSetAsciiDoc renders the same set as linked AsciiDoc files, each referring to the others by their .adoc file names.
func (*Session) RenderDocumentSetHTML ¶
func (s *Session) RenderDocumentSetHTML(opts docrender.HTMLOptions) ([]RenderedDocument, error)
RenderDocumentSetHTML renders the same set as linked HTML files, each referring to the others by their .html file names.
func (*Session) RenderDocumentSetMarkdown ¶
func (s *Session) RenderDocumentSetMarkdown(opts docrender.MarkdownOptions) ([]RenderedDocument, error)
RenderDocumentSetMarkdown compiles every document definition the session's model declares, evaluates them together, and renders each as Markdown with its deterministic file name, so cross-document references link on disk. A document that cannot be rendered is a page stating why, under Err, so the links into it land on the reason; the others are rendered whole.
func (*Session) ResolveSelfCheckPackages ¶ added in v0.10.0
ResolveSelfCheckPackages reports the -self-check-package names no loaded model or library declares a package for, or nil when every name resolves.
func (*Session) RunAction ¶
RunAction runs an action to completion outside the prompt, on the object performer names when it names one. An action that could not be run, or that stopped short of completing, is unresolved: it produced no outputs to judge.
func (*Session) RunActionWithInputs ¶ added in v0.11.0
RunActionWithInputs is RunAction with the action's input parameters bound before it starts, from arguments written positionally, in parameter order, or as `<parameter>=<expression>`, each evaluated where the prompt evaluates one. Inputs bind a run only; under check or explore, which search every schedule from the action's own start, the verdict is unresolved and says so.
func (*Session) RunAnalysis ¶
RunAnalysis runs an analysis case outside the prompt and returns what it computed and decided. invocation is what `%analysis` takes: a name, optionally carrying arguments as `Case(3.0, limit = 4.0)`, then the object that is its subject. Its status is the worst its objective and assertions decided.
func (*Session) RunCalc ¶
RunCalc invokes a calculation and returns what it computed. invocation is what `%calc` takes: a name, optionally followed by its arguments or carrying them as `Fall(3, 4)`.
func (*Session) RunDocumentQuery ¶
RunDocumentQuery compiles the named document query, binds its entry parameters and executes it. invocation is what `%run-query` takes: a name followed by `<parameter>=<expression>` bindings.
func (*Session) RunFor ¶
RunFor starts the behaviors named, advances their shared clock by duration once and returns one verdict per behavior (an action holds when it completed in time). Under the check engine the behaviors are one invocation, every schedule of which up to that instant is searched: one verdict for them all.
func (*Session) RunMeta ¶
runMeta executes a meta command line. Returns lines to print, whether to quit, and an error only for unrecoverable I/O (unknown commands print guidance). RunMeta executes a meta-command (e.g., %eval, %load) and returns the output lines, a quit flag, and any error encountered.
func (*Session) RunMonteCarlo ¶
RunMonteCarlo runs the named case count times on fresh subjects, each run seeded from seed (the session's when nil), and reports the table, distribution and conclusion.
func (*Session) RunOccurrence ¶ added in v0.11.0
RunOccurrence performs an occurrence def as the interaction its body states, which is `%occurrence`: each message is transferred from the lifeline holding the event it leaves to the one holding the event it reaches, in the order the events admit. The values are the transfers performed, in order.
func (*Session) RunRuns ¶
func (s *Session) RunRuns(name string, performer []string, count int64, seed *uint64, observables []string) Verdict
RunRuns runs the action count times, each run drawing its modeled randomness from a seed of its own derived from seed — the session's when seed is nil, and none when it has none, as a fixed draw policy allows — on an object of performer when one is named, and reports the table of the observables named — every feature the action holds and the clock when none are — with each one's distribution.
func (*Session) RunSamples ¶
RunSamples runs one invocation once per drawn row, drawing count values for each range from seed. The same seed draws the same table.
func (*Session) RunStateMachine ¶
RunStateMachine starts a state machine outside the prompt, taking only its initial transition, which is `%state` alone. The values are the configuration the machine settled in. Under the check engine every schedule of that initial transition is searched instead.
func (*Session) RunStateMachineFor ¶
RunStateMachineFor starts a state machine and advances it by duration time units, which is `%state` followed by `%advance`. A duration of 0 is a run to the current time, dispatching the events already due, as `%advance 0` is. Under the check engine every schedule up to that instant is searched.
func (*Session) RunSweep ¶
RunSweep runs one invocation once per row of the ranges given and reports the table. invocation is what `%analysis` and `%calc` take; each range is written `<parameter>=<from>..<to>[:<step>]`.
func (*Session) RunTraceRendering ¶ added in v0.10.0
RunTraceRendering renders the trace the session recorded so far.
func (*Session) Save ¶ added in v0.11.0
Save writes the session's model to path as %save does: `.sysml` notation, or `.ttl`/`.json` RDF, and returns the lines %save prints. A path that cannot be written is the error.
func (*Session) SavePreview ¶ added in v0.11.0
SavePreview is the file Save would write to path, in the format its extension names, and the lines Save would print before writing it, with nothing written. A save that would be refused is the error, with its lines. An empty session previews as it saves: no content, and a line saying so.
func (*Session) Schedule ¶
func (s *Session) Schedule() runtime.SchedulePolicy
Schedule returns the policy runs started from here on resolve their choice points under.
func (*Session) SelfCheck ¶ added in v0.10.0
SelfCheck applies the SysMLValidation constraints to every element of the loaded model and reports what fails.
func (*Session) SelfCheckPackages ¶ added in v0.10.0
SelfCheckPackages applies the SysMLValidation constraints together with the constraint defs of each named rule package. A name nothing declares is an error wrapping ErrSelfCheckPackageNotFound and nothing is evaluated.
func (*Session) SendSignal ¶ added in v0.11.0
SendSignal sends a signal as %send does; text is what follows the command: the signal, its arguments in parentheses, and `to <object>` when the target is not the debugged behavior's. The signal a behavior would not take is the error.
func (*Session) SetBreakpoints ¶ added in v0.11.0
func (s *Session) SetBreakpoints(nodes []string, reset bool) (DebugReport, error)
SetBreakpoints sets a breakpoint at each node named, clearing the ones set before when reset is set, and reports the breakpoints the debugged action then has with the lines %break prints. A node the action has none of is the error, naming its nodes.
func (*Session) SetBudgets ¶
SetBudgets sets the bounds for runtime contexts created from here on, dropping the current one with its objects and the debuggers driving it, which the next command reports. It errors on a non-positive bound, which no run could make progress under.
func (*Session) SetCheckAssume ¶
SetCheckAssume names the constraints and requirements a check assumes over the initial state; each is resolved when the check runs.
func (*Session) SetCheckBounds ¶
SetCheckBounds sets the search bounds a check runs under; 0 keeps the engines' default for depth, states and unroll, and no clock for the timeout.
func (*Session) SetCheckDiverge ¶
SetCheckDiverge names the features a check compares the final values of.
func (*Session) SetCheckInputs ¶
SetCheckInputs names the features a check leaves free although the model binds them; each is resolved when the check runs.
func (*Session) SetCheckProperties ¶
SetCheckProperties names the constraints and requirements a check evaluates at every stable state; each is resolved when the check runs.
func (*Session) SetCheckWitnessDir ¶
SetCheckWitnessDir names where a check writes its witnesses, one file per violation and per divergent value; "" writes none.
func (*Session) SetClockStep ¶
SetClockStep sets the clock step for runs started from here on, the debugger's included: their waits come due at multiples of step seconds; 0 restores the continuous clock. A step that is not a finite, non-negative number is runtime.ErrClockStep.
func (*Session) SetConformanceMode ¶
func (s *Session) SetConformanceMode(mode diag.ConformanceMode) error
SetConformanceMode switches what the session asks of its model: whether notation no SysML v2 production admits is a warning or an error. It takes effect at once — the buffer is re-analyzed on the next request. A workspace holding a document as its interface record keeps its mode and says so.
func (*Session) SetDisabledLints ¶ added in v0.9.2
SetDisabledLints replaces the lints the session leaves out of its diagnostics; a code naming no lint is an error and changes nothing.
func (*Session) SetDraws ¶
func (s *Session) SetDraws(policy runtime.DrawPolicy)
SetDraws sets the draw policy for runs started from here on, the debugger's included; a fixed policy draws without a seed.
func (*Session) SetEnabledLints ¶ added in v0.10.0
SetEnabledLints replaces the opt-in lints the session keeps in its diagnostics; a code naming no lint is an error and changes nothing.
func (*Session) SetEngine ¶
SetEngine selects the engine questions asked from here on are put to: `auto`, `all`, or one engine by name. A name no engine is registered under is a typed error.
func (*Session) SetEngines ¶
SetEngines replaces the registry the session's questions are put to, keeping the selection where the registry still knows it. A nil registry is refused.
func (*Session) SetFileGuard ¶ added in v0.11.0
SetFileGuard installs a check every file the session is asked to read or write must pass: the files %load and %save name, those a directory or glob expands to, and the dependencies found beside them. For a file a load may take from an installed project, the guard is handed the library roots as exempt directories, since those live outside a workspace. A nil guard lifts the check.
func (*Session) SetFileWriter ¶ added in v0.11.0
func (s *Session) SetFileWriter(write replext.FileWriter)
SetFileWriter installs the writer every file the session saves is written with, so a host confining the session to a workspace can perform the write through the workspace root itself. A nil writer writes each path directly.
func (*Session) SetJobs ¶
SetJobs sets how many runs of one plan go concurrently from here on, and how many files of one load are parsed and analyzed at once. The held context, its objects and the debuggers keep going: jobs bound a plan's runs, not the session's context. A value below one is a typed error.
func (*Session) SetLibraryRoots ¶ added in v0.11.0
SetLibraryRoots replaces the directories installed projects are looked for under, besides the well-known ones beneath a loaded file's project.
func (*Session) SetModelSeed ¶
SetModelSeed fixes the seed runs started from here on draw their modeled randomness from, whatever the scheduling policy; ClearModelSeed leaves it to the policy's own seed, so a `declared` run that draws is refused.
func (*Session) SetProgress ¶
SetProgress names where the progress external engines report while a plan runs is printed — the CLI's standard error; a nil writer prints none, the default.
func (*Session) SetRecordCache ¶ added in v0.9.2
SetRecordCache has the session hold the files it loads as the interface records cache holds for their content, and write the records of the files it analyzes to it; nil holds every file loaded, as a session with no cache does. The typed transcript is never recorded.
func (*Session) SetRecording ¶ added in v0.10.0
SetRecording records typed execution events without printing trace lines.
func (*Session) SetRenderWidth ¶
SetRenderWidth sets the width a text rendering's table is written to fit. The frontend sets it from the terminal; view.WidthUnbounded, the default, writes every column as wide as its widest cell.
func (*Session) SetSchedule ¶
func (s *Session) SetSchedule(policy runtime.SchedulePolicy) error
SetSchedule sets the policy for runs started from here on; a debugger under way keeps its own, and `explore` runs on contexts of their own.
func (*Session) SetToolVersion ¶
SetToolVersion names the tool a recorded run's provenance reports.
func (*Session) SetTracing ¶
SetTracing turns recording of execution steps on or off. It takes effect at once, on the session's runtime context and on a debugging session already under way as well as on everything created afterwards.
func (*Session) SetVerbosity ¶
SetVerbosity sets the session's output level.
func (*Session) SetWorkspaceRoot ¶ added in v0.12.0
SetWorkspaceRoot names the directory a typed submission's unresolved root namespaces are looked for under: when an import or a qualified reference begins with a name neither the session nor the library declares, the model file under the root declaring it loads as %load would. The empty string looks nowhere, which is how a session starts.
func (*Session) SolveValues ¶
func (s *Session) SolveValues(name string) []SolveReport
SolveValues asks a solver for values satisfying the named constraint, requirement or satisfaction, with the values the model already fixes — held by an object of the session, else declared — asserted, so only what is still free is synthesised. Experimental: SysML v2 defines no solving, and the runtime evaluator remains normative. Read-only: no object is created.
func (*Session) Submit ¶
Submit accumulates src into the <repl> document, reindexes and eagerly analyzes the whole buffer, and returns a Result. A submission with parse errors is still accumulated, so its diagnostics are reported against the live session context; one that leaves a brace, comment or quoted name open is masked out of the buffer instead, since it would otherwise absorb the next submission. A later redeclaration of the same name replaces the prior snippet (see accept); one that declares no name to redeclare is dropped once its errors are reported.
func (*Session) SubmitAll ¶
SubmitAll accumulates every src as one submission, from no file in particular.
func (*Session) SubmitFiles ¶
func (s *Session) SubmitFiles(files []SourceFile) Result
SubmitFiles accumulates every file as one submission: all of them are accepted before the buffer is reindexed and analyzed, so a declaration in one resolves against the others no matter which order they arrive in. This is what makes loading a multi-file project order-independent. A file's Name is its workspace document, so a file named as the transcript is refused: nothing is accepted and the result carries the *ReservedNameError as Refused.
func (*Session) Suppress ¶ added in v0.11.0
Suppress keeps the diagnostics the predicate accepts out of everything the session reports about its model: the lines, the located findings and whether it has errors. Suppressed counts how many the last report left out.
func (*Session) Suppressed ¶ added in v0.11.0
Suppressed is how many diagnostics the predicate given to Suppress kept out of the session's last report.
func (*Session) ToolDryRun ¶ added in v0.9.2
ToolDryRun previews the first tool call the case or action target names would make, without starting the tool's process.
func (*Session) ValidateObject ¶
ValidateObject checks every assertion about a held object (a name, #<id> or a path such as car.engine) and the objects it holds, then adds a summary verdict for it.
func (*Session) View ¶
View reports what a view exposes, the views nested in it, and whether it conforms to the viewpoints it satisfies. A view exposing nothing says so; an element that is no view is semantics.ErrNotAView.
func (*Session) ViewRendering ¶
ViewRendering renders a view of the session's model. It reads the session's symbols and creates nothing in it: no object, no runtime, no change to a debugging session in progress.
func (*Session) ViewSites ¶ added in v0.10.0
ViewSites answers source locations in the current session for a rendering.
func (*Session) Views ¶
Views lists every view the session declares, in document then declaration order.
func (*Session) Viz ¶ added in v0.10.0
Viz runs %viz with its arguments and answers what it drew: the artifact in the form asked for, or, when none was, in each of the fallback forms the chosen rendering kind is written in — the first alone when it is written in none of them — or as text when no fallback is given. A usage problem is a *UsageError holding what the prompt prints; a name that does not resolve is an error naming it.
func (*Session) WorkspaceRoot ¶ added in v0.12.0
WorkspaceRoot is the directory unresolved root namespaces are looked for under, empty when they are looked for nowhere.
type SolveReport ¶
type SolveReport struct {
// Subject is what was checked, spelled as the caller named it.
Subject string
Status SolveStatus
Lines []string
// Solver names the solver that answered, empty when none did.
Solver string
// Plan is how the engines answered; nil for a report made before any was asked.
Plan *analysis.Plan
}
SolveReport is what a solver answered about one element, with the lines the REPL prints for it.
func (SolveReport) Satisfiable ¶
func (r SolveReport) Satisfiable() bool
Satisfiable reports whether the solver found the conditions satisfiable.
type SolveStatus ¶
type SolveStatus int
SolveStatus is what a solver answered about an element's conditions. It is kept apart from VerdictStatus: satisfiability is not evaluation.
const ( // SolveSat means an assignment satisfying the conditions exists. SolveSat SolveStatus = iota // SolveUnsat means no assignment satisfies them. SolveUnsat // SolveUnknown means the solver did not decide: it timed out, or gave up on // arithmetic it cannot decide. SolveUnknown // SolveUnbounded means the conditions are satisfiable but an objective // improves without limit, so it has no optimum. SolveUnbounded // SolveNoOptimum means the conditions are satisfiable and an objective's // optimum was not established: only a bound, or an unverified answer. SolveNoOptimum // element is outside the translatable subset, or the solver failed. SolveUnavailable )
func (SolveStatus) String ¶
func (s SolveStatus) String() string
String names the status for a report a machine reads.
type SourceConverter ¶ added in v0.10.0
type SourceConverter func(name string, data []byte, warn func(string)) (text []byte, converted bool, err error)
SourceConverter transforms a named source file before the REPL parses it.
type SourceFile ¶
type SourceFile struct {
Name string
Text string
Kind source.Kind
// Of names the file this source was read from along with others — the
// notebook a cell is one of — empty for a source that is its own file.
Of string
// Whole is set when Of was read whole, so that re-reading it drops what an
// earlier reading declared and this one no longer holds.
Whole bool
Warnings []string
// Key identifies the source across the spellings of its path where Name is
// no file's — a notebook cell's is its notebook's key and its position;
// empty for a source whose Name is its path.
Key string
}
SourceFile is one source of a submission together with the file it was read from, which is what diagnostics over a multi-file load are reported against.
type SweptArgumentError ¶
SweptArgumentError reports an argument whose value no row of a sweep can carry into a context of its own.
func (*SweptArgumentError) Error ¶
func (e *SweptArgumentError) Error() string
func (*SweptArgumentError) Unwrap ¶
func (e *SweptArgumentError) Unwrap() error
type SweptObjectError ¶
SweptObjectError reports a held object no row can make its own of: its state cannot be imaged into a context of its own. Err is the runtime's reason where it gave one.
func (*SweptObjectError) Error ¶
func (e *SweptObjectError) Error() string
func (*SweptObjectError) Unwrap ¶
func (e *SweptObjectError) Unwrap() error
type TokenReport ¶ added in v0.11.0
TokenReport is one token of the debugged action: where it sits, where it came from and, at a join, the successions it still waits for.
type UnknownObjectIDError ¶
type UnknownObjectIDError struct {
ID int64
Known []int64
// Err is what kept the connector a carry-over set aside under ID from being
// materialized again, nil when no object was ever there.
Err error
}
UnknownObjectIDError reports an id no object of the session has, with the ids that do exist so the reader can pick one.
func (*UnknownObjectIDError) Error ¶
func (e *UnknownObjectIDError) Error() string
func (*UnknownObjectIDError) Unwrap ¶
func (e *UnknownObjectIDError) Unwrap() error
type UnplannedObjectError ¶
type UnplannedObjectError struct {
Ref string
}
UnplannedObjectError reports an object name an explored run asked for that its plan did not resolve: runs name only what was planned while the session was held.
func (*UnplannedObjectError) Error ¶
func (e *UnplannedObjectError) Error() string
type UsageError ¶ added in v0.10.0
type UsageError struct{ Lines []string }
UsageError is a %render or %render-document invocation the prompt would answer with its usage rather than run: the lines it prints, for a front end to show as the command's failure.
func (*UsageError) Error ¶ added in v0.10.0
func (e *UsageError) Error() string
type Verbosity ¶
type Verbosity int
Verbosity selects how much of a submission's analysis reaches the terminal.
The REPL analyses the whole accumulated buffer on every submission, which is what the runtime needs but not what a user typing one declaration wants to read. Verbosity scopes the report back down to what was just typed.
const ( // VerbosityQuiet reports only errors in the submission just made. VerbosityQuiet Verbosity = iota // VerbosityNormal adds warnings in that submission. The default. VerbosityNormal // VerbosityDebug reports every diagnostic over the whole buffer, at // buffer-absolute positions and with the pass that produced it. VerbosityDebug )
func ParseVerbosity ¶
ParseVerbosity maps a flag or %verbosity argument to a level.
type Verdict ¶
type Verdict struct {
// Subject is what was checked, spelled as the caller named it.
Subject string
Status VerdictStatus
Lines []string
// Values are what a run produced, for a caller reporting more than a status.
Values []NamedValue
// Verifications are the verdicts the bodies of the verification cases
// verifying the checked requirement answered, reported beside its status
// rather than deciding it.
Verifications []VerificationVerdict
// Rows are the runs a sweep made, one per row of its table; no other kind of
// verdict has any.
Rows []VerdictRow
// Table is the row set a document query returned, as data; nil for every
// other verdict.
Table *VerdictTable
// Evaluations are the applications an analysis case made of its own calcs as
// function values — a trade study's evaluation of each alternative — in the
// order made.
Evaluations []Evaluation
// Outcomes are the distinct outcomes an exploration reached, in canonical
// order, and Exploration how it ended; only an explored run has them.
Outcomes []VerdictOutcome
Exploration *VerdictExploration
// Outcome is the QVTS record behind a document query that could not be run
// (queryexec.Outcome); nil for every other verdict.
Outcome *queryexec.Outcome
// Plan is how the engines answered: the selection made, each engine put to
// the question and what it answered, and the composed result whose standing
// the last line reports. Nil for a verdict decided before any engine was asked.
Plan *analysis.Plan
}
Verdict is the outcome of one checked constraint, requirement or satisfaction assertion. It carries both the status a caller decides on (an exit code, a report) and the lines the REPL prints, so the prompt and a non-interactive caller always report the same verdict from the same evaluation.
type VerdictExploration ¶
type VerdictExploration struct {
Complete bool
Runs int
FailedLinearizations int
// BudgetsHit names the budgets hit, `runs` before `depth`; none when complete.
BudgetsHit []string
// Unenumerated names the constructs whose unordered alternatives the runs took
// in one order without a choice point; none when complete.
Unenumerated []string
// ProbabilitiesBounded reports the outcomes' probabilities are lower bounds.
ProbabilitiesBounded bool
}
VerdictExploration is how an exploration ended: whether every linearization within the budget was run, and which budget stopped it when not.
type VerdictOutcome ¶
type VerdictOutcome struct {
Values []NamedValue
// Error is what stopped the runs reaching this outcome, empty for one they completed.
Error string
Linearizations int
Probability *runtime.ProbabilityRange
// Witness is one run's choice sequence, a choice per entry in run order.
Witness []string
}
VerdictOutcome is one distinct outcome an exploration reached: what the runs reaching it produced, how many did, the probability they carry, and the choices of one that did.
type VerdictRow ¶
type VerdictRow struct {
Inputs []NamedValue
Outputs []NamedValue
Verdicts []NamedValue
Evaluations []Evaluation
Millis float64
Error string
}
VerdictRow is one run of a sweep: what it was given, what it produced and decided, how long it took, and what stopped it when it failed.
type VerdictStatus ¶
type VerdictStatus int
VerdictStatus is what a checked condition answered.
const ( // VerdictHolds is a condition the model satisfies. VerdictHolds VerdictStatus = iota // VerdictFails is a condition the model answered false. VerdictFails // VerdictUnresolved is a check that was never decided — an unknown name, a // session with no declarations, an element stating no assertion, an // evaluation that could not be carried out — which is a question about the // model, not an answer from it. VerdictUnresolved )
func WorstStatus ¶
func WorstStatus(verdicts []Verdict) VerdictStatus
WorstStatus is the status a set of verdicts should be judged by: unresolved outranks a failure, since a check that was never made says nothing about the model. An empty set holds.
func (VerdictStatus) String ¶
func (s VerdictStatus) String() string
String names the status for a report a machine reads.
type VerdictTable ¶ added in v0.12.0
type VerdictTable struct {
Columns []string
Rows []VerdictTableRow
}
VerdictTable is a document query's row set as data: the projected columns in order, and each row's element with one cell per column.
type VerdictTableRow ¶ added in v0.12.0
VerdictTableRow is one row of a query's table: the element the row is about, and its cells by column position, each the values the cell holds as the prompt prints them.
type VerificationVerdict ¶
type VerificationVerdict struct {
// Case is the qualified name of the verification case that ran.
Case string
// Kind is the VerdictKind literal the body produced.
Kind string
// Detail is why an error or inconclusive verdict decided nothing.
Detail string
// Subcase marks a case another case performed as a step of its body.
Subcase bool
// Object names the object the case ran as a feature of, by its usage and
// id; empty for a package-level case.
Object string
}
VerificationVerdict is the verdict the body of a verification case answered, reported beside the requirement or satisfaction verdict of the requirement the case verifies. It does not decide that verdict: the specification leaves the evaluation of a verdict unspecified, so this is what running the body and the library's own PassIf calculation answer.
Source Files
¶
- analysis.go
- carryover.go
- cell.go
- check.go
- checker.go
- compare.go
- compile.go
- complete.go
- conformance.go
- continuation.go
- debugger.go
- declnames.go
- discover.go
- docquery.go
- docrender.go
- enclosure.go
- engines.go
- evaluate.go
- explain.go
- explain_code.go
- explore.go
- features.go
- graphs.go
- import.go
- instantiate_report.go
- interrupt.go
- invocation.go
- jobs.go
- listing.go
- load.go
- lookup.go
- loop.go
- merge.go
- meta.go
- modeledit.go
- montecarlo.go
- notation.go
- notebook.go
- notices.go
- optimize.go
- oslc_query.go
- parsememo.go
- print.go
- progress.go
- qualname.go
- qualsuggest.go
- query.go
- record.go
- records.go
- render.go
- repository.go
- run.go
- run_render.go
- runs.go
- save.go
- schedule.go
- self_check.go
- send.go
- session.go
- sweep.go
- synth.go
- tool.go
- trace.go
- validate.go
- verbosity.go
- verification.go
- view.go
- viz.go
- workspace.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package replext is where REPL features that need a translator or a transport register themselves, so a bare REPL links neither; replext/all links them all.
|
Package replext is where REPL features that need a translator or a transport register themselves, so a bare REPL links neither; replext/all links them all. |
|
all
Package all links every REPL feature replext lets a build leave out, so a REPL built with it serves every command the full `sysml` does.
|
Package all links every REPL feature replext lets a build leave out, so a REPL built with it serves every command the full `sysml` does. |
|
graphviz
Package graphviz registers the drawer %render-document draws DOT diagrams with: the PDF backend's Graphviz, so the Markdown it prints carries the SVG a render on the command line writes.
|
Package graphviz registers the drawer %render-document draws DOT diagrams with: the PDF backend's Graphviz, so the Markdown it prints carries the SVG a render on the command line writes. |
|
instancegraph
Package instancegraph registers %features json: an object graph written as the API's Instantiate response, so a client reads one shape whether it asked the service or the REPL.
|
Package instancegraph registers %features json: an object graph written as the API's Instantiate response, so a client reads one shape whether it asked the service or the REPL. |
|
notation
Package notation registers the REPL's %print and %save: the session's model written as SysML notation, or converted to the format a file name selects.
|
Package notation registers the REPL's %print and %save: the session's model written as SysML notation, or converted to the format a file name selects. |
|
positional
Package positional registers the names OSLC query gives elements without a qualified identity: the positional `@N` identities the RDF export writes, so a query answers with the identifiers a saved graph holds.
|
Package positional registers the names OSLC query gives elements without a qualified identity: the positional `@N` identities the RDF export writes, so a query answers with the identifiers a saved graph holds. |
|
repository
Package repository links the %repo, %projects, %load and %publish commands to a SysML v2 API server: any conformant one through the standard surface, with a bearer token from the environment when the server wants one.
|
Package repository links the %repo, %projects, %load and %publish commands to a SysML v2 API server: any conformant one through the standard surface, with a bearer token from the environment when the server wants one. |