Evaluating State Modeling Techniques in Alloy
نویسندگان
چکیده
sig State {} sig List { header: Node -> State } fact { all l: List | all s: State | lone l.(header.s) } State is an abstract sig, i.e., it contains only atoms that are strictly necessary for the constraint solved. The symbol ‘->’ denotes the Cartesian product in expressions and adds arity in declarations. The field header is now a ternary relation of type List × Node × State, which allows a list to have different nodes as its header in different states. Note that the state need not be the last type; it can be in any position, e.g., in the first position where the sig State would have other relations (such as header and link) as its fields. We use state in the last position because it allows us to preserve the declaration structure of the original model. A fact in Alloy is a formula that must always hold. We use a fact to require each list to have at most one header node in each state to conform to the partial function relation in the original model (without state). 16:4 • Allison Sullivan et al The following snippet shows how the predicate Acyclic can be written in the presence of state: pred Acyclic(l: List, s: State) { all n: l.(header.s).*(link.s) | n !in n.^(link.s) } Note the new state parameter s for which the predicate holds, and also the new composition of each relation with a state to represent the field values in the desired state, e.g., l.(header.s) is the header of the list l in the state s. Consider next modeling state mutation. This snippet defines removal of the first node from the list: pred RemoveFirst(l: List, s: State, s': State) { s != s' -states are unique RepOk[l, s] -l satisfies RepOk in s l.(header.s).*(link.s).(elem.s) l.(header.s).(elem.s) = l.(header.s').*(link.s').(elem.s') RepOk[l, s'] -l satisfies RepOk in s' } run RemoveFirst for 2 State, 1 List, 3 Node, 2 Int The predicate has two state parameters: s represents the pre-state, and s' represents the post-state. The operator ‘-’ is set difference. (The symbol ‘-’ is used for comments.) The predicate encodes that the two states are distinct; l satisfies RepOk in the pre-state; the set of elements in the pre-state minus the header element in the pre-state is the set of elements in the post-state; and l satisfies RepOk in the post-state. Figure 1 graphically illustrates an instance for RemoveFirst.
منابع مشابه
Simulation and modeling of friction welding of stainless steel to aluminum alloy using finite element method and artificial neural network
Aluminum to stainless steel joints are broadly used in industries in order to reduce fuel consumption. While fusion welding is not a suitable method to join these metals. solid state welding, like friction welding (FW), is an effective way to this process. However, risk of intermetallic compounds (IMCs) formation is probable in these welds. In previews investigations formation of FeAl3, Fe2Al5 ...
متن کاملSimulation and modeling of friction welding of stainless steel to aluminum alloy using finite element method and artificial neural network
Aluminum to stainless steel joints are broadly used in industries in order to reduce fuel consumption. While fusion welding is not a suitable method to join these metals. solid state welding, like friction welding (FW), is an effective way to this process. However, risk of intermetallic compounds (IMCs) formation is probable in these welds. In previews investigations formation of FeAl3, Fe2Al5 ...
متن کاملEvaluating the Seismic Performance of Steel-SMA Hybrid Braces
The seismic performance of hybrid braces composed of steel and shape memory alloy (SMA) was investigated in this paper. Six types of hybrid braces were used, constituted by SMA content of 0, 20, 40, 60, 80, and 100%. A nonlinear dynamic analysis was performed under El Centro earthquake records, with the maximum acceleration of 0.6g and 0.9g. Our results showed that the seismic performance, i.e....
متن کاملA Coupled Rigid-viscoplastic Numerical Modeling for Evaluating Effects of Shoulder Geometry on Friction Stir-welded Aluminum Alloys
Shoulder geometry of tool plays an important role in friction-stir welding because it controls thermal interactions and heat generation. This work is proposed and developed a coupled rigid-viscoplastic numerical modeling based on computational fluid dynamics and finite element calculations aiming to understand these interactions. Model solves mass conservation, momentum, and energy equations in...
متن کاملDomain-Specific Visualization of Alloy Instances
Motivation Alloy is a modelling language based on first order logic and relational calculus combining the precision of formal specifications with powerful automatic analysis features [3]. The automatic analysis is done by the Alloy Analyzer, a tool capable of finding satisfiable instances for given Alloy models in a finite domain space using Sat-solving. The utility of this instance finding mec...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2017