Formalizing Cardinality-based Feature Models and their Staged Configuration

Size: px
Start display at page:

Download "Formalizing Cardinality-based Feature Models and their Staged Configuration"

Transcription

1 Formalizing Cardinality-based Feature Models and their Staged Coniguration Krzyszto Czarnecki, Simon Helsen, and Ulrich Eisenecker 2 University o Waterloo, Canada 2 University o Applied Sciences Kaiserslautern, Zweibrücken, Germany Abstract Feature modeling is an important approach to capture the commonalities and variabilities in system amilies and product lines. Cardinality-based eature modeling integrates a number o existing extensions o previous approaches. Staged coniguration is a process that allows the incremental coniguration o cardinality-based eature models. It is achieved by perorming a step-wise specialization o the eature model. In this paper, we argue that cardinality-based eature models can be interpreted as a special class o context-ree grammars. We make this precise by speciying a translation rom a eature model into a contextree grammar. Consequently, we provide a semantic interpretation or cardinality-based eature models by assigning an appropriate semantics to the language recognized by the corresponding grammar. Finally, we give an account on how eature model specialization can be ormalized as transormations on the grammar equivalent o eature models. Introduction Feature modeling is a key approach to capture and manage the common and variable eatures in a system amily or a product line. In the early stages o sotware amily development, eature models provide the basis or scoping the system amily by recording and assessing inormation such as which eatures are important to enter a new market or remain in an existing market, which eatures incur a technological risk, what is the projected development cost o each eature, etc. []. Later, eature models play a central role in the development o a system amily architecture, which has to realize the variation points speciied in the eature models [6, 0]. In application engineering, eature models can drive requirements elicitation and analysis. Knowing which eatures are available in the sotware amily may help the customer to decide about the eatures his or her system should support. Knowing which o the desired eatures are provided by the system amily and which have to be custom-developed helps to better estimate the time and cost needed or developing the system. A sotware pricing model could also be based on the additional inormation recorded in a eature model. Feature models also play a key role in generative sotware development [2, 7, 0, 5, 24]. Generative sotware development aims at automating application

2 engineering based on system amilies: a system is generated rom a speciication written in one or more textual or graphical domain-speciic languages (DSLs). In this context, eature models are used to scope and develop DSLs [0, 4], which may range rom simple parameter lists or eature hierarchies to more sophisticated DSLs with graph-like structures. Feature modeling was proposed as part o the Feature-Oriented Domain Analysis (FODA) method in [9] and since then it has been applied in a number o domains including telecom systems [6, 20], template libraries [0], network protocols [], and embedded systems [9]. Based on this growing experience, a number o extensions and variants o the original FODA notation have been proposed [8, 6, 8, 20, 22, 2].. Contributions and Overview This paper is based on our previous work or cardinality-based eature models []. In that work, we introduce cardinality-based eature modeling as an integration and extension o existing approaches. We also introduce and motivate the notion o staged coniguration. The present work adds a ormal account o cardinality-based eature modeling and its specialization. The main contributions include a) a translation or cardinality-based eature models into contextree grammars b) a semantic interpretation o eature models c) a set o inormal grammar transormation rules which mimics eature model specialization steps. The remainder o the paper is organized as ollows: in Section 2, we describe cardinality-based eature modeling as it was proposed in []. However, instead o using an example rom operating system security proiling, we explain the eature modeling approach by means o a conigurable editor. Section describes the notion o staged coniguration as introduced in []. It is motivated and applied to the conigurable editor example. The interpretation o eature models as context-ree grammars is then detailed in Section 4. This includes the introduction o an abstract syntax model (Section 4.), a translation into context-ree grammars (Section 4.2), and a semantics or eature models (Section 4.). Section 5 inormally describes how eature model specialization steps have equivalent grammar transormation rules. Related work is discussed in Section 6 and Section 7 concludes. 2 Cardinality-Based Feature Modeling A eature is a system property that is relevant to some stakeholder and is used to capture commonalities or discriminate between systems. Features are organized in eature diagrams. A eature diagram is a tree o eatures with the root representing a concept (e.g., a sotware system). Feature models are eature diagrams plus additional inormation such as eature descriptions, binding times, priorities, stakeholders, etc. As a practical example to demonstrate our cardinality-based language or eature modeling, consider the eature diagram o a conigurable text editor in Figure. 2

3 editorconig backup [0..*] documentclass(string) autosave backuponchange backupextention associatedfileextensions commands syntaxhighlighting <0 > [0..*] minutes(int) ile.bak ile.bak.ext ile.ext.bak ext(string) syntaxdeinitionfile(string) removeblanklines spellcheck dosunixconversion Figure. Text editor coniguration example The root eature o our sample diagram is editorconig. A root eature is only one o three dierent kind o eatures. The other two are the grouped eature and the solitary eature. The ormer is a eature which occurs in a eature group, e.g., removeblanklines. A solitary eature is a eature which is, by deinition, not grouped in a eature group. Many eatures in a typical eature model are solitary, or example, the eatures backup and autosave. The eature minutes is a subeature o autosave and has an attribute or speciying the time period between automatic saves. In general, any eature can be given maximum one attribute by associating it with a type, which is Int in thecaseominutes. A collection o attributes can be modeled as a number o subeatures, where each is associated with a desired type. I present, we indicate the associated type within parentheses ater the eature name, e.g., myfeature (Int). It is also possible to speciy a value o the associated type immediately with the myfeature (5 : Int) type, e.g.,. Every solitary eature is qualiied by a eature cardinality. It speciies how oten the solitary subeature (and any possible subtree) can be duplicated as a child o its parent. For example, the eatures documentclass and ext have the eature cardinality [0.. ]. This means that an editor can be conigured or zero or more document classes, each with zero or more associated ile extensions. The eature cardinality o the remaining solitary eatures are implied by the illed or empty circle above the given eature as [..] or [0..], respectively. For example, backup has the cardinality [..] (it is a mandatory eature), whereas the cardinality o autosave is [0..] (it is an optional eature). In general, a eature cardinality I is a sequence o intervals o the orm [n..n ]...[n l..n l ], More precisely, a eature cardinality is attached to the relationship between a solitary eature and its parent.

4 where we assume the ollowing invariants: i {,...,l } : n i,n i N n l N n l N { } n N : n< 0 n i {,...,l} : n i n i i {,...,l } : n i <n i+ An empty sequence o intervals is denoted by ε. An example o a valid speciication o a eature cardinality with more than one interval is [0..2][6..6], which says that we can take a eature 0,, 2 or 6 times. Note that we allow the last interval in a eature cardinality to have as an upper bound the Kleene star. Such an upper bound denotes the possibility to take a eature an unbounded number o times. For example, the eature cardinality [..2][5.. ] requires that the associated eature is taken, 2, 5, or any number greater than 5 times. Semantically, the eature cardinality ε is equivalent to [0..0] and implies that the subeature can never be chosen in a coniguration. The available naming schema or back-up iles (such as ile.bak or ile.ext.bak) are modeled as a eature group. In general, a eature group expresses a choice over the grouped eatures in the group. This choice is restricted by the group cardinality n n, which speciies that one has to select at least n and at most n distinct grouped eatures in the group. Given that k>0isthenumbero grouped eatures, we assume that the ollowing invariant on group cardinalities holds: 0 n n k. In our example, since no cardinality was speciied or the group o naming schemas, the cardinality is assumed, i.e., the naming schemas orm an exclusive-or group. Conversely, any combination o zero or more subeatures o commands are allowed thanks to the group cardinality 0. At this point, we ought to mention that, theoretically, we could generalize the notion o group cardinality to be a sequence o intervals, similarly as or eature cardinalities. However, we have ound no practical applications o this usage and it would only clutter the presentation. Grouped eatures do not have eature cardinalities because they are not in the solitary subeature relationship. This avoids redundant representations or groups and the need or group normalization which was necessary or the notation in [8]. For example, in that notation, an inclusive-or group which has group cardinality k where k is the size o the group can have both optional and mandatory subeatures (corresponding to eature cardinalities [0..] and [..], respectively). This would be equivalent to an inclusive-or group in which all the subeatures were optional. Keeping eature cardinalities out o groups also avoids problems during specialization (see Section.2). For example, the duplication o a subeature with a eature cardinality [n..n ], where n >, within a group could potentially increase its size beyond the upper bound o the group cardinality. Observe that, even without the redundant representations or groups, there is still more than one way to express the same situation in our notation. For example, the eature group with group cardinality 0 under the eature commands in Figure can also be modeled as ollows: 4

