PrismDevRelOpen the app
Reference: Prompt reference

Learn

The facets of a Prism app

Build

Prompt referencePrism source

// reference · Build

Prompt reference

Every member of a prism/prompt/1 prompt, the command line and the MCP tool prism_prompt.

A prompt is the arguments of one call to the MCP tool prism_prompt. Its members, and the members of its app spec, are below.

The shape of a prompt26 nodes and 25 links. prompt to goal; prompt to app; prompt to stakeholders; prompt to concerns; prompt to components; prompt to threats; prompt to quality; prompt to journeys; prompt to pattern; prompt to machine; prompt to license; prompt to repository; prompt to axioms; app to name; app to title; app to purpose; app to fields; app to outcomes; app to meanings; app to rules; app to otherwise; app to otherwiseWhy; app to properties; app to limits; app to examples.promptgoalappstakeholdersconcernscomponentsthreatsqualityjourneyspatternmachinelicenserepositoryaxiomsnametitlepurposefieldsoutcomesmeaningsrulesotherwiseotherwiseWhypropertieslimitsexamplesThe shape of a prompt26 nodes and 25 links. prompt to goal; prompt to app; prompt to stakeholders; prompt to concerns; prompt to components; prompt to threats; prompt to quality; prompt to journeys; prompt to pattern; prompt to machine; prompt to license; prompt to repository; prompt to axioms; app to name; app to title; app to purpose; app to fields; app to outcomes; app to meanings; app to rules; app to otherwise; app to otherwiseWhy; app to properties; app to limits; app to examples.promptgoalstakeholdersconcernscomponentsthreatsappqualityjourneyspatternmachinelicenserepositoryaxiomsnametitlepurposefieldsoutcomesmeaningsrulesotherwiseotherwiseWhypropertieslimitsexamples
The shape of a prompt. A prompt and its members, then the members of its app spec. The colour marks a required member.
The data in this figure
FromLinkTo
prompt→goal
prompt→app
prompt→stakeholders
prompt→concerns
prompt→components
prompt→threats
prompt→quality
prompt→journeys
prompt→pattern
prompt→machine
prompt→license
prompt→repository
prompt→axioms
app→name
app→title
app→purpose
app→fields
app→outcomes
app→meanings
app→rules
app→otherwise
app→otherwiseWhy
app→properties
app→limits
app→examples

Prompt members

This table is the tool's input schema.

Prompt members 13 rows
MemberTypePresenceMeaning
goalstringoptionalThe goal the app is built toward, in one sentence a developer would say. It becomes the spec purpose when app.purpose is left out.
appobjectrequiredThe whole app as a prism/spec/1 spec, the input of prism-code's prism_spec. Its members are below.
stakeholdersarrayoptionalWho the app is for. A Verifier, anyone who replays the holo before trusting it, is always added.
concernsarrayoptionalWhat the stakeholders care about, each viewed in one model.
componentsarrayoptionalSystems outside the app that send it requests or read its answers.
threatsarrayoptionalWhat can go wrong, beyond the threats every app has (an oversized or malformed request, a substituted holo or source, a granted capability, an answer a property rules out).
qualityarrayoptionalHow good is good enough, as ISO/IEC 25010:2023 requirements with a measure and its threshold.
journeysarrayoptionalOrdered steps a stakeholder takes. A step is a rule ID (REQ-001), a property ID (INV-001), otherwise or refuse.
patternone ofoptionalThe pattern the behavior follows: decisionTable (OMG DMN 1.5, hit policy FIRST, the default), policyDecision (OASIS XACML 3.0: the answers are exactly permit, deny, not-applicable and indeterminate) or stateMachine (OMG UML 2.5.1: the answer is the next state, and machine is required).
machineobjectoptionalFor a stateMachine: which choice field carries the current state, the initial state, and the final states. The answers are exactly the state values. The builder proves that a final state is never left and that no run from the initial state reaches a state outside the reachable set.
licensestringoptionalThe SPDX license expression; MIT OR Apache-2.0 when left out.
repositorystringoptionalowner/name of the repository the app will live in, for its page and links.
axiomsobjectoptionalThe exact axiom set a verify observed for a generated declaration, by declaration name, as prism-code records it when LexLean reports LLV7005. `node builder/cli.mjs axioms` writes it from a verify log.

app: the prism/spec/1 spec

The same input prism-code's MCP tool prism_spec takes.

MemberTypePresenceMeaning
namestringoptionalLower case and hyphens, such as loan-approval.
titlestringoptional
purposestringrequiredWhat the app decides, in one sentence.
fieldsarrayrequiredOne request is these values in order, separated by spaces.
outcomesarrayrequiredLower-case words; invalid is reserved.
meaningsobjectoptionalWhat each answer means, such as {"review": "a person must decide"}.
rulesarrayrequiredIn order; the first that matches decides.
otherwisestringrequiredThe answer when no rule matches.
otherwiseWhystringoptionalWhy, in a few words, such as "it enforces INV-001".
propertiesarrayoptionalWhat must never or always happen; each becomes a theorem Lean proves.
limitsarrayoptionalWhat the app does not decide, and choices the rules make silently, such as "fair credit is treated as good".
examplesarrayoptionalRequests and their expected answers; each becomes an acceptance vector.

