// reference · Build
Prism source
The shared files every app is built on, and where each one comes from.
Every app the builder writes carries these 62 files, unchanged, beside its own model. They are the Foundation and Production modules that type its facets, and the LexLean language packages whose words name them. Each is a byte-for-byte copy of a file of UOR-Foundation/template or UOR-Foundation/PrismPM at a pinned commit. Its SHA-256 is recorded in builder/assets/provenance.json. The prism-code modules at the end write the behavior, and are copied byte for byte too.
LexLean modules
LexLean modules 6 rows
| Module | Declares | Imports | From |
|---|---|---|---|
Foundation.Arch | 22 structures, 7 inductives, 2 classes, 2 instances, 10 definitions, 1 theorem | lexlean.std.bool@1.2.0, lexlean.std.nat@1.2.0, prism.arch@1.0.0 | UOR-Foundation/PrismPM@3db7f3e6 |
Foundation.Bytes | 2 inductives, 1 structure, 5 definitions | lexlean.std.bool@1.2.0, lexlean.std.nat@1.2.0, prism.arch@1.0.0 | UOR-Foundation/template@e79e0dcd |
Foundation.Qual | 4 structures, 8 definitions | lexlean.std.bool@1.2.0, lexlean.std.nat@1.2.0, prism.qual@1.0.0 | UOR-Foundation/PrismPM@3db7f3e6 |
Foundation.Sec | 2 inductives, 5 structures, 6 definitions | lexlean.std.bool@1.2.0, lexlean.std.nat@1.2.0, prism.sec@1.0.0 | UOR-Foundation/PrismPM@3db7f3e6 |
Foundation.View.Text.V1.Model | 3 structures, 1 definition | lexlean.std.bool@1.2.0, lexlean.std.nat@1.2.0, prism.arch@1.0.0 | UOR-Foundation/template@e79e0dcd |
Production.ThreatModel | 2 inductives, 8 structures, 8 definitions, 5 theorems | Foundation.Sec, lexlean.std.bool@1.2.0, lexlean.std.nat@1.2.0, prism.arch@1.0.0, prism.sec@1.0.0 | UOR-Foundation/PrismPM@3db7f3e6 |
Foundation.Arch
app/src/Foundation/Arch.lex.tex, 410 lines, from UOR-Foundation/PrismPM@3db7f3e6.
Foundation.Arch 44 rows
| Declaration | Kind | Word |
|---|---|---|
Foundation.Arch::StandardReference | structure | standards reference |
Foundation.Arch::ComponentKind | inductive | architectural component kind |
Foundation.Arch::EdgeKind | inductive | architectural edge kind |
Foundation.Arch::ModelKind | inductive | architecture model kind |
Foundation.Arch::Component | structure | architectural component |
Foundation.Arch::Edge | structure | architectural edge |
Foundation.Arch::Stakeholder | structure | stakeholder |
Foundation.Arch::Concern | structure | architectural concern |
Foundation.Arch::Viewpoint | structure | architecture viewpoint |
Foundation.Arch::View | structure | architecture view |
Foundation.Arch::ViewpointClass | class | architecture viewpoint class |
Foundation.Arch::ViewClass | class | architecture view class |
Foundation.Arch::canonicalViewpoint | instance | |
Foundation.Arch::canonicalView | instance | |
Foundation.Arch::componentGateway | definition | |
Foundation.Arch::componentAuth | definition | |
Foundation.Arch::edgeIngress | definition | |
Foundation.Arch::edgeReturnCycle | definition | |
Foundation.Arch::stakeholderOperator | definition | |
Foundation.Arch::concernSecurity | definition | |
Foundation.Arch::standardArchitectureDescription | definition | |
Foundation.Arch::modelKindComponents | definition | |
Foundation.Arch::viewpointOperations | definition | |
Foundation.Arch::viewPrimary | definition | |
Foundation.Arch::DesignDiagram | inductive | design diagram |
Foundation.Arch::OpmThingKind | inductive | OPM thing kind |
Foundation.Arch::OpmLinkKind | inductive | OPM link kind |
Foundation.Arch::UmlMessageKind | inductive | UML message kind |
Foundation.Arch::SystemProcess | structure | system process |
Foundation.Arch::SystemState | structure | system state |
Foundation.Arch::DesignView | structure | design view |
Foundation.Arch::OpmThing | structure | OPM thing |
Foundation.Arch::OpmState | structure | OPM state |
Foundation.Arch::OpmLink | structure | OPM link |
Foundation.Arch::OpmZoom | structure | OPM zoom |
Foundation.Arch::UmlComponent | structure | UML component |
Foundation.Arch::UmlConnector | structure | UML connector |
Foundation.Arch::UmlLifeline | structure | UML lifeline |
Foundation.Arch::UmlMessage | structure | UML message |
Foundation.Arch::UmlState | structure | UML state |
Foundation.Arch::UmlTransition | structure | UML transition |
Foundation.Arch::Feature | structure | feature |
Foundation.Arch::Journey | structure | journey |
Foundation.Arch::componentIdentityUnique | theorem |
Source
\begin{lexlean}{Foundation.Arch}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\useglossary{prism.arch@1.0.0}
\title{Boolean}
\begin{semanticmodule}
structure{
name: StandardReference,
type_parameters: [],
parameters: [],
fields: [
{name: standardIndex, type: Nat},
{name: editionIndex, type: Nat},
{name: standardId, type: String},
{name: edition, type: String}
]
}
inductive{
name: ComponentKind,
type_parameters: [],
parameters: [],
constructors: [
{name: service, fields: []},
{name: database, fields: []},
{name: externalSystem, fields: []},
{name: cliAdapter, fields: []},
{name: staticSite, fields: []},
{name: releaseBinary, fields: []}
]
}
inductive{
name: EdgeKind,
type_parameters: [],
parameters: [],
constructors: [{name: dataFlow, fields: []}, {name: controlFlow, fields: []}]
}
inductive{
name: ModelKind,
type_parameters: [],
parameters: [],
constructors: [
{name: componentModel, fields: []},
{name: securityModel, fields: []},
{name: qualityModel, fields: []}
]
}
structure{
name: Component,
type_parameters: [],
parameters: [],
fields: [
{name: index, type: Nat},
{name: kind, type: ComponentKind},
{name: name, type: String},
{name: text, type: String}
]
}
structure{
name: Edge,
type_parameters: [],
parameters: [],
fields: [
{name: index, type: Nat},
{name: fromIndex, type: Nat},
{name: toIndex, type: Nat},
{name: kind, type: EdgeKind}
]
}
structure{
name: Stakeholder,
type_parameters: [],
parameters: [],
fields: [{name: index, type: Nat}, {name: name, type: String}, {name: text, type: String}]
}
structure{
name: Concern,
type_parameters: [],
parameters: [],
fields: [{name: index, type: Nat}, {name: name, type: String}, {name: text, type: String}]
}
structure{
name: Viewpoint,
type_parameters: [],
parameters: [],
fields: [
{name: index, type: Nat},
{name: stakeholderIndex, type: Nat},
{name: concernIndex, type: Nat},
{name: modelKindIndex, type: Nat}
]
}
structure{
name: View,
type_parameters: [],
parameters: [],
fields: [
{name: index, type: Nat},
{name: viewpointIndex, type: Nat},
{name: modelKindIndex, type: Nat}
]
}
class{
name: ViewpointClass,
type_parameters: [],
parameters: [],
fields: [{name: selectedModelKind, type: Nat}]
}
class{
name: ViewClass,
type_parameters: [],
parameters: [],
fields: [{name: selectedViewpoint, type: Nat}]
}
instance{
name: canonicalViewpoint,
fields: [{field: selectedModelKind, value: 0}],
arguments: [],
class: ViewpointClass,
priority: 1000
}
instance{
name: canonicalView,
fields: [{field: selectedViewpoint, value: 0}],
arguments: [],
class: ViewClass,
priority: 1000
}
definition{
name: componentGateway,
parameters: [],
result: Component,
body: (record Component {index := 1, kind := (ctor ComponentKind.service), name := "gateway", text := "Accepts external requests and forwards them to the authentication store."})
}
definition{
name: componentAuth,
parameters: [],
result: Component,
body: (record Component {index := 0, kind := (ctor ComponentKind.database), name := "auth", text := "Holds credentials and answers lookups from the gateway."})
}
definition{
name: edgeIngress,
parameters: [],
result: Edge,
body: (record Edge {index := 0, fromIndex := 0, toIndex := 1, kind := (ctor EdgeKind.dataFlow)})
}
definition{
name: edgeReturnCycle,
parameters: [],
result: Edge,
body: (record Edge {index := 1, fromIndex := 1, toIndex := 0, kind := (ctor EdgeKind.controlFlow)})
}
definition{
name: stakeholderOperator,
parameters: [],
result: Stakeholder,
body: (record Stakeholder {index := 0, name := "operator", text := "Runs the system in production and answers for its availability."})
}
definition{
name: concernSecurity,
parameters: [],
result: Concern,
body: (record Concern {index := 0, name := "security", text := "Credentials and requests must not be disclosed or altered in transit or at rest."})
}
definition{
name: standardArchitectureDescription,
parameters: [],
result: StandardReference,
body: (record StandardReference {standardIndex := 4, editionIndex := 0, standardId := "ISO-42010-2022", edition := "2022"})
}
definition{
name: modelKindComponents,
parameters: [],
result: ModelKind,
body: (ctor ModelKind.componentModel)
}
definition{
name: viewpointOperations,
parameters: [],
result: Viewpoint,
body: (record Viewpoint {index := 0, stakeholderIndex := 0, concernIndex := 0, modelKindIndex := 0})
}
definition{
name: viewPrimary,
parameters: [],
result: View,
body: (record View {index := 0, viewpointIndex := 0, modelKindIndex := 0})
}
inductive{
name: DesignDiagram,
type_parameters: [],
parameters: [],
constructors: [
{name: opmObjectProcess, fields: []},
{name: umlComponent, fields: []},
{name: umlSequence, fields: []},
{name: umlStateMachine, fields: []}
]
}
inductive{
name: OpmThingKind,
type_parameters: [],
parameters: [],
constructors: [{name: object, fields: []}, {name: process, fields: []}]
}
inductive{
name: OpmLinkKind,
type_parameters: [],
parameters: [],
constructors: [
{name: agent, fields: []},
{name: instrument, fields: []},
{name: consumption, fields: []},
{name: result, fields: []},
{name: effect, fields: []},
{name: invocation, fields: []},
{name: aggregation, fields: []},
{name: exhibition, fields: []},
{name: generalization, fields: []},
{name: classification, fields: []}
]
}
inductive{
name: UmlMessageKind,
type_parameters: [],
parameters: [],
constructors: [
{name: synchronous, fields: []},
{name: asynchronous, fields: []},
{name: reply, fields: []}
]
}
structure{
name: SystemProcess,
type_parameters: [],
parameters: [],
fields: [{name: owner, type: String}]
}
structure{
name: SystemState,
type_parameters: [],
parameters: [],
fields: [{name: owner, type: String}]
}
structure{
name: DesignView,
type_parameters: [],
parameters: [],
fields: [
{name: title, type: String},
{name: viewpoint, type: String},
{name: diagram, type: DesignDiagram}
]
}
structure{
name: OpmThing,
type_parameters: [],
parameters: [],
fields: [
{name: view, type: String},
{name: kind, type: OpmThingKind},
{name: subject, type: String}
]
}
structure{
name: OpmState,
type_parameters: [],
parameters: [],
fields: [{name: view, type: String}, {name: thing, type: String}, {name: state, type: String}]
}
structure{
name: OpmLink,
type_parameters: [],
parameters: [],
fields: [
{name: view, type: String},
{name: kind, type: OpmLinkKind},
{name: source, type: String},
{name: target, type: String}
]
}
structure{
name: OpmZoom,
type_parameters: [],
parameters: [],
fields: [
{name: view, type: String},
{name: process, type: String},
{name: subprocess, type: String},
{name: order, type: Nat}
]
}
structure{
name: UmlComponent,
type_parameters: [],
parameters: [],
fields: [{name: view, type: String}, {name: component, type: String}]
}
structure{
name: UmlConnector,
type_parameters: [],
parameters: [],
fields: [{name: view, type: String}, {name: edge, type: String}]
}
structure{
name: UmlLifeline,
type_parameters: [],
parameters: [],
fields: [{name: view, type: String}, {name: component, type: String}, {name: order, type: Nat}]
}
structure{
name: UmlMessage,
type_parameters: [],
parameters: [],
fields: [
{name: view, type: String},
{name: kind, type: UmlMessageKind},
{name: order, type: Nat},
{name: source, type: String},
{name: target, type: String},
{name: process, type: String}
]
}
structure{
name: UmlState,
type_parameters: [],
parameters: [],
fields: [{name: view, type: String}, {name: state, type: String}, {name: initial, type: Bool}]
}
structure{
name: UmlTransition,
type_parameters: [],
parameters: [],
fields: [
{name: view, type: String},
{name: order, type: Nat},
{name: source, type: String},
{name: target, type: String},
{name: trigger, type: String}
]
}
structure{
name: Feature,
type_parameters: [],
parameters: [],
fields: [
{name: statement, type: String},
{name: calls, type: (List String)},
{name: acceptance, type: (List String)}
]
}
structure{
name: Journey,
type_parameters: [],
parameters: [],
fields: [{name: actor, type: String}, {name: steps, type: (List String)}]
}
theorem{
name: componentIdentityUnique,
parameters: [value : Component],
statement: (value = value),
proof: reflexivity{}
}
theorem{name: cyclesPermitted, parameters: [], statement: (true = true), proof: reflexivity{}}
\end{semanticmodule}
\end{lexlean}
Foundation.Bytes
app/src/Foundation/Bytes.lex.tex, 69 lines, from UOR-Foundation/template@e79e0dcd.
| Declaration | Kind | Word |
|---|---|---|
Foundation.Bytes::ByteOrder | inductive | |
Foundation.Bytes::BufferError | inductive | |
Foundation.Bytes::BoundedBuffer | structure | Bounded byte buffer |
Foundation.Bytes::appendBytes | definition | |
Foundation.Bytes::byteLength | definition | |
Foundation.Bytes::byteAt | definition | |
Foundation.Bytes::sliceBytes | definition | |
Foundation.Bytes::compareBytes | definition |
Source
\begin{lexlean}{Foundation.Bytes}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\useglossary{prism.arch@1.0.0}
\title{Bounded byte buffer}
\begin{semanticmodule}
inductive{
name: ByteOrder,
type_parameters: [],
parameters: [],
constructors: [{name: LittleEndian, fields: []}, {name: BigEndian, fields: []}]
}
inductive{
name: BufferError,
type_parameters: [],
parameters: [],
constructors: [
{name: OutOfBounds, fields: []},
{name: LengthOverflow, fields: []},
{name: NonCanonical, fields: []}
]
}
structure{
name: BoundedBuffer,
type_parameters: [],
parameters: [],
fields: [{name: bytes, type: Bytes}, {name: maximum, type: UInt64}]
}
definition{
name: appendBytes,
parameters: [left : Bytes, right : Bytes],
result: Bytes,
body: (prim append left right : Bytes)
}
definition{
name: byteLength,
parameters: [value : Bytes],
result: Nat,
body: (prim length value : Nat)
}
definition{
name: byteAt,
parameters: [value : Bytes, offset : Nat],
result: (Option UInt8),
body: (prim index value offset : (Option UInt8))
}
definition{
name: sliceBytes,
parameters: [value : Bytes, start : Nat, count : Nat],
result: (Option Bytes),
body: (prim slice value start count : (Option Bytes))
}
definition{
name: compareBytes,
parameters: [left : Bytes, right : Bytes],
result: Ordering,
body: (prim compare_bytes left right : Ordering),
axioms: [propext]
}
\end{semanticmodule}
\end{lexlean}
Foundation.Qual
app/src/Foundation/Qual.lex.tex, 98 lines, from UOR-Foundation/PrismPM@3db7f3e6.
| Declaration | Kind | Word |
|---|---|---|
Foundation.Qual::ProductQualityCharacteristic | structure | quality characteristic |
Foundation.Qual::QualitySubcharacteristic | structure | quality subcharacteristic |
Foundation.Qual::QualityRequirement | structure | quality requirement |
Foundation.Qual::QualityMeasure | structure | quality measure |
Foundation.Qual::characteristicInteractionCapability | definition | |
Foundation.Qual::characteristicMaintainability | definition | |
Foundation.Qual::subcharacteristicInclusivity | definition | |
Foundation.Qual::subcharacteristicModularity | definition | |
Foundation.Qual::requirementModuleBoundaries | definition | |
Foundation.Qual::requirementWcag1411ForcedColorsNonTextContrast | definition | |
Foundation.Qual::requirementWcag413StatusMessages | definition | |
Foundation.Qual::measureDependencyCount | definition |
Source
\begin{lexlean}{Foundation.Qual}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\useglossary{prism.qual@1.0.0}
\title{Boolean}
\begin{semanticmodule}
structure{
name: ProductQualityCharacteristic,
type_parameters: [],
parameters: [],
fields: [{name: index, type: Nat}]
}
structure{
name: QualitySubcharacteristic,
type_parameters: [],
parameters: [],
fields: [{name: index, type: Nat}, {name: characteristicIndex, type: Nat}]
}
structure{
name: QualityRequirement,
type_parameters: [],
parameters: [],
fields: [{name: index, type: Nat}, {name: subcharacteristicIndex, type: Nat}]
}
structure{
name: QualityMeasure,
type_parameters: [],
parameters: [],
fields: [
{name: index, type: Nat},
{name: requirementIndex, type: Nat},
{name: threshold, type: Nat}
]
}
definition{
name: characteristicInteractionCapability,
parameters: [],
result: ProductQualityCharacteristic,
body: (record ProductQualityCharacteristic {index := 0})
}
definition{
name: characteristicMaintainability,
parameters: [],
result: ProductQualityCharacteristic,
body: (record ProductQualityCharacteristic {index := 1})
}
definition{
name: subcharacteristicInclusivity,
parameters: [],
result: QualitySubcharacteristic,
body: (record QualitySubcharacteristic {index := 0, characteristicIndex := 0})
}
definition{
name: subcharacteristicModularity,
parameters: [],
result: QualitySubcharacteristic,
body: (record QualitySubcharacteristic {index := 1, characteristicIndex := 1})
}
definition{
name: requirementModuleBoundaries,
parameters: [],
result: QualityRequirement,
body: (record QualityRequirement {index := 0, subcharacteristicIndex := 1})
}
definition{
name: requirementWcag1411ForcedColorsNonTextContrast,
parameters: [],
result: QualityRequirement,
body: (record QualityRequirement {index := 1, subcharacteristicIndex := 0})
}
definition{
name: requirementWcag413StatusMessages,
parameters: [],
result: QualityRequirement,
body: (record QualityRequirement {index := 2, subcharacteristicIndex := 0})
}
definition{
name: measureDependencyCount,
parameters: [],
result: QualityMeasure,
body: (record QualityMeasure {index := 0, requirementIndex := 0, threshold := 10})
}
theorem{name: qualityChainConsistent, parameters: [], statement: (0 = 0), proof: reflexivity{}}
\end{semanticmodule}
\end{lexlean}
Foundation.Sec
app/src/Foundation/Sec.lex.tex, 109 lines, from UOR-Foundation/PrismPM@3db7f3e6.
| Declaration | Kind | Word |
|---|---|---|
Foundation.Sec::Likelihood | inductive | security likelihood |
Foundation.Sec::Impact | inductive | security impact |
Foundation.Sec::Asset | structure | security asset |
Foundation.Sec::Risk | structure | security risk |
Foundation.Sec::ApplicationSecurityControl | structure | security control |
Foundation.Sec::SecurityActivity | structure | security activity |
Foundation.Sec::VerificationMeasurement | structure | security verification measurement |
Foundation.Sec::assetCredentials | definition | |
Foundation.Sec::threatUnauthorizedAccess | definition | |
Foundation.Sec::riskUnauthorizedAccess | definition | |
Foundation.Sec::controlMutualTls | definition | |
Foundation.Sec::activityRotateCredentials | definition | |
Foundation.Sec::measurementMutualTls | definition |
Source
\begin{lexlean}{Foundation.Sec}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\useglossary{prism.sec@1.0.0}
\title{Boolean}
\begin{semanticmodule}
inductive{
name: Likelihood,
type_parameters: [],
parameters: [],
constructors: [{name: low, fields: []}, {name: medium, fields: []}, {name: high, fields: []}]
}
inductive{
name: Impact,
type_parameters: [],
parameters: [],
constructors: [{name: minor, fields: []}, {name: major, fields: []}, {name: critical, fields: []}]
}
structure{
name: Asset,
type_parameters: [],
parameters: [],
fields: [{name: index, type: Nat}, {name: componentIndex, type: Nat}]
}
structure{name: Threat, type_parameters: [], parameters: [], fields: [{name: index, type: Nat}]}
structure{
name: Risk,
type_parameters: [],
parameters: [],
fields: [
{name: index, type: Nat},
{name: assetIndex, type: Nat},
{name: threatIndex, type: Nat},
{name: likelihood, type: Likelihood},
{name: impact, type: Impact}
]
}
structure{
name: ApplicationSecurityControl,
type_parameters: [],
parameters: [],
fields: [{name: index, type: Nat}, {name: riskIndex, type: Nat}]
}
structure{
name: SecurityActivity,
type_parameters: [],
parameters: [],
fields: [{name: index, type: Nat}, {name: controlIndex, type: Nat}]
}
structure{
name: VerificationMeasurement,
type_parameters: [],
parameters: [],
fields: [{name: index, type: Nat}, {name: controlIndex, type: Nat}, {name: passed, type: Bool}]
}
definition{
name: assetCredentials,
parameters: [],
result: Asset,
body: (record Asset {index := 0, componentIndex := 1})
}
definition{
name: threatUnauthorizedAccess,
parameters: [],
result: Threat,
body: (record Threat {index := 0})
}
definition{
name: riskUnauthorizedAccess,
parameters: [],
result: Risk,
body: (record Risk {index := 0, assetIndex := 0, threatIndex := 0, likelihood := (ctor Likelihood.high), impact := (ctor Impact.critical)})
}
definition{
name: controlMutualTls,
parameters: [],
result: ApplicationSecurityControl,
body: (record ApplicationSecurityControl {index := 0, riskIndex := 0})
}
definition{
name: activityRotateCredentials,
parameters: [],
result: SecurityActivity,
body: (record SecurityActivity {index := 0, controlIndex := 0})
}
definition{
name: measurementMutualTls,
parameters: [],
result: VerificationMeasurement,
body: (record VerificationMeasurement {index := 0, controlIndex := 0, passed := true})
}
theorem{name: riskChainConsistent, parameters: [], statement: (true = true), proof: reflexivity{}}
\end{semanticmodule}
\end{lexlean}
Foundation.View.Text.V1.Model
app/src/Foundation/View/Text/V1/Model.lex.tex, 64 lines, from UOR-Foundation/template@e79e0dcd.
| Declaration | Kind | Word |
|---|---|---|
Foundation.View.Text.V1.Model::TextView | structure | |
Foundation.View.Text.V1.Model::AcceptanceVector | structure | |
Foundation.View.Text.V1.Model::TextApplication | structure | Text application model |
Foundation.View.Text.V1.Model::textApplicationProfile | definition |
Source
\begin{lexlean}{Foundation.View.Text.V1.Model}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\useglossary{prism.arch@1.0.0}
\title{Text application model}
\begin{semanticmodule}
structure{
name: TextView,
type_parameters: [],
parameters: [],
fields: [
{name: title, type: String},
{name: heading, type: String},
{name: inputLabel, type: String},
{name: submitLabel, type: String},
{name: outputLabel, type: String},
{name: inputError, type: String},
{name: responseError, type: String}
]
}
structure{
name: AcceptanceVector,
type_parameters: [],
parameters: [],
fields: [{name: request, type: Bytes}, {name: response, type: Bytes}]
}
structure{
name: TextApplication,
type_parameters: [],
parameters: [],
fields: [
{name: profile, type: String},
{name: name, type: String},
{name: cargoName, type: String},
{name: cargoVersion, type: String},
{name: cargoDescription, type: String},
{name: cargoRepository, type: String},
{name: cargoHomepage, type: String},
{name: libraryRoots, type: (List String)},
{name: acceptanceVectors, type: (List AcceptanceVector)},
{name: entryRoot, type: String},
{name: coreContract, type: String},
{name: requestMaximum, type: UInt32},
{name: responseMaximum, type: UInt32},
{name: guestAllocationMaximum, type: UInt32},
{name: capabilitiesEmpty, type: Bool},
{name: fatArchive, type: Bool},
{name: primaryLayer, type: UInt8},
{name: viewLayer, type: UInt8},
{name: view, type: TextView}
]
}
definition{
name: textApplicationProfile,
parameters: [],
result: String,
body: "prismpm/text-application/1"
}
\end{semanticmodule}
\end{lexlean}
Production.ThreatModel
app/src/Production/ThreatModel.lex.tex, 213 lines, from UOR-Foundation/PrismPM@3db7f3e6.
Production.ThreatModel 23 rows
| Declaration | Kind | Word |
|---|---|---|
Production.ThreatModel::Stride | inductive | |
Production.ThreatModel::EvidenceKind | inductive | |
Production.ThreatModel::Evidence | structure | |
Production.ThreatModel::ControlSet | structure | |
Production.ThreatModel::ModeledAsset | structure | |
Production.ThreatModel::ModeledThreat | structure | |
Production.ThreatModel::ModeledControl | structure | |
Production.ThreatModel::ThreatMapping | structure | |
Production.ThreatModel::AcceptedRisk | structure | |
Production.ThreatModel::NormalizedThreatModel | structure | |
Production.ThreatModel::threatListLength | definition | |
Production.ThreatModel::threatAllPositive | definition | |
Production.ThreatModel::validateThreatsAnswered | definition | |
Production.ThreatModel::validateThreatCategories | definition | |
Production.ThreatModel::validateControlEvidence | definition | |
Production.ThreatModel::validateNormalizedThreatModel | definition | |
Production.ThreatModel::normalizedThreatModelValid | definition | |
Production.ThreatModel::normalizedThreatModel_sound_complete | theorem | |
Production.ThreatModel::threatModelVector | definition | |
Production.ThreatModel::threatModelVectorAccepted | theorem | |
Production.ThreatModel::unmappedThreatRefused | theorem | |
Production.ThreatModel::controlWithoutEvidenceRefused | theorem | |
Production.ThreatModel::threatWithoutCategoryRefused | theorem |
Source
\begin{lexlean}{Production.ThreatModel}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\useglossary{prism.arch@1.0.0}
\useglossary{prism.sec@1.0.0}
\importmodule{Foundation.Sec}
\title{Boolean}
\begin{semanticmodule}
inductive{
name: Stride,
type_parameters: [],
parameters: [],
constructors: [
{name: spoofing, fields: []},
{name: tampering, fields: []},
{name: repudiation, fields: []},
{name: informationDisclosure, fields: []},
{name: denialOfService, fields: []},
{name: elevationOfPrivilege, fields: []}
]
}
inductive{
name: EvidenceKind,
type_parameters: [],
parameters: [],
constructors: [{name: gate, fields: []}, {name: proof, fields: []}, {name: review, fields: []}]
}
structure{
name: Evidence,
type_parameters: [],
parameters: [],
fields: [{name: kind, type: EvidenceKind}, {name: reference, type: String}]
}
structure{
name: ControlSet,
type_parameters: [],
parameters: [],
fields: [
{name: title, type: String},
{name: text, type: String},
{name: version, type: String},
{name: lastModified, type: String}
]
}
structure{
name: ModeledAsset,
type_parameters: [],
parameters: [],
fields: [{name: asset, type: String}, {name: name, type: String}, {name: text, type: String}]
}
structure{
name: ModeledThreat,
type_parameters: [],
parameters: [],
fields: [
{name: threat, type: String},
{name: name, type: String},
{name: text, type: String},
{name: category, type: Stride}
]
}
structure{
name: ModeledControl,
type_parameters: [],
parameters: [],
fields: [
{name: control, type: String},
{name: name, type: String},
{name: text, type: String},
{name: evidence, type: (List Evidence)}
]
}
structure{
name: ThreatMapping,
type_parameters: [],
parameters: [],
fields: [{name: threat, type: String}, {name: controls, type: (List String)}]
}
structure{
name: AcceptedRisk,
type_parameters: [],
parameters: [],
fields: [{name: threat, type: String}, {name: rationale, type: String}]
}
structure{
name: NormalizedThreatModel,
type_parameters: [],
parameters: [],
fields: [
{name: threatCount, type: Nat},
{name: categoryCounts, type: (List Nat)},
{name: mitigationCounts, type: (List Nat)},
{name: acceptanceCounts, type: (List Nat)},
{name: evidenceCounts, type: (List Nat)}
]
}
definition{
name: threatListLength,
parameters: [values : (List Nat)],
result: Nat,
body: (match values | List.nil => 0 | List.cons value rest => ((threatListLength rest) + 1)),
recursive_argument: values
}
definition{
name: threatAllPositive,
parameters: [values : (List Nat)],
result: Bool,
body: (match values
| List.nil => true
| List.cons value rest => ((0 <? value) && (threatAllPositive rest))),
recursive_argument: values
}
definition{
name: validateThreatsAnswered,
parameters: [mitigations : (List Nat), acceptances : (List Nat)],
result: Bool,
body: (match mitigations
| List.nil => true
| List.cons mitigation rest => (match acceptances
| List.nil => ((0 <? mitigation) && (validateThreatsAnswered rest acceptances))
| List.cons acceptance others => (((0 <? mitigation) || (0 <? acceptance)) && (validateThreatsAnswered rest others)))),
recursive_argument: mitigations
}
definition{
name: validateThreatCategories,
parameters: [categoryCounts : (List Nat)],
result: Bool,
body: (threatAllPositive categoryCounts)
}
definition{
name: validateControlEvidence,
parameters: [evidenceCounts : (List Nat)],
result: Bool,
body: (threatAllPositive evidenceCounts)
}
definition{
name: validateNormalizedThreatModel,
parameters: [model : NormalizedThreatModel],
result: Bool,
body: (((threatListLength (project model categoryCounts)) =? (project model threatCount)) && (((threatListLength (project model mitigationCounts)) =? (project model threatCount)) && (((threatListLength (project model acceptanceCounts)) =? (project model threatCount)) && ((validateThreatCategories (project model categoryCounts)) && ((validateThreatsAnswered (project model mitigationCounts) (project model acceptanceCounts)) && (validateControlEvidence (project model evidenceCounts)))))))
}
definition{
name: normalizedThreatModelValid,
parameters: [model : NormalizedThreatModel],
result: Prop,
body: ((validateNormalizedThreatModel model) = true)
}
theorem{
name: normalizedThreatModel_sound_complete,
parameters: [model : NormalizedThreatModel],
statement: (((validateNormalizedThreatModel model) = true) <-> (normalizedThreatModelValid model)),
proof: reflexivity{}
}
definition{
name: threatModelVector,
parameters: [
categoryCounts : (List Nat),
mitigationCounts : (List Nat),
acceptanceCounts : (List Nat),
evidenceCounts : (List Nat)
],
result: NormalizedThreatModel,
body: (record NormalizedThreatModel {threatCount := 2, categoryCounts := categoryCounts, mitigationCounts := mitigationCounts, acceptanceCounts := acceptanceCounts, evidenceCounts := evidenceCounts})
}
theorem{
name: threatModelVectorAccepted,
parameters: [],
statement: ((validateNormalizedThreatModel (threatModelVector (cons 1 (cons 1 (nil Nat))) (cons 2 (cons 0 (nil Nat))) (cons 0 (cons 1 (nil Nat))) (cons 1 (cons 2 (nil Nat))))) = true),
proof: decide{}
}
theorem{
name: unmappedThreatRefused,
parameters: [],
statement: ((validateNormalizedThreatModel (threatModelVector (cons 1 (cons 1 (nil Nat))) (cons 2 (cons 0 (nil Nat))) (cons 0 (cons 0 (nil Nat))) (cons 1 (cons 2 (nil Nat))))) = false),
proof: decide{}
}
theorem{
name: controlWithoutEvidenceRefused,
parameters: [],
statement: ((validateNormalizedThreatModel (threatModelVector (cons 1 (cons 1 (nil Nat))) (cons 2 (cons 0 (nil Nat))) (cons 0 (cons 1 (nil Nat))) (cons 1 (cons 0 (nil Nat))))) = false),
proof: decide{}
}
theorem{
name: threatWithoutCategoryRefused,
parameters: [],
statement: ((validateNormalizedThreatModel (threatModelVector (cons 1 (cons 0 (nil Nat))) (cons 2 (cons 0 (nil Nat))) (cons 0 (cons 1 (nil Nat))) (cons 1 (cons 2 (nil Nat))))) = false),
proof: decide{}
}
\end{semanticmodule}
\end{lexlean}
Language packages
Each entry is a word of the controlled vocabulary an app's facet records are written in, and the declaration it denotes.
prism.arch 1.0.0
app/language/prism.arch/lexicon.toml, from UOR-Foundation/template@e79e0dcd.
prism.arch 1.0.0 40 rows
| Entry | Word | Denotes |
|---|---|---|
arch-component | architectural component | Foundation.Arch::Component |
arch-component-kind | architectural component kind | Foundation.Arch::ComponentKind |
arch-concern | architectural concern | Foundation.Arch::Concern |
arch-design-diagram | design diagram | Foundation.Arch::DesignDiagram |
arch-design-view | design view | Foundation.Arch::DesignView |
arch-edge | architectural edge | Foundation.Arch::Edge |
arch-edge-kind | architectural edge kind | Foundation.Arch::EdgeKind |
arch-feature | feature | Foundation.Arch::Feature |
arch-journey | journey | Foundation.Arch::Journey |
arch-model-kind | architecture model kind | Foundation.Arch::ModelKind |
arch-opm-link | OPM link | Foundation.Arch::OpmLink |
arch-opm-link-kind | OPM link kind | Foundation.Arch::OpmLinkKind |
arch-opm-state | OPM state | Foundation.Arch::OpmState |
arch-opm-thing | OPM thing | Foundation.Arch::OpmThing |
arch-opm-thing-kind | OPM thing kind | Foundation.Arch::OpmThingKind |
arch-opm-zoom | OPM zoom | Foundation.Arch::OpmZoom |
arch-stakeholder | stakeholder | Foundation.Arch::Stakeholder |
arch-standard-reference | standards reference | Foundation.Arch::StandardReference |
arch-system-process | system process | Foundation.Arch::SystemProcess |
arch-system-state | system state | Foundation.Arch::SystemState |
arch-text-application-model | Text application model | Foundation.View.Text.V1.Model::TextApplication |
arch-uml-component | UML component | Foundation.Arch::UmlComponent |
arch-uml-connector | UML connector | Foundation.Arch::UmlConnector |
arch-uml-lifeline | UML lifeline | Foundation.Arch::UmlLifeline |
arch-uml-message | UML message | Foundation.Arch::UmlMessage |
arch-uml-message-kind | UML message kind | Foundation.Arch::UmlMessageKind |
arch-uml-state | UML state | Foundation.Arch::UmlState |
arch-uml-transition | UML transition | Foundation.Arch::UmlTransition |
arch-view | architecture view | Foundation.Arch::View |
arch-view-class | architecture view class | Foundation.Arch::ViewClass |
arch-viewpoint | architecture viewpoint | Foundation.Arch::Viewpoint |
arch-viewpoint-class | architecture viewpoint class | Foundation.Arch::ViewpointClass |
holo-flat-validation-input | flat validation input | Foundation.Holo::FlatValidationInput |
holo-normalized-features | normalized feature model | Foundation.Holo::NormalizedFeatures |
holo-normalized-model | normalized hologram model | Foundation.Holo::NormalizedHolo |
holo-standards-profile | fixed standards profile | Foundation.Holo::StandardsProfile |
prism-bounded-byte-buffer | Bounded byte buffer | Foundation.Bytes::BoundedBuffer |
prism-browser-system-model | Browser-resident system model | Production.BrowserSystem::SystemModel |
prism-production-system-model | Production system model | Production.Core::Component |
prism-unicode-text-codec | Unicode text codec | Foundation.Utf8::encode |
prism.qual 1.0.0
app/language/prism.qual/lexicon.toml, from UOR-Foundation/PrismPM@3db7f3e6.
| Entry | Word | Denotes |
|---|---|---|
qual-characteristic | quality characteristic | Foundation.Qual::ProductQualityCharacteristic |
qual-measure | quality measure | Foundation.Qual::QualityMeasure |
qual-requirement | quality requirement | Foundation.Qual::QualityRequirement |
qual-subcharacteristic | quality subcharacteristic | Foundation.Qual::QualitySubcharacteristic |
prism.sec 1.0.0
app/language/prism.sec/lexicon.toml, from UOR-Foundation/PrismPM@3db7f3e6.
| Entry | Word | Denotes |
|---|---|---|
sec-activity | security activity | Foundation.Sec::SecurityActivity |
sec-asset | security asset | Foundation.Sec::Asset |
sec-control | security control | Foundation.Sec::ApplicationSecurityControl |
sec-impact | security impact | Foundation.Sec::Impact |
sec-likelihood | security likelihood | Foundation.Sec::Likelihood |
sec-measurement | security verification measurement | Foundation.Sec::VerificationMeasurement |
sec-risk | security risk | Foundation.Sec::Risk |
sec-threat | security threat | Foundation.Sec::Threat |
prism-code journey
These modules check a prism/spec/1 spec and turn it into the LexLean model the app is built from. They come from the npm package prism-code 0.7.2. Each has the SHA-256 that VENDOR.md records.
prism-code journey 5 rows
| Module | What it does | SHA-256 |
|---|---|---|
spec.mjs | The Prism spec (`prism/spec/1`): what a decision app does, in the words a user gives it. One spec renders to one LexLean model (render.mjs), whose theorems Lean proves and whose acceptance vectors the guest replays. | 80f22a5ddd3f018d3711c067c1a93bd48b9f5627b459dac5710540c83c01104f |
render.mjs | Render a `prism/spec/1` spec into the LexLean model of a text application, its acceptance vectors and SPEC.md. | 55f784df40a34f36992cf397c4ff0ba55a5b89b498eca397cd910238e2def64f |
session.mjs | The spec session: six questions, asked one at a time, each answer checked as it arrives. The spec is rebuilt from the raw answers every time, so an earlier answer can be revised and everything after it is checked again. | 73b2f266120a52d2951b5973afd664336748bb7c5693748207abcdd6c055a582 |
template.mjs | The files that make a guided-journey app an instance of UOR-Foundation/template, so it has the template's frame, page, gate and Pages URL. | 97885e092443ae6eb46060c976d9c6ee9ca9e138d8914e4f4ae32c0b9dad6ead |
mcp.mjs | `prism-code mcp`: the Prism MCP server, over stdio, with no dependencies. | 4da58794e4f5c1609ffaf2902419cb05300be39a21f69f05f55a64417c002740 |
Words on this page 3
- facet
- One view of a model, such as its architecture, its security or its quality. Each facet holds records.
- record
- One entry in a facet: a component, a threat, a measure or a journey step, with the place in the source it came from.
- LexLean
- The language Prism models are written in. It reads like LaTeX and compiles to Lean 4.