5 commands [0..] [0..] [0..] removeblanklines spellcheck dosunixconversion We keep this distinct rom the representation in Figure and leave it up to a tool implementer to decide how to deal with these multiple representations. For instance, it might be useul to provide a conversion unction or such diagrams. Alternatively, one could decide on one type o preerred orm which is shown by deault. Staged Coniguration A eature model describes the coniguration space o a system amily. An application engineer may speciy a member o a system amily by selecting the desired eatures rom the eature model within the variability constraints deined by the model (e.g., the choice o exactly one eature rom a set o alternative eatures). The process o speciying a amily member may also be perormed in stages, where each stage eliminates some coniguration choices. We reer to this process as staged coniguration. Each stage takes a eature model and yields a specialized eature model, where the set o systems described by the specialized model is a proper subset o the systems described by the eature model to be specialized. The need or staged coniguration arises in at least three contexts: Sotware supply chains In sotware supply chains [5], a supplier can create amilies o sotware components, platorms, and/or services dedicated or dierent system integrators based on one common system amily, which covers all the variability needed by the individual amilies. In general, a similar relationship can exist between tier-n and tier-n+ suppliers o the system integrator. This creates the need or multi-stage coniguration, where each supplier and system integrator is able to eliminate certain variabilities and to compose specialized amilies. In [], we provide an example involving embedded sotware in the automotive industry. Optimization Staged coniguration oers an opportunity to perorm optimizations based on partial evaluation. When certain coniguration inormation becomes available at some stage and it remains unchanged thereater, the sotware can be optimized with respect to this inormation. For example, coniguration inormation available at compile-time can be used to eliminate unused code rom a component and to perorm additional compile-time optimizations. Similarly, the component could be urther specialized based on coniguration inormation available at deployment time. Optimizations are especially interesting or embedded sotware and sotware that needs to be distributed over the net. Note that optimization stages may coincide with the coniguration stages within a supply chain, but this is not always the case. 5

6 Many suppliers decide to deploy runtime keys to enable or disable certain product eatures without physically eliminating the unused code. 4 Policy standards Inrastructure policies may be deined at dierent levels o an organization with the requirement o hierarchical compliance. For example, security policy choices provided by the computing inrastructure o an enterprise can be specialized at the enterprise level, then urther specialized at the level o each department, and inally at the level o individual computers. A concrete example o specializing security policies is give in []. Coniguration stages can be deined in terms o three dierent dimensions: Time A coniguration stage may deined in terms o the dierent phases in a product liecycle (e.g., development, roll-out, deployment, normal operation, maintenance, etc.). These times are, o course, product-speciic. They will have to be mapped to the dierent binding times oered by the utilized technologies (e.g., compile-time, preprocessing time, template-instantiation time, load time, runtime, etc.). Roles In staged coniguration scenarios, eliminating dierent variabilities may be the responsibility o dierent parties, which can be assigned dierent roles. For example, a central security group may be responsible or deining enterprise-wide security polices, while the coniguration o the individual computers may be done by the departmental system administrators. Similarly, multiple coniguration roles will be typically required in a supply-chain scenario. Targets A target system or subsystem or which a given sotware needs to be conigured may also deine possible coniguration stages. For example, a given component may be deployed several times within a given sotware system. In this case, the component could irst be specialized to eliminate unctionality not needed within the system and then be urther conigured or each deployment context within that system.. Coniguration vs. Specialization So ar, we have loosely deined the terms eature model specialization and eature model coniguration. At this point, it is important to make these notions more precise. A coniguration consists o the eatures that were selected according to the variability constraints deined by the eature diagram. The relationship between a eature diagram and a coniguration is comparable to the one between a class and its instance in object-oriented programming. The process o deriving a coniguration rom a eature diagram is also reerred to as coniguration. Specialization is a transormation process that takes a eature diagram and yields another eature diagram, such that the set o the conigurations denoted by the 4 The choice o employing runtime techniques or static coniguration may sometimes be dictated by the limitations o the implementation technology being used. However, there may be more proound reasons, such as logistics requiring packaging all variants into a single distribution (see [9, pp ] or a concrete example). 6

7 latter diagram is a true subset o the conigurations denoted by the ormer diagram. We also say that the latter diagram is a specialization o the ormer one. A ully specialized eature diagram denotes only one coniguration. We now deine staged coniguration as a orm o coniguration, which is achieved by successive specialization steps ollowed by deriving a coniguration rom the most specialized eature diagram in the specialization sequence. In general, we can have the ollowing two extremes when perorming coniguration: a) deriving a coniguration rom a eature diagram directly and b) specializing a eature diagram down to a ully specialized eature diagram and then deriving the coniguration (which is trivial). Observe that we might not always be interested in one speciic coniguration. For example, a eature diagram that still contains unresolved variability could be used as an input to a generator. This is useul when generating a specialized version o a ramework (which still contains variability) or when generating an application that should support the remaining variability at runtime..2 Specialization Steps We already described the process o staged coniguration as the removal o possible coniguration choices. In this section, we discuss in more detail what kind o coniguration choices can be eliminated. We will call the removal o a certain coniguration choice a specialization step. There are ive categories o specialization steps: a) reining a eature cardinality, b) reining a group cardinality c) removing a subeature rom a group, d) assigning a value to an attribute which only has been given a type, and e) cloning a solitary subeature. We discuss each o these possibilities in more detail. Reining eature cardinalities A eature cardinality is a sequence o intervals representing a (possibly ininite) set o distinct natural numbers. Each natural number in the cardinality stands or an accepted number o occurrences or the solitary subeature. Reining a eature cardinality means to eliminate elements rom the subset o natural numbers denoted by the cardinality. This can be achieved as ollows:. remove an interval rom the sequence; or 2. i an interval is o the orm [n i..n i ]wheren i <n i, (a) reduce the interval by increasing n i to n i or decrease the n i to n i as long as n i n i.in i =, then it is possible to replace with a number m such that n i m; or (b) split the interval in such a way that the new sequence still obeys the eature cardinality invariant and then reduce the split intervals. A special case o reining a eature cardinality is to reine it to [0..0] or ε. In either case, it means we have removed the entire subeature and its descendents. We leave it up to a tool to decide whether to visually remove eatures with eature cardinality [0..0] or ε. 7

8 Reining group cardinalities A group cardinality n n 2 is an interval indicating a minimum and maximum number o distinct subeatures to be chosen rom the eature group. Its orm is a simpliication o a eature cardinality and can only be reined by reducing the interval, i.e., byincreasingn to n and decreasing n 2 to n 2 as long as n n 2. Currently, we do not allow to split an interval, because we have no representation or such a cardinality. O course, such an operation should be incorporated whenever we allow sequences o intervals or group cardinalities. Removing a subeature rom a group A eature group o size k with group cardinality n n 2 combines a set o k subeatures and indicates a choice o at least n and at most n 2 distinct subeatures. A specialization step can alter a eature group by removing one o the subeatures with all its descendents provided that n <k. The new eature group will have size k and its new group cardinality will be n min(n 2,k ), wheremin(n, n ) takes the minimum o the two natural numbers n and n. The ollowing is an example specialization sequence where each step removes one subeature rom the group: <2 > <2 > <2 2> It is not possible to remove subeatures rom a eature group once n = k. In that case, all subeature have to be taken and all variability is eliminated. Assigning an attribute value An obvious specialization step which assigns a value to an uninitialized attribute. The value has to be o the type o the attribute. Cloning a solitary subeature This operation makes it possible to clone a solitary subeature and its entire subtree, provided the eature cardinality allows it. Moreover, the cloned eature may be given an arbitrary, but ixed, eature cardinality by the user, as long as it is allowed by the original eature cardinality o the solitary subeature. Unlike the other specialization operations, it is possible that cloning only changes the diagram without removing variabilities. However, the new diagram will generally be more amenable to specialization, so we consider it a specialization step nonetheless. We explain this process with an example: 8

9 0 [2..2][4..*] [..] [..*] 0 0 The eature cardinality [2..2][4.. ] o the original subeature 0 indicates that 0 must occur at least 2 times or more than times in a coniguration. In the specialized diagram above, we have cloned 0 (to the let) and assigned it a new eature cardinality [..]. The original eature 0 (to the right) has a new cardinality that guarantees that the new diagram does not allow conigurations which were previously orbidden. In the example, because we have chosen to give the let 0 the ixed eature cardinality [..], the eature cardinality o the right-most 0 has to be [.. ]. Specialization has occurred since the new diagram does not allow a user to only select 0 two times. Consider another example: [2..*] [2..2] [0..*] In this case, no actual specialization took place. The cloned eature to the let has been given the ixed cardinality [2..2]. However, because the original eature cardinality was [2.. ], the right-most now has cardinality [0.. ]. More generally, suppose I =[n..n ]...[n l..n l ]and0<m.providedwehave (n l = ) (m n l < ), it is possible to clone the solitary subeature o with eature cardinality I as ollows: I [m..m] L(m,I) Given that we always have n = or any n N, we can deine the unction L (m, I) as ollows: L (m, ε) =ε i (m n) : [(n m)..(n m)]l (m, I) L (m, [n..n ]I) = i (n <m) (m n ) : [0..(n m)]l (m, I) i n <m : L (m, I) The reader may wonder why we only allow the cloned eature to be given a ixed eature cardinality. This is because in general, it is impossible to construct 9

