Skip to content

v0.1.0: OpenSysML Release

Choose a tag to compare

@HuiJun HuiJun released this 18 Aug 20:57
· 153 commits to main since this release
ff3616c

ATTENTION: We have renamed the project to OpenSysML.

OpenSysML 0.1.0

First release under the OpenSysML name, and the release where a model does more than parse: an
object runs the behavior its type exhibits, an SMT solver decides what its conditions permit, a
view renders, and a model can be edited through the source it was parsed from.

Install

brew install Open-MBEE/tap/opensysml           # brings z3 along, so solving works out of the box
go install github.com/Open-MBEE/OpenSysML/cmd/sysml@latest
pip install opensysml                          # Python client, released separately

Or download opensysml-<os>-<arch>.tar.gz (.zip on Windows) below: sysml, sysml-lsp and
sysml-grpc for macOS, Linux and Windows on amd64/arm64.

What's new

An object runs its behavior. Materializing an object starts the state machines and actions its
type exhibits or performs — each object with its own execution, event queue and feature values,
each entry/do/exit/effect body reading and writing that object's values, and send … to reaching
the addressed object. Startup and quiescence are defined, and a machine that never settles reports
a budget error instead of hanging. %invoke <object> <op> p=… performs an operation of the
object's type; %state <object> points %step, %advance, %current, %events and %features
at that object's own machine.

A solver decides (experimental). %check answers whether a constraint, requirement or
satisfaction assertion can hold, with an assignment on sat; %explain reduces an unsat to a
minimal core, printing each conflicting condition with its declaring element and
file:line:col; %solve synthesises a witness while keeping fixed what already is; %configure
answers which variant selections an assertion permits; %optimize improves the objectives an
analysis def states, lexicographically, verifying every optimum by asking whether anything does
better. A solver is optional — discovered on PATH or named by OPENSYSML_SMT — and what a
backend can do is probed as capabilities, so a missing feature is a typed refusal, never a
fabricated verdict. z3 covers everything; cvc5 covers everything but %optimize.

A view renders. %render <name> [text|mermaid|markdown] and sysml -render <view> produce a
containment tree, an interconnection diagram, a state machine, an action flow or a table. State and
action renderings read the same lowered graphs the runtime executes, so a diagram cannot drift from
what runs, and rendering is a read: no object is materialized, and an %action/%state session
keeps stepping across it.

A model is edited in place. ApplyEdits, and model.edit() in Python, sets a feature's value
or renames a declaration by rewriting the bytes of the parsed source, so comments and the text as
typed survive; the result is re-parsed and re-analyzed before it is returned, and a request's edits
apply all or none.

%print writes the session's model — or one element — back as SysML notation at the prompt,
through the same writer %save uses.

RDF (experimental) now covers behavior: action and state bodies round-trip byte-identically
through Turtle, and 102 of 120 example models convert, up from 71, with the rest refused by
construct rather than partly written.

Semantics and notation fixes. A nested value body governs over an inherited value (KerML
§7.3.4.5); require/assume bodies resolve and type-check to any depth, in their own scope;
binding connectors propagate in both directions with typed conflict and cycle errors; bind
accepts qualified and chained ends, and a requirement body takes a prefixed connector; fork,
join, merge and decision register the names they declare; feature-chain resolution is linear
in chain length; and an element reached through two scope trees is exposed and rendered once.

Upgrading

The rename is a clean break, with no compatibility aliases:

  • Go module: github.com/Open-MBEE/OpenSysML (the old path resolves only for v0.0.x).
  • Python: pip install opensysml (first release under the new name is 0.3.0, carrying on from
    pysysml 0.2.0), import opensysml, OPENSYSML_* variables, OpenSysMLError,
    opensysml-generate, ~/.opensysml. pysysml gets one final 0.2.1 that only reports the
    rename; pin pysysml==0.2.0 to stay on the pre-rename client while migrating.
  • Env vars are OPENSYSML_*; SYSTEMICA_* is not read.
  • VS Code: extension opensysml-sysml, settings opensysml.server.* / opensysml.trace.server
    re-set them under the new keys.
  • Models importing SystemicaMathFunctions::* must import OpenSysMLMathFunctions::*. A bare
    exp, ln, log or atan2 without that import is now a typed error naming it, instead of
    being reported unresolved and evaluated anyway.
  • .ttl written before this release carries urn:systemica:sysml: properties and is refused
    rather than read with those properties dropped — re-export from the notation source.
  • %slots is now %features, and the "slot" vocabulary is gone everywhere: on the wire
    Instance.feature_values / FeatureValue (field 3 and the name slots stay reserved), and
    in Python features, raw_features, get_feature, FeatureValueError and
    feature_value/optional_feature_value/list_feature_value. The client requires the service's
    feature_values capability, so a pre-0.1.0 sysml-grpc is named rather than answering with an
    object that appears to hold nothing. Diagnostic text changed with the vocabulary (feature value …, do action steps); exit statuses are unchanged, so a script matching the old text needs
    updating.

Known limitations

  • Constraint solving is experimental and needs an external solver: %check, %explain, %solve
    and %configure want z3 or cvc5, %optimize wants z3 (optimization is a z3 extension). A
    condition with no SMT-LIB form refuses the whole query rather than dropping the condition.
  • RDF conversion is experimental: expressions are not emitted as triples, end-binding heads depend
    on sysx:sourceText, the vocabulary may change without a compatibility path, and no round trip
    through a running triplestore has been demonstrated.
  • An edit sets a value or renames a declaration; creating or deleting an element, and renaming a
    referenced one, are refused.
  • Only an action member is executable through %invoke; a calc or constraint operation is
    evaluated as an expression and says so.
  • A package-owned binding connector does not propagate values; one declared in a materialized type
    or usage body does.
  • A rendering is tool-defined output — SysML v2 §10.2 leaves rendering to the tool — so %render
    output is OpenSysML's own artifact, not a standard interchange form.
  • A that inside a nested action, constraint or transition-guard body binds to the innermost
    enclosing usage; an unqualified standard library name requires an import (conformant, won't-do);
    and a port that accepts TCP but never answers gRPC costs the Python client about 9 s.

Quality gates

gofmt, go build, go vet, go test -race ./..., staticcheck and gosec green; stdlib
conformance clean; the OMG training corpus at its pinned 98/100 baseline; the SMT path gated with
z3, with cvc5 and with no solver, including a differential gate requiring solver verdicts to agree
with the evaluator; Python client suite green. Rule-by-rule status: docs/project/spec-compliance.md.

Full detail: CHANGELOG.md § 0.1.0.