CASE2019 Task Scheduling SMT
CASE2019 Task Scheduling SMT
net/publication/333132948
CITATIONS READS
0 125
3 authors:
Georgios Fainekos
Arizona State University
120 PUBLICATIONS 3,355 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
Multi-fidelity Simulation Optimization with Model Mismatch using Gaussian Process Regression View project
All content following this page was uploaded by Mohammad Hekmatnejad on 24 September 2019.
Abstract— There are many natural and engineering processes has been demonstrated that reachability based methods for
which require scheduling under nonlinear cost functions. Cur- scheduling can outperform classical scheduling methods as
rent tools and theories only support scheduling under linear cost the problem size instance increases [6].
functions. In this paper, we model the scheduling problem under
nonlinear costs using Priced Timed Automata (PTA). We also However, many important scheduling problems require
present a translation from PTA to Satisfiability Modulo Theory cost functions that go beyond just optimizing the makespan.
(SMT) formulas whose models correspond to schedules which In order to address such more complex problems, the mod-
satisfy the scheduling constraints under a given cost bound. We eling framework of Weighted (WTA) [7] or Priced Timed
present a case-study for batch scheduling in bio-manufacturing. Automata (PTA) [8] was utilized. PTA have costs associated
We compare our results with UPPAAL CORA when the costs
are linear. We show that the SMT based solution outperforms with the instantaneous transitions as well as with the duration
the UPPAAL CORA solver when the length of the schedule is of the stay in each state. Hence, the scheduling problem
bounded. becomes one of computing a path of minimum cumulative
cost. This line of work led to the development of schedul-
I. INTRODUCTION
ing toolboxes such as UPPAAL CORA [9] and to several
The motivation for looking into the scheduling problem practical applications, e.g., [10], [11], [12].
under nonlinear cost functions comes from the domain of Contribution: In this paper, we provide a versatile ap-
biomanufacturing. Figure 1 shows the typical cell growth proach to the scheduling problem under nonlinear costs. We
count as a function of fermentation time for two bio-process model tasks and machines as PTA annotated with nonlinear
types, batch and fed-batch. It can be observed how the cells cost functions on the clock variables. By modifying the
die if the process duration is beyond a time threshold. This framework proposed in [13], we translate the PTA reacha-
translates into the need to consider non-linear cost functions bility problem to an SMT formula whose models correspond
for the process yield. Hence, such cost functions enable us to feasible schedules that satisfy a given cost constraint. A
to consider schedules avoiding “over-waiting times” of the bisection method can be used to compute optimal schedules.
cells in the process, which causes death of cells leading to We demonstrate that the resulting framework based on SMT
loss of yield, i.e., the system throughput. solvers can outperform UPPAAL CORA when the costs are
linear functions of the clocks. Finally, we have released a
100 100 publicly available tool called CEPTA2SMT1 .
80 80
Viable cells
Viable cells
Viability %
Viability %
II. PRELIMINARIES
A. Priced Timed Automata
2 4 6 8 Days 2 4 6 8 Days
In this paper, we adopt and adapt the PTA definitions
Fig. 1: Examples of typical cell growth (yield) using different cultivation methods (for from [14]. Priced Timed Automata (PTA) is an extension
actual data see [1]). Left: Batch; Right: Fed-Batch. of timed automata which supports costs (prices) on states
and transitions which may depend on time. Prices at states
Existing tools in the biomanufacturing domain can only are rates of delays, but transition prices are constants. Let
schedule decisions with linear approximations of the prod- C be a set of clocks, then X (C) is the set of conjunctive
uct yield as a function of the product schedules [2], [3]. formulas in which atomic clock constraints are of the form
Therefore, there is a lack of methods which can address c ./ r and c1 − c2 ./ r for c, c1 , c2 ∈ C, r ∈ R+ , and
the original nonlinear scheduling problem. Here, we provide ./∈ {>, <, =, ≥, ≤}.
a general solution to the same problem. Early on [4], [5], Definition 1: A priced timed automaton A is a tuple
it was realized that scheduling problems can be modeled hL, l0 , C, A, E, I, PL , PE i where: L is a finite set of loca-
using communicating timed automata and that they can be tions, l0 is the initial location, C is a set of clock variables,
solved using reachability analysis (by solving the shortest A is a set of actions or labels.
path problem). In the original problem formulation, the goal Here, E is a set of transitions s.t. E ⊆ L × X (C) × A ×
is to compute a schedule that minimizes the makespan (i.e., 2C × L, and hl, φ, a, γ, l0 i represents a transition from l to
the time by which all the jobs are completed). In fact, it l0 taking action a. Also, φ and γ represent clock constraints
and clocks to be reset to zero, respectively by taking the
This work was partially supported by NSF-CMMI 1829238.
1 The authors are with the School of Computing, Informatics, and transition. I : L → X (C) assigns invariants to locations.
Decision Systems Engineering, Arizona State University, Tempe, USA
{mhekmatn,Giulia.Pedrielli,fainekos}@asu.edu 1 https://cpslab.assembla.com/spaces/bio-manufacturing/
Here, PE : E → R+ assigns constant prices to transitions, states, combined prices, and elapsed times, respectively. The
and PL : L → Ψ(C) assigns a nonlinear function of clocks parallel composition operator can be easily defined as an
to locations. Note than for UPPAAL CORA the function Ψ extension upon the timed automata parallel composition [15].
can only be a constant. See [16] for example for a similar definition without discrete
In this work, we consider actions as blocking send/receive update variables.
signals over channels for inter-communication purposes (syn- We treat actions as signals in composite PTAs to syn-
chronization among composite PTAs). For example, setup! chronize PTAs using blocking send and receive signals over
and setup? are send and receive signals, respectively over communication channels. We let a set of global update
channel setup. Also, later we let actions to include ε where variables V g to be used among PTAs, too.
it represents the absence of any action. A transition T =
hl, φ, a, γ, l0 i is valid only if the set of clock constraints φ is B. Satisfiability Modulo Theory (SMT)
satisfiable, and then all clocks in γ must be reset to zero. The SMT problem is checking if a given closed logical
Definition 2: A trace over PTA A = formula φ is satisfiable with respect to some background
hL, l0 , C, A, E, I, PL , PE i is a sequence of locations theory T which restricts the range of used symbols in φ.
a0 ,γ0 ,p0 ,t0 a1 ,γ1 ,p1 ,t1
and transitions i.e., p = l0 −−−−−−−→ l1 −−−−−−−→ In other words, the SMT problem for φ and T is about the
a2 ,γ2 ,p2 ,t2 an−1 ,γn−1 ,pn−1 ,tn−1
l2 −−−−−−−→ ... −−−−−−−−−−−−−−→ ln where existence of a model of T that satisfies the formula φ [17].
∀i ∈ N, i < n: Initially, all the clocks are set to zero An SMT solver is a software that implements a procedure
C0 = 0; At each time-step i the clock values are updated as for satisfiability modulo for some given theory. SMT solvers
Ci = (Ci−1 + ti−1 )[γi−1 = 0] meaning that the value of all come with different underlying logics, background theories,
the clock variables in Ci−1 increases by ti−1 except the ones input formulas and interfaces. In this paper, we use the high-
in γi−1 which reset to zero; |p| = n is the length of the trace performance SMT Solver Z3 that supports all the theories
in number of discrete transitions which we call it time-step; that we need for modeling the scheduling problem such as
Ti = hli , φi , ai , γi , li+1 i ∈ E, and at each location li , every empty theory, linear arithmetic, nonlinear arithmetic, and bit-
clock valuation Ci + t satisfies I(li ) for t < ti ; The clock vectors [18].
valuation Ci + ti satisfies φi ; pi = PE (Ti ) + PL (li ) is the
price calculated by taking transition Ti from location li . III. PROBLEM DEFINITION
To model bio-manufacturing scheduling problems, we also
Our goal in this work is to schedule tasks with nonlinear
need to introduce discrete variables in a PTA model. For
cost functions as in bio-manufacturing (Fig. 1).
example, discrete update variables are needed to model
Problem 1 Given a set of jobs (tasks or operations) each
the behavior of semaphore for allocating resources to tasks
with its nonlinear cost function, a set of machines, and a
exclusively. Such a model is also supported by existing tools
dependency graph among the jobs and machines, compute a
for modeling PTAs such as UPPAAL CORA.
schedule for the jobs which minimizes the total additive cost
Extended PTA is an extension of a standard PTA by
over all jobs.
adding a set of integer update variables (updates) U . These
It is well known, e.g., [9], that under linear cost functions,
variables are updated and evaluated in locations and tran-
Problem 1 can be modeled as a cost-optimal reachability
sitions similar to clocks but more expressive. For example,
problem over PTA. In this work, we use the same type of
an update can be used as a counter to form a loop. For
translation from job scheduling to PTA, but now we need to
an extended PTA A = hL, l0 , C, A, E, I, PL , PE , U, U 0 i,
consider nonlinear costs functions.
X U (U ) represents the same type of formulas as for X (C)
using update variables rather than clocks. U 0 : U → Z Solution Overview: Formally, given a set of m concur-
assigns initial values to the updates. Let U be a set of Qm Ai , a finite horizon n, and a set of target locations
rent PTAs
updates, then U(U ) is the set of conjunctive formulas in L ⊆ i=1 Li , we are interested in an execution path R =
p0 ,t0 p1 ,t1 pn−1 ,tn−1
which atomic update assignments are of the form u, u ./ n s0 −→ s1 −→ ...sn−1 −→ sn for which sn ∈ L,
p0 ,t0 p0 ,t0
and u1 ./ u2 for u, u1 , u2 ∈ U , n ∈ Z, ∈ {++, −−}, and for any other execution path R0 = s00 −→
0 0
s01 −→
1 1
and ./∈ {=, + =, − =}. The transition set E, and invariant p0l−1 ,t0l−1
function I in extended PTA are defined as: ...s0l−1 −→ s0l of length l ≤ n and s0l ∈ L, we have
Pn−1 Pl−1 0
• E is a set of transitions s.t. E ⊆ L × X (C) ∪ X (U ) ∪
U i=0 pi ≤ i=0 pi .
U(U ) × A × 2 × 2 × L, and for T = hl, φ, a, γ, λ, l0 i,
C U In order to solve this cost-optimal reachability problem,
λ is a set of update variables that needs to be updated we translate the concurrent PTAs Ai to an SMT formula
after taking the transition. F and pass the translated formula to an SMT solver. If
U
• I : L → X (C) ∪ X (U ) assigns invariants to locations.
no instance model was attainable for a finite horizon of
scheduling actions, then it means that the scheduling problem
Composite PTA: The parallel composition of m PTAs
is not feasible within the finite horizon. If the formula was
A1 , ..., Am denoted by Am || = A1 ||A2 ...||Am is the syn-
p0 ,t0
satisfiable, then for linear and in some cases polynomial cost
chronized product of all the automata. By R = s0 −→ functions on the task execution times, we can derive globally
p1 ,t1 pn−1 ,tn−1
s1 −→ ...sn−1 −→ sn , we represent a trace over a optimal traces. On the other hand, for general non-linear cost
composite PTA, where si , pi , and ti represent composed functions, we can return sub-optimal traces.
IV. PTA TO SMT T RANSLATION (1 ≤ i, j, k ≤ m):
^
We adapted the method introduced in [13] and [19] for Ai .A.a =⇒ ∃j 6= i ∧ Aj .A.a ∧ ¬Ak .A.a (9)
k6=i,j
translating PTAs into SMT formulas. In the following set ^
∀u ∈ V g , =⇒ u0 = u
of formulas, each symbol that is taken from PTA definitions ¬Ti (10)
has an equivalent predicate symbol where it is used in the Ti =hl,φ,a,γ,λ,l0 i,u∈λ
propositions. The new symbols are defined as follows. We In Formula (9), by notation Ai .A.a we refer to the channel
use s : L → {true, f alse} to represent that the current state a from a set of actions that belongs to PTA Ai .
of an automaton is in location l ∈ L (denoted as sl = true). We formulate a reachability problem for the set of target
We use z : R as a global clock which is only used for locations L where n is the desired horizon as follows
keeping track of global time. Symbols T , Tδ , and Tnull : ^
E → {true, f alse} represent a switch transition, delay f = sl ∧ l ∈ L (11)
transition, and no transition, respectively. The accumulated f ∈L
cost is denoted by P ∈ R, and P0 represents the cost in the For optimality, we either use the internal optimizer of SMT
beginning. We add a prime on the symbol names to denote solver for which the following formula is added
the value of the same symbol at the next time-step i.e., c0 = c
n
states that the value of the local clock c remains the same at X
Optimal Pi (12)
next time-step.
i=1
^ or, we use a bisection method that requires the formula:
sl0 =⇒ U 0 , sl =⇒ I(l) (1)
n
l∈L X
^ Ymin ≤ Pi ≤ Ymax (13)
T =⇒ sl ∧ φ ∧ s0l0 ∧ (a 6= ε =⇒ a)∧ i=1
T =hl,φ,a,γ,λ,l0 i
(2) Note that Optimal is an SMT keyword that requires the
^ ^ solver to find a sample model among all the other models
c0 = z 0 ∧ c0 = c ∧ z 0 = z , Tδ =⇒
that minimizes the cost. The second formula guarantees
c∈γ c6∈γ
^ ^ the approximate optimality where Ymin , Ymax ∈ R are
s0l 0
c0 = c ∧
sl = ∧ (z − z < 0) ∧ ¬a (3) minimum and maximum boundaries of a schedule’s total
c∈C a∈A\{ε} cost, respectively.
^ ^
sl = s0l ∧ z 0 = z ∧ c0 = c ∧
Tnull =⇒ ¬a V. SMT- BASED VS UPPAAL TASK S CHEDULING AND
c∈C a∈A\{ε} R EACHABILITY A NALYSIS
(4)
^ ^ ^ Many in the literature, such as [20], advocate the use of
0
¬T =⇒ u = u, (¬a ∨ ¬b) PTA as an effective method for modeling optimal schedul-
T =hl,φ,a,γ,λ,l0 i u∈λ a,b∈A\{ε},a6=b ing problems. In our SMT-based approach based on [13],
(5) we directly translate the UPPAAL CORA models into an
equivalent SMT formula. Our translator does not support
_ ^ _
T =⇒ ¬a, Tnull ∨ Tδ ∨ T
T =hl,φ,ε,γ,λ,l0 i a∈A\{ε} T ∈E
some of the UPPAAL syntax and semantics which are
(6) beyond standard PTA semantics. However, we let non-clock
^ variables (updates) to be used for modeling purposes with
P 0 = P + PE (T )
P0 = 0, T =⇒ (7) some restrictions as presented in the preliminaries section.
T ∈E
^ Our translation is modular. That is, for each PTA in the
Tδ ∧ sl =⇒ P 0 = P + PL (l), Tnull =⇒ P 0 = P (8) problem, we produce an SMT formula that uses the same
l∈L names for the variables, but indexed with different time-
steps. The global clocks and variables, inner-variables used
From the above, formulas (2), (3), (4) represent three for computing costs, and global synchronization are part
different types of transitions, and Formula (6) asserts that of global declarations in the generated SMT formula. The
at each time-step at least one of them has to be true. In reachability specification needs to be manually specified by
Formulas (7), (8) current accumulative price is formulated. the users. We translate a computed solution of the SMT
Formula (1) is to enforce validation of invariants at locations formulas into the corresponding trace on the PTA and
at each time-step. It is assumed that in the beginning, sl0 is schedule.
valid. The other equations are used for consistent signaling UPPAAL [21] is a tool for model checking, reachability
and updating evaluations. analysis, and simulation of timed automata. UPPAAL CORA
Given a composite PTA Am || and V
g
a set of global [22], [23] is an extension to UPPAAL that provides minimum
variables, the following formulas in conjunction with the cost reachability analysis for PTA, which is known to be a
local ones are used to guarantee a sound and pair-wise ex- decidable problem for certain classes of PTA [24]. UPPAAL
clusive inter-communication among all the composed PTAs CORA has been applied successfully to many scheduling
represent four different machines and their task dependen-
cies, as illustrated in Fig. 2. ProductA represents the bio-
manufacturing product process PTA, and it communicates
with other processes using two pair of channels as depicted
in Fig. 2a. Channel sFerm1 and eFerm1 are used to send
and receive signals for the start and end of the upstream
process, respectively. Similarly, sPur1 and ePur1 are used
for communicating with the downstream process. Fig. 2c
and 2d represent the upstream and downstream processes,
(b) Cost function
respectively. They use cleanBio1 and cleanPur1 channels to
request the cleaning process (Fig. 2e) after they are done
(a) Product process with their jobs. Among the processes in Fig. 2, the product
process represents the mainstream tasks and has embedded
cost functions.
In the product process, there is only one local clock cA
to measure time. In the beginning, this process is in the
initial state startBio, with cA ← 0. The only transition
from the initial state has a guard that requires the clock to
(c) Upstream process (d) Downstream process (e) Cleaning process
become greater than t11sf1 time units. Also, there has to be a
Fig. 2: Four processes that are used in our bio-manufacturing example, and the used waiting receiver for the signal sFerm1 on the channel. If the
cost function.
condition becomes satisfied, then the current state becomes
execFerm, and as a result, clock resets to zero. As shown in
Fig. 2a, the execFerm state has an invariant that requires the
problems [6], [25], [26]. In this work, we used UPPAAL
clock not to pass tFermDone, while the associated weight
CORA as a scheduler that supports positive linear cost
“cost0 == 1” implies that the cost associated with the state
functions. As such, it can only provide an approximate
is equal to the delayed time. From this state, there are two
solution to the problems with polynomial cost functions.
non-deterministic branches: (1) a transition to noPenalty if
The basic idea behind UPPAAL CORA is to reduce the
the condition tEarly≤ cA ≤ tFermDone becomes satisfied;
scheduling problem to a graph search problem. UPPAAL
(2) a transition to the state penalized after upstream time
CORA uses a standard branch and bound algorithm to find
passed. As a result, the cost will increase if a task is delayed
optimal schedules. It supports different search strategies such
beyond the upstream time, or if the task is terminated before
as Depth-First Search (DFS), Breath-First Search (BFS), and
the upstream time. In the first case, the cost function (Fig. 2b)
random search for branching exploration. Bounding is based
at state penalized applies coefficient 5 to penalize more
on estimating the remaining cost to reach a goal location
than choosing the left branch, which ends in state noPenalty
form the current location.
in which the coefficient is 3. Note that it is possible to
choose either branch and do not get penalized if the transition
VI. C ASE S TUDY: B IO - MANUFACTURING S CHEDULING
happens at tFermDone exactly while the upstream process is
P ROBLEM
done and ready to send the eFerm signal on the channel.
Optimally scheduling a bio-manufacturing process entails When the product machine reaches the waitPur1 state, it
the allocation of jobs to machines and time windows to max- means that the current product is ready to be transferred to
imize the throughput of the system (in the form of the yield the downstream unit, and therefore is waiting to get hold of
of the produced molecule) at the minimum cost. Typically, the downstream machine using sP ur1 channel. In the end,
bio-pharmaceutical production processes have been divided after the clock reaches t21f2, and the downstream machine
into upstream and downstream: (1) the upstream process is sends the ePur1 signal, then the whole product process ends
responsible for the cell growth, (2) the downstream process by reaching the ENDJOB state. The GPFID and GPUID
is designed with the main objective to purify and test the updates has to be equivalent to 4 on the last transition to the
quality of the product. As soon as a batch completes an ENDJOB state. GPUID is a global update as a counter that
operation over a specific device, a cleaning operation under counts the number of different downstream machines that are
vacuum needs to be performed to guarantee the absence of used during the whole process, and similarly, GPFID counts
contamination. Also, the duration of the different tasks differs the number of upstream machines. The initial value of both
remarkably from one device to the other. In the following, we updates is set to 1, and in the current problem configuration,
model and solve a batch bio-manufacturing task scheduling there are three of each device available.
problem using the above mentioned approaches based on The downstream process has three states Idle, exePur,
timed automata. and waitCleanPur as shown in Fig. 2d. It starts from the
For the sake of simplicity and computational efficiency, in initial state Idle setting its clock cP to zero, and waiting
our modeling, we abstracted both upstream and downstream for a product process to send sPur1 signal. If the clock
machines and tasks. In our model, we used four PTAs to guard condition was satisfiable and UID could get the same
TABLE I: The results of solving bio-manufacturing task scheduling problems using as it can be observed in Fig. 2a on the waitPur1 location,
SMT and CORA. The first row represents the test number, and the next four rows
represent number of products, upstream machines, downstream machines and cleaners,
the downstream process has to start instantly by entering the
respectively. “SMT Max Step” represents maximum length of satisfiable schedule as location (notice the location invariant cA ≤ 0). That means
a constraint. “Opt Cost” represents the attained optimal cost. “SMT Len” and “CORA
Len” represent the length of the result schedule for SMT and UPPAAL method,
any delay before downstream process and after starting
respectively. “SMT Time” and “CORA Time” represent the total solving time for SMT upstream process happens in one of the three locations:
and CORA methods, respectively. “SO” denotes stack-overflow, and “TO” denotes
time-out. Running time is in seconds.
exeFerm, penalized, or noPenalty for which a linear cost
is associated. The longer schedule for test #3 complies
Test 1 2 3 4 5 6
# Prod 3 3 3 3 6 6 with the prior result. As it can be observed in Fig. 2d, the
# Bio 3 3 3 3 3 6 downstream machine uses the common channel cleanPur1
# Pur 1 2 1 2 3 6
# Clean 1 1 2 2 3 6 to communicate with the cleaners, and uses cleanBio1 to
EXCLUSIVELY NON-DETERMINISTIC OPTIONS
SMT Max Step 40 40 40 40 50 50
communicate with upstream machines. Note that we only
Opt Cost 120 120 120 120 TO TO used a single signal to simulate the cleaning process, and,
SMT Len 25 19 25 19 38 22
CORA Len 39 34 SO SO SO SO therefore, each device can acquire a cleaner without signal
SMT Time 56 33 73 30 363 685 interference. Signal interference happens when one device
CORA Time 202 2074 SO SO SO SO
DETERMINISTIC AND NON-DETERMINISTIC OPTIONS uses a start signal (signal names with prefix s) to start using
SMT Max Step 40 16 25 16 19 10 a serving device, but then another device uses the end signal
Opt Cost 220 120 220 120 240 240
SMT Len 25 16 25 16 19 10 (signal names with prefix e) to release the serving device. We
CORA Len 34 28 35 29 SO SO
SMT Time 57 2 43 2 54 5 used a mechanism to avoid signal interference by assigning
CORA Time 43 41 8515 6860 SO SO unique IDs to devices that share the same signal channel.
For example, observe the updates PID, GPFID, and FID,
GPFID in Fig. 2a and Fig. 2c, respectively. All the updates
value as GPUID, then it takes the transition to the execPur starting with G are used for generating unique global and
state. After the downstream task is accomplished, signal local IDs. In fact, we implemented a semaphore mechanism
ePur1 will be sent to the initiated product process where to guarantee that the same device that starts a task also
GUID has to have the value equal to PID. In the end, the finishes it.
downstream process waits for the cleaner to start and finish We modeled an UPPAAL system configuration for our
its task using cleanPur1 signal. When cleaning is done, the example using the four processes in Figures 2a, 2c, 2d, and
downstream process comes back to the initial state, resets 2e. In our model, there is one channel used per pair of
its clock and becomes ready to serve another request. The device communication. Based on this system configuration:
upstream process has the same behavior as the downstream the instantiated processes ProdA1, ProdA2, and ProdA3 are
process, and the cleaning process is basic; therefore, we instances of Product; Bio11, Bio12, and Bio13 are instances
omitted their process descriptions. of Upstream; Pur1 is an instance of Downstream; and Clean1
is an instance of Cleaning.
VII. E XPERIMENTAL R ESULTS Table I is divided into three sections: the upper section
All the models used in this section are provided with our represents the number of each device per system configura-
tool CEPTA2SMT. In our comparison study, we started with tion; the middle section represents the resulting data of SMT
three batches of materials. Each batch at run time is assigned and UPPAAL CORA methods; the lower section shares the
to a product process non-deterministically. In the beginning, same titles as the middle section, except in the model we pre-
we assumed that there are as many upstream machines as the determined some task assignments for some devices to work
number of batches, but only one set of downstream devices. exclusively with each other. Note that in the middle section
The scheduling problem is to compute the start time of each of the table, in tests #5 and #6 the optimal cost is missing,
task and their end time so that the maximum yield (minimum but the execution time for the SMT method is stated, which
cost) is achieved. For generating more sample problems, is the time to find a random schedule which may not be the
we varied the number of upstream machines, downstream optimal one. As it is observed in the last section of Table
machines, and cleaners. The performance of each experiment I, the execution time for all the tests decreased significantly.
is presented in Table I. One crucial observation is that the The reason for the gained performance is that the number
solving time of models goes high when the number of of non-deterministic choices during scheduling are reduced.
non-deterministic task assignments increases. For example, The UPPAAL CORA performance drastically reduces as the
consider tests #2 and #3 in Table I. The only difference number of non-deterministic choices increases, while the
between the two models from the modeling perspective change for SMT models is linear. As it can be observed
is that in one setting there are two downstream machines in the results, the optimal cost for both approaches is the
and one cleaner, whereas in the other setting there is one same for each test, but the solution length is smaller for the
downstream machine and two cleaners. The optimal cost for SMT ones. One reason for getting shorter trace length in
test #3 is higher than the cost for test #2 that suggests SMT model instances is that our algorithm first finds shorter
somewhere in the process some tasks are delayed more satisfiable traces, and then tries to find the minimum cost by
than before. The result is intuitive because the downstream increasing the length until no trace with lower cost can be
process is happening sequentially before cleaning, and also discovered. The data in Table I demonstrates that almost in
all cases, the SMT method outperforms UPPAAL CORA if R EFERENCES
the solutions are attainable within short horizons. [1] M. Dorceus, S. S. Willard, A. Suttle, K. Han, P.-J. Chen, and M. Sha,
Optimal schedules: UPPAAL CORA is capable of finding “Comparing culture methods in monoclonal antibody production:
optimal schedules using linear cost functions. However, as Batch, fed-batch, and perfusion,” BioProcess International, 3 2017.
[2] D. Petrides, D. Carmichael, C. Siletti, and A. Koulouris, “Biopharma-
our results demonstrated in Table I, UPPAAL CORA is ceutical process optimization with simulation and scheduling tools,”
not able to compute schedules when the number of non- Bioengineering, vol. 1, no. 4, pp. 154–187, 2014.
deterministic choices increases, and crashed with “memory [3] M. Kornecki and J. Strube, “Process analytical technology for ad-
vanced process control in biologics manufacturing with the aid of
overflow” error. We used the option “random optimal depth macroscopic kinetic modeling,” Bioengineering, vol. 5, no. 1, 2018.
first” to find the best trace. SMT uses Bit-Vector to represent [4] Y. Abdeddaı̈m and O. Maler, “Job-shop scheduling using timed
locations; Real to represent clocks; Boolean to represent automata?” in Computer Aided Verification, ser. LNCS, vol. 2102.
Springer, 2001, pp. 478–492.
states and signals; Integer to represent updates. In our SMT [5] Y. Abdeddaim, E. Asarin, and O. Maler, “Scheduling with timed
approach, we find optimal traces either by using the internal automata,” TCS, vol. 354, pp. 272–300, 2006.
optimizer of Z3 SMT solver, or our implemented bisection [6] S. Panek, S. Engell, S. Subbiah, and O. Stursberg, “Scheduling
of multi-product batch plants based upon timed automata models,”
method. In our developed SMT method, we have to give the Computers & Chemical Eng, vol. 32, no. 1-2, pp. 275–291, 2008.
finite horizon as an input to the system, and for the bisection [7] R. Alur, S. L. Torre, and G. Pappas, “Optimal paths in weighted timed
cost evaluation, a lower and an upper cost bounds are needed. automata,” in HSCC, ser. LNCS, vol. 2034, 2001, pp. 49–62.
[8] G. Behrmann, A. Fehnker, T. Hune, K. G. Larsen, P. Pettersson, and
We ran our experiments on a Windows 10 64bit machine (our J. Romijn, “Minimum-cost reachability for priced timed automata,” in
tool is compatible with other platforms such as Linux and HSCC, ser. LNCS, vol. 2034. Springer, 2001, pp. 147–161.
MacOS) equipped with Core i7 CPU and 16GB RAM. [9] G. Behrmann, K. G. Larsen, and J. I. Rasmussen, “Priced timed
automata: Algorithms and applications,” in Formal Methods for Com-
Nonlinear cost functions: We created a client-server ponents and Objects (FMCO), ser. LNCS, 2005, pp. 162–182.
model with 3 instance processes from each. A server PTA [10] S. Subbiah, T. Tometzki, S. Panek, and S. Engell, “Multi-product batch
has 6 states and 8 transitions, and a client has 5 states and scheduling with intermediate due dates using priced timed automata
models,” Computers and Chemical Eng, vol. 33, pp. 1661–1676, 2009.
7 transitions. A client can non-deterministically request for [11] M. Jongerden, A. Mereacre, H. Bohnenkamp, B. Haverkort, and J. P.
a service at most 10 times in a loop. A sever has to provide Katoen, “Computing optimal schedules of battery usage in embedded
service to one client at each iteration in a loop until it serves systems,” IEEE TII, vol. 6, no. 3, pp. 276–286, Aug 2010.
[12] M. Bisgaard, D. Gerhardt, H. Hermanns, J. Krcal, G. Nies, and
4 clients, and then it is done. A server offers three types of M. Stenger, “Battery-aware scheduling in low orbit: The gomx3 case,”
services, for each, it uses a separate polynomial cost function in FM, ser. LNCS, vol. 9995. Springer, 2016, pp. 559–576.
to claim a charge. We used degree two and three polynomials [13] D. Bhave, S. N. Krishna, and A. Trivedi, “On nonlinear prices in timed
automata,” in V2CPS, ser. EPTCS, vol. 232, 2016, pp. 65–78.
in our experiments. No two servers can serve the same type [14] R. Kumar, E. Ruijters, and M. Stoelinga, “Quantitative attack tree
of service at the same time. We used the bisection method analysis via priced timed automata,” in FORMATS. Springer, 2015,
iteratively to find a sub-optimal schedule until the difference pp. 156–171.
[15] C. Baier and J.-P. Katoen, Principles of model checking. MIT, 2008.
between upper and lower bounds became less than 1. The [16] A. David, K. G. Larsen, A. Legay, M. Mikučionis, D. B. Poulsen,
result was computed in 455 seconds. J. Van Vliet, and Z. Wang, “Statistical model checking for networks
of priced timed automata,” in FORMATS. Springer, 2011, pp. 80–96.
VIII. C ONCLUSIONS AND F UTURE W ORK [17] C. Barrett, A. Stump, C. Tinelli, et al., “The smt-lib standard: Version
2.0,” in 8th Workshop on SMT, vol. 13, 2010, p. 14.
In this work, we modeled and solved a bio-manufacturing [18] L. De Moura and N. Bjørner, “Z3: An efficient smt solver,” TACAS,
task scheduling problem in two different ways. We used pp. 337–340, 2008.
[19] G. Audemard, A. Cimatti, A. Kornilowicz, and R. Sebastiani,
PTA to represent the models in both cases, and for optimal- “Bounded model checking for timed systems,” in FORTE. Springer,
cost reachability we used UPPAAL CORA, and satisfiabil- 2002, pp. 243–259.
ity modulo theory by Z3 SMT solver. Our result shows [20] K. G. Larsen, “Priced timed automata: Theory and tools,” in FSTTCS.
Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 2009.
that modeling concurrent PTAs with many non-deterministic [21] J. Bengtsson, “Uppaal: A tool for automatic verification of real-time
transitions in them significantly decreases the performance systems,” Ph.D. dissertation, Inst för info, Univ.[distributör], 1996.
in both approaches. However, the SMT approach scales [22] G. Behrmann, A. Fehnker, T. Hune, K. Larsen, P. Pettersson,
J. Romijn, and F. Vaandrager, “Minimum-cost reachability for priced
better than the graph-based search algorithms. The length of time automata,” in HSCC. Springer, 2001, pp. 147–161.
potential solutions (horizon) for a given problem is a critical [23] G. Behrmann, A. Fehnker, T. Hune, K. Larsen, P. Pettersson, and
performance factor. The generated SMT formula for a longer J. Romijn, “Efficient guiding towards cost-optimality in uppaal,” in
TACAS. Springer, 2001, pp. 174–188.
horizon exponentially increases the solving time. The same [24] P. Bouyer, T. Brihaye, V. Bruyre, and J.-F. Raskin, “On the optimal
behavior observed by adding more PTAs to a given problem. reachability problem of weighted timed automata,” Formal Methods
This is because by linearly increasing the number of PTAs, in System Design, vol. 31, no. 2, p. 135175, 2007.
[25] T. Ovatman, A. W. Brekling, and M. R. Hansen, “Cost analysis for
in the worst case, the number of asserted SMT equations embedded systems: Experiments with priced timed automata,” ENTCS,
increases exponentially for non-deterministic transitions. vol. 238, no. 6, pp. 81–95, 2010.
Also, our SMT based framework supports non-linear cost [26] Z. Gu, M. Yuan, and X. He, “Optimal static task scheduling on
reconfigurable hardware devices using model-checking,” in RTAS.
functions. However, since the problem is undecidable in IEEE, 2007, pp. 32–44.
the general form, it is possible that the SMT solver may
terminate without a solution. Finally, we incorporated a
bisection method in our tool for dealing with non-linear cost
functions when an upper bound and a lower bound exist.