## 3 Domain Representation
In our case, time steps were associated with the time elapsed in seconds from the reference time. The amount of time left before a fluent \(f\) returns to its default value is formalized by a literal \(left(f,l,t)\), intuitively expressing that there are \(l\) time units left (or seconds in our case), at time \(t\), before \(f\) returns to its default (negative) value. Suitable defaults make it possible to calculate the amount of time left at any time step of interest. Simple extensions of the laws we discussed in Section 2 reset the amount of time left when necessary, e.g., if an observation is received that the subject was exposed to a sick individual and, as a result, the isolation is extended. This approach makes it necessary for the extension of relation _time_ to be determined by the rules of the program, and based on observed needs. Note that this is different from typical approaches for reasoning about dynamic domains in ASP, where one relies on the _time_ relation to be defined as part of the input. Consider a case in which a certain set of conditions \(\Gamma(t)\) that are true at time \(t\) causes default fluent \(f\) to become true and remain true for duration \(d\). In our approach, this is captured by the following set of rules:  
\[ \begin{array}{l}h(f,T)\leftarrow\Gamma(T).\\ left(f,d,T)\leftarrow\Gamma(T).\\ newtime(T,T+d)\leftarrow\Gamma(T).\end{array}  \tag{10}\]  
The first two rules modify the truth value of the fluent and set the amount of time left before the fluent reverts to its default value. The third rule is responsible for extending the timeline: it states that a time step \(T+d\) should be added to the timeline if not already present. (The role of the first argument will become clear later). The timeline is extended in order to allow for the reasoning component to reason about the point at which the default will revert to its default value (that is, unless of course other causes intervene to prevent that). The formalization of the behavior of durative fluents is thus given by (9) together with:  
\[ \begin{array}{l}left(F,V-E,T^{\prime})\leftarrow\\ \text{not }inertial(F),\\ next(T,T^{\prime}),\\ E=T^{\prime}-T,V-E\geq 0,\%\text{ elapsed time}\\ left(F,V,T),V>0,\\ \text{not }willHaveOtherLeftValue(F,T^{\prime}).\\ \\ willHaveOtherLeftValue(F,T^{\prime})\leftarrow\\ \text{not }inertial(F),\\ next(T,T^{\prime}),\\ left(F,V,T),\\ left(F,V^{\prime},T^{\prime}),\\ E=T^{\prime}-T,V-E\geq 0,\%\text{ elapsed time}\\ V^{\prime}\
eq V-E.\\ \\ left(F,0,T^{\prime})\leftarrow\\ \text{not }inertial(F),\\ next(T,T^{\prime}),\\ left(F,0,T),\\ \text{not }willHaveOtherLeftValueThan0(F,T^{\prime}).\\ \\ willHaveOtherLeftValueThan0(F,T)\leftarrow\\ \text{not }inertial(F),\\ time(T),\\ left(F,V,T),\\ V\
eq 0.\\ \\ h(F,T^{\prime})\leftarrow\text{not }inertial(F),left(F,V,T),V>0,next(T,T^{\prime}),h(F,T), \text{not }h(\
eg F,T^{\prime}).\\ \end{array}  \tag{11}\]  
The first four rules of (11) ensure that the amount of time left is correctly updated from one time step to the next. The last rule captures the inertial behavior of default fluents while they are set to true for a certain amount of time. Due to our use of a sparse representation of the timeline, we also need to refine the definition of relation \(next\), which is accomplished by the rule:  
\[ \begin{array}{l}next(T,T^{\prime})\leftarrow\\ time(T),\\ T^{\prime}=\#min\{S\;:\;time(S),\;S>T\}.\\ \end{array}  \tag{12}\]  
Note the use of clingo's aggregate \(\#min\) to identify the time step \(T^{\prime}\) that immediately follows \(T\). The ASP-based reasoning component of our application is designed to take in input a set of observations about the truth value of fluents. In practice, the observations encode the results and types of tests, information about close contacts and travel, self-reported or observed symptoms, etc. Following the approaches from the related literature (e.g., [22]), we represent observations by means of statements of the form  
\[obs(l,t) \tag{13}\]  
where \(l\) is a fluent literal and \(t\) is a time step.