Patterns

The pattern member names the established pattern the behavior follows. Each is one function from a request to one answer. They differ in what the answer means, and in what is checked and proved.

patternNameStandardWhat the builder checks and proves
decisionTableDecision tableOMG DMN 1.5, hit policy FIRSTThe rules are tried in order, and the first one that matches gives the answer. If none matches, the default answer applies. This is a DMN decision table with the FIRST hit policy.
policyDecisionPolicy decisionOASIS XACML 3.0 policy decision pointThe answer is one XACML 3.0 decision: permit, deny, not-applicable, indeterminate. A policy that applies gives permit or deny. If none applies, the answer is not-applicable. If the request cannot be judged, it is indeterminate.
stateMachineState machineOMG UML 2.5.1 behavioral state machineThe answer is the next state, given the current state and an event. This is a UML state machine written as one pure function. The state travels in the request, so the app keeps nothing between requests. The builder proves what holds over every run.

machine: the state machine

MemberTypePresenceMeaning
statestringrequiredThe choice field whose values are the states.
initialstringrequiredThe state every run starts in.
finalarrayoptionalStates a run never leaves once it reaches them (UML FinalState).

Command line

node builder/cli.mjsDoes
build <prompt.json> --out <dir> [--last-modified <instant>]Write every file of the application into <dir>, laid out as a repository created from UOR-Foundation/template, and delete the template's example app there if it is present.
check <prompt.json>Check the prompt and print what the app will claim, writing nothing.
schemaPrint the MCP tool prism_prompt, whose input is one prompt.
axioms <prompt.json> <verify.log>Record in the prompt the exact axiom set each declaration was observed to use, from the LLV7005 diagnostics of a verify (as prism-code does).
listPrint the gallery's example names as a JSON array, the matrix the pages workflow builds and verifies one job per example from.

Exit codes: 0 done, 2 the prompt was refused (the reason is printed), 64 usage.

MCP tool call

