AGENTS.md — how to modify this module
Invariants, conventions and change recipes for contributors — and for AI coding assistants, which load this file automatically when editing the module. Largely derived from the source and verified against it.
Mirrored from subprojects/xta/xta-analysis/AGENTS.md — edit it there, not here.
xta/xta-analysis — notes for editing this module
Gradle module: :theta-xta-analysis. Binds Uppaal timed automata (an XtaSystem from xta) to the analyses of common/analysis. Its only production consumer is xta-cli, through LazyXtaCheckerFactory. Overview: README.md; the papers behind the lazy algorithms are listed in xta/README.md.
Build and test
./gradlew :theta-xta-analysis:test. The tests load the.xtamodels insrc/test/resources/withXtaDslManager.createSystem.:theta-xta-clihas no tests, so this is the whole XTA suite.- The analyses need no SMT solver (explicit values and DBMs).
LazyXtaCheckerTestruns everyDataStrategy×ClockStrategypair on each model and checks the resulting ARG withArgChecker.isWellLabeledon the legacy Z3, so a new enum value is covered automatically.
Layout
Paths are relative to src/main/java/hu/bme/mit/theta/xta/analysis/.
XtaState(location vector plus an inner state;isCommitted()/isUrgent()derive from the locations),XtaAction(basic, binary and broadcast synchronization),XtaLts, and theXtaAnalysiswrapper that lifts an inner analysis.zone/: DBM semantics inXtaZoneUtils.post/pre, with LU-bound (lu/) and interpolating (itp/) zone states.expl/: explicit data variables, withitp/.lazy/:LazyXtaCheckerandLazyXtaCheckerFactory. A checker combines oneDataStrategyand oneClockStrategy, each anAlgorithmStrategythat sees its half of theProd2Statethrough aLens.
Invariants / gotchas
- Time may elapse only if every location of the vector is NORMAL. The rule is implemented twice: in
XtaZoneUtils(successor zones, and the initial zone inXtaZoneInitFunc) and inXtaAction.getStmts()(the_delayhavoc of the statement view, whichtoExpr()andArgCheckerread). Change both together. - Initial states must not be bottom.
LazyXtaCheckerputs initial states into the ARG unchecked, and the strategies read both components of the product state, which a bottomProd2Statedoes not have. This is whyXtaZoneInitFuncdoes not apply the initial invariants:postapplies the source invariants anyway. XtaZoneAnalysisis created per system (XtaZoneAnalysis.create(system)) because its initial zone depends on the initial locations. Thelu/anditp/init funcs only wrap it.- Clock guards on the receiving edges of a broadcast are not supported:
XtaZoneUtilsthrowsUnsupportedOperationException.
Change recipe: a new data or clock strategy
Add the value to DataStrategy or ClockStrategy (xta-cli exposes them as --discrete and --clock). Add a factory method to DataStrategies or ClockStrategies that returns an AlgorithmStrategy over the left or right lens, and a case to every nested switch in LazyXtaCheckerFactory.combineStrategies, whose defaults throw AssertionError.