Manuscript Offprint
arXiv:2611.12300Reconfigurable Action Theories: A Formal Foundation for Dynamically Composable Agent Harnesses
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Action theories typically fix their vocabulary and causal laws, whereas agent harnesses can change their tools, providers, and policies during execution. We introduce Reconfigurable Action Theories (RAT), in which actions can change the action theory itself. A theory module in RAT contains a vocabulary, causal laws, and an initializer. A RAT configuration records the active modules and the world state. Module loading and unloading are represented by actions governed by ordinary causal laws. RAT retains the standard causal action semantics of its language fragment when the active module set is fixed. We give sufficient conditions for at most one next configuration, preservation of existing behavior when a module is added, and equal results when modules are loaded in either order. We establish the computational complexity of reasoning tasks in RAT and translate finite RAT systems into nonmonotonic causal theories and Answer Set Programming (ASP), preserving bounded executions. Experiments compare finite RAT models with executions of official DeepSeek Harness, Pi, and OpenHands implementations. RAT provides a formal basis for checking how component changes affect a harness's available actions, behavior, and reachable goals.
Keywords: Reasoning about Actions, Action Languages, Dynamic Reconfiguration, Agent Harnesses, Answer Set Programming
1. Introduction
Action theories describe how actions change a world. A conventional action description fixes a vocabulary of fluents, which represent changeable facts, and actions, together with the causal laws governing them, while states or histories evolve [1-5]. We study actions that also change the vocabulary and causal laws used to describe later actions.
Agentic AI provides a concrete setting for this problem. An agent repeatedly proposes actions, invokes tools, observes results, and updates its context while pursuing a goal [6-8]. The surrounding agent harness constructs model context, exposes and validates tools, selects providers, dispatches calls, maintains sessions, enforces policies, and records effects [9]. Several harnesses support runtime changes to components, tools, or provider bindings [10-13]. For example, loading a tool can introduce new calls, while replacing a provider or changing a policy can alter when a call is permitted and what it does. To reason about these changes, we need to represent both the current action description and the actions that change it.
Consider a ReAct agent [8] asked to compute when no calculator tool is initially available. Loading a calculator module should introduce its multiplication action, causal laws, and private state. Removal should withdraw that contribution. A fixed description can encode availability through fluents and guarded, predeclared laws, but the vocabulary and laws themselves remain fixed. We make the module structure explicit: which action-description fragments are in force, and how actions change their selection.
Corresponding author.
Email address: jianmin@ustc.edu.cn (Jianmin Ji)
We introduce Reconfigurable Action Theories (RAT), a minimal extension in which actions can change the action theory itself, using the ordinary nonmonotonic causal foundation [3, 14]. A theory module is a named action-description fragment. A configuration records active optional modules and world state , alongside an always-active “core”. The actions load() and unload() select or deselect module , without rewriting its laws. Ordinary causal laws govern their world effects and qualification, while RAT fixes their effect on .
Runtime theory change itself is not new. Modular action languages assemble reusable descriptions, while evolving logic programs, domain update, and action-theory revision address changes of rules or theories [15–19]. RAT instead makes module selection explicit, distinguishes its roles before and after an action, and studies preservation and reordering of module changes. For a fixed execution bound, a causal theory can represent the same executions. RAT keeps module declarations and their changes explicit, so conditions for preserving behavior can be stated in terms of the modules rather than the auxiliary rules of an encoding. Section 9.1 discusses this role of RAT alongside its causal-theory translation.
The central semantic issue is which laws govern a step that changes the theory itself. Write for the ordinary action description formed by the core and the modules in and for its configuration. At time , an action labels a transition
We call the state before the action its source state and the state after it its target state. We check executability using the nonexecutability laws of and the current module set . Dynamic laws also come from . Their effects depend on conditions evaluated in and . Loading or unloading changes to . The static laws of determine within-state causal consequences, jointly with effects, inertia, and initialization. A newly loaded module contributes no executability or direct-effect law to its loading step, but its static laws already govern the resulting state and may cause indirect changes to existing fluents (Figure 1).