MCP tool call 305 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "prism_prompt",
    "arguments": {
      "schema": "prism/prompt/1",
      "goal": "Find the next state of one Rule 30 cell from its neighbours, so every row of the pattern can be replayed and checked.",
      "pattern": "decisionTable",
      "repository": "afflom/rule30",
      "license": "MIT",
      "app": {
        "name": "rule-thirty-cell",
        "title": "Rule 30 cell",
        "purpose": "Decide the next state of a Rule 30 cell from its left neighbour, itself and its right neighbour.",
        "fields": [
          {
            "name": "left",
            "kind": "choice",
            "values": [
              "off",
              "on"
            ],
            "means": "the left neighbour now"
          },
          {
            "name": "center",
            "kind": "choice",
            "values": [
              "off",
              "on"
            ],
            "means": "the cell now"
          },
          {
            "name": "right",
            "kind": "choice",
            "values": [
              "off",
              "on"
            ],
            "means": "the right neighbour now"
          }
        ],
        "outcomes": [
          "off",
          "on"
        ],
        "meanings": {
          "on": "the cell is black in the next row",
          "off": "the cell is white in the next row"
        },
        "rules": [
          {
            "when": [
              {
                "field": "left",
                "op": "is",
                "value": "on"
              },
              {
                "field": "center",
                "op": "is",
                "value": "off"
              },
              {
                "field": "right",
                "op": "is",
                "value": "off"
              }
            ],
            "then": "on",
            "why": "rule30-lexlean/src/Core.lex.tex: rule a b c = bxor a (b || c), so 100 gives 1"
          },
          {
            "when": [
              {
                "field": "left",
                "op": "is",
                "value": "off"
              },
              {
                "field": "center",
                "op": "is",
                "value": "on"
              }
            ],
            "then": "on",
            "why": "rule30-lexlean/src/Core.lex.tex: with a off, rule is b || c, so 010 and 011 give 1"
          },
          {
            "when": [
              {
                "field": "left",
                "op": "is",
                "value": "off"
              },
              {
                "field": "right",
                "op": "is",
                "value": "on"
              }
            ],
            "then": "on",
            "why": "rule30-lexlean/src/Core.lex.tex: with a off, rule is b || c, so 001 gives 1"
          }
        ],
        "otherwise": "off",
        "otherwiseWhy": "rule30-lexlean/src/Core.lex.tex: bxor a (b || c) is 0 for 000, 101, 110 and 111",
        "properties": [
          {
            "kind": "never",
            "when": [
              {
                "field": "left",
                "op": "is",
                "value": "on"
              },
              {
                "field": "center",
                "op": "is",
                "value": "on"
              }
            ],
            "then": "on",
            "why": "Core.lex.tex: with a and b on, bxor true true is false, so 110 and 111 give 0"
          },
          {
            "kind": "always",
            "when": [
              {
                "field": "left",
                "op": "is",
                "value": "off"
              },
              {
                "field": "center",
                "op": "is",
                "value": "off"
              },
              {
                "field": "right",
                "op": "is",
                "value": "off"
              }
            ],
            "then": "off",
            "why": "a white neighbourhood stays white, the background of the Rule 30 diagram"
          }
        ],
        "examples": [
          {
            "request": "off off off",
            "response": "off"
          },
          {
            "request": "off off on",
            "response": "on"
          },
          {
            "request": "off on off",
            "response": "on"
          },
          {
            "request": "off on on",
            "response": "on"
          },
          {
            "request": "on off off",
            "response": "on"
          },
          {
            "request": "on off on",
            "response": "off"
          },
          {
            "request": "on on off",
            "response": "off"
          },
          {
            "request": "on on on",
            "response": "off"
          }
        ]
      },
      "stakeholders": [
        {
          "name": "Researcher",
          "text": "Studies the Rule 30 sequence for Prize Problem 1 and needs every cell of every row to be the one the rule gives.",
          "concerns": [
            "Correct answers",
            "Proved guarantees"
          ]
        },
        {
          "name": "Proof engineer",
          "text": "Extends the LexLean and Lean 4 formalization and needs the cell rule to stay the one Core.lex.tex and the prize kit define.",
          "concerns": [
            "Agreement with the prize kit",
            "Proved guarantees"
          ]
        }
      ],
      "concerns": [
        {
          "name": "Agreement with the prize kit",
          "text": "The local rule is the one Rule30PrizeKit defines, as rule30-bridge/Rule30Bridge.lean connects every paper theorem to Ruliology.CellularAutomata.Rule30Prize.",
          "model": "component"
        }
      ],
      "components": [
        {
          "name": "Rule30PrizeKit",
          "kind": "externalSystem",
          "text": "The Rule 30 Prize kit, Ruliology.CellularAutomata.Rule30Prize, whose definitions the bridge module ties the LexLean theorems to."
        },
        {
          "name": "r30 command surface",
          "kind": "cliAdapter",
          "text": "bin/r30: status, frontier, theorem add, check, verify and axioms, also served as an MCP server."
        }
      ],
      "threats": [
        {
          "name": "Rule drifts from the prize kit",
          "text": "The cell table differs from the Rule 30 the prize kit defines, so a replayed row is not the automaton the prize asks about.",
          "stride": "tampering",
          "asset": "source",
          "likelihood": "low",
          "impact": "critical",
          "control": {
            "name": "Bridged to the prize kit",
            "text": "Rule30Bridge.lean proves every LexLean paper theorem against the kit definition, and all eight neighbourhoods are acceptance examples.",
            "evidence": [
              {
                "kind": "review",
                "reference": "rule30-bridge/Rule30Bridge.lean"
              },
              {
                "kind": "gate",
                "reference": "make check-research"
              }
            ]
          }
        },
        {
          "name": "Classical choice in a proof",
          "text": "A proof of the rule depends on Classical.choice, which the repository forbids in its authored proof surfaces.",
          "stride": "tampering",
          "asset": "source",
          "likelihood": "low",
          "impact": "major",
          "control": {
            "name": "Choice forbidden",
            "text": "The kernel axiom audit accepts only propext and Quot.sound, and a source check rejects classical constants.",
            "evidence": [
              {
                "kind": "gate",
                "reference": "scripts/check_no_choice.py"
              },
              {
                "kind": "gate",
                "reference": "make check-research"
              }
            ]
          }
        },
        {
          "name": "Boundary cells guessed",
          "text": "A caller asks about a cell at the edge of a finite row and supplies a neighbour that is not in the row.",
          "stride": "tampering",
          "asset": "request",
          "likelihood": "medium",
          "impact": "minor",
          "accepted": "The app answers one neighbourhood exactly; the convention for cells beyond a finite row belongs to the caller that builds the row."
        }
      ],
      "quality": [
        {
          "characteristic": "Maintainability",
          "subcharacteristic": "Testability",
          "requirement": "Whole truth table pinned",
          "text": "Each of the eight neighbourhoods of three cells is an acceptance example, so the table is checked row by row against Core.lex.tex.",
          "measure": "Neighbourhoods without an example",
          "measureText": "Of the eight three-cell neighbourhoods, those no example states.",
          "threshold": 0
        }
      ],
      "journeys": [
        {
          "stakeholder": "Researcher",
          "steps": [
            "REQ-001",
            "REQ-002",
            "REQ-003",
            "otherwise",
            "INV-001",
            "INV-002"
          ]
        }
      ]
    }
  }
}

referenceBuildMarkdown

Words on this page 2
MCP
Model Context Protocol: an open protocol through which AI agents call tools such as the Prism builder.
prompt
One JSON document that describes an app. The builder turns it into every facet of a Prism model.