Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

satisfaction claims

This notebook introduces the assert satisfy / assert not satisfy idiom; after running it you can record, inside a usage’s own context, whether it meets a requirement, and evaluate that claim against the model.

The previous notebook applied TimelyToast to the model as timely : TimelyToast. slow, from Chapter 2, is a deliberately injected fault: cycleTime fixed at 200 seconds, built to fail timely’s 180-second bound. This notebook folds a negated satisfaction claim into slow’s own body and evaluates it against the model’s own values.

    assert not satisfy timely by slow;

The claim is folded into slow’s own body: slow names itself as the usage the claim is about, so no separate container is needed. slow’s full usage, restated with this new line, is what the cumulative model now carries.

The reopened slow usage loads without diagnostics, restating its Chapter 2 override with the injected-fault claim added. The next cell checks what happens when an assert satisfy names a usage that does not resolve.

Expected error: unresolved reference: undefinedUsage

With the negative control confirmed, the next cell evaluates the claim slow now carries against the model’s own values.

satisfy claim: {'id': 'ToasterDemo::slow::@1', 'requirement': 'ToasterDemo::timely', 'subject': 'ToasterDemo::slow', 'is_negated': True}
ToasterDemo::timely(ToasterDemo::slow) = False

timely(slow) evaluates to False: slow’s 200-second cycleTime does not meet the 180-second bound. The model’s claim is assert not satisfy, so this result confirms the claim rather than contradicting it. This demonstrates the deliberately negated claim applied to an injected fault value: a real, evaluable claim about a fixture built to fail. It does not yet demonstrate a check catching a failure that traces back to a design choice, since deriving a cycle time from an actual mechanism is not yet possible; slow’s fixed value is the measured quantity itself, typed in directly, not a result computed from anything.

assert not satisfy timely by slow;, printed above, loaded without error; model.eval() confirms the negated claim holds against slow’s own values, shown by the False result above.

Try the chapter exercise in exercises/ch03/exercise.ipynb: fold a negated satisfaction claim into your hot usage of BrewUnit, following the pattern above; do not assert anything about nominal, whose brewTemp is unbound.