File size: 2,208 Bytes
d7b24f0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | /*
* Copyright (C) 2026 HCALC / Foundry J contributors
* SPDX-License-Identifier: AGPL-3.0-only
*
* Module: State — production Carrier Fin n → ℝ with ℓ∞ (abstract).
* Cite: PRODUCTION.md §1 Gap-Carrier CLOSED; FOUNDRY_J_CROSSLINKS §0–§2.
* Provenance: SpecDefined
*/
module modules/State
/* Discrete evolution carrier (abstract atoms; dim/norm in CarrierSpec). */
sig State {}
/* Finite time atoms for bounded evolution. */
sig Time {
next: lone Time,
at: one State
}
/* Total order spine on Time: linear chain, unique start.
* Provenance: derived — finite-scope safety for evolution. */
fact INV_time_linear_chain {
one t: Time | no t.~next
all t: Time | lone t.next
all disj t1, t2: Time | t1 in t2.^next or t2 in t1.^next
}
/* Evolution totality: every State is witnessed at some Time. */
fact fact_evolution_total_on_State {
all s: State | some t: Time | t.at = s
}
pred evolution_total_on_State {
all s: State | some t: Time | t.at = s
}
assert INV_evolution_total_on_State {
evolution_total_on_State
}
/* Instance tag: Foundry vs HCALC-native step shape (do not equate silently). */
abstract sig InstanceKind {}
one sig FoundryInstance, HCALCInstance extends InstanceKind {}
one sig ActiveInstance {
kind: one InstanceKind
}
/* ---- Production Carrier: abstract dim n≥1, ℓ∞ ----
* Provenance: SpecDefined — PRODUCTION.md §1.
* Numeric ℝ^n lives in Lean; Alloy encodes dim≥1 + LInf flags (no heavy Int arith). */
abstract sig NormKind {}
one sig LInf extends NormKind {}
one sig CarrierSpec {
/* dimPositive=1 encodes n≥1 (avoid bitblast of concrete n). */
dimPositive: Int,
norm: one NormKind
}
fact fact_P1_carrier_production {
CarrierSpec.dimPositive = 1
CarrierSpec.norm = LInf
}
pred carrier_linf_dim_ok {
CarrierSpec.dimPositive = 1
CarrierSpec.norm = LInf
}
assert P1_carrier_linf_dim {
/* Production assert P1 — Carrier abstract dim n≥1, ℓ∞ */
carrier_linf_dim_ok
}
/* Measure atom — no Int payload (Int bitblast hangs checks). */
sig Measure {}
sig StateMeasure {
of: one State,
m: one Measure
}
fact INV_state_measure_functional {
all s: State | lone sm: StateMeasure | sm.of = s
}
|