140 likes | 161 Views
Explore optimizing software for safety and desired functionality while considering system redesign and control costs. Learn about FSM models, control strategies, and dynamic programming solutions.
E N D
Optimally Modifying Software for Safety and Functionality Sampath Kannan U.Penn (with Arvind Easwaran & Insup Lee)
Introduction • User requirements on software systems • Desired functionality • Safety properties • Verification/validation used to locate safetyviolations • What about static correction of errors bysystem redesign?
Desirable Features of Model • System redesign must preserve functionality: reward functionality, penalize violations • System model must be stochastic becauseof interaction with unpredictable environment • Each redesign/system control incurs a control cost.
System Model • Software system represented by a finite state machine (FSM) • Probability on transitions abstracts stochasticity • Cost of control associated with blocking transitions • Uncontrollable transitions explicitly labeled • Numeric rewards and penalties at the states
System Model – cont’d 20 -200 10 .5 a q0 q1 25 .3 b 30 .2 c q2 q3 100 Goal: Control transitions to maximize difference betweenexpected reward and control cost. Only consider the static version of the problem here.
DBMS Concurrency Controller • Concurrency controller controls execution of transactions • Transaction i can read/writedata items • Commit ci indicates i is complete • Serializable schedule – schedule equivalent to sequential execution of transactions
DBMS Controller as FSM • States = set of active transactions with state for each • Transitions = read/write/commit • Stochasticity = which transaction chosen • Control cost = increased latency • Reward = completed transaction • Violation = non-serializability
Wireless Network Routing • Message routing in wireless ad-hoc networks • Each wireless node capable of communicating • with a fixed set of nodes called its neighbors • Nodes communicate by broadcasting messages • Depending on the operating environment, only • some of the neighbors would be able to receive • the broadcast • At each stage, routing algorithm chooses a node • for transmission
Network Routing (2) • State: Set of wireless nodes with the message • Transition: Transmission by a particular node • and reception by some of its neighbors • Control action: Preventing the router from • selecting some nodes • Stochasticity: Uncertainty in reception of • message transmitted by a neighbor • Penalty: Cost of transmission • Rewards: Reward for reception of message by a • destination node
Mathematical Notation A: Control policy specifying blocked trans’ns. p(u,v) : Probability of transition (u,v) cA(u,v): Cost of controlling (u,v) under A. r(i): Reward/penalty at state i
Goal • Want to pick control strategy A (i.e. whichtransitions to suppress) to minimize expected cost. • Challenge: Transition probabilities are dynamic... suppressing one transition increases probabilities of others
Solution Technique - DAGs • If FSM is directed acyclic graph (DAG) • Dynamic programming algorithm computes optimal strategy efficiently • Starting from the sink nodes k, compute Ek up the DAG. • When computing Ei if suppressing some transition (i,j) improves Eido it.
Arbitrary Graphs • Unique solution might not exist – switch to discounted rewards to ensure it does. • Write constraints for each possible subset of transitions controlled – exponential number of constraints! • Use implicit Linear Programming Solver such as Ellipsoid Algorithm to find optimum in polynomial time.
Conclusion • Abstracted software systems as a stochastic FSM • with cost of control, rewards and penalties • Developed polynomial time DP algorithm for • directed acyclic graphs • Formulated optimization problem for strongly • connected components as a LPP • Described polynomial time separation oracle • thereby generating polynomial time ellipsoid • algorithm