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.

asserted context

This notebook introduces the asserted_context judgment record; after running it you can declare and inspect the assumptions that frame an engineering requirement.

The model now has a requirement (TimelyToast) and two named usages of Toaster: nominal, which carries no cycle-time value, and slow, built with a deliberately injected fault cycle time to exercise the requirement’s failing branch. Before asking whether either satisfies the requirement, we need to declare the context: what do we assume about the operating environment? An asserted_context record (Hawkins 2011 §3.2) documents one such assumption. The context record does not claim the design is correct. It claims that the assumption used for the cycle-time estimate is appropriate, not that any evaluation has been performed.

requirement def TimelyToast {
        doc /*
         * The toaster shall complete a toasting cycle in at most 180 seconds.
         * Rationale: kitchen workflows typically span 5-15 minutes; a cycle
         * exceeding 3 minutes delays meal preparation and falls outside where
         * and how a user prepares a meal.
         */
        subject toaster : Toaster;
        require constraint { toaster.cycleTime <= 180.0 [SI::s] }
    }
attribute :>> cycleTime = 200.0 [SI::s];

The containment skeleton this model carries so far, drawn directly from the model that just loaded. The one solid, hollow-triangle edge is Toaster’s own specialization of ToastingSystem (Chapter 1), not containment.

Loading...

The ch02-cumulative.sysml file adds the first requirements construct: requirement def TimelyToast constrains cycleTime <= 180.0 [SI::s] with a typed subject and require constraint body. nominal (cycleTime unset) and slow (cycleTime fixed at 200 s, a deliberately injected fault) are declared for later comparison. The assert satisfy pattern comes in Chapter 3; for now these usages exist without a recorded claim.

Expected error: unresolved member: nonExistentAttr

With the model side confirmed, the next cells introduce a new construct: a ReviewRecordRef metadata tag that gives a Hawkins judgment record a real, checkable anchor in the model, before building the asserted_context record itself.

metadata def ReviewRecordRef {
    attribute identifier : ScalarValues::String;
}

ReviewRecordRef is a new metadata definition: a tag with one attribute, identifier, that can be attached about any model element (SysML v2 formal/2026-03-02 §7.27.2). It gives a Hawkins judgment record a real, queryable anchor in the model, not just a string the reader has to trust.

metadata ac001Tag : ReviewRecordRef about nominal {
    identifier = "AC-001";
}

This fragment, together with the ReviewRecordRef definition above, is the same text already committed in models/ch02-cumulative.sysml; loading the cumulative model (the model.ok cell above, unchanged) is what makes this a real, checkable tag rather than an assertion the reader has to trust.

AC-001 states the claim first: the placeholder cycle-time estimate this chapter uses.

Approximately 120 seconds is assumed, for illustration only, as a plausible nominal cycle time for standard sliced bread, a placeholder pending the mechanism-and-energy-balance derivation a later chapter performs, not a value drawn from any real-world source.

scope names where in the model the assumption applies; criteria states the illustrative range the estimate must fall inside, so a reader can judge whether the claim is appropriate for what it’s used for.

This chapter adopts an illustrative placeholder range of 90-150 seconds for a toaster's nominal cycle time toasting standard sliced bread. The range is invented for this tutorial and is not drawn from any manufacturer data, measurement, or cited source.

premises is empty (the estimate isn’t derived from anything else in this chapter); assumption_refs names the one assumption it rests on directly.

['A-CH02-1: illustrative placeholder cycle-time range (90-150s) for standard sliced bread, invented for this tutorial; no real-world source exists for it.']

evidence_refs states plainly that there is no real evidence behind this number, only the stated assumption; rationale explains why 120 seconds was picked within that range anyway.

120 seconds sits within the illustrative placeholder range (A-CH02-1) and is used only as a stand-in estimate; it is not derived from any mechanism or energy-balance analysis in this chapter, and it is not backed by any real-world data.

The challenge: counterevidence names a real case the placeholder doesn’t cover, and residual_uncertainties says what a reader must not conclude from this record (Hawkins’ trustworthiness: naming the record’s own limits, not hiding them).

Thick-cut and frozen bread may require 180-240s, which would exceed TimelyToast's 180-second bound. More fundamentally, the placeholder range itself is invented for this tutorial and has no real-world source, so it carries no evidentiary weight beyond illustrating the pattern.
User preference variation is not modeled. Because 120 seconds is an invented placeholder, not a derived or measured value, any comparison against the 180-second threshold is conditional on this assumption and must never be reported as a settled pass/fail verdict.

With every part named above, the context record assembles from them directly.

Record: AC-001 | kind: asserted_context
Claim: Approximately 120 seconds is assumed, for illustration only, as a plausible nominal cycle time for standard sliced bread, a placeholder pending the mechanism-and-energy-balance derivation a later chapter performs, not a value drawn from any real-world source.
Model tag: {'tag': 'ToasterDemo::ac001Tag', 'identifier': 'AC-001', 'annotated_element': 'ToasterDemo::nominal'}
Validation errors: []

The tag printed above is now part of the loaded model, and validate_record confirms the Python record and the model’s own tag agree about what AC-001 is actually about.

Try the chapter exercise in exercises/ch02/exercise.ipynb: write an asserted_context record for the brewTemp assumption in your coffee maker model.