10 editorconig backup documentclass( binary : String) documentclass( Java : String) autosave backuponchange backupextention associatedfileextensions commands associatedfileextensions syntaxhighlighting minutes(int) ile.bak ile.bak.ext ile.ext.bak [0..*] [0..*] ext(string) ext( dll : String) ext(string) ext( exe : String) ext( java : String) commands syntaxdeinitionfile( java.syn : String) <2 2> removeblanklines dosunixconversion Figure 2. Sample specialization o the editor coniguration a correct eature diagram by cloning a eature and giving it an arbitrary interval or sequence o intervals without some more expressive orm o additional constraints. However, there are a ew useul special cases or this situation, which we do not consider in this paper and leave or uture work.. Editor Coniguration Example Revisited Coming back to our editor coniguration example in Section 2, assume that the developer o the editor decides to create specialized editors or dierent markets. For example, a specialization or programmers might support editing Java iles and viewing binary iles (see Figure 2). The specialization is achieved by a combination o steps rom Section.2: reining the eature cardinalities or autosave and backuponchange to [..]; cloning documentclass twice and removing the original documentclass by reining its eature cardinality to [0..0]; assigning names to the cloned documentclasses; cloning ext and assigning names to each o them; deleting selected eatures rom the groups under commands; and reining the group cardinality or the commands o the Java document class to 2 2. The specialized eature diagram could be used as the input to a generator or as a start-up coniguration ile. The remaining variability could be exposed to the end-user through a properties dialog box in the generated editor. 4 Feature Models as Context-Free Grammars Our approach to ormalize cardinality-based eature models is based on a translation o eature diagrams into context-ree grammars. A ormal semantics or a eature model is then obtained by an appropriate interpretation o the sentences recognized by the corresponding grammar. Beore we can translate cardinality-based eature models into grammars, we need a more practical ormulation or eature models. Our strategy is to deine an abstract syntax and a corresponding meta model or the cardinality-based eature modeling notation introduced in Section 2. 0

11 Subeature Relationship eaturecardinality is subeature o * children Node name 0.. parent Feature Node..* children Grouping Node groupcardinality 0.. parent eature group Figure. Abstract syntax meta model or cardinality-based eature models 4. Abstract Syntax or Feature Diagrams Usually, an abstract-syntax model is engineered to accommodate the expressiveness o the meta modeling language. For example, i the meta model is expressed as a UML model, sound object-oriented design principles are used. In our case, however, we want the abstract syntax to be easily manipulable by a translation algorithm. This requires more orthogonality o the dierent language elements and may not necessarily lead to the most intuitive meta model. Still, or improved readability, we ormalize the abstract syntax model with a UML class diagram because this standardized notation is readily understandable. Figure contains the meta model or the proposed abstract syntax o our cardinality-based eature notation 5. An abstract syntax eature diagram consists o nodes which can be either eature nodes or grouping nodes. Each node has a name which reers to the actual eature name. Note that we dierentiate between a eature name and a eature node. As is the case in the concrete syntax, eature names do not have to be unique. However, each eature node is a unique object. A eature node may have a set o zero or more subnodes via the subeature relationship, which in itsel has a eature cardinality. Solitary subeatures rom the concrete syntax are thus represented in the abstract syntax as a node with an is-subeature-o link. A grouping node, on the other hand, has at least one or more subeature nodes in its eature group. Observe that a grouping node cannot have an empty eature group because i a node has no children, it must be a eature node. In addition to the diagram constraints o Figure, we have three implicit constraints: a) a grouping node always has an associated subeature link; in other words, a diagram cannot have a grouping node as its root; b) the eature cardinality o the subeature link associated with a grouping node is always [..]; c) an abstract syntax eature diagram is always a proper tree, i.e., a node cannot appear as one o its descendents. The attentive reader will notice that there is no one-to-one match between the abstract syntax model and the previously introduced concrete syntax. The 5 Contrast this with the meta model proposed in [].

12 main dierence is that in the concrete syntax, we allow a eature to have a heterogeneous mix o solitary subeatures and eature groups. In contrast, the abstract syntax insists on a homogeneous orm o subeaturing: each node either has solitary subeatures or stands or a eature group. I we need a eature group to co-exist with solitary subeatures, we have to introduce a grouping node, which can be treated as an anonymous solitary subeature. This explains the requirement that the anonymous subeature or a grouping node always has eature cardinality [..]. Although attributes are a useul and important aspect o the eature notation presented in this paper, we do not consider eatures with attributes in the ormalization o eature models. This extension only clutters the presentation. In Section 4.2 we inormally discuss how attributes can be added to the ormalization. Let us now consider a practical notation or the abstract syntax. A eature node and its subeatures with associated eature cardinality have the ollowing orm: I. I n n In this case, is a eature node, whereas,..., n are its subnodes, which can be either eatures or grouping nodes. Note that in this notation, we mix eature names and eature nodes because we can uniquely determine which node we are talking about by observing its position in the tree. The eature cardinality I i o a subeature relationship precedes the eature node it is qualiying. A grouping node o size k (i.e., withk subeatures) is presented as ollows: g n n.. The interval n n is the group cardinality. The concrete syntax can now be easily mapped onto the abstract syntax: k I. I. 2

13 < > [..2][4..*] [0..2] 2 4 <2 > [0..*] Figure 4. An example eature diagram <n n > k. [..] g n n. k. It is relatively straightorward to check that this mapping obeys the implicit constraints on the abstract syntax mentioned above. We inish this section with the small example in Figure 4. Its translation into the abstract syntax is as ollows: [..2][4.. ] [..] g 2 [0.. ] 5 6 [0..2] 4 [..] g We will use this eature diagram in the remainder o the paper to explain the ormalization o cardinality-based eature models. 4.2 A Translation into Context-Free Grammars As mentioned earlier, our approach to the ormalization o a eature diagram is to translate it into a context-ree grammar. Feature diagrams, as they are presented in this paper, can actually be modeled as regular grammars 6 and do not require 6 Regular grammars require that the right-hand side o a production can only have one terminal possibly ollowed by a non-terminal.

14 the additional expressiveness o context-ree grammars. However, because regular grammars are rather awkward to read, we will present a translation into a more convenient context-ree grammar. An inormal description We irst explain the translation into context-ree grammars by means o the example in Figure 4. The notation or context-ree grammars is standard, but or improved readability, we print non-terminals in italic and underline terminals. The translation consists o two parts: translating eature nodes and translating grouping nodes. First, let us look at how to deal with eature nodes, or example the root eature node o the example. It has three subeature links with associated nodes, g, and 4. For the root eature, we generate the ollowing production: F (, N N g 2 N 4 ). Although eature names are generally not unique, an actual eature node occurring in a diagram is. Hence, we use an encoding that guarantees that the non-terminal corresponding to a particular node in the diagram is unique. It works as ollows: Each abstract syntax node is represented by a non-terminal F id. The subscript id is a sequence o node names describing the path o the root node all the way down to the current node. Moreover, each node name itsel is superscripted with an index that distinguishes it rom all its siblings 7. In theory, it is suicient to only use the superscripts without the node names to orm a unique identity or the non-terminal. However, it is easier to read the productions when we add the node names to the identity. We use the same method or other non-terminals such as N and G that describe dierent aspects o the same diagram node. In the above production, we see the non-terminals N, N g 2,and N 4. They encode the possible number o occurrences according to the eature cardinality o the respective eature. For example, let us investigate what happens with the case or N. It requires our productions: N {N } N {N2 } N {N 4 } N {N5 Each right-hand side is a non-terminal, enclosed in curly brackets to represent the dierent numbers that the eature cardinality represents. Because the inal interval has a Kleene star, it is possible to go to the non-terminal N 5.Each o these numbered non-terminals is then elaborated in a production that goes to the non-terminal representation o the subnode. For node,thisimpliesthe } 7 In many o the examples in this paper, we use subscripts o to identiy dierent eature names, e.g.,. However, these subscripts are part o the actual eature name and should not be conused with the indices that identiy siblings. 4

15 ollowing productions: N F N 2 F, F N 4 F, F, F, F N 5 F, N 4 N 5 F, N 5 The irst three productions are obvious. The last two productions take care o the interval [5.. ]. The Kleene star requires a recursive production to represent an unbounded number o, but always ends by taking at least 5 o those eatures. Note that we insert a comma terminal symbol in between occurrences o F. That is to make sure we can interpret the result sentence appropriately. The interpretation o resulting sentences is discussed below. The cases or N g 2 and N 4 are analogous. I the eature cardinality allows or 0 occurrences, as is the case or N 4, we have to include a production N 0 ɛ. Finally, we have to consider the case where a eature has no subeature links at all. This is the case or eature, where we have the production 4 F (, ). Now, let us look at the translation o a grouping node. From the example diagram in Figure 4, we take the grouping node g o the eature 4, which has group cardinality 2 and our subeatures 6, 7, 8,and. This means that we have to generate productions that accept all combinations o minimum 2 and maximum distinct subeatures. As with eature cardinalities, we directly encode all possible numbers in the interval o the group cardinality with extra non-terminals. However, unlike eature nodes, we do not produce a terminal or the grouping node because it is only an artiact o the abstract syntax: F 4 g 2 G2 4 g 2 F 4 g 2 G 4 g 2 In the next step, we have to produce all the combinations or each number in the interval. A possible choice o subnodes is comma-separated. For example, or G 2 4 g 2, we have the ollowing productions: G 2 4 g F 2 4 g 2 6, F 4 g G 2 4 g F 2 4 g 2 6, F 4 g 2 4 G 2 4 g F 2 4 g 2 7 2, F 4 g 2 4 G 2 4 g F 2 4 g 2 6, F 4 g 2 8 G 2 4 g F 2 4 g 2 7 2, F 4 g 2 8 G 2 4 g F 2 4 g 2 8, F 4 g 2 4 The productions or G 4 g 2 are analogous. The context-ree grammar is completed by identiying the start symbol, which is the non-terminal representing the root eature node. In our example, this is F. The complete translation o the example in Figure 4 can be ound in Appendix A. 5

