Dane Sabo e69fd0a6f4 reachability: pin FRET predicates as numerical halfspaces
predicates.json is the single source of truth for concretizing the
FRET-spec predicates (t_avg_above_min, t_avg_in_range, p_above_crit,
inv1_holds, inv2_holds) as polytopes {x : A x <= b}. Until now these
were abstract booleans in the synthesis spec; reach analysis
re-invented ad-hoc thresholds that weren't tied to the spec. Closes
the Thrust-1-meets-Thrust-3 seam.

T_standby now defined as T_c0 - 60 F = 275 C (from user review).
Replaces the earlier simplification where shutdown IC held all temps
at T_cold0. 275 C is inside the model's +/-50 C trust region around
operating point and above coolant saturation at reduced pressure.

load_predicates.m in MATLAB reads the JSON and resolves rhs_expr
strings (which reference plant-derived constants like T_c0, T_cold0,
T_standby) into numeric bounds. Returns per-predicate (A_poly, b_poly)
plus a constants struct.

main_mode_sweep.m now pulls T_standby from predicates and uses it
for shutdown + heatup ICs. Heatup horizon extended to 90 min to
cover the wider 60 F -> operating range at 28 C/hr tech-spec limit.

reach_operation.m reads delta_safe_Tc from the t_avg_in_range
halfspace instead of hardcoding +/-5 K. Current concretization is
+/-2.78 C (~5 F); LQR reach still shows 28x margin.

inv1_holds and inv2_holds are marked PLACEHOLDER in the JSON —
engineering best guesses, not derived from a specific plant's tech
specs or a DNBR correlation. Revisit before thesis defense.

Hacker-Split: single-source concretization for FRET predicates,
end seam with reach.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 15:09:37 -04:00

pwr-hybrid-3-demo

Preliminary example for the HAHACS thesis — a verified hybrid controller for a small modular PWR startup. Composes three layers into one demonstrable pipeline:

  • Discrete layer (fret-pipeline/): FRET natural-language requirements → LTL → synthesized AIGER controller → state-machine diagram.
  • Continuous layer (plant-model/): 10-state point kinetic equation + thermal-hydraulics PWR model with bounded steam-generator heat removal as the disturbance input.
  • Research context (thesis/): the HAHACS PhD proposal that motivates and formalizes the methodology.

Layout

pwr-hybrid-3-demo/
  CLAUDE.md                AI-facing context and architecture map
  docs/
    architecture.md        How the discrete and continuous layers compose
    figures/               Shared figures for thesis + talks
  fret-pipeline/           FRET → ltlsynt → AIGER → state machine
  plant-model/             PWR point kinetics + thermal-hydraulics
  reachability/            Continuous-mode verification (linear-model tube + Lyapunov barrier attempt; see README)
  julia-port/              Parallel plant-model port + ReachabilityAnalysis.jl scaffold
  hardware/                Ovation HIL artifacts (TBD)
  claude_memory/           Session notes by AI agents (distilled up into CLAUDE.md over time)
  thesis/                  [submodule] PhD proposal
  presentations/
    2026DICE/              [submodule] DICE 2026 abstract

Quickstart

Clone with submodules:

git clone --recurse-submodules <url>
cd pwr-hybrid-3-demo

Run the controller synthesis pipeline:

cd fret-pipeline
python3 scripts/fret_to_synth.py pwr_hybrid_3.json specs/synthesis_config_v3.json
bash scripts/synthesize.sh specs/synthesis_config_v3.json circuits
python3 scripts/trace_aiger.py circuits/PWR_HYBRID_3_DRC.aag diagrams
dot -Tpng diagrams/PWR_HYBRID_3_DRC_states.dot -o diagrams/PWR_HYBRID_3_DRC_states.png

Run the plant model (MATLAB in plant-model/ — Octave compatibility not tested since the LQR pieces landed):

main                 % original single-scenario demo (null vs operation)
main_mode_sweep      % all five DRC modes back-to-back, writes to ../docs/figures/
test_linearize       % Jacobian sanity check, saves linearization for reach

Run the reach artifacts (reachability/):

reach_operation      % linear reach tube for operation-mode LQR
barrier_lyapunov     % Lyapunov-ellipsoid barrier cert attempt (sweeps weights)

Soundness note: the current reach tube is the LINEAR model's tube; it is not yet a sound over-approximation of the nonlinear plant. See reachability/README.md § Soundness status.

Prerequisites

  • Python 3.10+
  • Spot for ltlsynt (brew install spot)
  • Graphviz for dot (brew install graphviz)
  • MATLAB or GNU Octave for the plant model
  • LaTeX (via latexmk) for the thesis submodule

Further reading

  • CLAUDE.md — orientation for AI agents working in this repo
  • docs/architecture.md — how the layers compose
  • thesis/CLAUDE.md — the thesis project structure
  • fret-pipeline/README.md — FRET naming conventions and pipeline details
  • plant-model/README.md — scenario setup and model equations
Description
No description provided
Readme 6.7 MiB
Languages
Julia 46.5%
TeX 34.5%
Python 17.5%
Shell 1.5%