Figure 1: An action may change both the world state and the action theory. The description , formed by the core and the modules in , supplies the executability and direct-effect laws for . Loading or unloading changes to ; the resulting description supplies the static laws governing .
For finite ground RAT models whose initialization conditions are represented by propositional formulas, a proposed transition can be checked in polynomial time. Successor existence is NP-complete, while unbounded reachability is PSPACE-complete. Thus finite module selection does not raise these worst-case bounds above ordinary finite-state causal reasoning and planning. For finite RAT systems, causal theories and Answer Set Programming (ASP) [20, 21] give bounded planning, diagnosis, and counterexample search.
RAT is a specification for reasoning about a harness, not a replacement for its scheduler or tool runtime. A designer can use it to ask whether a tool can be loaded, whether existing actions retain their behavior, or whether a goal remains reachable after a module change. Reproducible experiments compare finite RAT models with local executions of official DeepSeek Harness, Pi, and OpenHands [22] implementations. We also test ASP-based configuration computation and
https://www.deepseek.com/en/harness/
https://pi.dev/ planning on generated models, measuring how running time and ground-program size grow with problem size.
The main contributions are:
(1) RAT and its properties. We define how actions change both world state and the modules forming an action description. For actions other than loading and unloading, RAT has the ordinary causal action semantics of the active description. We give sufficient conditions for at most one successor, for preserving existing behavior when adding a module, including through a read-only shared interface, and for the same possible final configurations when loading two modules in either order. We also show why unloading and reloading need not restore the earlier state. Experiments compare RAT predictions with recorded tool calls and component changes in three harness implementations.
(2) Reasoning tasks and complexity. We define transition checking, successor existence, possible and necessary goal satisfaction, execution of a supplied action sequence, and reachability. We establish their complexity for finite ground inputs with formula-represented initialization conditions.
(3) Causal and ASP representations. For finite RAT systems, we give a bounded causal translation and prove that its explanations represent exactly the executions. An established causal-to-ASP translation then represents these executions as answer sets, for fixed action sequences or bounded action choice.
Section 2 fixes the logical foundations. Sections 3–6 give RAT's language, semantics, properties, and translations. Section 7 reports executable checks. Section 8 compares related work, including Cordis. Section 9 discusses use in harnesses, limitations, and further work. The separate Supplementary Material³ supplies expanded proofs, implementation checks, and reproduction details.
2.1. Grounding convention
Let be a finite nonempty set of object constants. We use function-free schematic expressions, whose variables are meta-level placeholders. For an expression , let denote its variables. A grounding substitution replaces each variable by . We write for the expression obtained by applying this substitution to . Define
for a finite set of expressions.
A variable may be restricted to a designated subset ; in that case, only substitutions assigning it a constant from are allowed. This restriction is meta-level and does not introduce a sort into the object language. All definitions below are over the resulting finite ground language.
³The experimental code, usage instructions, and Supplementary Material are available at http://staff.ustc.edu.cn/~jianmin/rat/.
2.2. Action signatures, formulas, and states
A finite ground action signature consists of pairwise disjoint finite sets of basic fluents, defined fluents, and actions. Intuitively, a basic fluent records a fact that can persist, such as whether a tool has been registered. Basic fluents obey inertia: their values normally persist between states, but dynamic or static causal laws may cause them to change. A defined fluent instead expresses a condition whose value must be explained by static laws in each state, such as whether a registered tool is currently ready for use. It has no inertia: a previous value alone does not justify its current value. The word defined specifies where causal support must come from.
For convenience, write , , , and , omitting when it is clear from context.
For a fluent set , a fluent literal is either or , where . Let . For a fluent literal , let denote its underlying fluent, so .
We treat fluents as propositional atoms. More generally, for any finite set of propositional atoms, let denote the formulas generated by
Here and denote truth and falsity. For , implication abbreviates , and equivalence abbreviates . We use for literals over any atom set . A classical interpretation makes exactly the atoms in true. We write when it satisfies . A state formula is a formula in . For a state formula , denotes the set of fluents occurring in , regardless of polarity.
A literal set is consistent if it does not contain both and for any . It is complete over if it contains exactly one of and for every .
Define
a state in assigns every fluent in . For , let . We write for a state formula iff the classical interpretation satisfies .
2.3. Nonmonotonic causal theories
A causal theory specifies not only which formulas are true, but also what causes them to be true [3, 14]. Fix a finite set of propositional atoms. A causal rule , where , states that its head is caused when its body holds. A finite set of causal rules is a causal theory. Define its causal reduct at and its causally explained interpretations by
The reduct contains the heads whose bodies are true in . They must determine uniquely over ; satisfying the implications is insufficient. For , the empty theory has no explanation, but explains . Adding rules can create or remove explanations, so the semantics is nonmonotonic.
2.4. Causal action descriptions
An action description specifies constraints on states, effects of actions, and conditions that forbid actions. Our baseline is the Boolean, literal-headed, single-action fragment of , with its distinction between simple and statically determined fluent constants [14]. We call these basic and defined fluents, respectively, and declare every basic fluent inertial. Fix and . For a step performing action , we call the state before the action its source state and the state after it its target state. A static causal law
causes when holds in the same state. If , it is a static constraint excluding such states. A dynamic causal law
causes in the target state , provided the action is , holds in , and holds in . The abbreviation causes if sets ; omitting the condition also sets . A nonexecutability law
forbids performing a in any state satisfying .
An action description consists of the signature and finite sets of static causal laws, dynamic causal laws, and nonexecutability laws, respectively. For and , put
In this paper, exactly one ground action occurs at each step. We do not use the full language : our law heads are literals, except for in constraints, and we do not allow concurrent action occurrences.
Causal theories for states and transitions. We define the state and transition semantics by causal theories, using CE from Section 2.3. For an action description , one theory specifies which states are possible, while another specifies the possible target states for a given source and action. Both are over the fluent atoms .
For a complete basic-fluent assignment , define the state theory
A complete state is causally admissible for iff
The first set of rules fixes the basic values of this candidate state, while the static laws must explain its defined-fluent values. All fluent values must also satisfy those laws. Fixing basic values here specifies which individual states are admissible.
For a causally admissible source and an action , define the single-step causal theory
(2)
Its three sets of rules represent static laws, dynamic laws for whose formula holds in , and inertia, respectively. The remaining rule bodies are evaluated in the candidate target state. Unlike the facts in , the inertia rules in support source basic literals only if they remain true in the target. Static or dynamic laws may support a changed value.
For causally admissible states , the ordinary transition relation is
Thus must not be blocked in , and must causally explain . This is the fixed-source form of the standard + causal semantics [14, Sections 4.2 and 4.4].
2.5. Answer Set Programming
ASP is a form of nonmonotonic logic programming for knowledge representation and declarative problem solving, supported by efficient answer set solvers [23]. Its languages allow rules, constraints, and defaults to describe combinatorial search problems. We first recall ground normal rules and their answer set semantics [24, 25].
Fix a finite set of propositional atoms. A ground normal rule over has the form
Here is the head, and the expressions to the right of form the body. Each body literal , for , is either an atom or its classical negation , for . Thus classical negation is allowed in both the head and the body; not denotes a different operation, default negation. A rule with is a constraint, usually written without a head. A finite set of such rules is a ground normal program.
An ASP interpretation is a consistent set . For an atom , it may omit both and ; unlike a state, it need not assign a truth value to every atom. For , define
In particular, requires , whereas requires only . For a rule of the displayed form, satisfies , written , iff
Thus a rule with a literal head requires that literal whenever its body is true. A constraint is satisfied exactly when its body is false. An empty body is true. An interpretation is a model of a program , written , iff for every .
For an ASP interpretation , the Gelfond–Lifschitz reduct is obtained by deleting every rule whose body contains not with , and then removing all remaining default-negated literals from rule bodies. The interpretation is an answer set of iff it is a model of and no proper subset of is a model of . In other words, must be a subset-minimal model of its own reduct. We consider only consistent answer sets and write
Satisfaction alone is not enough: for example, both and satisfy . The reduct is the same rule for either interpretation, and is its only subset-minimal model. Thus this program has only the answer set .
Rules with nested bodies. The translation in Section 6.3 uses Boolean bodies and repeated default negation. These go beyond normal-rule syntax. We therefore also recall the standard extension to nested expressions [26], generated by
A rule keeps the head . A finite set of these rules is a program with nested bodies. An ASP interpretation evaluates literals as above, as true, and conjunction and disjunction in the usual way. It satisfies not iff it does not satisfy , and satisfies the rule iff implies .
The reduct replaces each occurrence of not that is not inside another default negation by if , and by otherwise. Answer sets are again the consistent subset-minimal models of their own reducts. We still use to denote the set of answer sets of a program with nested expressions. This definition agrees with the preceding one on normal programs. In particular,
Double default negation cannot in general be removed. For example, not not has answer sets and , whereas has only .
ASP computation typically involves two stages: grounding and solving. A grounder, such as gringo [27], converts a finite-domain non-ground program into a ground program. A solver, such as clasp [28], computes answer sets of the resulting ground program. Literal-headed causal theories can be translated into ASP to compute their causally explained interpretations [21]. Furthermore, Ji and Lin [29] study related translations of Turner's logic of universal causation into propositional logic and logic programs.
3. Reconfigurable Action Theories
In RAT, actions can load or unload modules of an action description. We define theory modules and configurations, and specify which action description each configuration uses. Section 4 defines their transitions.
3.1. Motivating example
Consider a ReAct-style agent [8] asked to compute . It initially has no calculator, so the harness first loads one. After loading, the harness registers the calculator so that the agent can call it. A multiplication call then stores the answer 391, which can later be cleared. The harness can also unload the calculator, after which the agent can no longer use its actions. In this example, multiplication is allowed only while the calculator is registered and the task has not finished.
Loading changes what the agent can do: it adds calculator actions and the rules that describe when they can be used and what they do. These actions and rules were absent before loading. Unloading removes them again, along with the calculator's registration and answer state. A fixed action description can simulate this behavior using predeclared availability flags; RAT instead represents the calculator as a module that is added to or removed from the current action description.
3.2. Theory modules and RAT systems
A module contains an action description and an initializer. Its vocabulary and laws become active together. Actions select from a fixed finite module set without changing their laws.
Let be a finite set of optional module identifiers represented by object constants. Meta-variables range over . The always-present core , with core , and optional are ordinary descriptions, each declaring all symbols used in its laws. Two signatures are compatible iff every shared symbol has the same category in both: basic fluent, defined fluent, or action. We require pairwise compatibility and take signature unions componentwise. Define the ambient signature and each module's private basic-fluent set by
We require for all distinct . Thus each noncore basic fluent has one declaring module, whose initializer supplies its values on loading. This ownership condition keeps the responsibility for initialization unambiguous. Core fluents remain visible; compatible actions and defined fluents may be shared. A defined fluent needs no initializing owner: its value requires support from the active static laws.
Loading a module introduces its private basic fluents into the state. These fluents have no values in the preceding state, so inertia cannot supply their initial values. An initializer specifies
All schematic expressions below stand for their finite ground instances, as in Section 2.1.
the values they may have immediately after loading, possibly depending on the current state. For example, a newly loaded calculator may start unregistered and without a stored answer.
For a fluent set , write for the set of consistent subsets of . Such a partial valuation may leave some fluents unassigned.
Definition 1 (Theory module). For a module identifier , a RAT theory module is , with ordinary description and an initializer
The input records the fluent values available before loading. The output is a set of permitted initial assignments. Each member is a complete assignment to . For every basic fluent , it contains exactly one of and . A loading successor must be causally explained using one such assignment together with the applicable laws (Section 4). The selected assignment fixes the new basic values; the laws can reject it, but cannot replace those values. We allow several assignments because the same loading action from the same source state may initialize a module in different ways. Initialization may depend on external conditions, such as service availability, that are not represented in the source state.
As an example, consider loading a connector module that attempts to connect to an external service. The connection attempt may succeed or fail without changing whether the connector itself is installed. If its outcome is not determined by the represented source state, we model both possibilities using the private basic fluent connected():
Let the core basic fluent mustConnect record whether loading requires a successful connection. The module declares this shared fluent and has the static constraint
Take no other fluents or laws. Inertia preserves mustConnect. When it is false, loading has two successors, one connected and one disconnected; when it is true, only the connected successor is allowed.
Definition 2 (RAT system and module actions). A finite RAT system is
For every module identifier , it reserves two ground action symbols, load() and unload(), with
Distinct identifiers give distinct loading actions and distinct unloading actions, and no loading action equals an unloading action.
Ordinary dynamic and nonexecutability laws specify these actions' world effects and when they are blocked. RAT also specifies how they change the active module set (Section 4.2).
3.3. Active action descriptions
Let be the set of active optional modules. The current signature and law sets are their unions with those of the core:
The active action description is , with , , , and .
Exactly the modules in K are active; inactive modules contribute neither signatures nor laws. A symbol disappears only when no active fragment declares it.
3.4. RAT configurations
A world state records fluent values. RAT also records the active module set, which determines the current action description.
Definition 3 (RAT configuration). A RAT configuration is
The ground actions are those present in the active description. A present action may still be blocked or have no successor. This definition specifies the components of a configuration; Section 4 determines which states satisfy the causal semantics. RAT records only the active modules and the world state.
3.5. Formalization of the running example
We formalize the running example in Section 3.1. We specify the core first, then the calculator. The only optional module identifier is the object constant , so . The core basic fluent taskDone records task completion. The action finishTask marks the task complete; load(cal) and unload(cal) add and remove the calculator. Its signature is
The core has the single dynamic law finishTask causes taskDone; its static and nonexecutability law sets are empty. Initially, the task is not finished and the calculator is not loaded:
The calculator’s private basic fluents are registered(cal) and answer(391): they record whether the calculator is registered and whether the answer 391 is stored. Its defined fluent ready(cal) records whether multiplication is allowed. Its three actions are register(cal), multiply(23,17), and clearAnswer(391). All terms are ground; the numeral arguments are object constants. Its signature is
Registration and the stored answer persist until changed. Readiness must instead reflect the current registration and task status; it must not remain true merely because it was true before the task finished. The calculator reads taskDone but never changes it. In the notation of Section 2.4, the calculator's static laws are
Its dynamic laws and nonexecutability law are
These are exactly the laws in , respectively.
Loading the calculator starts it unregistered and without a stored answer. Its initializer therefore returns the same singleton set for every input :
The initializer assigns neither taskDone, which belongs to the core, nor ready(cal), which is defined. The second static law makes ready(cal) false because the calculator is initially unregistered. This completes the RAT system .
Before loading, the calculator's three fluents and its multiplication action are absent:
With the calculator active, the selection instead gives
Section 4.5 derives the transitions of this system.
4. RAT transition semantics
We now define when an action takes a configuration to . We first specify which states satisfy the static causal laws of the core and active modules. We then specify which actions are enabled, how changes to , and which fluent values can hold after the action. The definition uses the nonmonotonic causal semantics of Section 2.3. When loading introduces new basic fluents, their initial values come from the module's initializer.
4.1. Static causal closure and admissibility
A complete assignment of fluent values need not be a possible state of the system. It must satisfy the static laws, and the truth value of each defined fluent must have causal support from those laws. Let be the active module set in a RAT system . The description has signature , with basic and defined fluent sets and . For , its basic projection keeps only the basic literals.
We treat the values of basic fluents as given when imposing these conditions on a state. For a complete assignment , define the following causal theory over :
The first set fixes the basic-fluent values to ; the second translates every static law of into a causal rule. Using the classical interpretation for the state from Section 2.2, define the causal static closure
Thus contains the complete states causally explained by : each must be the unique model of its own causal reduct. The set can be empty, contain one state, or contain several states. A state is causally admissible under iff ; we then call the configuration causally admissible as well.
4.2. Executability and module change
An action is enabled only if no nonexecutability law of blocks it. Loading an already active module and unloading an inactive one are also excluded. For a causally admissible configuration , with over , define the set of enabled actions by
Thus RAT uses the ordinary test from Section 2.4 and also checks the active status of the module being loaded or unloaded. Passing these tests does not guarantee a transition: the causal laws may allow no target state.
The action label determines the next module set. For and , define
Loading and unloading labels can occupy the action position in dynamic and nonexecutability laws, just like any other ground action. For example, fix and let the core basic fluents canLoad(M) and reserved(M) record permission to load M and whether a resource is reserved for it. The core may contain
Thus loading requires permission and causes a reservation, while unloading releases it.
4.3. Initialization and the single-step causal theory
Let be a source configuration of the RAT system , with active module set and state . For a ground action , let be the target active module set. We construct a causal theory over whose explanations give the possible target states . It describes one action from the fixed source, rather than a sequence of actions; we therefore call it a single-step causal theory.
Initialization. For each newly active module, choose an assignment allowed by its initializer. The set of combined assignments is
Each assignment gives the initial values of module 's private basic fluents. These fluent sets are disjoint, so the union of the assignments is consistent. If no module is new, . One RAT step loads at most one module; the set-based form is also useful when discussing several module changes in the later proofs.
Selecting the laws. Loading or unloading can change both the laws and the fluents in the action description. We therefore need to specify which laws describe the action and which laws describe the resulting state. The target state uses all static laws of , giving
The action’s dynamic laws come from , the description in force before the action. In particular, a newly loaded module supplies static laws for the target state, but no dynamic law for its own loading. Likewise, its nonexecutability laws cannot block its own loading, but can block its unloading while the module is active. For the selected action , consider a dynamic law
The formula is tested in the state before the action, while is tested in the candidate state after the action. The law can cause in only when both conditions hold.
Unloading may remove fluents mentioned in the law. We call a dynamic law target applicable if the fluent in its head and all fluents written in belong to . This tests whether the law can be evaluated there, not whether is true. The formula may still refer to a removed fluent, since its value is available in . No such additional test is needed for the static laws above: their symbols already belong to . The selected dynamic laws give
Combining the causes. Let be the set of all basic fluents present before and after the action. For an allowed initialization assignment , the single-step causal theory is
These are exactly four families of causal rules:
(i) Static rules. Each static law of contributes . Its body is evaluated in the candidate target state .
(ii) Dynamic rules. Each target-applicable dynamic law for in with contributes . The formula has already been tested in , while remains in the rule body to be tested in .
(iii) Inertia rules. For every basic fluent , take its literal true in and include . This includes all such fluents, even when a static or dynamic law may change their values. If remains true in , the rule supplies a cause for it. If is false in , the rule's body is false and contributes nothing to the causal reduct; the opposite value must have another cause.
(iv) Initialization rules. For every literal , include . These facts assign the new basic fluents, which had no values in to preserve by inertia. Incompatible laws reject this assignment rather than replace it.
Every fluent in is either in or newly introduced, so items (iii) and (iv) cover all of them. Fluents removed by the action do not belong to . Defined fluents have no inertia rules; their values must be supported by the static rules in item (i). All four families are evaluated together by causal explanation, without an order of application or a priority between them.
References to removed fluents. Target applicability checks the formula as written, not an equivalent simplification. The written fluent set is part of the law's interface. Removing a fluent needed in its head or after-state condition disables that effect rule, rather than blocking the whole action. For example, suppose unloading removes private basic but retains basic , and the source is . A dynamic law causing with is omitted because it refers to the removed fluent. With no other laws, the successor is . Replacing that condition by keeps the law and gives instead.
The formula is evaluated before unloading, so it may refer to private fluents that the action removes. We call a dynamic law for target-safe if its head and formula mention only fluents in for every active set containing in which the law is present. Since there are finitely many possible sets , this condition can be checked directly from the module signatures.
RAT also allows laws that are not target-safe. Such a law is omitted from a step if its head or mentions a fluent absent after unloading. The translation in Section 6 makes the same check using the fluents in the head and the unsimplified formula .
4.4. RAT transitions and executions
We can now define a transition for RAT.
Definition 4 (RAT transition). For causally admissible configurations and ,
iff all of the following hold:
(i) ;
(ii) ;
(iii) for some initialization assignment , for the state .
Static laws, dynamic laws, inertia, and initialization are solved jointly, including when a dynamic law's formula depends on fluent values in the state after the action. This definition is declarative: the conditions are simultaneous semantic constraints, not an operational evaluation order.
The last condition also ensures that the target is causally admissible. In the causal reduct for a target state , only static laws can support the truth values of defined fluents. If we replace the causes of basic literals by the facts , the reduct still has the same unique model. This is exactly the static admissibility test. The truth values of basic fluents may nevertheless change indirectly during the step.
These transitions form a labeled transition system: its nodes are the causally admissible RAT configurations, and an edge labeled connects two configurations exactly when they satisfy Definition 4 for action . For actions , that is, actions other than loading and unloading, does not change. Their transitions coincide with those of the ordinary description . Proposition 1 in Section 5.1 proves this for one step; Corollary 1 in the same section extends it to finite executions.
An action occurs when the transition relation holds, not merely when its label is available or enabled. From a fixed source configuration, the same action may have several successors because of alternative initializations or causal explanations. All these successors have the same module set.
A finite action sequence is an ordered tuple , where for . A finite execution, or path, is a sequence
with causally admissible configurations for , and each step satisfying Definition 4. We write when such a path starts at and ends at . The empty sequence leaves its starting configuration unchanged.
4.5. Transitions for the running example
For the instance in Section 3.5, , with , is causally admissible over its core vocabulary . Loading is enabled because the core has no blocking law and is inactive, with . No dynamic law in changes a fluent when is loaded. Inertia preserves , and initialization supplies . The calculator's static laws explain . Together these conditions give the unique target state
Hence . No calculator law is active before loading; its static laws apply afterward. Multiplication is visible but disabled because .
Registration causes registered(cal). Inertia preserves , and the static laws explain ready(cal). Multiplication then causes answer(391). For the configurations
the remaining execution is
The first two steps preserve ; unloading retains by inertia. Multiplication stores the answer but does not mark the task complete. The return to occurs because no core fluent has changed. It does not make unloading and reloading inverse operations: reloading from gives , not , because initialization does not restore the earlier registration or stored answer. Section 5.5 gives a further example of why unloading and reloading need not restore the earlier state.
After multiplication, we can also finish the task instead of unloading the calculator. From , the core action finishTask leads to
The calculator remains loaded and registered, and the stored answer is unchanged. Its static laws make ready(cal) false because taskDone is now true, so further multiplication is blocked. If we then unload the calculator, inertia preserves the now-true core fluent taskDone, giving
With or without the calculator, finishTask still makes taskDone true. The module reads this core fluent without preventing the core action or changing its effect on that fluent. Theorem 2 in Section 5.4 gives sufficient conditions for this preservation of existing behavior.
5. Properties of RAT
Changing a harness component can affect tasks that use other components. A designer may therefore want to know whether existing actions remain usable, whether the model determines one next configuration for a given action, and whether loading two tools in either order permits the same final configurations. For a RAT model, these questions can be answered by examining its causal laws and initializers. We give sufficient conditions for these properties, then define the corresponding reasoning tasks and establish their computational complexity.
Throughout this section, we use a finite RAT system as in Definition 2. Let be the active module set in . The symbols , , and are its active description, fluents, and actions. All transition relations and initializers refer to . The properties hold for every such system.
The proofs use a simple fact about literal-headed causal theories. Let be such a theory over atoms and an interpretation. Its causal reduct , defined in Section 2.3, contains the heads of the rules whose bodies are true in . Here those heads are literals or . Thus is the unique classical model of iff . The reduct must therefore specify exactly the truth value assigned by to each atom. We use this criterion to check causal explanations below.
5.1. Transitions without loading or unloading
Let be the active module set in the RAT system , and let be a ground action that neither loads nor unloads a module. The core and the modules in form the ordinary action description . We compare its states and transitions, defined in Section 2.4, with those of RAT.
For a state , its basic literals form the assignment . The ordinary action description and RAT use exactly the same causal theory to determine whether the static laws explain s with this basic assignment. Equation (1) and Equation (4) give
Both theories contain facts for the basic values in and all static laws of . Thus is a causally admissible state of the action description exactly when is a causally admissible RAT configuration. We now show that executing permits the same next states in both descriptions.
Proposition 1. Let and be causally admissible configurations of the RAT system , and let be a ground action. Then
Proof. Since , , . No fluent is added or removed, so every selected dynamic law is target applicable and there are no initialization facts. Comparing Equation (8) with Equation (2) gives . Ordinary executability, , tests whether a nonexecutability law blocks the action. RAT's in Equation (6) adds the module-status tests for loading and unloading. Since is neither, iff . The ordinary transition test in Equation (3) and the RAT test in Definition 4 therefore impose the same conditions, proving both directions.
Applying Proposition 1 to each action gives the following result for finite executions. No step changes K, and each step permits exactly the same next states in both systems. For an empty sequence, both executions consist of the initial state alone.
Corollary 1. Let be the active module set in the RAT system , and let be a finite action sequence with for . For any states that are causally admissible under , the chain
is a RAT execution iff
is an execution of the action description .
Thus, for sequences without loading or unloading actions, RAT and the action description have exactly the same paths, including all indirect effects permitted by its static laws.
5.2. When the next configuration is unique
After registering a tool or finishing a task, a harness needs updated status information before choosing its next action. If the model gives one next configuration, it can predict which tools are ready and which actions are enabled without maintaining several possible states. A designer can check sufficient conditions for this uniqueness before using the action. The result below gives a way to compute this configuration, or determine that no successor exists, once the initialization assignment is supplied. We first give a uniqueness condition for defined values when the basic assignment is fixed. We then add conditions on initialization and on the dependencies among effects to determine a unique next configuration.
Let be the active module set in the RAT system . We record dependencies in the static dependency graph , where
Here are defined fluents in , is a literal on , and is the condition of the displayed static law. An edge means that a law defining mentions in its condition. Only static laws with defined-fluent heads contribute edges. If this graph has no directed cycle, its fluents can be ordered so that each depends only on basic fluents and earlier defined fluents. We use such an order in the proof below. RAT also permits cyclic definitions. Acyclicity is only a sufficient condition for uniqueness.
Proposition 2. Let be the active module set in the RAT system , and let be the static dependency graph of . If is acyclic, then for every complete assignment to the basic fluents.
Proof. We show that any two states in must be equal. Fix a complete basic assignment , and let be two states. Their classical interpretations are and . The states agree on all basic fluents because both contain . Since is acyclic, choose an ordering of in which every static law with head or mentions only basic fluents and in its condition.
Suppose the states differ, and let be the first fluent in this order on which they differ. They agree on every fluent used in the conditions of laws with head or . The reducts of at and therefore contain exactly the same heads concerning . The facts supplied by concern only basic fluents, so these static heads are the only possible support for 's value. Each reduct must contain exactly one of . With neither, it would not have a unique model. With both, it would have no model. The same literal must therefore belong to both and , contrary to their assumed difference at . Thus , which proves .
Proposition 2 concerns the defined fluents after all basic values have been fixed. To obtain a unique next configuration, we also need to determine the next basic values. The following result extends the same dependency-order argument to both basic and defined fluents in the state after the action. The conditions below also cover indirect changes to basic fluents and dynamic laws whose effects depend on values after the action.
Proposition 3. Let be a causally admissible configuration of the RAT system , and let be an enabled ground action. Its target module set is . Suppose the following conditions hold:
(i) The combined initializer supplies one assignment, i.e., for an assignment .
(ii) There is an ordering of all fluents in , so that for every literal-headed rule in , implies .
Then, in the RAT system , there is at most one configuration satisfying
Proof sketch. The enabled action fixes , and assumption (i) fixes . We assign the fluents in the order of (ii), show that every successor must have these values, and then check the static constraints.
(i) Construct a candidate state. Start with the empty assignment . For each , let consist of the heads on of rules in whose bodies are true in , together with any literal in . By the ordering assumption, all these bodies use only fluents already assigned.
If , the reduct for any state extending contains both literals and has no classical model, so the construction stops. If , its literal must belong to every successor extending . If , cannot be a newly introduced basic fluent, because assigns each such fluent a literal. For a defined fluent, neither nor has causal support, so the reduct cannot determine its value uniquely and the construction also stops. The remaining case is a basic fluent present before and after the action. Only its inertia rule , with , can supply a literal on . Changing its value makes this rule's body false and leaves the new value without causal support. Thus its value must remain as in .
After these checks, the only possible assignments are
Each assigns exactly . If the construction reaches , the candidate state is .
(ii) Prove uniqueness. Every successor agrees with . If it agrees with , the ordering assumption gives the same set . The checks in (i) then either rule out a successor or force the assignment . By induction, stopping excludes every successor, and completing the construction leaves as the only possible successor state.
(iii) Check existence. If the construction yields a complete state let be its classical interpretation. Check every static constraint in . If for any such rule, no transition is possible. Otherwise the static and dynamic rules whose bodies are true in , together with the initialization facts, contribute exactly . The inertia rules contribute exactly . Therefore . This reduct has the unique model . Every defined literal of comes from a static rule. Together with facts for its basic literals, these rules also give , so is causally admissible. Definition 4 now gives the transition from to under . By the uniqueness argument in (ii), it is the only such transition. Thus a completed construction gives the unique successor exactly when satisfies all static constraints.
The construction in the above proof either returns the unique successor configuration or establishes that no such transition exists in .
In the running example in Section 3.5, order the fluents of as follows. If , the only fluent is taskDone. If , use taskDone, registered(cal), answer(391), ready(cal). The combined initializer supplies one assignment, as required by (i). Every selected dynamic rule has body , and the two static laws for ready(cal) refer only to taskDone and registered(cal), which occur earlier in this order. Thus (ii) also holds, and Proposition 3 applies to every enabled action in the running example.
5.3. Adding a module without changing existing behavior
A harness may add an optional component while an existing task continues. It then needs to know whether loading changes the task state or prevents an action that was previously possible. We first give conditions for a module that shares no fluents or actions with the current description. Section 5.4 then considers modules whose laws also refer to fluents of the core or other active modules.
Let be the active module set in the RAT system , and let be the module to be added. To check 's static laws separately, fix a complete assignment and define the local causal theory over by
The states causally explained by this theory form the set
Here is a complete state of , while is its corresponding classical interpretation. The basic-projection equality is already enforced by the facts for in . The causal explanation condition is the same as in Section 4.1.
We require to share no symbols with , and loading to have no dynamic effects specified by . We also require its initialization assignments to permit states under 's static laws. The following definition states these conditions.
Definition 5. Let be the active module set in the RAT system . An inactive module is an independent extension of if the following conditions hold.
(i) The fluent and action vocabularies of are disjoint from those of , i.e., , .
(ii) There is no dynamic law (caused if after load .
(iii) For every state such that is causally admissible, is nonempty. Each assignment to 's private basic fluents must permit at least one state under its static laws, i.e., , for every .
Since the core fluents belong to , condition (i) implies . Thus the initializer assigns all basic fluents of , and condition (iii) requires that each assignment can be extended to a state of . These are sufficient conditions for the results below, not requirements on every RAT module.
Because and share no fluents, their states can be checked separately and then combined by set union.
Lemma 1. Let be the active module set in the RAT system , and let be an independent extension of . For complete basic assignments over and over ,
Proof. The laws of mention only , while the laws of mention only . The reduct of the combined theory is therefore the union of their reducts over disjoint atom sets. A model of this union consists of one model from each reduct. It is unique exactly when both models are unique. This gives Equation (9).
When an independent module is loaded, no dynamic rule assigns a fluent in , and 's laws cannot mention fluents in . Their values after loading are therefore determined by the static laws of and inertia from the state before loading. Inertia does not fix the basic literals of as facts. Static laws may still support different basic values. To determine whether loading preserves , we therefore collect all states explained by these static laws and inertia. For a causally admissible state under , define
The superscript 0 indicates that no dynamic rules are included. The interpretation is . Since is causally admissible, evaluating these rules at gives exactly the literals of , so . The equality means that static laws and inertia permit only . By contrast, uses facts to fix the basic values and does not test whether they can change during loading.
For a causally admissible configuration and a ground action , define its possible successor states by
Each state in this set assigns the fluents in . The set is empty if no -transition is possible from .
Theorem 1(i) determines the possible values of after loading . Part (ii) compares execution of the same action with inactive and active, starting from states that agree on . It shows that does not change the possible next values of those fluents.
Theorem 1 (Preservation by an independent module). Let be the active module set in the RAT system , let be an independent extension of , and let be a causally admissible state under .
(i) If , then .
(ii) Let be a causally admissible state under . If , then for every ground action , .
Proof sketch. We separate the rules over from those over . Since these fluent sets are disjoint, the unique-model test can be applied to the two sets of rules separately, as in Lemma 1.
(i) Assume . During loading, the rules over are exactly the static laws of and inertia from . The rules over form , for an assignment . Hence . Definition 5(iii) supplies at least one such and . Therefore every occurs in a loading successor, and every loading successor restricts to such . This proves (i).
(ii) The assumption on gives , where . By Lemma 1, is causally admissible under 's static laws. The module cannot mention , so it neither blocks nor adds dynamic rules for . If is blocked by , both successor sets are empty. Otherwise the step theory separates into and 's static laws with inertia from . The latter rules permit itself, because their reduct at is the same as for its admissibility test. Thus every gives an extended successor . Conversely, if is an extended successor, its reduct over must have a unique model. Therefore belongs to . This proves both inclusions in (ii).
The causal explanations used in both parts also give causally admissible configurations, as established after Definition 4.
When loading is enabled, part (i) guarantees at least one successor because . In that case, all loading successors retain the values in exactly when . Part (ii) compares configurations that already agree on . If , the comparison instead uses that restricted state in place of .
Why shared interfaces need separate conditions. Consider a harness that loads a policy module after a task has finished. Let have one basic fluent taskDone and no laws. Let be the policy module. Its signature declares the shared basic fluent taskDone, but no private fluents. Its initializer returns , and its only law is caused \perp if taskDone. In the configuration , load(P)$ is enabled because $P$ is inactive and no nonexecutability law blocks loading. However, neither possible value of taskDone` gives a successor. If it is true after loading, 's constraint contributes to the reduct. If it is false, no rule supports . Thus loading has no successor. The policy module shares a fluent with , violating Definition 5(i). This example shows why merely refraining from assigning a shared fluent does not guarantee preservation. A constraint that reads the fluent can still prevent a transition.
5.4. Adding a module that reads existing fluents
A harness component may need to read the task state without changing which actions the task can perform or their possible results. In the running example, the calculator reads taskDone to determine ready(cal). Its vocabulary therefore cannot be disjoint from the core's. We give conditions under which adding such a module preserves the possible transitions on the fluents already in . The module may still update its own private fluents.
Let be the active module set in the RAT system , and let be a module to be added. Let contain the fluents of , and let contain its actions other than loading and unloading. The interface consists of the fluents that shares with . The sets contain the basic and defined fluents introduced by loading , while are pairwise disjoint. Specifically, , , , , , and .
We require the module not to cause or forbid a value in , block an action in , or prevent a transition because its private values cannot be assigned. The following sufficient conditions ensure this. We call a read-only extension over when they hold:
(i) Static laws determine the new defined values. Every static head belongs to Lit(), so the module adds no static constraint or static cause for a fluent in . There is an ordering for all fluents in , such that each law with head or has a body satisfying . For an assignment , put
Require for every such and every . For each fixed assignment , these laws therefore support exactly one of and . The supported literal may differ for different assignments .
(ii) Dynamic laws update private basic fluents consistently. Every dynamic head belongs to Lit(). For an action , every dynamic law in for has the form , where is tested before the action. For each state , let
Require for every , state above, and . The effects may assign only some private basic fluents. Each unassigned fluent retains its value by inertia.
(iii) Existing actions are not blocked. No law nonexecutable if in has .
(iv) Loading has an initialization choice. For every state for which is causally admissible, . By Definition 1, each allowed initial assignment is a complete assignment to . It contains exactly one of and for each , and no literals outside Lit().
The four conditions defining a read-only extension are sufficient for preservation, not restrictions on general RAT systems. Condition (i) permits several static laws to support the same literal, but requires the stated dependency order and exactly one supported value for each fixed assignment . Condition (ii) permits conditional updates to only some fluents in , provided the effects are consistent. The module must also permit initialization at every causally admissible state under , add no static constraints, and introduce no blocking laws for actions in .
For example, condition (i) permits the calculator's readiness to be specified by three laws:
The last two may both apply, but they support the same literal. These laws determine the same readiness value as the two laws in the running example. Condition (ii) likewise permits a single conditional effect without requiring a rule for its negation when the condition is false.
For an independent module, Section 5.3 uses to collect the local states permitted by the basic assignment . A read-only module also reads the interface , whose values must be supplied by a state . For each fixed and , condition (i) determines exactly one assignment to . Using the stated dependency order, define
Thus extends with basic assignment and the defined values supported by 's static laws. It denotes one state, not a set of states. If , the union is empty and .
Theorem 2 (Preservation by a read-only module). Let be the active module set in the RAT system , let be a read-only extension over , and let be a causally admissible state under . Write , , and let denote the private basic fluents introduced by .
(i) Actions of . For every basic assignment , is causally admissible under , and for every ground action ,
(ii) Loading. If and contains no law of the form
then
Proof sketch. We determine the private values and compare the reducts on . The laws of mention only , while the module's heads belong to . For these literal-headed causal theories and a complete state , its classical interpretation is a causal explanation exactly when the reduct is the literal set . Thus private heads cannot supply a missing literal on or remove a conflicting literal or .
Part (i). Let and . Since is causally admissible, its static laws and basic facts give the reduct . Adding and the heads gives exactly , so is causally admissible. Here are the assignments in the construction of . For , condition
(iii) leaves executability unchanged. If is blocked, both successor sets are empty. Otherwise, condition (ii) gives the consistent effects . An effect fixes its fluent's value. If it changes that value, the inertia rule for the previous value has a false body. Without an effect, inertia is the only rule that can support a value of that private basic fluent, since no static head belongs to . The resulting complete assignment is .
For every , condition (i) determines . Its step reduct is exactly that state, so it is an extended successor. Conversely, every extended successor has the private basic assignment . Removing its reduct heads on leaves exactly the step reduct of , evaluated at the restricted state on . This reduct must equal that restricted state and contain no . The restricted state therefore belongs to , proving both inclusions.
Part (ii). The step has no dynamic rules because contains no dynamic law for , and is not yet active. For each , initializer facts fix the values in . On , the step theory contains exactly the static laws of and inertia used to define . For each state explained by those rules, condition (i) determines . Conversely, every loading successor must use such a and , and its values on are fixed by the same construction. This proves the equality in (ii). The set is nonempty because and . In both parts, these causal explanations also give causally admissible successor configurations, as shown after Definition 4.
Part (i) says that the module neither removes nor adds a possible successor on for an action in . Starting from its extended state , a harness can therefore perform the same action sequences over as from , with the same possible state sequences on . Part (ii) describes loading itself. Under its hypotheses, loading has at least one successor. Every such successor agrees with on iff . Otherwise, the static laws already in may permit other values, as explained in Section 5.3.
5.5. Loading modules in either order
When a harness needs two new components, it may load either one first. We give conditions under which both orders are possible and lead to the same set of final configurations. Disjoint module vocabularies are not enough. An initializer may read fluents outside its module's signature, and the first load may change the values read by the second initializer. The conditions below ensure that each module offers the same initial assignments in either order.
Let be a causally admissible configuration of the RAT system , and let be a finite ground action sequence. Using the execution relation from Section 4, define the set of configurations reachable by this sequence as
Two distinct inactive modules are jointly independent over if each is an independent extension of and , . Loading adds its fluent values to the input of 's initializer. We require that removing those values from the input leaves the initializer's output unchanged, and impose the same requirement on 's initializer when is loaded. Formally, the initializers are unchanged by loading the other module over if
The first equality must hold for every state causally admissible under , and the second for every state causally admissible under . The intersections retain exactly the literals over . Each initializer may still offer several assignments or depend on values of these retained fluents.
Theorem 3 (Same final configurations in either loading order). Let be a causally admissible configuration of the RAT system , and let be jointly independent modules over the active module set . Assume the following conditions.
(i) Unique state for the given basic assignment, i.e., .
(ii) Both loads are enabled, i.e., .
(iii) Unchanged initialization choices, i.e., both equalities in Equation (10) hold.
(iv) No basic-fluent heads in static laws, i.e., every static head in is a defined literal or .
Then both loading sequences have an execution and the same set of final configurations, i.e.,
Proof sketch. We first show that either first load preserves and permits the second load. We then describe the final configurations explicitly. Definition 5(ii) excludes dynamic laws for and from . Together with condition (iv), this leaves inertia as the only support for basic fluents in , so their values cannot change. With those values fixed, condition (i) leaves as the only causally admissible state on . Thus , and either first load preserves on . Both loading actions belong to the core action set, while each module's action signature is disjoint from . Neither module can therefore add a dynamic or nonexecutability law for either loading action. The other module remains inactive, and the nonexecutability conditions in retain their truth values. Condition (ii) therefore keeps the second load enabled.
Equation (10) gives the second module the same initialization choices as at , because the intermediate state agrees with on . Definition 5(iii) ensures that each of these choices permits a local admissible state. The final configurations are precisely , where , , , and .
During the second load, the same argument preserves on . The first module's basic assignment also persists by (iv), while its defined values must have causal support from its static laws. Its resulting local state therefore belongs to or , respectively. Every final configuration has the form above. Conversely, choose any configuration of that form. Load each module with its specified assignment and local state, retaining the first module's state during the second load. At each step, the causal reduct separates over the disjoint fluent sets of the active descriptions and explains their union. Both orders therefore reach this configuration. Definition 5(iii) ensures that the initializer outputs and the required sets of local states are nonempty.
Without condition (iv) of Theorem 3, order can matter even with disjoint vocabularies and constant initializers. Let the core state be empty. Let introduce a basic fluent , the static law caused if , and the constant initializer . Let introduce a basic fluent , no laws, and initializer . All the other hypotheses hold. Loading and then can end in either or , because 's static law can support on the second step. If is loaded first, loading last fixes , so only is possible. Thus the two orders have different final states under standard causal semantics.
Reloading need not restore the previous state. Loading a module again uses its initializer, not its previous private state. For example, a module may keep a private basic fluent connected, initialized to false. Take an empty core state, no static or nonexecutability laws, the action law connect causes connected, and for every input. Then the following transitions exist,
The displayed source can be reached by performing the action connect after an earlier load. Unloading removes the value of connected, and the next load again initializes it to false. A harness that needs to preserve a connection or other private state must specify how that information is retained and restored.
5.6. Reasoning tasks and their computational complexity
A harness can use RAT to check a proposed transition, determine whether an action can occur, or find an execution that achieves a goal. We define these reasoning tasks and compare their computational costs.
Decision tasks. We consider a finite ground RAT system , with explicitly listed signatures and laws and propositional law conditions. Let be a causally admissible configuration of . A goal condition is a propositional formula whose atomic tests ask whether a module is active, a fluent is present, or a fluent is true. A truth test is false when the fluent is absent. We write when these tests make true at . For example, a goal may require that the calculator module cal is active and registered(cal) is true. We consider the following five tasks.
(i) Transition checking. Given a ground action and a candidate configuration , does hold?
(ii) Successor existence. Given a ground action , is there a configuration such that ?
(iii) Possible and necessary goal satisfaction. Given a ground action and a goal condition , possible satisfaction asks whether some configuration satisfies both and . Necessary satisfaction asks whether every configuration with satisfies . Note that, if no such configuration exists, then the necessary condition is still true.
(iv) Execution of a given action sequence. Given a sequence of ground actions from and a goal condition , can this sequence be executed from and end at a configuration satisfying ? Formally, does some satisfy and ? Taking asks only whether the sequence can be executed.
(v) Reachability. Given a goal condition , can any finite action sequence, including the empty sequence, take to a configuration satisfying ? This is unbounded reachability. For bounded reachability, a nonnegative bound is also supplied, and the sequence must contain at most actions.
Theorem 4 (Complexity of finite-ground RAT reasoning). For the finite ground RAT systems above, with initializer membership represented by propositional formulas, the five tasks have the following complexity.
(i) Transition checking is in P.
(ii) Successor existence is NP-complete.
(iii) Possible goal satisfaction is NP-complete, while necessary goal satisfaction is coNP-complete.
(iv) Execution of a given action sequence is NP-complete.
(v) Bounded reachability is NP-complete, while unbounded reachability is PSPACE-complete.
Proof sketch. The upper bounds use a polynomial test for a supplied transition. For the lower bounds of the finite search tasks, we use one reduction from propositional satisfiability. Given a propositional formula , take a core with no fluents or laws and one module whose only fluents are the private basic fluents . Its initializer permits every complete assignment, . Its only law is caused if . Loading from chooses an assignment . The initialization facts explain , and the constraint permits it exactly when . Thus loading has a successor iff is satisfiable. This construction has polynomial size.
(i) Transition checking. For a proposed transition from to with action , check the state vocabularies, source admissibility, , and . The target state fixes the initialization assignment . For loading , test whether . Let be the classical interpretation represented by . Since every causal head is a literal or , the remaining test is . It only evaluates rule bodies and compares literal sets. The same test on checks source admissibility. Target admissibility follows as shown after Definition 4. All checks are polynomial.
(ii) Successor existence. Guess a configuration and verify the transition by (i), giving the NP upper bound. The loading construction above gives NP-hardness.
(iii) Possible and necessary goal satisfaction. For possible satisfaction, guess a configuration, check its transition by (i), and evaluate there. This gives membership in NP, and in the loading construction gives hardness. A counterexample to necessary satisfaction is a verified successor where is false, giving membership in coNP. With , necessary satisfaction holds exactly when the construction has no successor, or equivalently when is unsatisfiable. This proves coNP-hardness.
(iv) Execution of a given action sequence. Guess the successive configurations, check each transition by (i), and test at the final configuration. The explicitly listed sequence makes this a polynomial-size certificate, giving membership in NP. The loading construction with the one-action sequence and proves hardness.
(v) Reachability. For the bound , guess at most actions and their successive configurations. Verify the transitions and the final goal. This gives membership in NP. For hardness, use the loading construction with and let require to be active. The goal is false initially and reachable within one step exactly when is satisfiable.
For unbounded reachability, let and . There are at most configurations, since each module is active or inactive and each fluent is absent, true, or false. A reachable configuration has a path of at most steps without repeated configurations. A nondeterministic search stores only the current and next configurations. Using (i) to verify each step gives membership in NPSPACE = PSPACE.
For hardness, encode propositional STRIPS planning, whose plan-existence problem is PSPACE-complete [30]. Use no optional modules and make the planning atoms core basic fluents. For each operator , with precondition and consistent effect set , add nonexecutable if and causes for each . With no static laws, these effects and inertia give exactly the planning transitions. Reaching its goal is therefore the same problem in RAT.
□
6. From RAT to causal theories and answer set programs
A RAT execution may change which fluents and laws are present. To represent it by one causal theory, we keep an atom for every declared fluent and use additional atoms to record which modules are active. We first define this representation of a configuration. We then add time indices and causal rules to represent a finite execution. Finally, we apply the causal-theory translation of Ferraris et al. [21] to obtain an answer set program.
Throughout this section, let be a finite ground RAT system. For an initial configuration and an action sequence of length , we denote the resulting causal theory by and the answer set program by . Both represent exactly the RAT executions from with those action labels.
6.1. Representing active modules in a fixed vocabulary
In the running example, records whether the calculator has been registered for use. This fluent belongs to the RAT state only while the calculator module is active. The translation instead uses one fixed set of atoms for all configurations. It keeps in that set even before loading and uses the atom to record whether the fluent is currently part of the RAT state.
Atoms and interpretations. The signature contains all fluents and actions declared in the RAT system . Introduce a fresh atom for each module . The fixed propositional vocabulary for configurations is
Represent a configuration by the classical interpretation
As in Section 2, an interpretation is the set of atoms assigned true. Thus records the values in , makes exactly the modules in active, and assigns false to every fluent outside .
Testing whether a symbol is present. For a fluent or action symbol declared in , define
Here means that declares , and an empty disjunction is . The formula is true in exactly when is present in . For a state formula , define . An empty conjunction is . This formula tests whether every fluent in is present. As discussed in Section 4, is taken before simplifying .
The running example. The fixed vocabulary for the calculator example is
For the configurations before loading and immediately after loading in Section 4.5, , . All fluent atoms are false in both interpretations. Nevertheless, is false in the first and true in the second. It distinguishes an absent registration fluent from one that is present and false. The same test applies to and , whereas .
This gives a fixed vocabulary and an interpretation for each configuration. It does not yet specify which transitions are possible. The following causal rules provide that part of the translation.
6.2. A causal theory for a finite execution
To represent actions, we use a copy of at each time . Causal rules relate these copies so that their interpretations describe successive RAT configurations. We first fix the action at each step. Corollary 3 then allows the actions to be chosen for planning.
Let be an integer. Fix a causally admissible initial configuration , and with . We use the following notation.
-
For each atom , its fresh copy records its value at time , where . For a formula over , replaces each atom by and preserves the Boolean connectives. In particular, , , and .
-
For each action and time , a fresh atom is true exactly when occurs between time and . For fluents and actions written with arguments, we place the time index before the arguments, as in registered (cal) and load (M).
-
A law of module applies only when holds. To write the same rule for core laws, we write for .
-
For each causally admissible configuration , inactive module , assignment , and time , introduce a fresh selector atom . It records the choice of when is loaded from at time .
The translation below produces a causal theory. Each part adds a specified set of rules to it. Their bodies test conditions on a candidate execution, and their heads must causally explain all its atom values.
Definition 6 (Causal translation of a finite RAT execution). Let be a finite ground RAT system, a causally admissible initial configuration, and a sequence of actions in . The theory is the union of the seven sets of ground causal rules in (a)–(g). Its atoms are
together with the selector atoms for every possible causally admissible configuration , inactive module , assignment , and time .
(a) Initial configuration. Fix the initial module set by
Include for every . For each , include . These constraints require the specified defined-fluent values without supplying their causal support, which must come from (c). The rules in (f) assign false to fluents absent at time zero.
(b) Fixed action occurrences. These facts require exactly the action specified by at each time .
(c) Static causal laws. These rules express within-state causes from the core and the modules active at that time. For every , law caused if in , and , include
(d) Dynamic causal laws and executability. These rules express effects and blocked actions using the laws active before the action. For every , law caused if after in , and , include
For the same range of , each law nonexecutable if in and , include
Here requires the law's module to be active before the action. The formula is tested at time , and at time . The two vis tests require all fluents in and the fluent of to be present after the action.
(e) Module changes and available actions. These rules implement and require the action to be present before it occurs. For each and , include
For every and , also include . The third and fourth rules support the value of at time when it agrees with the value at time . Loading supplies support for becoming active, and unloading for becoming inactive. No rule supports any other change on .
(f) Inertia and values for absent fluents. For each basic fluent , each , and , include
For a basic fluent present at both times, these rules support its value if it stays unchanged. A changed value instead needs support from a dynamic or static causal law.
For each fluent and , also include
These false values represent absence, not a value in the RAT state. The inertia rule requires to be present at both times, so it cannot carry such a value into a newly loaded module.
(g) Initializer selection. These rules choose one assignment permitted by the initializer whenever a module is loaded, and require its new basic fluents to have those values. Enumerate every causally admissible configuration of , every inactive module , and every time index with . We call a pair a loading context. It specifies the source configuration and the module being loaded. For each such context, use the selectors , where , and define
Here tests that the source is exactly and this step loads . The atom records the choice of assignment . When is true, exactly one selector for this context must be true. When it is false, every selector for the context must be false. Include the following rules, where the assignments range over .
The fourth line requires at least one choice and is included once per context, even if . In that case its empty conjunction is , so it becomes and forbids loading in that context.
Translation of the running example. Take from Section 3.5, , and . The initializer supplies the single assignment
The rules in (a), (b), and (f) fix the atom values at time zero and the action occurrence. The rules in (e) make true, and (g) makes true and every other selector false. After substituting these values and removing the resulting trivial rules, the causal theory for the four fluent atoms at time one is
The first rule gives inertia for the core fluent. The next two rules give the initializer values, and the last two are the calculator's static laws. The calculator contributes no dynamic law to this step because it is inactive before loading. The only causally explained interpretation assigns false to all four fluent atoms. Together with , it represents the configuration
derived in Section 4.5.
The initialization rules in (g) enumerate source configurations and assignment choices, so this finite translation may be exponentially large. For initializers that explicitly list assignments independently of the input state, the implementation in Section 7 uses selectors indexed only by module, assignment, and time. The Supplementary Material explains why this smaller encoding represents the same executions for that fragment.
To state correctness, we define how to recover a RAT execution from an interpretation of the translated theory. Activation atoms give the module set at each time, and literals over the resulting visible fluent set give its state. For an interpretation of the translated signature, define
Theorem 5 (RAT-causal-theory correspondence). For the finite RAT system , a causally admissible initial configuration , action sequence , and configurations ,
iff has a causally explained interpretation with
Proof sketch. We compare the rules that explain fluent values at each time with the single-step theory in Equation (8). A literal-headed causal reduct explains an interpretation exactly when it contains the literal true at each atom, contains no false literal, and does not contain . For a causal explanation of , abbreviate its decoded module set and state as and .
(i) Recover the initial configuration and action labels. The rules in (a) fix the values of , while (c) explains its defined-fluent values. The rules in (f) set absent fluents to false. Thus decoding gives . The facts in (b) fix every action label. The rules in (d)–(e) exclude blocked or absent actions and require .
(ii) Recover each transition. Suppose the decoded is causally admissible. If loads , the rules in (g) choose one . Otherwise put . On the time- copies of fluents in , the heads of are exactly those of , with time indices added. Here is the classical interpretation of the decoded state. The rules in (c), (d), (f), and (g) give, respectively, static rules, dynamic rules, inertia, and initializer facts. Hence this single-step theory explains . Only static rules can explain its defined-fluent values, so is also causally admissible under . Together with (i), these are the transition requirements of Definition 4. Induction gives the execution.
(iii) Represent a given execution. Conversely, assign the activation and present-fluent values from each , set absent fluents to false, and fix the action labels to . At every loading step, choose an initializer assignment used by that transition and make its selector true. Set every other selector false, including all selectors at steps without loading. The same comparison with the single-step reduct shows that (a)–(g) supply exactly the assigned literal for every atom and no . The resulting interpretation is therefore the unique model of its reduct, and it decodes to the given execution.
If no action loads or unloads a module, the construction represents executions of the one ordinary action description .
Corollary 2 (Executions with a fixed module set). Let be causally admissible in the RAT system , and let contain only actions in . Every causal explanation of has for all . As ranges over these explanations, the decoded state sequences are exactly the sequences, i.e.,
under the ordinary causal transition relation of Section 2.4.
Proof sketch. There is no loading or unloading, so the rules in (e) keep fixed and all initializer selectors are false. Theorem 5 then gives exactly the RAT executions at this fixed . Proposition 1 identifies each of their transitions with the ordinary transition under .
So far, the input specifies every action. Planning instead leaves the actions to be chosen. We replace only the occurrence facts, keeping all rules that determine which transitions are permitted.
Corollary 3 (Bounded planning encoding). Let be a finite ground RAT system with a causally admissible initial configuration , and let be an integer specifying the number of action steps. Replace (b) of Definition 6 by, for every and ,
and the exactly-one constraints, where range over ,
Call the resulting theory . Its decoded causal explanations are exactly all length- RAT executions from , including the action at each step.
Proof. For each action atom, the two occurrence rules support the truth value assigned by the candidate interpretation. The constraints require exactly one action atom to be true at each step. Each resulting sequence is covered by Theorem 5. Action visibility, nonexecutability tests, and all successor conditions remain unchanged.
6.3. Translation to answer set programs
The theory is now an ordinary nonmonotonic causal theory. Every head is a literal or , so we can apply the corresponding translation of Ferraris et al. [21, Sections 2.4 and 5.2]. We write the translation as a program with nested bodies, using the semantics in Section 2.5. The Supplementary Material gives the conversion to normal rules using auxiliary atoms and expands the proofs.
For a finite literal-headed causal theory over atoms , introduce two ASP atoms and for each . They represent its true and false values. In particular, is an ordinary ASP atom, not a negated expression. Write each Boolean body with negations only on atoms, and let replace by and by , preserving . The same notation applies to a literal head. The nested program contains
It also contains, for every ,
The body [G] may contain conjunctions and disjunctions, and not not [G] applies default negation twice to that entire expression. These bodies use the nested syntax, not the normal-rule syntax. Equation (13) requires exactly one truth value but does not provide support for either one. Double default negation tests the body in the candidate answer set. The rule becomes a fact in the reduct when that test is true, just as a true causal body contributes its head to the causal reduct. Replacing not not [G] by [G] would be incorrect. For example, explains p, whereas alone does not derive p.
For a classical interpretation , the corresponding set of ASP atoms is
The following is the Boolean literal-headed case of the cited result.
Theorem 6 (Causal-theory-ASP correspondence [21]). For every finite Boolean literal-headed causal theory and every classical interpretation over its signature,
Proof sketch. At , the translated nonconstraint rules give precisely the signed heads of as facts in the ASP reduct. The constraints reject conflicting or incomplete truth values and violated causal constraints. Minimality requires each chosen value to be supported by a fact. Thus the answer-set test holds exactly when uniquely determines .
Apply this translation to , giving
For an answer set , let be its classical interpretation. Equation (11) and Equation (12) then recover the modules and state at each time.
Corollary 4 (RAT executions represented by answer sets). Let be a finite ground RAT system, a causally admissible initial configuration, and the number of steps. Let be a sequence of ground actions in . The sequences
are exactly the RAT executions from with action sequence , where is the classical interpretation recovered from the answer set . Translating instead gives all length- executions from , with their selected actions.
Proof. Combine Theorem 6 with Theorem 5 and Corollary 3.
Auxiliary-atom translations can eliminate nested expressions while preserving answer sets on the original atoms [31]. For the programs used here, auxiliary atoms allow us to express every translated rule as normal rules and constraints, without disjunctive heads. The resulting programs can be evaluated by ASP solvers such as clasp, with grounding supplied by gringo [32]. The Supplementary Material gives the construction and proves that removing the auxiliary atoms recovers exactly the answer sets of .
7. Experiments with harness applications
We first compare RAT descriptions with recorded executions of DeepSeek Harness, Pi, and OpenHands. In these local tests, the finite RAT models predict the observed outcomes of tool calls and component changes in the three official implementations. We also examine which properties from Section 5 apply. We then use generated RAT models to test configuration computation and planning with ASP, measuring how grounding and search costs grow and when the implementation reaches its time or memory limit. The Supplementary Material lists the source repositories, tested commits, package versions, and test inputs. OpenAI Codex assisted with preparing and revising the instance-specific ASP encodings, test scenarios, and queries. Section S8 of the Supplementary Material describes the scope of this assistance and the verification procedures.
7.1. Three harness applications
A workflow here is a sequence of related tool calls and component changes. We give a complete RAT description of a DeepSeek file-editing workflow. Three Pi workflows and one OpenHands workflow illustrate other tool changes. For all examples, the Supplementary Material provides the complete RAT descriptions, ASP code, recorded test sequences, and detailed comparisons.
In the following tests, each counted operation is one attempt to call a tool, change a component, or write a file externally. A successful operation is carried out by the tested implementation. A rejected attempt is refused and leaves the represented configuration unchanged. From the configuration before each attempt, we compute the RAT successors by direct causal evaluation and by ASP. Each method must give exactly the next configuration obtained from the recorded observations for a successful operation, and no successor for a rejected attempt. Agreement on a rejection therefore counts as a correct prediction.
7.1.1. DeepSeek Harness: loading and unloading the observation-policy plugin
The workflow. An agent reads and changes an existing file through DeepSeek's file-tool plugin. It provides three operations. A read returns the file contents without changing them. A write overwrites the entire contents with the supplied text. An edit changes specified matching text within the file and leaves the rest unchanged.
DeepSeek also provides an optional observation-policy plugin. This is a separate plugin that checks whether the agent has observed the file's current version before allowing a write or edit. Reading the file establishes that observation. A successful write or edit updates the observation to the version it produces. A change made outside these tools makes the previous observation outdated.
Unloading the observation-policy plugin permits writes without this check. Reloading the observation-policy plugin starts a new observation record, so the agent must observe the file again. We use RAT to describe how loading and unloading the observation-policy plugin changes which writes are permitted.
The RAT representation. We represent the observation-policy plugin by the single module policy. The core records the file contents and describes the file operations, including those in the file-tool plugin.
Table 1 gives the recorded test sequence. Before Stage 1, the observation-policy plugin has not been loaded. The file document.txt contains one line, initially "alpha=1". To test a change made outside the agent's tool calls, the test program performs an external write. This operation overwrites the entire file directly through the filesystem, without calling the file-tool plugin.
The following description defines fluents, actions, laws, and initial values used for this case.
(1) Representing the file contents. We use seven basic fluents for the file contents used in the test. Fluent is true when the file contains the line "alpha=value", where value is entry of the list (1, 2, 3, 4, 5, external, external-again), numbered from zero. For example, means that the file contains "alpha=1". Static constraints below require exactly one of these fluents to be true. The complete assignment for contents is
The executable model uses these same seven indicators.
(2) Actions, fluents, and modules. The action read reads the file without changing its contents. The action write uses the file-tool plugin to overwrite the entire contents with the text represented by . The action external is an external write of that same text directly to disk, without calling the file-tool plugin. The action edit changes the unique occurrence of "alpha=1" to "alpha=2" and leaves the rest unchanged. The ordinary action set is
We use for the file-tool calls and for those that change the file.
See https://github.com/deepseek-ai/deepseek-harness, under packages/fs: tool-fs is the file-tool plugin and fs-observation-policy is the observation-policy plugin. The Supplementary Material records the tested commit.
Table 1: Recorded DeepSeek sequence. The filesystem service and file-tool plugin remain available throughout. Initially, the observation-policy plugin is absent and the file contains "alpha=1".
| Stage | Operations | Observed result |
|---|---|---|
| 1 | Load the observation-policy plugin, then write "alpha=2". | Loading succeeds. Write rejected because the file has not been observed. File remains "alpha=1". |
| 2 | Read, then edit "alpha=1" to "alpha=2". | Both calls succeed. File becomes "alpha=2". |
| 3 | External write of "alpha=external", then write "alpha=3". | External write succeeds, making the file "alpha=external". The subsequent write is rejected as the observation is outdated. |
| 4 | Read again, then write "alpha=3". | Both calls succeed. File becomes "alpha=3". |
| 5 | Unload the observation-policy plugin, perform an external write of "alpha=external-again", then write "alpha=4". | Unloading succeeds. External write makes the file "alpha=external-again". The subsequent write succeeds without another read, making the file "alpha=4". |
| 6 | Reload the observation-policy plugin, then write "alpha=5". | Reloading clears the observation record. Write rejected. File remains "alpha=4". |
| 7 | Read, then write "alpha=5". | Both calls succeed. File becomes "alpha=5". |
The private basic fluent seen of module policy records whether the agent has observed the file since the observation-policy plugin was loaded. The private basic fluent fresh records whether that observation is still current. The RAT system and its signatures are
For , let . We give all the laws below.
(3) Laws for file operations. The static laws in require exactly one file content.
The dynamic laws in assign every literal in when a write sets the file to . The edit action changes to .
The core has one nonexecutability law. The fixed edit arguments require content .
(4) Laws and initial values of the observation-policy plugin. The module policy has no static laws, so . Its dynamic laws in are
A successful file-tool call records the current version, while an external write makes that observation outdated. The laws in are
For every input partial valuation , the initializer is
(5) Initial configuration. The initial configuration is
The file contains "alpha=1", and the observation-policy plugin is absent. This is the configuration at the start of Table 1. Loading or unloading policy changes the restrictions on the core file actions, not the availability of the file-tool plugin itself.
Why the model gives the observed results. Loading or reloading the observation-policy plugin sets seen and fresh false, blocking the writes in Stages 1 and 6. Reading sets both true, permitting the edit in Stage 2 and the write in Stage 7. The external write in Stage 3 makes fresh false, blocking the subsequent write. In Stage 5, unloading the observation-policy plugin removes this blocking law, so the write succeeds even after an external write. Neither loading nor unloading the observation-policy plugin changes the file contents.
We compare four recorded DeepSeek sequences with the corresponding RAT descriptions in the Supplementary Material. One extends Table 1 with setup, file-tool removal, and a rejected read; another tests filesystem loss and restoration. The remaining two load the observation-policy and file-tool plugins in opposite orders. DeepSeek Harness carries out 31 of the 39 attempted operations and refuses eight calls. Direct causal evaluation and ASP each correctly predict every execution or rejection and the resulting configurations, including the file contents.
7.1.2. Pi: disabling tools, planning mode, and internal calls
We use three Pi workflows to distinguish disabling a tool, restricting file changes, and calling a tool that is not listed for direct use by the language model. Each workflow has its own RAT model.
- Disabling a registered tool. Pi’s official dynamic-tool example registers an echo tool that returns a message containing the supplied text. The test calls the tool, disables it, and enables it again. Direct calls are rejected while the tool is disabled, but its registered definition remains.
In RAT, registration loads module echo, whose private basic fluent echoEnabled is initialized true. Disabling sets this fluent false, and enabling sets it true. The action echo represents a call to the tool. The module contains the nonexecutability law
nonexecutable echo if .
The module stays loaded. Disabling the tool changes a fluent, rather than removing the action from the active description.
- Restricting file changes in planning mode. Pi's planning-mode extension permits reading and searching a task file but rejects a write and a shell command that would create another file. After leaving that mode, a write updates the task file.
See https://github.com/earendil-works/pi, packages/coding-agent/examples/extensions/dynamic-tools.ts. The Supplementary Material records the tested revision.
See https://github.com/earendil-works/pi, packages/coding-agent/examples/extensions/plan-mode/index.ts.
In RAT, module planPolicy remains loaded. Its basic fluent planMode is true in planning mode. Its nonexecutability laws then block the file-changing actions. For example, the action writeDone writes the updated task file and is blocked by
nonexecutable writeDone if planMode.
Leaving planning mode sets planMode false, permitting the write without unloading planPolicy.
- Calling a tool through another tool. We provide a local MCP search server and a query tool for this test. The query tool calls the search tool through Pi's MCP client. Pi does not list the search tool among the tools the language model can call directly. Instead, its codemode setting permits the internal call. The internal call succeeds, while a direct search call is rejected. If the server withdraws the search tool, the internal call also fails. Restoring the tool permits the internal call again.⁸
In RAT, module search provides three ground search actions for two fixed query strings. We write directSearch for the direct query using the first string, and internalSearch₁ and internalSearch₂ for the internal queries using the first and second strings, respectively. Its private basic fluent declared records whether the search tool is listed for direct calls. For every input partial valuation v, initialization and the direct-call restriction are given by
nonexecutable directSearch if .
Neither internal action has this restriction. Thus loading search permits internal queries but not direct ones. Server withdrawal is represented by unload(search), which removes all three search actions. Reloading restores the internal calls.
We test the echo-tool, planning-mode, and direct and internal search workflows in Pi and in the corresponding RAT descriptions. The three tests contain six, eight, and ten attempted operations, respectively. Pi carries out 18 operations and refuses six calls. Direct causal evaluation and ASP each correctly predict every execution or rejection and the resulting tool status and file contents.
7.1.3. OpenHands: removing a tool while retaining a report
The workflow. A task may use a temporary tool and save its result in a file. Removing the tool should prevent further calls, but need not delete the saved result. We test these two effects with an OpenHands MCP server that can add and remove an arithmetic tool during a session. The tool is named extra in the upstream test and returns twice its integer input.⁹
Our test creates REPORT.txt, registers this tool, and calls it with input 21, obtaining 42. A separate call to OpenHands' file editor writes that result into the report.¹⁰ The server then removes the arithmetic tool. Calling its previously saved SDK definition reaches the server and fails, while reading the report still returns the saved result. Registering the tool again allows another successful call.
The RAT representation. The core's basic fluents reportExists and reportHasResult record whether the report exists and contains the result. Registration loads module extra. The ground action extra21 represents the arithmetic call with the fixed input 21. The module's private basic fluent resultReturned records whether this call has returned 42 since the module was last loaded.
⁸The test follows Pi's MCP integration tests at https://github.com/earendil-works/pi, packages/coding-agent/test/suite/agent-session-mcp.test.ts.
⁹See https://github.com/OpenHands/software-agent-sdk, tests/sdk/mcp/test_mcp_tool_list_changed.py. The Supplementary Material records the tested revision.
¹⁰The workload combines MCP tools with native file tools, following the pattern in https://github.com/OpenHands/software-agent-sdk, examples/01_standalone_sdk/07_mcp_integration.py.
It is initially false and becomes true when extra21 occurs. For every input partial valuation , the signature, initializer, and effect law are
This law records the returned result for the fixed input, rather than implementing integer multiplication. A separate file-editor action makes reportHasResult true. The file editor accepts supplied text, so the model does not require the arithmetic call before writing.
Why the report remains available. Unloading extra removes its action and the private fluent resultReturned. Inertia preserves both core report fluents, so the saved report can still be read. Reloading restores the action and initializes resultReturned to false. Unlike the DeepSeek observation-policy plugin example, this example removes an action rather than changing when it is permitted. We compare the registered tools after each change notification has been processed. The model does not describe notification delivery.
We test the same sequence in OpenHands and in the corresponding RAT description. It contains 13 attempts at tool calls and registration changes, including writing and reading the report. OpenHands carries out 12 and refuses the call to the removed tool. Direct causal evaluation and ASP each correctly predict every execution or rejection and the resulting configurations, including the record of the returned result and the saved report.
7.1.4. Using the RAT properties in these examples
The properties in Section 5 apply to the RAT descriptions above as follows. The Supplementary Material gives the checks of their conditions.
-
Predicting one next configuration. The DeepSeek file-editing model, the three Pi models, and the OpenHands report model satisfy Proposition 3. Each initializer permits one assignment, and the laws satisfy the required dependency order. Thus each enabled action has at most one successor from a given configuration. Exhaustive evaluation of these finite models also confirms that every enabled action has a successor at every causally admissible configuration. A controller can therefore compute the next configuration predicted by the model before executing an enabled action.
-
Adding a tool without changing existing behavior. The OpenHands module extra adds the action extra21 and the private fluent resultReturned. Its effect law changes only this private fluent. It satisfies the independent-extension conditions of Theorem 1. In this model, loading extra preserves the report state and the possible effects of the existing file-editor actions on the two report fluents.
-
Restricting existing actions. The DeepSeek observation-policy plugin blocks writes without a current observation. Pi's planning-mode extension blocks file changes while planning mode is active. Both add nonexecutability laws for actions already provided by the core, so the extension theorems do not guarantee that those actions remain executable. A designer must instead check calls against the added laws. With the observation-policy plugin loaded, the DeepSeek model requires another read before writing after an external file change. The Pi model requires leaving planning mode before a write.
Each application model has one optional module, so these tests do not illustrate the two-module loading-order result.
7.2. Configuration computation and planning on generated models
We implement the causal rules of Section 6 directly in ASP for explicitly listed, state-independent initializer assignments. We test two reasoning tasks on generated RAT systems. For a RAT system , an initial configuration , and an integer , the tasks are as follows.
-
Configuration computation. Given an action sequence , find an execution , or establish that none exists.
-
Planning. Given a goal and a set of allowed actions, find an execution from that reaches the goal in at most actions. The goal specifies fluent values and may also require modules to be active or inactive in the final configuration.
In these models, the initial configuration and an executable action sequence uniquely determine the configuration after each action. For these models and the bounds below, one query with exactly actions decides the bounded planning task. The Supplementary Material gives the argument. Timings measure that query, not incremental search over lengths.
Three model families. We increase , the number of tools, providers, or jobs in the following models, so we can measure how computation time and ground-program size grow with the problem size. Complete laws and generation procedures are in the Supplementary Material.
-
Tool sequences. A harness may collect data, analyze it, and write a report using different tools. We model tools, each an initially unloaded module. Each tool must be loaded before use, and the tools must be used once each in a fixed order. Configuration computation follows a supplied sequence that loads, uses, and unloads each tool in that order. Planning must use all tools and leave them unloaded. Each tool requires a load, a use, and an unload, so we use . Loading and unloading need not follow the supplied sequence.
-
Provider choices. A harness may select optional services, such as search, translation, or storage, subject to compatibility requirements. We model candidate providers as initially unloaded modules. For each provider in index order, an action either loads its module or records that it is not selected. Planning chooses all decisions to satisfy a generated Boolean formula describing the allowed combinations, with . Configuration computation instead takes the choices as given and computes which modules are active after each action.
-
Resource allocation. A harness may reserve a separate workspace for each job in a batch. Let be the number of jobs and the number of workspaces. Each workspace is represented by an initially unloaded resource module. Jobs are assigned in order to distinct loaded resources, with no unloading or reuse. With , a plan needs loads and assignments, so . Configuration computation follows a supplied load-and-assign sequence for this case. We also test planning with and . There is then one fewer workspace than jobs, so no plan exists at any length.
Test cases and repetitions. A test case consists of a model and one of the two reasoning queries above. We use the following sizes and repetition counts.
-
Tools. We test , with one case per size for each reasoning task. Each case is run three times, giving 5 cases and 15 runs per task.
-
Providers. We test . At each size, 10 seeds generate 10 different instances. Each instance is tested once for configuration computation and once for planning, giving 50 cases and 50 runs per task.
-
Resources. Configuration computation uses and , giving 12 cases. Feasible planning uses , giving 8 cases with . Infeasible planning uses , giving 7 cases with . Each case is run three times.
Measurement protocol. We used a Mac mini with an Apple M4 processor (10 CPU cores), 24 GiB RAM, macOS 26.2, Python 3.14.3, and clingo 5.8.2. Queries ran sequentially, each in a fresh process with one solver thread. Each query had a 1,200-second wall-clock budget and an 8 GiB worker resident-memory stopping threshold. The supplement gives monitoring details and observed memory overruns. Reported times cover model construction, ASP generation, parsing and grounding, search, and result decoding. We report a median query time only when every run in its group finishes. Program size is the number of ground rules, including choice rules and constraints, not file size in bytes. The project webpage¹¹ provides the code, complete query inputs, per-run records, and reproduction instructions. The feasible planning case at was added in a separate batch using the same machine, frozen code, and measurement settings.
Results. Table 2 summarizes the 137 test cases and 211 runs for the three model families. The Cases column counts distinct queries, and Repeats gives the number of runs per case. Thus Runs is their product. The four outcome columns count runs as follows. For SAT, the solver finds an execution satisfying the query. For UNSAT, it reports that no execution satisfies the query. Timeout and Memory count runs stopped at the time or memory limit without either answer. Each run has exactly one of these four outcomes, so Runs = SAT + UNSAT + Timeout + Memory. Figures 2–4 show how time and ground-program size change with problem size. Full numerical tables are in the Supplementary Material.
Table 2: Query and run counts for the three generated model families. C denotes configuration computation and P planning.
| Family | Task | Cases | Repeats | Runs | SAT | UNSAT | Timeout | Memory |
|---|---|---|---|---|---|---|---|---|
| Tools | C | 5 | 3 | 15 | 12 | 0 | 0 | 3 |
| Tools | P | 5 | 3 | 15 | 9 | 0 | 3 | 3 |
| Providers | C | 50 | 1 | 50 | 40 | 0 | 0 | 10 |
| Providers | P | 50 | 1 | 50 | 19 | 12 | 1 | 18 |
| Resources, feasible | C | 12 | 3 | 36 | 36 | 0 | 0 | 0 |
| Resources, feasible | P | 8 | 3 | 24 | 24 | 0 | 0 | 0 |
| Resources, infeasible | P | 7 | 3 | 21 | 0 | 12 | 9 | 0 |
| Total | 137 | – | 211 | 140 | 24 | 13 | 34 |
Figures 2–4 compare the two reasoning tasks as increases.
-
Tool sequences require substantially more time for planning. Both tasks finish all three runs for . For , median times are 9.37 seconds for configuration computation and 194.84 seconds for planning. For , configuration computation takes a median 112.18 seconds, while all three planning runs time out during search. For , all runs stop during grounding at the memory threshold.
-
Provider choices are limited mainly by grounding. Both tasks finish all ten cases at each of . For , configuration computation has median query and grounding times of 206.12 and 202.44 seconds. Only one planning case finishes (UNSAT), while nine stop during grounding at the memory threshold. The hollow points “1 of 10 cases” report the completed case’s 342.46 seconds and 3,282,605 ground rules, not group averages. No case finishes for . Configuration-query SAT results concern execution of the given choices, not their compatibility.
-
Infeasible resource queries can require substantial search. All feasible cases finish all three runs. Median times are 2.19 seconds for planning at and 11.31 seconds for configuration
¹¹http://staff.ustc.edu.cn/~jianmin/rat/

Figure 2: Tool-sequence results, with horizon 3n. Each point summarizes three runs of one case. Bars show interquartile ranges. Triangles mark timeouts.

Figure 3: Provider results, with horizon n. Each group has ten distinct cases, run once each. The hollow points at n = 240 show the time and ground-rule count of the only completed planning query, not ten-case medians.

Figure 4: Resource-allocation results for n jobs. Each point summarizes three runs of one case. Feasible instances use h = 2n, and infeasible instances use h = 2n - 1. Triangles mark timeouts.
computation at . The three planning runs at each produce 214,161 ground rules. With one fewer resource, all runs return UNSAT for , taking a median 134.95 seconds at . For , all nine runs time out during search despite having at most 102,341 ground rules. Resource counting proves infeasibility, but these solver results remain timeouts. Even without the allocation goal, at most actions can execute, fewer than the tested . These timings therefore do not isolate the cost of checking the allocation goal.
Checking the reported answers. A separate checker validated all 140 returned SAT executions in the reported study, comprising 12,756 transitions, directly against the RAT laws. The Supplementary Material describes these checks, the resource-allocation infeasibility argument, and the absence of independent certificates for the 12 provider UNSAT results. Runs stopped by time or memory limits remain without a solver answer.
8. Related work
RAT studies actions that change the modules forming an action description. The closest work concerns modular action languages, theory change, and runtime reconfiguration.
Action languages and modular descriptions. Action languages and situation calculus provide accounts of action effects, inertia, and executability [1–5, 14]. RAT retains the ordinary causal semantics of a fixed action description. Its difference from modular action languages concerns when modules are composed. MAD imports modules, with renaming and redefinition, to construct an action description [15]. ALM organizes reusable knowledge into module hierarchies and separates a theory from the structure specifying its objects [16, 33]. RAT instead represents the currently active modules in each configuration. Loading and unloading are actions that change which vocabulary and laws apply during an execution. A module also supplies initial assignments for its private basic fluents when it is loaded. Thus MAD and ALM provide modular descriptions of a domain, whereas RAT directly describes changes to the active modules within that domain.
Theory change and software reconfiguration. Action-domain update and action-theory revision or contraction change descriptions according to constraints, preferences, or minimal-change criteria [18, 19]. Evolp Action Programs allow rules to be asserted during execution, including rules governing further change [17]. Runtime architectures, self-adaptation, and dynamic software updating address component replacement and state migration [34–37]. RAT has a narrower purpose. It describes execution with a fixed catalogue of modules whose membership in the active theory can change. It does not revise laws to accommodate new information, generate arbitrary rules, or give later rules priority over earlier ones. Nor does it implement software replacement or state migration. Instead, its causal laws specify the permitted state changes when declared modules are loaded or unloaded. RAT inherits the fixed-description causal semantics. Its additional results concern private state introduced or removed by module changes and conditions for preserving behavior or changing loading order. These results make no claim of greater expressive power than evolving programs.
Cordis and the DeepSeek Harness theory. The context paradigm underlying Cordis and DeepSeek Harness [38] represents component effects by context transformations with associated inverse operations. It also records dependencies so that component lifecycles can respond to changes in their providers. Its central questions concern undoing effects and restoring dependent components under stated recovery assumptions. RAT modules instead contain vocabulary, causal laws, and initializers. They specify which actions and states are possible before and after a module change, without prescribing a recovery procedure. In particular, unloading a RAT module need not reverse its previous effects, and RAT does not automatically restart work that depended on it. Cordis therefore provides an account of dependency management and recovery, while RAT provides an action-theory account of the changing laws and their permitted executions. Relating the two requires a model of the relevant Cordis operations, not merely identifying each plugin with a RAT module.
9. Discussion and conclusion
9.1. Why use RAT if causal theories suffice?
For a finite module catalogue and execution bound, Section 6 translates RAT into an ordinary causal theory. RAT therefore does not add expressive power in this setting. Its purpose is to let a designer describe component changes in terms of modules, rather than encode all their consequences directly as causal rules.
In a direct encoding, the designer must represent module activation, guard the corresponding laws, and account for initialization and the removal of private fluents. In RAT, the designer declares each module's vocabulary, laws, and initializer. The semantics and translation handle these consequences of loading and unloading uniformly. For example, removing the observation-policy plugin in Section 7.1 removes its observation record and the associated blocking laws, but leaves the file and file actions in the core. The module declaration states this separation explicitly.
RAT also states conditions for preserving behavior and changing loading order in terms of these declarations, as shown in Section 5. A designer can apply a result after checking its hypotheses for the RAT system at hand, without reproving it for the causal encoding. The translation then makes the same model available to existing reasoners.
9.2. Relation to harness architectures
In a RAT configuration , selects the active vocabulary and laws, while records the current fluent values. The applications in Section 7.1 use this distinction to separate removing a tool or its blocking laws from changing its visibility or permission under fixed laws. Modeling another harness requires deciding which operations change , possibly together with , and which change only . The designer then specifies the relevant vocabulary, laws, and initializers and checks the predicted transitions against the implementation.
9.3. LLM-assisted modeling and reasoning
We outline a possible workflow in which an LLM drafts RAT descriptions and proposes executions for formal checking. We have not evaluated its effect on modeling effort or planning time. Following LLM-assisted modeling and externally checked planning [39–41], we suggest three steps.
-
Describe the components. An LLM would draft fluents, actions, laws, and initializers from interfaces, documentation, and recorded executions. A developer would review these choices and test expected and forbidden transitions. Formal checks can detect inconsistent descriptions.
-
Propose and check an execution. For an approved RAT model and goal, the LLM would supply actions and complete configurations. A checker would verify every transition and the final goal. By Theorem 4, this takes polynomial time in the model, goal, and fully specified execution under the stated input representation. Supplying only the actions leaves an NP-complete problem of finding suitable configurations. A failed check can guide a revised proposal.
-
Compare with execution. In this proposed workflow, a runtime checker would compare each observed transition with the RAT model. If the successor is permitted but differs from the proposed configuration, it would check the remaining execution from the observed successor before deciding whether to replan. An observation outside the model would require reviewing the model.
9.4. Limitations
-
Language and execution. RAT does not directly describe concurrent or overlapping tool calls. Each step contains one action, so representing a call that remains in progress requires explicit start and finish actions and additional state. RAT also cannot load a module outside the declared catalogue. It has no built-in account of unfinished requests, resource commitments, or recovery when a component disappears. Such behavior needs additional laws or an extension of the semantics.
-
Modeling and reasoning cost. Writing a faithful RAT model requires identifying the relevant state, effects, blocking conditions, and initialization behavior. Tool interfaces alone do not provide this information, and formal checks cannot establish that the chosen laws match the software. Reasoning can also be expensive. Finding an execution remains hard even when checking a fully specified execution is efficient (Section 5.6). The experiments in Section 7.2 show that both grounding size and search time can limit the ASP implementation. These measurements evaluate this encoding and solver, without comparison against alternative encodings or solvers.
9.5. Future work
RAT describes how actions change an action theory. A proposed extension, Harness Action Theory (HAT), asks what happens to unfinished work when that theory changes. Replacing a provider, for example, does not complete a request already sent to it or release resources held by that request. HAT would record provider choices, performed actions, and recovery information, so that removal can account for work that must finish or be recovered first.
9.6. Conclusion
RAT is an action theory in which actions can change the action theory itself by loading and unloading declared modules. It retains ordinary causal semantics when the active modules remain fixed. Its results give sufficient conditions for at most one next configuration, preservation of existing behavior, and the same possible final configurations under either loading order. For finite RAT systems, the complexity results and the causal and ASP translations provide a basis for execution checking and bounded plan search. RAT thus allows a designer to specify component changes and analyze their effects on a harness's available actions, possible executions, and reachable goals.
Data and code availability
The project webpage, http://staff.ustc.edu.cn/~jianmin/rat/, provides the code, Supplementary Material, and experimental records. The downloads include RAT models, causal and ASP evaluators, harness observations, query inputs, returned executions, and checking and plotting scripts. Source hashes and pinned dependencies identify the tested versions. Instructions distinguish checking saved records from running the harnesses or measurements again. No production user data or authenticated service data were collected.
Declaration of generative AI and AI-assisted technologies in the manuscript preparation process
During the preparation of this work, the author used OpenAI Codex to assist with manuscript organization, drafting and revision of text, improvement of language and readability, IATEX editing, and preparation and revision of the ASP encoding, scenarios, queries, and accompanying documentation. After using this tool, the author critically reviewed, verified, and edited all AI-assisted material as needed and takes full responsibility for the content of the publication.
References
[1] M. Gelfond, V. Lifschitz, Action languages, Electron. Trans. Artif. Intell. 3 (1998) 195–210.
[2] E. Giunchiglia, V. Lifschitz, An action language based on causal explanation: Preliminary report, in: Proceedings of the 15th National Conference on Artificial Intelligence (AAAI 1998), 1998, pp. 623–630.
[3] N. McCain, H. Turner, Causal theories of action and change, in: Proceedings of the 14th National Conference on Artificial Intelligence (AAAI 1997), 1997, pp. 460–465.
[4] R. Reiter, Knowledge in Action: Logical Foundations for Specifying and Implementing Dynamical Systems, MIT Press, Cambridge, MA, 2001.
[5] C. Baral, Knowledge Representation, Reasoning and Declarative Problem Solving, Cambridge University Press, Cambridge, 2003.
[6] L. Wang, C. Ma, X. Feng, Z. Zhang, H. Yang, J. Zhang, et al., A survey on large language model based autonomous agents, Front. Comput. Sci. 18 (6) (2024) 186345.
[7] Y. Qin, S. Hu, Y. Lin, W. Chen, N. Ding, G. Cui, et al., Tool learning with foundation models, ACM Comput. Surv. 57 (4) (2025) 101:1–101:40.
[8] S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. Narasimhan, Y. Cao, ReAct: Synergizing reasoning and acting in language models, in: Proceedings of the 11th International Conference on Learning Representations (ICLR 2023), 2023.
[9] J. Li, X. Xiao, Y. Zhang, C. Liu, L. Zhao, X. Liao, et al., Agent harness engineering: A survey, Online preprint (May 2026).
URL https://picrew.github.io/LLM-Harness/
[10] DeepSeek AI, DeepSeek harness architecture, Online documentation, Accessed 9 October 2026 (2026).
URL https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/architecture.md
[11] Earendil Inc., Pi coding agent SDK documentation, Online documentation, Accessed 9 October 2026 (2026).
URL https://pi.dev/docs/latest/sdk
[12] OpenClaw Foundation, Gateway architecture, Online documentation, Accessed 9 October 2026 (2026).
URL https://docs.openclaw.ai/concepts/architecture
[13] OpenAI, Codex app server, Online documentation, Accessed 9 October 2026 (2026).
URL https://learn.chatgpt.com/docs/app-server
[14] E. Giunchiglia, J. Lee, V. Lifschitz, N. McCain, H. Turner, Nonmonotonic causal theories, Artif. Intell. 153 (1–2) (2004) 49–104.
[15] V. Lifschitz, W. Ren, A modular action description language, in: Proceedings of the 21st National Conference on Artificial Intelligence (AAAI 2006), 2006, pp. 853–859.
[16] D. Inclezan, M. Gelfond, Modular action language ALM, Theory Pract. Log. Program. 16 (2) (2016) 189–235.
[17] J. J. Alferes, F. Banti, A. Brogi, From logic programs updates to action description updates, in: Proceedings of the 5th International Workshop on Computational Logic in Multi-Agent Systems (CLIMA V), 2005, pp. 52–77.
[18] T. Eiter, E. Erdem, M. Fink, J. Senko, Updating action domain descriptions, Artif. Intell. 174 (15) (2010) 1172–1221.
[19] I. J. Varzinczak, On action theory change, J. Artif. Intell. Res. 37 (2010) 189–246.
[20] V. Lifschitz, H. Turner, Representing transition systems by logic programs, in: Proceedings of the 5th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR 1999), 1999, pp. 92–106.
[21] P. Ferraris, J. Lee, Y. Lierler, V. Lifschitz, F. Yang, Representing first-order causal theories by logic programs, Theory Pract. Log. Program. 12 (3) (2012) 383–412.
[22] X. Wang, B. Li, Y. Song, F. F. Xu, X. Tang, M. Zhuge, et al., OpenHands: An open platform for AI software developers as generalist agents, in: Proceedings of the 13th International Conference on Learning Representations (ICLR 2025), 2025.
[23] G. Brewka, T. Eiter, M. Truszczyński, Answer set programming at a glance, Commun. ACM 54 (12) (2011) 92–103.
[24] M. Gelfond, V. Lifschitz, The stable model semantics for logic programming, in: Proceedings of the Joint International Conference and Symposium on Logic Programming (ICLP/SLP 1988), 1988, pp. 1070–1080.
[25] M. Gelfond, V. Lifschitz, Classical negation in logic programs and disjunctive databases, New Gener. Comput. 9 (3–4) (1991) 365–385.
[26] V. Lifschitz, L. R. Tang, H. Turner, Nested expressions in logic programs, Ann. Math. Artif. Intell. 25 (3–4) (1999) 369–389.
[27] M. Gebser, T. Schaub, S. Thiele, GrinGo: A new grounder for answer set programming, in: Proceedings of the 9th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR 2007), 2007, pp. 266–271.
[28] M. Gebser, B. Kaufmann, A. Neumann, T. Schaub, clasp: A conflict-driven answer set solver, in: Proceedings of the 9th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR 2007), 2007, pp. 260–265.
[29] J. Ji, F. Lin, Turner's logic of universal causation, propositional logic, and logic programming, in: Proceedings of the 12th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR 2013), 2013, pp. 401–413.
[30] T. Bylander, The computational complexity of propositional STRIPS planning, Artif. Intell. 69 (1–2) (1994) 165–204.
[31] D. Pearce, V. Sarsakov, T. Schaub, H. Tompits, S. Woltran, A polynomial translation of logic programs with nested expressions into disjunctive logic programs: Preliminary report, in: Proceedings of the 18th International Conference on Logic Programming (ICLP 2002), 2002, pp. 405–420.
[32] M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub, Multi-shot ASP solving with clingo, Theory Pract. Log. Program. 19 (1) (2019) 27–82.
[33] D. Inclezan, A CLib-inspired library of commonsense knowledge in modular action language ALM, in: Proceedings of the 2015 AAAI Spring Symposium on Logical Formalizations of Commonsense Reasoning (Commonsense 2015), 2015, pp. 82–88.
[34] J. Kramer, J. Magee, The evolving philosophers problem: Dynamic change management, IEEE Trans. Softw. Eng. 16 (11) (1990) 1293–1306.
[35] P. Oreizy, N. Medvidovic, R. N. Taylor, Architecture-based runtime software evolution, in: Proceedings of the 20th International Conference on Software Engineering (ICSE 1998), 1998, pp. 177–186.
[36] D. Garlan, S.-W. Cheng, A.-C. Huang, B. Schmerl, P. Steenkiste, Rainbow: Architecture-based self-adaptation with reusable infrastructure, Computer 37 (10) (2004) 46–54.
[37] M. Hicks, J. T. Moore, S. Nettles, Dynamic software updating, in: Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2001), 2001, pp. 13–23.
[38] Y. Shi, W. Zhang, T. Cui, A programming paradigm for spatiotemporal composability, arXiv preprint arXiv:2608.25512 (2026). URL https://arxiv.org/abs/2608.25512
[39] L. Guan, K. Valmeekam, S. Sreedharan, S. Kambhampati, Leveraging pre-trained large language models to construct and utilize world models for model-based task planning, in: Advances in Neural Information Processing Systems (NeurIPS 2023), 2023, pp. 79081–79094.
[40] S. Kambhampati, K. Valmeekam, L. Guan, M. Verma, K. Stechly, S. Bhambri, L. P. Saldyt, A. B Murthy, Position: LLMs can't plan, but can help planning in LLM-modulo frameworks, in: Proceedings of the 41st International Conference on Machine Learning (ICML 2024), 2024, pp. 22895–22907.
[41] X. Lin, Y. Wu, H. Yang, Y. Huang, Y. Zhang, J. Ji, Y. Zhang, Improving efficiency of answer set planning with rough solutions from large language models for robotic task planning, in: Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence (IJCAI-25), 2025, pp. 4570–4578.