16 A translation algorithm We now provide a complete algorithm, written in pseudo-code. It consists o a large recursive unction T (... ) which takes as one o its arguments an abstract syntax node and produces a set o grammar productions. The notation used in the pseudo-code is largely sel-explaining. We use the symbol α or a sequence o grammar symbols, which may contain both terminals and non-terminals. Juxtaposition expresses construction and destruction o a sequence o objects. For example, I =[n..n ]I implies that [n..n ] is the head o the sequence I and I is its tail. The symbol ξ stands or a sequence o eature names. We use pattern matching on the type o the parameter o the unction T (... ). According to the meta model in Figure, the parameter is a node object that can be either a eature node or a grouping node. The unction T dispatches accordingly. The translation starts with T ( ε,,... ),where is the root eature o the diagram. First, we speciy the case or a eature node: i n =0 : { F ξ (, ) } I... i n>0 : { F ξ (, N ξ... N ξ n ) } n T ξ,m,. = i I = ε : { N ξ n i } i I n n... i I ε : N ( N ξ i, I i, F i ξ i ) i i= T ( ξ,i, i... ) where ξ = ξ m It needs a unction which generates productions or each number in the eature cardinality. i N ( N, I, F )= i I = ε : ε ( I =[n..n i 2 ]I ) n <n 2 < i ( I =[n..n]i n< ( I =[n.. ]I 0 <n ) ) : { N {N n } } N ( N, [(n +)..n 2 ]I, F ) N ( N n,n, F ) : { N {N n } } N( N, I, F ) N ( N n,n, F ) : { N {N n }, N {N (n+ ) }, N (n+ ) F, N n, N (n+ ) F, N (n+ ), N n N (n, F )} i I =[0.. ]I : { N {N 0 }, N {N }, N F, N F, N, N 0 ɛ} 6

17 The ollowing unctions generate a production which repeats the non-terminal F, separated by commas, as indicated by n. { i n =0 : { N ɛ} N ( N,n,F)= i n>0 : { N N (n, F )} { i n = : F N (n, F )= i n> : F, N (n, F ) T Now, we consider the case or a grouping node: i n =0 : { F ξ ɛ} i 0 <n= n : { F ξ Gξ n } G( Gξ n,n,ξ, k... ) k... (T ( ξ,i, i... ) ) ξ,m, n n. = i= k... i n<n : { F ξ Gξ n } G( Gξ n,n,ξ, k... )... T ξ,m, n n.. k... where ξ = ξ m and n = n + It requires two unctions G and G, which are very similar. Together, they generate all possible combinations o n subeatures or the grouping node. We need two unctions because we have to deal separately with the irst selected eature and any possibly remaining eatures because o the comma separation. Note that or the case n = k, wehave to take all subeatures. In case we have n<k,we can either select the subeature or not. i n =0 : { G ɛ} G( G,n,ξ, k... )= i 0 <n<k : G ( G, F ξ k k,n,ξ, k... ) G( G,n,ξ, k... ) i 0 <n= k : G ( G, F ξ k k,n,ξ, k... ) i n =0 : { G α} G i 0 <n<k : ( G,α,n,ξ, k... )= G ( G,α,n,ξ, k... ) G ( G,α,n,ξ, k... ) i 0 <n= k : G ( G,α,n,ξ, k... ) where α = F ξ k k, α 7

18 4. Semantics o Feature Models In general, the semantics o a eature model can be deined by the set o all possible conigurations captured by the eature model. A coniguration itsel is denoted by a structured set o eatures, which are chosen according to the inormal rules o interpretation o eature diagrams. Although this description is suicient in practice, it is helpul to provide a more ormal semantics to improve the understanding o some o the intricacies o eature modeling. For example, a ormal semantics allows us to deine exactly what it means when two apparently dierent eature models are equivalent, i.e., when they denote the same set o conigurations. Consider the context-ree grammar generated rom a cardinality-based eature model. We deine the semantics o a eature model as an interpretation o the sentences rom the language recognized by the grammar. Each individual sentence o the recognized language corresponds to exactly one coniguration. For example, the ollowing string is recognized by the grammar in Appendix A and thus, represents a valid coniguration o the eature diagram in Figure 4: (,{(, ), (, )} {(, )} {( 4, {( 5, )} {( 6, ), (, )})}) Although the string is nothing more than a sequence o terminals, we can assign it a semantic interpretation as ollows: each pair is an element rom the relation between eatures (identiied by their eature names) and their multiset o subeatures. The semantics o the entire eature model is now deined as the set o all such conigurations. There are a ew observations to make at this point: The sentences representing conigurations still contain the tree structure o the eature diagram via the nested pairs o eatures and their subeatures. This is important because a coniguration not only represents what eatures are selected but also how they it in the hierarchy. The second element o a pair is a multiset, notaset.thisimpliesthateach occurrence o the same eature name is semantically relevant or a coniguration. Moreover, we cannot use sequences to represent subeatures, because the order in which eatures are chosen is not relevant or the result coniguration. The semantics o eature diagrams via context-ree grammars is layered: irst, we interpret a eature model as a language that the corresponding grammar recognizes. Second, we interpret the recognized language in a standard mathematical way to obtain a denotation or the eature model. It is relatively easy to add attribute types to the generated grammar. For aeature with an attribute o type t, wewanttobeabletoconstructa coniguration triple consisting o the eature, a value v o the type t, and a multiset o possible subeatures. In the production o the eature,wehavea non-terminal T t at the position or the value. The non-terminal represents the type t at the grammar level. This is achieved by a set o productions 8

19 with let-hand side T t, encoding all possible values in t. Thesemantics o the eature diagram will now include all possible conigurations with a particular value o the type t. I a eature diagram has already assigned a value v to the attribute, we can simply adapt the productions or T t in such a way that they only recognize v. In this case, the adapted productions or T t actually stand or the singleton type {v}. 5 Feature Model Specialization and Context-Free Grammars In Section.2, we discussed the possible specialization steps to achieve staged coniguration o eature models. Specialization o a eature model can also be interpreted on the level o its grammar equivalent. 5. Specialization as a Grammar Transormation In this section, we give an inormal discussion on how to achieve each individual specialization step o Section.2 by grammar transormations, where we omit the initialization o attributes. We do not provide a ormal algorithm because it would unnecessarily clutter the exposition. Instead, we explain the dierent specialization operations by means o the example eature diagram in Figure 4. Reining eature cardinalities Consider the eature cardinality [..2][4.. ] o the eature node or. This cardinality is represented by the production rules with let-hand side N. In Section.2, we gave several possibilities to reine a eature cardinality, including the removal o an interval, reducing an interval and splitting it. On the level o the grammar, this amounts to removing the productions that stand or any o the numbers, 2, and 4 rom the cardinality. In other words, delete the production N { N i },wherei {, 2, 4}. The reduction o the interval [4.. ] to [4..4] simply requires the removal o N {N5 }. Observe that the removal o these kind o productions leaves several more productions in the grammar dead, i.e., they are never used whenever we try to accept a sentence starting with the start symbol. In the remaining o this section, we will assume that dead productions are automatically garbage collected. The nature o the grammar has excluded one category o reinement so ar: the reduction or splitting o [4.. ] into two intervals [4..m] and[m.. ], where m>4. That is because the encoding o the Kleene star at the grammar level uses recursion. In order to achieve a reinement o [4.. ] involving a number m>4, we have to unroll the productions that encode the Kleene star. In the example, suppose we want to split [4.. ] into [4..6][7.. ], we have to replace the productions N { N 5 }, N 5 F, N 4,and 9

20 N 5 F, N 5 by the ollowing rules: N N {N5 } N {N6 } N {N 7 } {N 8 N 7 F, N 6 } N 5 F, N 4 N 8 F, N 7 N 6 F, N 5 N 8 F, N 8 The translation process might want to expand the productions with let-hand side N 5, N 6,and N 7 as well. This will guarantee that the new grammar would be identical to the grammar that the translation o the specialized eature diagram generates. Reining group cardinalities Because the reinement o a group cardinality is a simpliication o the reinement o a eature cardinality, we can use the same process as above. However, we are only allowed to remove productions in such a way that we reduce the interval. In the example, we can reduce the group cardinality 2 o the eature group o 4 by removing either the production F 4 g 2 G2 4 g 2 (constructing the group cardinality ) or the production F 4 g 2 G 4 g 2 (constructing the group cardinality 2 2 ). Removing a subeature rom a group To remove a subeature node with identiication id rom a eature group, we have to eliminate the productions with let-hand side G i id that have the non-terminal F id in their right-hand side. For example, suppose we want to remove the eature node or 8 rom the eature group o 4 in Figure 4, we have to eliminate the ollowing productions: G 2 4 g F 2 4 g 2 6, F 4 g 2 8 G 2 4 g F 2 4 g 2 7 2, F 4 g 2 8 G 2 4 g F 2 4 g 2 8, F 4 g 2 4 G 4 g F 2 4 g 2 6, F 4 g 2 7 2, F 4 g 2 8 G 4 g F 2 4 g 2 7 2, F 4 g 2 8, F 4 g 2 4 G 4 g F 2 4 g 2 6, F 4 g 2 8, F 4 g 2 4 However, as we noted in Section.2, the new upper bound o the group cardinality is n = min(n,k ) where n is the old upper bound and k the old size o the group. I n = n, nothing else has to be done. However, i n <n, then we also have to remove all the productions o the orm F id Gid i,where i {n +,...,n }. In the example, this means that we have to eliminate F 4 g 2 G 4 g once we remove another subeature rom the group. 2 Cloning a solitary subeature Cloning a solitary subeature on the grammar level involves several dierent operations. Suppose we want to clone a subeature with original eature cardinality I and give it a ixed eature cardinality [m..m]. 20

21 First, we have to make sure that we split I suiciently so that at least one interval [n..n ]ini has m<n. For example, i we have m =oreature in the example, nothing has to happen. However, i we have m =oreature 5, we have to unroll the Kleene star suiciently to turn [0.. ] into [0..][4.. ]. This step guarantees that we have a production in the grammar which has at least m non-terminals F id,whereid is the identity o the to-be-cloned subeature. For the second step, we have to perorm a process called production splitting. To explain this, let us clone rom the example with a ixed eature cardinality [..]. The production N 4 F, F, F, F represents the number 4 in the original eature cardinality, so we turn it into two productions N F and N F 4 4, F 4, F 4. The new identity 4 stands or the unique eature node that now occurs as a new sibling o the old node or. The superscript 4 indicates that it is the 4 th sibling. Next, we simply duplicate all the production rules that are reachable rom the non-terminal F, but rename each non-terminal in a unique way. The occurrences o F, however, have to be substituted or F 4. This process obviously does not change the semantics o the grammar as it is the equivalent o duplicating the descendent nodes o the node or in the actual eature diagram. Because we have split the production or N 4 let-hand side non-terminals N and N 4 also upwards in the grammar. To this end, we split N N { N } and N 4 { N 4 into two productions with, we have to relect this change { N 4 } into }. The production or the parent represents o the to-be-cloned eature has to be updated to relect that N 4 the eature cardinality o the new subeature node, so we change it into F (, N N 4 N g 2 N 4 ). We are not done because we still have to relect the changes incurred by L (, [..2][4.. ]) on the eature cardinality o the original node. This is done by ollowing an analogous process as in the deinition L (m, I), but this time on the superscripts o the non-terminal N. The rules where the superscript is smaller than m are eliminated. For rules where the superscript is greater or equal to m, we simply reduce the superscripts with m. Here too, the change in the grammar will at most imply that less sentences are recognized because we only eliminate grammar productions (the renaming o non-terminals does not aect the sentences being recognized). N In the example, this means that we get rid o N and N 5 F, N { N 2 }.Therules N F, N 5,and N 2 { N 5 are renamed into N, N 2 respectively. F 2 }, N 5 { N } and F, N 4, { N 2 }, N 2

22 5.2 Specialization does not add Conigurations The inormal transormation rules described above are designed in such a way that the resulting specialized grammar recognizes a language which, when interpreted, is a subset o the interpretation o the language recognized by the original non-specialized grammar. This is not very diicult to understand, because, with the exception o production splitting and production unolding, all the previously described transormations only eliminate productions and hence, only remove sentences rom the recognized language. Moreover, it is also relatively straightorward to see that the unrolling o the Kleene star preserves any recognized language, i.e., it does not remove or add sentences. Production splitting also preserves any recognized language by the grammar, but it is slightly more involved to prove this act, even though it is airly intuitive to understand. The main observation rom these properties is that eature diagram specialization does not increase the possible set o conigurations, which is exactly what we expect rom such a process. 6 Related Work Since its initial introduction in [9], several extensions and variants o the original FODA notation have been proposed [8 0, 6, 8, 20, 22, 2]. We introduced the cardinality-based notation or eature modeling described in Section 2 in a previous paper []. The notation integrates our earlier extensions: eature cardinalities [9], group cardinalities [22], eature diagram reerences [], and attributes [, 9]. This mix o concepts has been determined by our experience in applying eature modeling in practice (e.g., see [9]) and has been motivated in []. Other extensions such as consists-o or is-generalization-o relationships between eatures [6, 20, 2], as well as additional inormation on eatures such as descriptions, categories, binding time, priorities, stakeholders, exemplar systems, etc., are let to be handled as user-deined, structured annotations. Such annotations are also supported through an extensible meta model [, 9]. In this paper, we propose a ormalization o eature diagrams, which is not the irst attempt to do so. Van Deursen and Klint [4] use algebraic speciications to ormally deine FODA-style eature diagrams with exclusive-or groups. However, that work does not consider eature or group cardinalities. Moreover, we also give a ormal characterization o the specialization o cardinality-based eature models. The correspondence between eature diagrams and grammars has been suggested in a position paper by de Jonge and Visser [2]. While they only illustrate the idea using a simple FODA-like eature diagram and a grammar o a possible coniguration language corresponding to the sample diagram, we give a ull and precise semantics or cardinality-based eature diagrams and their specialization. The correspondence between eature diagrams and grammars can actually be traced back at least to early 70s, when Hall presented a ormal connection between and-or graphs and context-ree grammars in [7]. And-or graphs are used 22

Automated Planning for Feature Model Configuration based on Functional and Non-Functional Requirements

Automated Planning for Feature Model Configuration based on Functional and Non-Functional Requirements Automated Planning or Feature Model Coniguration based on Functional and Non-Functional Requirements Samaneh Soltani 1, Mohsen Asadi 1, Dragan Gašević 2, Marek Hatala 1, Ebrahim Bagheri 2 1 Simon Fraser

More information

MATRIX ALGORITHM OF SOLVING GRAPH CUTTING PROBLEM

MATRIX ALGORITHM OF SOLVING GRAPH CUTTING PROBLEM UDC 681.3.06 MATRIX ALGORITHM OF SOLVING GRAPH CUTTING PROBLEM V.K. Pogrebnoy TPU Institute «Cybernetic centre» E-mail: vk@ad.cctpu.edu.ru Matrix algorithm o solving graph cutting problem has been suggested.

More information

2. Getting Started with the Graphical User Interface

2. Getting Started with the Graphical User Interface February 2011 NII52017-10.1.0 2. Getting Started with the Graphical User Interace NII52017-10.1.0 The Nios II Sotware Build Tools (SBT) or Eclipse is a set o plugins based on the popular Eclipse ramework

More information

2.2 Syntax Definition

2.2 Syntax Definition 42 CHAPTER 2. A SIMPLE SYNTAX-DIRECTED TRANSLATOR sequence of "three-address" instructions; a more complete example appears in Fig. 2.2. This form of intermediate code takes its name from instructions

More information

2. Design Planning with the Quartus II Software

2. Design Planning with the Quartus II Software November 2013 QII51016-13.1.0 2. Design Planning with the Quartus II Sotware QII51016-13.1.0 This chapter discusses key FPGA design planning considerations, provides recommendations, and describes various

More information

9. Reviewing Printed Circuit Board Schematics with the Quartus II Software

9. Reviewing Printed Circuit Board Schematics with the Quartus II Software November 2012 QII52019-12.1.0 9. Reviewing Printed Circuit Board Schematics with the Quartus II Sotware QII52019-12.1.0 This chapter provides guidelines or reviewing printed circuit board (PCB) schematics

More information

Ad-hoc Workflow: Problems and Solutions

Ad-hoc Workflow: Problems and Solutions Ad-hoc Worklow: Problems and Solutions M. Voorhoeve and W. van der Aalst Dept. o Mathematics and Computing Science Eindhoven University o Technology Eindhoven, The Netherlands, 5600MB Abstract The paper

More information

Binary recursion. Unate functions. If a cover C(f) is unate in xj, x, then f is unate in xj. x

Binary recursion. Unate functions. If a cover C(f) is unate in xj, x, then f is unate in xj. x Binary recursion Unate unctions! Theorem I a cover C() is unate in,, then is unate in.! Theorem I is unate in,, then every prime implicant o is unate in. Why are unate unctions so special?! Special Boolean

More information

Generell Topologi. Richard Williamson. May 6, 2013

Generell Topologi. Richard Williamson. May 6, 2013 Generell Topologi Richard Williamson May 6, Thursday 7th January. Basis o a topological space generating a topology with a speciied basis standard topology on R examples Deinition.. Let (, O) be a topological

More information

Handout 9: Imperative Programs and State

Handout 9: Imperative Programs and State 06-02552 Princ. of Progr. Languages (and Extended ) The University of Birmingham Spring Semester 2016-17 School of Computer Science c Uday Reddy2016-17 Handout 9: Imperative Programs and State Imperative

More information

Piecewise polynomial interpolation

Piecewise polynomial interpolation Chapter 2 Piecewise polynomial interpolation In ection.6., and in Lab, we learned that it is not a good idea to interpolate unctions by a highorder polynomials at equally spaced points. However, it transpires

More information

Neighbourhood Operations

Neighbourhood Operations Neighbourhood Operations Neighbourhood operations simply operate on a larger neighbourhood o piels than point operations Origin Neighbourhoods are mostly a rectangle around a central piel Any size rectangle

More information

COMS W4705, Spring 2015: Problem Set 2 Total points: 140

COMS W4705, Spring 2015: Problem Set 2 Total points: 140 COM W4705, pring 2015: Problem et 2 Total points: 140 Analytic Problems (due March 2nd) Question 1 (20 points) A probabilistic context-ree grammar G = (N, Σ, R,, q) in Chomsky Normal Form is deined as

More information

THE FINANCIAL CALCULATOR

THE FINANCIAL CALCULATOR Starter Kit CHAPTER 3 Stalla Seminars THE FINANCIAL CALCULATOR In accordance with the AIMR calculator policy in eect at the time o this writing, CFA candidates are permitted to use one o two approved calculators

More information

A Requirement Specification Language for Configuration Dynamics of Multiagent Systems

A Requirement Specification Language for Configuration Dynamics of Multiagent Systems A Requirement Speciication Language or Coniguration Dynamics o Multiagent Systems Mehdi Dastani, Catholijn M. Jonker, Jan Treur* Vrije Universiteit Amsterdam, Department o Artiicial Intelligence, De Boelelaan

More information

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1 CME 305: Discrete Mathematics and Algorithms Instructor: Professor Aaron Sidford (sidford@stanford.edu) January 11, 2018 Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1 In this lecture

More information

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

Semantics via Syntax. f (4) = if define f (x) =2 x + 55. 1 Semantics via Syntax The specification of a programming language starts with its syntax. As every programmer knows, the syntax of a language comes in the shape of a variant of a BNF (Backus-Naur Form)

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

Using VCS with the Quartus II Software

Using VCS with the Quartus II Software Using VCS with the Quartus II Sotware December 2002, ver. 1.0 Application Note 239 Introduction As the design complexity o FPGAs continues to rise, veriication engineers are inding it increasingly diicult

More information

CS4215 Programming Language Implementation. Martin Henz

CS4215 Programming Language Implementation. Martin Henz CS4215 Programming Language Implementation Martin Henz Thursday 26 January, 2012 2 Chapter 4 The Language simpl In this chapter, we are exting the language epl in order to provide a more powerful programming

More information

A Proposed Approach for Solving Rough Bi-Level. Programming Problems by Genetic Algorithm

A Proposed Approach for Solving Rough Bi-Level. Programming Problems by Genetic Algorithm Int J Contemp Math Sciences, Vol 6, 0, no 0, 45 465 A Proposed Approach or Solving Rough Bi-Level Programming Problems by Genetic Algorithm M S Osman Department o Basic Science, Higher Technological Institute

More information

A Small Interpreted Language

A Small Interpreted Language A Small Interpreted Language What would you need to build a small computing language based on mathematical principles? The language should be simple, Turing equivalent (i.e.: it can compute anything that

More information

10. SOPC Builder Component Development Walkthrough

10. SOPC Builder Component Development Walkthrough 10. SOPC Builder Component Development Walkthrough QII54007-9.0.0 Introduction This chapter describes the parts o a custom SOPC Builder component and guides you through the process o creating an example

More information

Section II. Nios II Software Development

Section II. Nios II Software Development Section II. Nios II Sotware Development This section o the Embedded Design Handbook describes how to most eectively use the Altera tools or embedded system sotware development, and recommends design styles

More information

A Classification System and Analysis for Aspect-Oriented Programs

A Classification System and Analysis for Aspect-Oriented Programs A Classiication System and Analysis or Aspect-Oriented Programs Martin Rinard, Alexandru Sălcianu, and Suhabe Bugrara Massachusetts Institute o Technology Cambridge, MA 02139 ABSTRACT We present a new

More information

6.001 Notes: Section 8.1

6.001 Notes: Section 8.1 6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything

More information

Basic Structure of Denotational Definitions

Basic Structure of Denotational Definitions asic Structure of Denotational Definitions This chapter presents the format for denotational definitions. We use the abstract syntax and semantic algebra formats to define the appearance and the meaning

More information

2. Recommended Design Flow

2. Recommended Design Flow 2. Recommended Design Flow This chapter describes the Altera-recommended design low or successully implementing external memory interaces in Altera devices. Altera recommends that you create an example

More information

Classifier Evasion: Models and Open Problems

Classifier Evasion: Models and Open Problems Classiier Evasion: Models and Open Problems Blaine Nelson 1, Benjamin I. P. Rubinstein 2, Ling Huang 3, Anthony D. Joseph 1,3, and J. D. Tygar 1 1 UC Berkeley 2 Microsot Research 3 Intel Labs Berkeley

More information

WHEN DO THREE LONGEST PATHS HAVE A COMMON VERTEX?

WHEN DO THREE LONGEST PATHS HAVE A COMMON VERTEX? WHEN DO THREE LONGEST PATHS HAVE A COMMON VERTEX? MARIA AXENOVICH Abstract. It is well known that any two longest paths in a connected graph share a vertex. It is also known that there are connected graphs

More information

The λ-calculus. 1 Background on Computability. 2 Some Intuition for the λ-calculus. 1.1 Alan Turing. 1.2 Alonzo Church

The λ-calculus. 1 Background on Computability. 2 Some Intuition for the λ-calculus. 1.1 Alan Turing. 1.2 Alonzo Church The λ-calculus 1 Background on Computability The history o computability stretches back a long ways, but we ll start here with German mathematician David Hilbert in the 1920s. Hilbert proposed a grand

More information

Chapter 3 Image Enhancement in the Spatial Domain

Chapter 3 Image Enhancement in the Spatial Domain Chapter 3 Image Enhancement in the Spatial Domain Yinghua He School o Computer Science and Technology Tianjin University Image enhancement approaches Spatial domain image plane itsel Spatial domain methods

More information

A Fault Model Centered Modeling Framework for Self-healing Computing Systems

A Fault Model Centered Modeling Framework for Self-healing Computing Systems A Fault Model Centered Modeling Framework or Sel-healing Computing Systems Wei Lu 1, Yian Zhu 1, Chunyan Ma 1, and Longmei Zhang 2 1 Department o Sotware and Microelectronics, Northwestern Polytechnical

More information

Open XML Requirements Specifications, a Xylia based application

Open XML Requirements Specifications, a Xylia based application Open XML Requirements Specifications, a Xylia based application Naeim Semsarilar Dennis K. Peters Theodore S. Norvell Faculty of Engineering and Applied Science Memorial University of Newfoundland November

More information

Comp 411 Principles of Programming Languages Lecture 3 Parsing. Corky Cartwright January 11, 2019

Comp 411 Principles of Programming Languages Lecture 3 Parsing. Corky Cartwright January 11, 2019 Comp 411 Principles of Programming Languages Lecture 3 Parsing Corky Cartwright January 11, 2019 Top Down Parsing What is a context-free grammar (CFG)? A recursive definition of a set of strings; it is

More information

9.8 Graphing Rational Functions

9.8 Graphing Rational Functions 9. Graphing Rational Functions Lets begin with a deinition. Deinition: Rational Function A rational unction is a unction o the orm P where P and Q are polynomials. Q An eample o a simple rational unction

More information

Research Article Synthesis of Test Scenarios Using UML Sequence Diagrams

Research Article Synthesis of Test Scenarios Using UML Sequence Diagrams International Scholarly Research Network ISRN Sotware Engineering Volume 2012, Article ID 324054, 22 pages doi:10.5402/2012/324054 Research Article Synthesis o Test Scenarios Using UML Sequence Diagrams

More information

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS Objective PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS Explain what is meant by compiler. Explain how the compiler works. Describe various analysis of the source program. Describe the

More information

Byzantine Consensus in Directed Graphs

Byzantine Consensus in Directed Graphs Byzantine Consensus in Directed Graphs Lewis Tseng 1,3, and Nitin Vaidya 2,3 1 Department of Computer Science, 2 Department of Electrical and Computer Engineering, and 3 Coordinated Science Laboratory

More information

Proceedings of the Sixth International Workshop on Graph Transformation and Visual Modeling Techniques (GT-VMT 2007)

Proceedings of the Sixth International Workshop on Graph Transformation and Visual Modeling Techniques (GT-VMT 2007) Electronic Communications o the EASST Volume X (2007) Proceedings o the Sixth International Workshop on Graph Transormation and Visual Modeling Techniques (GT-VMT 2007) Visual Programming with Recursion

More information

Hardware versus software

Hardware versus software Logic 1 Hardware versus software 2 In hardware such as chip design or architecture, designs are usually proven to be correct using proof tools In software, a program is very rarely proved correct Why?

More information

The Encoding Complexity of Network Coding

The Encoding Complexity of Network Coding The Encoding Complexity of Network Coding Michael Langberg Alexander Sprintson Jehoshua Bruck California Institute of Technology Email: mikel,spalex,bruck @caltech.edu Abstract In the multicast network

More information

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic 3.4 Deduction and Evaluation: Tools 3.4.1 Conditional-Equational Logic The general definition of a formal specification from above was based on the existence of a precisely defined semantics for the syntax

More information

Compiler Theory. (Semantic Analysis and Run-Time Environments)

Compiler Theory. (Semantic Analysis and Run-Time Environments) Compiler Theory (Semantic Analysis and Run-Time Environments) 005 Semantic Actions A compiler must do more than recognise whether a sentence belongs to the language of a grammar it must do something useful

More information

13. Power Optimization

13. Power Optimization 13. Power Optimization May 2013 QII52016-13.0.0 QII52016-13.0.0 The Quartus II sotware oers power-driven compilation to ully optimize device power consumption. Power-driven compilation ocuses on reducing

More information

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Compiler Design

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Compiler Design i About the Tutorial A compiler translates the codes written in one language to some other language without changing the meaning of the program. It is also expected that a compiler should make the target

More information

Certificate Translation for Optimizing Compilers

Certificate Translation for Optimizing Compilers Certiicate Translation or Optimizing Compilers Gilles Barthe IMDEA Sotware and Benjamin Grégoire and César Kunz and Tamara Rezk INRIA Sophia Antipolis - Méditerranée Proo Carrying Code provides trust in

More information

Intelligent knowledge-based system for the automated screwing process control

Intelligent knowledge-based system for the automated screwing process control Intelligent knowledge-based system or the automated screwing process control YULIYA LEBEDYNSKA yuliya.lebedynska@tu-cottbus.de ULRICH BERGER Chair o automation Brandenburg University o Technology Cottbus

More information

6.001 Notes: Section 6.1

6.001 Notes: Section 6.1 6.001 Notes: Section 6.1 Slide 6.1.1 When we first starting talking about Scheme expressions, you may recall we said that (almost) every Scheme expression had three components, a syntax (legal ways of

More information

The PCAT Programming Language Reference Manual

The PCAT Programming Language Reference Manual The PCAT Programming Language Reference Manual Andrew Tolmach and Jingke Li Dept. of Computer Science Portland State University September 27, 1995 (revised October 15, 2002) 1 Introduction The PCAT language

More information

Connecting Definition and Use? Tiger Semantic Analysis. Symbol Tables. Symbol Tables (cont d)

Connecting Definition and Use? Tiger Semantic Analysis. Symbol Tables. Symbol Tables (cont d) Tiger source program Tiger Semantic Analysis lexical analyzer report all lexical errors token get next token parser construct variable deinitions to their uses report all syntactic errors absyn checks

More information

Variables. Substitution

Variables. Substitution Variables Elements of Programming Languages Lecture 4: Variables, binding and substitution James Cheney University of Edinburgh October 6, 2015 A variable is a symbol that can stand for another expression.

More information

Treewidth and graph minors

Treewidth and graph minors Treewidth and graph minors Lectures 9 and 10, December 29, 2011, January 5, 2012 We shall touch upon the theory of Graph Minors by Robertson and Seymour. This theory gives a very general condition under

More information

Consider a description of arithmetic. It includes two equations that define the structural types of digit and operator:

Consider a description of arithmetic. It includes two equations that define the structural types of digit and operator: Syntax A programming language consists of syntax, semantics, and pragmatics. We formalize syntax first, because only syntactically correct programs have semantics. A syntax definition of a language lists

More information

1.3. Conditional expressions To express case distinctions like

1.3. Conditional expressions To express case distinctions like Introduction Much of the theory developed in the underlying course Logic II can be implemented in a proof assistant. In the present setting this is interesting, since we can then machine extract from a

More information

CS 6110 S14 Lecture 38 Abstract Interpretation 30 April 2014

CS 6110 S14 Lecture 38 Abstract Interpretation 30 April 2014 CS 6110 S14 Lecture 38 Abstract Interpretation 30 April 2014 1 Introduction to Abstract Interpretation At this point in the course, we have looked at several aspects of programming languages: operational

More information

The XQuery Data Model

The XQuery Data Model The XQuery Data Model 9. XQuery Data Model XQuery Type System Like for any other database query language, before we talk about the operators of the language, we have to specify exactly what it is that

More information

Discrete mathematics

Discrete mathematics Discrete mathematics Petr Kovář petr.kovar@vsb.cz VŠB Technical University of Ostrava DiM 470-2301/02, Winter term 2018/2019 About this file This file is meant to be a guideline for the lecturer. Many

More information

Proportional-Share Scheduling for Distributed Storage Systems

Proportional-Share Scheduling for Distributed Storage Systems Proportional-Share Scheduling or Distributed Storage Systems Abstract Yin Wang University o Michigan yinw@eecs.umich.edu Fully distributed storage systems have gained popularity in the past ew years because

More information

On k-dimensional Balanced Binary Trees*

On k-dimensional Balanced Binary Trees* journal of computer and system sciences 52, 328348 (1996) article no. 0025 On k-dimensional Balanced Binary Trees* Vijay K. Vaishnavi Department of Computer Information Systems, Georgia State University,

More information

CS 6110 S14 Lecture 1 Introduction 24 January 2014

CS 6110 S14 Lecture 1 Introduction 24 January 2014 CS 6110 S14 Lecture 1 Introduction 24 January 2014 1 Introduction What is a program? Is it just something that tells the computer what to do? Yes, but there is much more to it than that. The basic expressions

More information

Lagrangian relaxations for multiple network alignment

Lagrangian relaxations for multiple network alignment Noname manuscript No. (will be inserted by the editor) Lagrangian relaxations or multiple network alignment Eric Malmi Sanjay Chawla Aristides Gionis Received: date / Accepted: date Abstract We propose

More information

Faster parameterized algorithms for Minimum Fill-In

Faster parameterized algorithms for Minimum Fill-In Faster parameterized algorithms for Minimum Fill-In Hans L. Bodlaender Pinar Heggernes Yngve Villanger Abstract We present two parameterized algorithms for the Minimum Fill-In problem, also known as Chordal

More information

Polymorphic lambda calculus Princ. of Progr. Languages (and Extended ) The University of Birmingham. c Uday Reddy

Polymorphic lambda calculus Princ. of Progr. Languages (and Extended ) The University of Birmingham. c Uday Reddy 06-02552 Princ. of Progr. Languages (and Extended ) The University of Birmingham Spring Semester 2016-17 School of Computer Science c Uday Reddy2016-17 Handout 6: Polymorphic Type Systems 1. Polymorphic

More information

Formal semantics of loosely typed languages. Joep Verkoelen Vincent Driessen

Formal semantics of loosely typed languages. Joep Verkoelen Vincent Driessen Formal semantics of loosely typed languages Joep Verkoelen Vincent Driessen June, 2004 ii Contents 1 Introduction 3 2 Syntax 5 2.1 Formalities.............................. 5 2.2 Example language LooselyWhile.................

More information

Section III. Advanced Programming Topics

Section III. Advanced Programming Topics Section III. Advanced Programming Topics This section provides inormation about several advanced embedded programming topics. It includes the ollowing chapters: Chapter 8, Exception Handling Chapter 9,

More information

Functional Languages. Hwansoo Han

Functional Languages. Hwansoo Han Functional Languages Hwansoo Han Historical Origins Imperative and functional models Alan Turing, Alonzo Church, Stephen Kleene, Emil Post, etc. ~1930s Different formalizations of the notion of an algorithm

More information

An Efficient Configuration Methodology for Time-Division Multiplexed Single Resources

An Efficient Configuration Methodology for Time-Division Multiplexed Single Resources An Eicient Coniguration Methodology or Time-Division Multiplexed Single Resources Benny Akesson 1, Anna Minaeva 1, Přemysl Šůcha 1, Andrew Nelson 2 and Zdeněk Hanzálek 1 1 Czech Technical University in

More information

This book is licensed under a Creative Commons Attribution 3.0 License

This book is licensed under a Creative Commons Attribution 3.0 License 6. Syntax Learning objectives: syntax and semantics syntax diagrams and EBNF describe context-free grammars terminal and nonterminal symbols productions definition of EBNF by itself parse tree grammars

More information

Unsupervised Learning of Probabilistic Models for Robot Navigation

Unsupervised Learning of Probabilistic Models for Robot Navigation Unsupervised Learning o Probabilistic Models or Robot Navigation Sven Koenig Reid G. Simmons School o Computer Science, Carnegie Mellon University Pittsburgh, PA 15213-3891 Abstract Navigation methods

More information

SOFTWARE ENGINEERING DESIGN I

SOFTWARE ENGINEERING DESIGN I 2 SOFTWARE ENGINEERING DESIGN I 3. Schemas and Theories The aim of this course is to learn how to write formal specifications of computer systems, using classical logic. The key descriptional technique

More information

On the Relationships between Zero Forcing Numbers and Certain Graph Coverings

On the Relationships between Zero Forcing Numbers and Certain Graph Coverings On the Relationships between Zero Forcing Numbers and Certain Graph Coverings Fatemeh Alinaghipour Taklimi, Shaun Fallat 1,, Karen Meagher 2 Department of Mathematics and Statistics, University of Regina,

More information

ARELAY network consists of a pair of source and destination

ARELAY network consists of a pair of source and destination 158 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL 55, NO 1, JANUARY 2009 Parity Forwarding for Multiple-Relay Networks Peyman Razaghi, Student Member, IEEE, Wei Yu, Senior Member, IEEE Abstract This paper

More information

CSCI B522 Lecture 11 Naming and Scope 8 Oct, 2009

CSCI B522 Lecture 11 Naming and Scope 8 Oct, 2009 CSCI B522 Lecture 11 Naming and Scope 8 Oct, 2009 Lecture notes for CS 6110 (Spring 09) taught by Andrew Myers at Cornell; edited by Amal Ahmed, Fall 09. 1 Static vs. dynamic scoping The scope of a variable

More information

Chapter 2: Number Systems

Chapter 2: Number Systems Chapter 2: Number Systems Logic circuits are used to generate and transmit 1s and 0s to compute and convey information. This two-valued number system is called binary. As presented earlier, there are many

More information

Chapter S:II. II. Search Space Representation

Chapter S:II. II. Search Space Representation Chapter S:II II. Search Space Representation Systematic Search Encoding of Problems State-Space Representation Problem-Reduction Representation Choosing a Representation S:II-1 Search Space Representation

More information

Propositional Logic. Part I

Propositional Logic. Part I Part I Propositional Logic 1 Classical Logic and the Material Conditional 1.1 Introduction 1.1.1 The first purpose of this chapter is to review classical propositional logic, including semantic tableaux.

More information

The λ-calculus. 1 Background on Computability. 2 Programming Paradigms and Functional Programming. 1.1 Alan Turing. 1.

The λ-calculus. 1 Background on Computability. 2 Programming Paradigms and Functional Programming. 1.1 Alan Turing. 1. The λ-calculus 1 Background on Computability The history o computability stretches back a long ways, but we ll start here with German mathematician David Hilbert in the 1920s. Hilbert proposed a grand

More information

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np Chapter 1: Introduction Introduction Purpose of the Theory of Computation: Develop formal mathematical models of computation that reflect real-world computers. Nowadays, the Theory of Computation can be

More information

Fundamental Concepts. Chapter 1

Fundamental Concepts. Chapter 1 Chapter 1 Fundamental Concepts This book is about the mathematical foundations of programming, with a special attention on computing with infinite objects. How can mathematics help in programming? There

More information

Reflection and Refraction

Reflection and Refraction Relection and Reraction Object To determine ocal lengths o lenses and mirrors and to determine the index o reraction o glass. Apparatus Lenses, optical bench, mirrors, light source, screen, plastic or

More information

Joint Entity Resolution

Joint Entity Resolution Joint Entity Resolution Steven Euijong Whang, Hector Garcia-Molina Computer Science Department, Stanford University 353 Serra Mall, Stanford, CA 94305, USA {swhang, hector}@cs.stanford.edu No Institute

More information

Faster parameterized algorithms for Minimum Fill-In

Faster parameterized algorithms for Minimum Fill-In Faster parameterized algorithms for Minimum Fill-In Hans L. Bodlaender Pinar Heggernes Yngve Villanger Technical Report UU-CS-2008-042 December 2008 Department of Information and Computing Sciences Utrecht

More information

CS4215 Programming Language Implementation. Martin Henz

CS4215 Programming Language Implementation. Martin Henz CS4215 Programming Language Implementation Martin Henz Thursday 15 March, 2012 2 Chapter 11 impl: A Simple Imperative Language 11.1 Introduction So far, we considered only languages, in which an identifier

More information

Languages and Compilers

Languages and Compilers Principles of Software Engineering and Operational Systems Languages and Compilers SDAGE: Level I 2012-13 3. Formal Languages, Grammars and Automata Dr Valery Adzhiev vadzhiev@bournemouth.ac.uk Office:

More information

Chapter 3. Describing Syntax and Semantics

Chapter 3. Describing Syntax and Semantics Chapter 3 Describing Syntax and Semantics Chapter 3 Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute Grammars Describing the Meanings of Programs:

More information

Object-oriented Compiler Construction

Object-oriented Compiler Construction 1 Object-oriented Compiler Construction Extended Abstract Axel-Tobias Schreiner, Bernd Kühl University of Osnabrück, Germany {axel,bekuehl}@uos.de, http://www.inf.uos.de/talks/hc2 A compiler takes a program

More information

Compiler construction

Compiler construction This lecture Compiler construction Lecture 5: Project etensions Magnus Mreen Spring 2018 Chalmers Universit o Technolog Gothenburg Universit Some project etensions: Arras Pointers and structures Object-oriented

More information

CS 161: Design and Analysis of Algorithms

CS 161: Design and Analysis of Algorithms CS 161: Design and Analysis o Algorithms Announcements Homework 3, problem 3 removed Greedy Algorithms 4: Human Encoding/Set Cover Human Encoding Set Cover Alphabets and Strings Alphabet = inite set o

More information

The architecture of Eiffel software 3.1 OVERVIEW classes clusters systems

The architecture of Eiffel software 3.1 OVERVIEW classes clusters systems 3 Draft 5.02.00-0, 15 August 2005 (Santa Barbara). Extracted from ongoing work on future third edition of Eiffel: The Language. Copyright Bertrand Meyer 1986-2005. Access restricted to purchasers of the

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

Keysight Technologies Specifying Calibration Standards and Kits for Keysight Vector Network Analyzers. Application Note

Keysight Technologies Specifying Calibration Standards and Kits for Keysight Vector Network Analyzers. Application Note Keysight Technologies Speciying Calibration Standards and Kits or Keysight Vector Network Analyzers Application Note Introduction Measurement errors in network analysis can be separated into two categories:

More information

AN 608: HST Jitter and BER Estimator Tool for Stratix IV GX and GT Devices

AN 608: HST Jitter and BER Estimator Tool for Stratix IV GX and GT Devices AN 608: HST Jitter and BER Estimator Tool or Stratix IV GX and GT Devices July 2010 AN-608-1.0 The high-speed communication link design toolkit (HST) jitter and bit error rate (BER) estimator tool is a

More information

Introduction to Parsing. Lecture 5

Introduction to Parsing. Lecture 5 Introduction to Parsing Lecture 5 1 Outline Regular languages revisited Parser overview Context-free grammars (CFG s) Derivations Ambiguity 2 Languages and Automata Formal languages are very important

More information

Automated Modelization of Dynamic Systems

Automated Modelization of Dynamic Systems Automated Modelization o Dynamic Systems Ivan Perl, Aleksandr Penskoi ITMO University Saint-Petersburg, Russia ivan.perl, aleksandr.penskoi@corp.imo.ru Abstract Nowadays, dierent kinds o modelling settled

More information

Data & Knowledge Engineering

Data & Knowledge Engineering Data & Knowledge Engineering 73 (2012) 1 22 Contents lists available at SciVerse ScienceDirect Data & Knowledge Engineering journal homepage: www.elsevier.com/locate/datak OCL-Lite: Finite reasoning on

More information

The SPL Programming Language Reference Manual

The SPL Programming Language Reference Manual The SPL Programming Language Reference Manual Leonidas Fegaras University of Texas at Arlington Arlington, TX 76019 fegaras@cse.uta.edu February 27, 2018 1 Introduction The SPL language is a Small Programming

More information

Formal Systems and their Applications

Formal Systems and their Applications Formal Systems and their Applications Dave Clarke (Dave.Clarke@cs.kuleuven.be) Acknowledgment: these slides are based in part on slides from Benjamin Pierce and Frank Piessens 1 Course Overview Introduction

More information

Intermediate Code Generation

Intermediate Code Generation Intermediate Code Generation In the analysis-synthesis model of a compiler, the front end analyzes a source program and creates an intermediate representation, from which the back end generates target

More information

Monotone Paths in Geometric Triangulations

Monotone Paths in Geometric Triangulations Monotone Paths in Geometric Triangulations Adrian Dumitrescu Ritankar Mandal Csaba D. Tóth November 19, 2017 Abstract (I) We prove that the (maximum) number of monotone paths in a geometric triangulation

More information