Typed transformations of typed abstract syntax Advantages of embedded domain-specific languages (EDSLs) are that one does not have to implement a separate type system nor an abstraction mechanism, since these are directly borrowed from the host language. Straightforward implementations of embedded domain-specific languages map the semantics of the embedded language onto a function in the host language. The semantic mappings are usually compositional, i.e. they directly follow the syntax of the embedded language.One of the questions which arises is whether conventional compilation techniques, such as global analysis and resulting transformations, can be applied in the context of EDSLs. The approach we take is that, instead of mapping the embedded language directly onto a function, we first build a representation of the abstract syntax tree of the embedded program fragment. This syntax tree is subsequently analyzed and transformed, and finally mapped onto a function representing its denotational semantics. In this way we achieve run-time "compilation" of the embedded language.Run-time transformations on the embedded language can have a huge effect on performance. In previous work (Viera et al. 2008) we present a case study comparing the Read instances generated by Haskells deriving construct with instances on which run-time grammar transformations (precedence resolution, left-factorisation and left-corner transformation) have been applied.In this paper we present the library, which has an arrow like interface, which supports in the construction of analyses and transformations, and we demonstrate its use in implementing a common sub-expression elemination transformation. The library uses typed abstract syntax to represent fragments of embedded programs containing variables and binding structures, while preserving the idea that the type system of the host language is used to emulate the type system of the embedded language. The tricky issue is how to keep a collection of mutually recursive structures well-typed while it is being transformed.We finally discuss the typing rules of Haskell, its extensions and those as implemented by the GHC and show that pure System-F based systems are sufficiently rich to express what we want to express, albeit at the cost of an increased complexity of the code. Modern functional languages such as Haskell and ML are excellent tools for embedding domain specific languages. This is usually done by defining a library of combinators, each combinator representing a grammatical structure from the embedded language. With such a library a programmer can use a domain-specific notation, and at the same time benefit from all the features, such as the type system and abstraction mechanisms, of the general purpose host language. The tight integration of the domain-specific language with the host language has great benefits: there is no need to extend the compiler or to use ad hoc external tools which map the specific notation onto the host language.. One of the essential aspects of a combinator-based domainspecific embedded language is that it shares its type system with the host language.. Although such a combinator-based approach for implementing domain-specific languages looks very convincing at first sight, many problems show up when one starts to use this technique in practice. Just as conventional compilers may analyze programs extensively and may transform them based on the results of such analyses, one also wants to use such techniques for combinator-based embedded languages.. Unfortunately, such analyses and transformations are usually not possible, because the value being constructed by the combinators is a (possibly higher order) function (as in denotational semantics), and hence the internal structure can be neither inspected nor transformed. The approach we take is to have the combinators build a data structure which corresponds to the typed abstract syntax tree as described by the grammar of the embedded language. This representation can then be analyzed, transformed, and finally mapped onto its semantics. The main complication we now face is that we have to do this in a typed setting.. The problem becomes even harder when the embedded language not only borrows the type system and the abstractions provided by the host language, but also its declarative structure. Now we have to deal with collections of abstract syntax trees containing references to each other and the question arises how to representing and observe the binding structures.. In their work on typed meta-programming (Pasalic and Linger 2004) , Pasilic and Linger, using the encoding of equality types in Haskell (Baars and Swierstra 2002) , show how to represent typed abstract syntax trees containing typed references to values. A group of mutually recursive bindings is represented by a nested cartesian product of terms. The variables occurring in the terms are represented by typed pointers into this enviroment. A similar approach was developed slightly earlier by Xi and Chen, using a dependently typed version of ML, in their work on typeful program transformations (Chen and Xi 2003) . The key ingredient for both is the encoding of environments and references pointing into these environments in host language terms. This encoding ensures that references always refer to existing values with the right types. In all approaches, references are basically indices into an environment, encoded as Peano numbers.. In earlier work we demonstrated the practical use of run-time typed grammar transformations for combinator parsers. In (Baars and Swierstra 2008) we have described a quite involved grammar transformation, the Left Corner transform which effectively removes left-recursive non-terminals from a grammar and replaces them by a set of non left-recursive ones. As a consequence topdown parsers can directly be generated from the resulting grammar. In (Viera et al. 2008) we eliminate common prefixes from sets of productions in order to improve parsing efficiency. In a small case study we derive an efficient version for the Haskell function read , converting the worst case exponential time algorithm used thus far into a linear one.. In this paper we explain the inner-workings of the library underlying these transformations. It has an Arrow -style interface and handles introductions of new typed bindings. It is not geared towards grammar transformations and thus can be used to implement a wide variety of other typed program transformations. As a small example of the use of the library we include an implementation of common-subexpression elimination, assuming that the algorithm used thus does not become a object of study by itself and attention can focus on the way the library is used.. Internally, the library makes heavy use of universally and existentially quantified types in combination with Generalized Algebraic Data Types (GADT). This paper therefore can also be seen as a non-trivial exercise using these type system extensions. Throughout the paper, we use GHC (GHC) syntax for these extensions to Haskell. The code in this paper can be found at: http: //www.cs.uu.nl/wiki/Center/TTTAS, and was produced by running lhs2TeX on the source of this paper. The code is accepted by the Glasgow Haskell Compiler (GHC). The library described in this paper is also released as a HackageDB(Hackage) package and can be downloaded from: http://hackage.haskell.org/ cgi-bin/hackage-scripts/package/TTTAS. This paper is organized as follows. In Section 2, summarizing earlier work (Pasalic and Linger 2004; Swierstra 2002, 2004) , we discuss the encoding of typed abstract syntax trees, references and environments. These are the objects for our transformations. In Section 3, we develop the library that maintains a changing typed environment. It ensures that all typed references (references that "know" the type of the values they refer to) remain consistent whenever a new definition is added to the environment. In Section 4, we show an example of the use of the library: the implementation of common sub-expression elimination. The implementation of the library makes use of lazy-pattern matching on data constructors involving existential types. This combination is unfortunately not supported by GHC. In Section 5 we present several solutions to avoid this problem. Finally, in Section 6, we present our conclusions. We have shown how to use the Haskell type system and its extensions to perform a fully typed program transformation. Doing so we have used a wide variety of type system concepts: placing existentials precisely at the positions where needed, making things polymorphic where needed, using loop combinators to feed back the result of the computation into the computation inside the scope of an existential, using GADTs to type the environments we construct, scoped type variables, splitting the type labels of the environment into a use and a def part and thus temporarily decoupling the types of the occurring references and the types associated with the terms in the environment being constructed. We introduced an arrow like style for composing the transformations. Besides this we make use of lazy evaluation in order to get computed information to the right places to be used.. We think that studying the algorithm and its approaches to the various subproblems is indispensable for anyone who wants to program similar transformation-based algorithms in a strongly typed setting. Some might wonder why the approach taken may be necessary at all, and why not resort to off-line techniques, and they have a point. It is often easier to work in an untyped setting, only to check the generated result afterwards for type correctness. On the other hand one can see the added complexity as a partial correctness proof of the transformation, and as we all know proofs of correct lemmas are superfluous.. We believe that the arrow-based library will turn out to be useful in building programs that transform typed abstract syntax, and that the pattern we have followed in this paper will be followed in many more interesting applications to come.. It is unfortunate that GHC does not support lazy pattern matching on data constructors with existential types. We hope this will be supported in the future. Until then, a user of the library is posed the following dillema: either have an unsafeCoerce in the implementation of runTrafo, or use the alternative Trafo type, but loose the convenience of the Arrow -notation. Briefly our implementation of CSE performs the following steps: For each sub-expression. • check if we already encountered it if not, add a declaration for this sub-expression to the result if yes, replace it by a reference to the equivalent expression that is already in the result To determine whether expressions have common sub-expressions we need to compare expressions for equality. Therefore we introduce the function equals, which compares two expressions, and, if they are equal returns a witness encoding that the types of the two expressions are the same.. = do Eq ← equals x1 x2 Eq ← equals y1 y2 return Eq. The implementation of the function equals is fairly straightforward. To determine whether two Var s are equal the function match is applied to determine whether the contained references are the same. Two IntVal expressions are equal if their contained values are the same. To determine whether two LessThan expressions are equivalent, the function equals is recursively applied on their components. We omit the definitions of equals for the constructors BoolVal , Add and If , because they are very similar to the ones above. During the CSE transformation we need to determine whether we already encountered an expression before. If an expression has not been encountered before, a declaration for it is added to the result. On the other hand if it was encountered before, it is not added to the result, but is instead replaced by a reference to the equivalent expression that is already present in the result.. For this we introduce the type Memo:. The Memo tells us whether an expression has been encountered before, and if so, returns a witness in the form of a reference to the copy of the expression in the transformation result. Note the use of two distinct type variables: env stands for the type of the original sequence of declarations and env for the result of the transformation.. We introduce a "smart" constructor to create an empty Memo:. We proceed by introducing a type synonym for the CSE transformation Arrow :. The terms that are to be transformed have type Expr and the state (meta-data) maintained is a table of type Memo. During the transformation all sub-expressions are visited. For each sub-expression we check whether it has already been encountered before. If so the table of type Memo provides us a reference to the earlier occurrence of the sub-expression, which is used as a replacement for the current sub-expression. On the other hand if the sub-expression was not encountered before, the Memo table is extended with an entry for this sub-expression. This is captured in the function insertIfNew , which is our application specific version of newSRef . Its argument is the subexpression that is being visited. Its result is a TrafoCSE with as input the transformed version of the sub-expression, which has type (Expr a s). The output is a reference to the transformed version of the first occurrence of the sub-expression. The first time we encounter a sub-expression it is not found in the Memo-table (i.e. the Nothing-case above). Firstly the transformed version of the sub-expression is appended to the transformed declarations using extEnv . The Memo table is extended (using extMemo) with an entry mapping the current sub-expression to Zero, so for a next occurence of the sub-expression we know where to find the transformed first occurrence. Because we added one declaration ourselves, one extra Suc is added to the rest of the references in the Memo table.. For every subsequent encounter of the sub-expression, we find it in the Memo table (i.e. the Just case above). The reference to the first occurrence is simply the one found in the Memo table. We apply the function castSRef to take into account the declarations that might be added by future transformation steps.. The function app cse 2 applies the CSE transformation to a single expression. The resulting TrafoCSE has as arrow input a Ref -transformer, that maps references from the original sequence of declarations to corresponding ones pointing into the transformation result. As output the TrafoCSE yields a reference to the transformed expression.. The reference inside a variable is transformed by applying the supplied Ref -transformer. The transformed reference now points to the corresponding value in the transformation result.. For integer constants the function insertIfNew is applied to the original expression (e). As transformed expression IntVal i is passed. The function insertIfNew only inserts this expression if the integer constant is not already presented in the transformation result.. app cse e@(LessThan x y) = proc tt → do l ← app cse x ≺ tt r ← app cse y ≺ tt insertIfNew e ≺ LessThan (Var l ) (Var r ) . . .. For the constructor LessThan the function app cse is applied recursively resulting in references to the transformed sub-expressions. The Ref -transformer tt is passed for both sub-expressions. Again insertIfNew is applied to the original expression; as transformed expression we pass a LessThen node containing the references to the transformed sub-expressions.. The implementations of app cse for the constructors BoolVal , Add , and If are very similar, and are therefore omitted.. The function app cse defined above applies the CSE transform to a single expression only. The final transformation should transform a sequence of declarations, which is encoded as a value of the data type Env . Therefore we define cse env , which takes an Env as argument and applies app cse to each expression. Analogous to app cse, the function cse env takes a Ref -transformer as input. It collects all the references returned by app cse in an Env . This collection contains for each reference of the original declarations a corresponding reference in the transformation result. The result of cse env is used to compute its own input. To construct such a feedback-loop, we use the special mdo-notation for mutually recursive Arrow statements.. trafo :: Decls env → TrafoCSE env s () (T env s) trafo decls = proc → mdo let tt = refTransformer refs refs ← cse env decls ≺ tt returnA ≺ tt. Finally we present the function cse which simply runs the trafo and extracts the result:. cse :: ∀env . Decls env → TDecls env cse decls = case runTrafo (trafo decls) emptyMemo () of Result t env → TDecls env t

B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


Investigating how to effectively combine static concern location techniques As software systems continue to grow and evolve, locating code for maintenance tasks becomes increasingly difficult. Studies have shown that combining static global concern location techniques like search with more structure-based local techniques can improve effectiveness. However, no studies have yet investigated why this occurs. In this paper, we investigate why combining global and local techniques improves effectiveness, and under what conditions. We explore such questions as: "What are the limits of lexical information in locating concerns?", "How far away does a local technique have to go to locate the remaining relevant elements?", and "How sensitive are these results to the query or scoring thresholds of the techniques?". The results of our study can inform design decisions to maximize effective global and local combinations in future concern location techniques. We presented an empirical investigation of how global and local techniques can be effectively combined for concern location. We observed that as global and local thresholds increase, recall increases more than precision decreases. However, the raw number of returned results is still a practical consideration for users. A regression model could approximate how many additional results are expected so users can select a local threshold based on global technique success.. We have confirmed the prior foundations of techniques combining local and global information [1, 8] by observing that 100% recall can be achieved within 1-2 structural edges from the global search results. While this result indicates the potential success of combining global and local techniques, further work is needed in designing global and local techniques that keep precision at acceptable levels.. We base our conclusions on the results of 48 queries for 8 concerns in Java. Other developers, concerns, and languages may yield different conclusions. Given the statistical significance of the results, we expect the trends to be similar.

O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


Perceptive Admission Control for Wireless Network Quality of Service As wireless networks become more widely used, there is a growing need to support advanced services, such as multimedia streaming and voice over IP. Traditional approaches to guarantee quality of service (QoS) work well only with predictable channel and network access. In wireless mobile networks, where conditions dynamically change as nodes move about the network, a stateless, high level approach is required. Since shared wireless resources are easily over-utilized, the load in the network must be controlled so that an acceptable QoS for real-time applications can be maintained. If minimum real-time requirements are not met, these unusable packets waste scarce bandwidth and hinder other traffic, compounding the problem. To enable high QoS for all admitted traffic, we propose the Perceptive Admission Control (PAC) protocol. PAC monitors the wireless channel and dynamically adapts admission control decisions to enable high network utilization while preventing congestion. Through discussion, simulations and testbed experiments, we demonstrate that PAC ensures low packet loss and delay for all admitted flows. Wireless devices are becoming prevalent because of their ability to provide mobile networking. Since many common applications, including voice and multimedia, require low packet loss and delay, quality of service (QoS) is an important requirement for these networks. In contrast to traditional wired networks, mobile networks operate under harsh conditions that include a shared wireless channel, limited bandwidth, and mobility.. Traditional attempts to provide guaranteed QoS [1] are unable to cope with constantly changing wireless network conditions. Similarly, hard real-time QoS constraints in wireless mobile networks are unrealistic because of shared medium access and mobility. Solutions that provide a stateless service and offer better than best-effort packet delivery for high priority packets, such as DiffServ [2] and IEEE 802.11e [3] , are more successful. Unfortunately, these solutions may fail to provide the low loss and delay that real-time applications require if the network becomes congested.. QoS for high priority flows is achievable without fully coordinated channel and network access. The wireless channel must be kept from reaching the congestion point since loss and delay increase rapidly once this point is reached. Keeping the utilization below the congestion point is difficult because the channel is shared between nodes that may not be able to communicate directly.. To control the amount of traffic in the network and provide high quality service to all admitted traffic, we introduce the Perceptive Admission Control (PAC) protocol. PAC ensures that the network does not admit a flow that will cause congestion. To make an admission decision, sources consider not only the limited area within their transmission range, but the entire region that a new flow's transmissions will impact. We show that with a proper carrier signal detection range, the time that the wireless channel is sensed as busy is a good estimate of the utilization and available bandwidth. Using this measure, PAC performs admission control for new flows to avoid admitting flows that would cause congestion. Our discussion focuses on single hop admission control.. The rest of this paper is organized as follows. Section 2 provides background on wireless transmissions, including methods for determining the available bandwidth and previous approaches for providing high packet delivery and low delay in wireless networks. In Section 3 we describe PAC, our approach for admission control. We present the performance of PAC in simulation (Section 4), describe how it avoids the shortcomings of previous approaches (Section 5), and discuss experimental results from tests performed using our Mica2 mote implementation (Sec-⋆ The research discussed in this articale was performed while Ian Chakeres was a graduate student at University of California, Santa Barbara. tion 6). Section 7 presents our conclusions. Our Perceptive Admission Control protocol for use in wireless mobile networks addresses two issues often overlooked by previous research: shared wireless bandwidth and node mobility. PAC is able to correctly compute the available bandwidth by sensing all important nearby transmissions.. In addition to the direct application of PAC, the utilization calculation is applicable to an even wider set of problems. The available bandwidth calculation can be used in conjunction with an advanced packet dropping strategy, such as RED [35] . By working with known TCP behavior, this packet dropping strategy should increase overall performance and fairness in wireless networks even with node mobility.. Another opportunity for increased control in the available bandwidth calculation is the inclusion of received signal strength. Nodes can calculate the available bandwidth using various sensing ranges simultaneously. By examining the available bandwidth with various thresholds, nodes can determine the amount of traffic and approximate distance to those traffic sources. This usage information can be used for admission control, congestion control, or to dynamically adjust MAC layer parameters, such as CSR or transmit power.. Additional mechanisms that utilize carrier signal information (such as perceptive behaviors [4] ) can be coupled with PAC to support additional network features. For example, supporting bursty traffic sources, handling multiple priority traffic, and calculating the contention count [27] . These and several other communication and coordination problems can be addressed using perceptive behavior. The shared nature of the wireless channel presents a challenge to QoS protocols that does not exist in wired networks. For this reason, QoS approaches that require MAC layer synchronization (i.e. TDMA) [12] [13] [14] [15] , network-wide information dissemination [16] [17] [18] or reservations [19, 1] do not work well in mobile networks where the network topology changes frequently. Similarly, measurement-based admission control protocols [20] [21] [22] cannot be applied directly since they ignore the impact of the wireless medium. PAC is a measurement-based admission control protocol, and we define the requirements to properly measure the current utilization in wireless networks.. INSIGNIA [23] and SWAN [24] are both protocols that enable a high QoS by limiting the traffic in the network. INSIGNIA uses in-band signaling by piggybacking control information on data. This in-band signaling allows INSIGNIA to quickly restore flow state when topology changes occur. In SWAN multiple traffic classes and explicit congestion notification (ECN) help give priority packets better than best effort QoS. The main drawback to both of these protocols is that they rely on active probe messages to determine the current available bandwidth and ignore many characteristics of wireless networks.. The Contention-aware Admission Control Protocol (CACP) [25] is one strategy that addresses admission control for wireless networks and considers the shared nature of the wireless channel. However, CACP has significant flaws and lacks support for node mobility. CACP is described in detail in the next section and qualitatively compared with our solution in Section 5.. Our admission control protocol, PAC, was designed specifically to be used in wireless mobile networks. PAC considers the shared nature of the wireless channel and the receiver's reception requirements. In addition, it is a stateless approach that does not need network-wide synchronization or control message dissemination. Finally, node mobility and its effect on the shared channel is also taken into account. To perform admission control in wireless networks, it is important to understand how a wireless transmission impacts other nodes in distributed wireless networks.. In this section, we describe the important distances for packet transmission and reception. We then examine several methods for calculating the available bandwidth, since admission control decisions depend on accurate estimation of the available bandwidth. We also elaborate on the effect of a less-deterministic propagation model including fading and multipath. We then discuss related work and why most proposed solutions are insufficient. Subsequently, we describe the solution most closely related to our approach.

O B I O B O B I I O B O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O B B O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O B O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O B B O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O B O O O O O O O O O B O O O O O O O O O O O O O O O O O O O B O O O O O O O O B B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O B B O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O B I O O O O O O O O O O O O O O O B O O O O O B I O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O B I O O O O O O O O B I O B O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O B B O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O B O O O O O O O O B O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


A General Framework for Representing, Reasoning and Querying with Annotated Semantic Web Data We describe a generic framework for representing and reasoning with annotated Semantic Web data, a task becoming more important with the recent increased amount of inconsistent and non-reliable meta-data on the web. We formalise the annotated language, the corresponding deductive system and address the query answering problem. Previous contributions on specific RDF annotation domains are encompassed by our unified reasoning formalism as we show by instantiating it on (i) temporal, (ii) fuzzy, and (iii) provenance annotations. Moreover, we provide a generic method for combining multiple annotation domains allowing to represent, e.g., temporally-annotated fuzzy RDF. Furthermore, we address the development of a query language -AnQL -that is inspired by SPARQL, including several features of SPARQL 1.1 (subqueries, aggregates, assignment, solution modifiers) along with the formal definitions of their semantics. RDF (Resource Description Framework) [1] is the widely used representation language for the Semantic Web and the Web of Data. RDF exposes data as triples, consisting of subject, predicate and object, stating that subject is related to object by the predicate relation. Several extensions of RDF were proposed in order to deal with time [2, 3, 4] , truth or imprecise information [5, 6] , trust [7, 8] and provenance [9] . All these proposals share a common approach of extending the RDF language by attaching meta-information about the RDF graph or triples. RDF Schema (RDFS) [10] is the specification of a restricted vocabulary that allows one to deduce further information from existing RDF triples. SPARQL [11] is the W3C-standardised query language for RDF.. In this paper, we present an extension of the RDF model to support meta-information in the form of annotations of triples. We specify the semantics by conEmail addresses: E-mail: antoine.zimmermann@insa-lyon.fr (Antoine Zimmermann), nuno.lopes@deri.org (Nuno Lopes), axel.polleres@deri.org (Axel Polleres), straccia@isti.cnr.it (Umberto Straccia) servatively extending the RDFS semantics and provide a deductive system for Annotated RDFS. Further, we define a query language that extends SPARQL and include advanced features such as aggregates, nested queries and variable assignments, which are part of the not-yetstandardised SPARQL 1.1 specification. The present paper is based on and extends two previously published articles introducing Annotated RDFS [12] and AnQL (our SPARQL extension) [13] . In addition to improving the descriptions of this existing body of work, we provide the following novelties:. 1. we introduce a use case scenario that better reflects a realistic example of how annotations can be used;. 2. we detail three concrete domains of annotations (temporal, fuzzy, provenance) that were only sketched in our previous publications;. 3. we present a detailed and systematic approach for combining multiple annotation domains into a new single complex domain; this represents the most significant novel contribution of the paper;. 4. we discuss the integration of annotated triples with standard, non-annotated triples, as well as the integration of data using different annotation domains;. 5. we describe a prototype implementation.. Section 2 gives preliminary definitions of the RDFS semantics and query answering, restricting ourselves to the sublanguage ρdf. Our extension of RDF is presented in Section 3 together with essential examples of primitive domains. Our extension of SPARQL, is presented in Section 4. Furthermore, Section 5 presents a discussion of important issues with respect to specific domains and their combination. Finally, Section 6 describes our prototype implementation. In this paper we have presented a generalised RDF annotation framework that conservatively extends the RDFS semantics, along with an extension of the SPARQL query language to query annotated data. The framework presented here is generic enough to cover other proposals for RDF annotations and their query languages. Our approach extends the classical case of RDFS reasoning with features of different annotation domains, such as temporality, fuzzyness, trust, etc. and presents a uniform and programatic way to combine any annotation domains.. Furthermore, we presented a semantics for an extension of the SPARQL query language, AnQL, that enables querying RDF with annotations. Queries exemplified in related literature for specific extensions of SPARQL can be expressed in AnQL. Noticeably, our semantics goes beyond the expressivity of the current SPARQL specification and includes some features from SPARQL 1.1 such as aggregates, variable assignments and sub-queries. We also described our implementation of AnQL based on constraint logic programming techniques along with a practical experiment for representing sensor data as Annotated RDF. Further, due to distributivity, Our definition of a compound annotation domain is, to the best of our knowledge, a novelty in settings involving annotations: previous work on annotated RDF [15, 12] , annotated logic programmes [16] or annotated database relations [17] have not addressed this issue. We present in this section some considerations with respect to the chosen approach.. 1. The normalisation algorithm is not optimised and would prove inefficient if directly implemented "as is". In this part, we have provided a working solution for normalising compound annotation as a mere proof of existence of such a solution. By observing the examples that we provide for the time+fuzzy domain, it seems that the cost of normalising can be reduced significantly with appropriate strategies.. 2. As indicated by Theorem 5.4, we only ensure that the normalisation is feasible for a combination of annotation domains where at least one is a lattice. Whether a normalisation function exists in the more general case of two commutative, idempotent, -annihilating semirings is an open question.. 3. The method we provide defines a new domain of annotation in function of existing domains, such that it is possible to reason and to query triples annotated with pairs of values. This does not mean that it is possible to reason with a combination of triples annotated with the values of the first domain, and triples annotated with values of the second domain. For instance, reasoning with a combination of temporally annoted triples and fuzzy annotated triples does not boil down to reasonning over time+fuzzy-annotated triples. The next section discusses this issues and how non-annotated triples can be combined with annotated triples. The basis for Annotated RDF were first established by Udrea et al. [14, 15] , where they define triples annotated with values taken from a finite partial order. In their work, triples are of the form (s, p : λ, o), where the property, rather than the triple is annotated. We instead rely on a richer, not necessarily finite, structure and provide additional inference capabilities to [15] , such as a more involved propagation of annotation values through schema triples. For instance, in the temporal domain, from (a, sc, b) : [2, 6] and (b, sc, c) : [3, 8] , we will infer (a, sc, c) : [3, 6] (sc is the subclass property). Essentially, Udrea et al. do not provide an operation to combine the annotation in such inferences, while the algebraic structures we consider support such operations. Also, they require specific algorithms, while we show that a simple extension to the classical RDF inference rules is sufficient. The query language presented in this paper consists of conjunctive queries and, while SPARQL's Basic Graph Patterns are compared to their conjunctive queries, they do not consider extending SPARQL with the possibility of querying annotations. Furthermore, OPTIONAL, UNION and FILTER SPARQL queries are not considered which results in a subset of SPARQL that can be directly translated into their previously presented conjunctive query system. Adding annotations to logical statements was already proposed in the logic programming realm in which Kifer & Subrahmanian [16] present a similar approach, where atomic formulas are annotated with a value taken from a lattice of annotation values, an annotation variable or a complex annotation, i.e., a function applied to annotation values or variables. Similarly, we can relate our work to annotated relational databases, especially Green et al. [17] who provides a similar framework for the relational algebra. After presenting a generic structure for annotations, they focus more specifically on the provenance domain. The specificities of the relation algebra, especially Closed World Assumption, allows them to define a slightly more general structure for annotation domains, namely semiring (as opposed to the residuated lattice in our initial approach [12, 13] ). In relation to our rule-based RDFS Reasoning, it should be mentioned that Green et al. [17] also provide an algorithm that can decide ground query answers for annotated Datalog, which might be used for RDFS rules; general query answering or materialisation though might not terminate, due to the general structure of annotations, in their case. Karvounarakis et al. [18] extend the work of [17] towards various annotationsnot only provenance, but also confidence, rank, etc. -but do not specifically discuss their combinations.. For the Semantic Web, several extensions of RDF were proposed in order to deal with specific domains such as truth of imprecise information [5, 19, 20, 6] , time [2, 3, 4] , trust [7, 8] and provenance [9] . These approaches are detailed in the following paragraphs.. Straccia [6] , presents Fuzzy RDF in a general setting where triples are annotated with a degree of truth in [0, 1] . For instance, "Rome is a big city to degree 0.8" can be represented with (Rome, type, BigCity) : 0.8; the annotation domain is [0, 1] . For the query language, it formalises conjunctive queries. Other similar approaches for Fuzzy RDF [5, 19, 20] provide the syntax and semantics, along with RDF and RDFS interpretations of the annotated triples. In [20] the author describes an implementation strategy that relies on translating the Fuzzy triples into plain RDF triples by using reification. However these works focus mostly on the representation format and the query answering problem is not addressed.. Gutiérrez et al. [2] presents the definitions of Temporal RDF, including reduction of the semantics of Temporal RDF graphs to RDF graphs, a sound and complete inference system and shows that entailment of Temporal graphs does not yield extra complexity than RDF entailment. Our Annotated RDFS framework encompasses this work by defining the temporal domain. They present conjunctive queries with built-in predicates as the query language for Temporal RDF, although they do not consider full SPARQL. Pugliese et al. [3] presents an optimised indexing schema for Temporal RDF, the notion of normalised Temporal RDF graph and a query language for these graphs based on SPARQL. The indexing scheme consists of clustering the RDF data based on their temporal distance, for which several metrics are given. For the query language they only define conjunctive queries, thus ignoring some of the more advanced features of SPARQL. Tappolet and Bernstein [4] present another approach to the implementation of Temporal RDF, where each temporal in-terval is represented as a named graph [21] containing all triples valid in that time period. Information about temporal intervals, such as their relative relations, start and end points, is asserted in the default graph. The τ-SPARQL query language allows to query the temporal RDF representation using an extended SPARQL syntax that can match the graph pattern against the snapshot of a temporal graph at any given time point and allows to query the start and endpoints of a temporal interval, whose values can then be used in other parts of the query.. SPARQL extensions towards querying trust have been presented by Hartig [7] . Hartig introduces a trust aware query language, tSPARQL, that includes a new constructor to access the trust value of a graph pattern. This value can then be used in other statements such as FILTERs or ORDER. Also in the setting of trust management, Schenk [8] defines a bilattice structure to model trust relying on the dimensions of knowledge and truth. The defined knowledge about trust in information sources can then be used to compute the trust of an inferred statement. An extension towards OWL is presented but there is no query language defined. Finally, this approach is used to resolve inconsistencies in ontologies arising from connecting multiple data sources.. In [9] the authors also present a generic extension of RDF to represent meta information, mostly focused on provenance and uncertainty. Such meta information is stored using named graphs and their extended semantics of RDF, denoted RDF + , assumes a predefined vocabulary to be interpreted as the meta information. However they do not provide an extension of the RDFS inference rules or any operations for combining meta information. The authors also provide an extension of the SPARQL query language, considering an additional expression that enables querying the RDF meta information.. Our initial approach of using residuated lattices as the structure for representing annotations [12, 13] was extended to the more general semiring structure by Buneman & Kostylev [22] . This paper also shows that, once the RDFS inferences of an RDF graph have been computed for a specific domain, it is possible to reuse these inferences if the graph is annotated with a different domain. Based on this result the authors define a universal domain which is possible to transform to other domains by applying the corresponding transformations. Aidan Hogan's thesis [23, Chapter 6] provides a framework for a specific combination of annotations (authoritativeness, rank, blacklisting) within RDFS and (a variant of) OWL 2 RL. This work is orthogonal to ours, in that it does not focus on aspects of query answering, or providing a generic framework for combinations of annotations, but rather on scalable and efficient algorithms for materialising inferences for the specific combined annotations under consideration.

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O B O O O O O O O B O O O O O O B O O O O B O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O B O O O B O B O O O O O O O O O O O O O O O O O B O B O O O O B O O B O O O O O O O O O B O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O B O O O O B O O O B O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O B O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O B O O O O O O O O O O B O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O B O O O O O O O B B O O B O O O O O O O O O O O O O O B B O O B O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B B O O O O O B O B O O O O O O O O O B O O O O O O O O O O O O O O O B O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O B O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O B O O O O O B O O O O O O O O O O B O O O O O O O O O O B O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O B O O O O O O O O O B O O B O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O B O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O B O O O O O O O B O O B O O O O O O O O O O O O O O O O O O O O B O O O B O O O O O O O O O O O O O O O O O O B O O O B O O O O O O B O O O O O O O O O O O B O O O O O B O O O B O O O O O O B O O O O O O O B O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O B O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O B O O B O O O O B O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O B B O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O B B O O O O O O O O O B O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O B O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O B O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O B O O O O O O O O O O O O O O B O O


Evaluating, combining and generalizing recommendations with prerequisites We consider the problem of recommending the best set of k items when there is an inherent ordering between items, expressed as a set of prerequisites (e.g., the movie 'Godfather I' is a prerequisite of 'Godfather II'). Since this general problem is computationally intractable, we develop 3 approximation algorithms to solve this problem for various prerequisite structures (e.g., chain graphs, AND graphs, AND-OR graphs). We derive worst-case bounds for these algorithms for these structures, and experimentally evaluate these algorithms on synthetic data. We also develop an algorithm to combine solutions in order to generate even better solutions, and compare the performance of this algorithm with the other three. Traditional recommendation systems deal with the problem of recommending items or sets of items to users by using various approaches [1, 17] . However, most of these approaches do not take into account prerequisites while recommending an item: A prerequisite of an item i is another item j that must be taken or consumed (watched, read, ...) in advance of i. For example, university courses often have prerequisites. If course i cannot be taken unless j has been completed, then it does not make sense to recommend to a student course i if j has not been taken. We could recommend both i and j, or perhaps we could recommend some other course k that may be less desirable than i but whose prerequisites have been met.. We are interested in the problem of prerequisites in the context of our CourseRank project at Stanford University. CourseRank is a social tool developed in our InfoLab and is used by students to evaluate courses and plan their academic program. CourseRank is currently used by over 9,000 Stanford students (out of 14,000); Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. the vast majority of undergraduates use it regularly. One of the CourseRank goals is to recommend courses that are not just 'good' but also help students meet academic requirements [15] . (Academic requirements describe the constraints on the courses needed to complete a major.) In addition, we would like to take into account prerequisites, which the current production system does not take into account. Since this shortcoming is serious, we have developed a model and algorithms for recommendations constrained by prerequisites, which we describe and evaluate in this paper. Our plan is to incorporate one of our algorithms into the production system.. Although our focus is on prerequisites in an academic environment, prerequisites also arise in other recommendation contexts. Movies, for instance, often are best watched in a sequence. For example, the movie "Godfather I" should be watched before "Godfather II," and both these movies should be watched before "Godfather III." The problem is even more acute when it comes to television serials and novels. TV serials, especially those of the drama genre, tend to proceed in sequential fashion, and need to be watched in sequence. Novels can be sequential as well. While movies tend to have relatively few sequels, a fiction series could have several books that should be read in order.. There are at least two ways to approach the problem of recommendations with prerequisites:. • Ranking. We are given a set of items, each with an initial score that describes how desirable that item is for a particular user. The initial scores can be derived using traditional recommendations techniques, e.g., a movie may have a high score if people like our given user have watched that movie. Next we compute new scores, based on the old scores, the prerequisite constraints, and knowledge of what items the user has already taken or watched. The idea is that an item's "desirability" score can increase or decrease depending on the prerequisites, e.g., an item that has many unfulfilled prerequisites is less desirable, especially if those prerequisites have low initial scores. Note that a high score does not guarantee that prerequisites have been met. That is, the user still needs to check if he can take a highly recommended item.. • Set Recommendation. In the second case, we again have a set of items with initial scores, and knowledge of what items have been taken. We now wish to recommend to the user a set of k desirable items, such that the set can be taken without further prerequisites. That is, the prerequisite of any item in the set has either been satisfied or is in the set itself. For example, if we wish to recommend "Lord of the Rings II" to a user as one of the k items, then we have to recommend "Lord of the Rings I" (a prequel, and therefore a prerequisite) as another one of the k items (unless the user has already watched part I). As discussed later, we can also return several sets of k items, each representing a different "package" recommendation. In this paper we only study set recommendations. Although we have not yet carefully compared both options, initially set recommendations seem more attractive and easier for the user to interpret. If a user wishes to take or watch a single item, then a set recommendation with k = 1 yields the best item that can currently be taken. (As stated earlier, the top ranked item in the ranking scenario may not be yet watchable.) If the user is planning ahead and wants to take k courses or watch k episodes, set recommendations provide one or more "package" recommendations that make sense as a unit.. Additionally, recommending each item that satisfies prerequisites one-by-one, instead of a "package" recommendation of size k, can prove to be sub-optimal, since at the start, we might end up not choosing items which are prerequisites for a lot of "good" items and as a result we may have to make poor recommendations later on. The challenge, therefore, is to not just recommend a package that satisfies prerequisites, but one that is the "best".. We also study various kinds of prerequisite constraints. For example, in some domains, it may be the case that in order to be able to take an item a, one needs to take either b or c. In other domains, in order to be able to take an item a, one might need both b and c.. This paper extends the work in our short paper [13] , which discussed only chain graphs. Our contributions are the following:. • We define the problem of recommendations with prerequisites for general prerequisite structures in Sec. 2.. • We prove hardness of recommendations for certain classes of prerequisite structures in Sec. 2.1.. • We provide a PTIME dynamic programming algorithm for a special prerequisite class in Sec. 3.1.. • We give algorithms that can adapt to any prerequisite structure in Sec. 3.2-3.5, obtain worst case bounds and prove incomparability in Sec. 4, and derive complexity in Sec. 5.. • We provide an algorithm that takes sets recommended by different algorithms and combine them to obtain a new set that is even better in Sec. 3.6.. • We experimentally evaluate the algorithms for two kinds of prerequisite structures in Sec. 6. As recommender systems are applied to more and more domains [12, 10] , it is important to incorporate into our recommendations the constraints introduced by the domain, or more generally, contextual information. If we do not incorporate such constraints we can end up making recommendations that do not make sense to the user, e.g., suggesting courses they are unable to take.. In our case, we considered prerequisite constraints and how they affect the problem of recommendations. We focused on the problem of recommending a set of items with high score, while satisfying prerequisites, for various prerequisite structures. We proved that this problem is NP-Hard for most prerequisite structures and suggested approximate algorithms to solve this problem. For the case of chain graphs, we presented an exact algorithm.. In our experiments, we find that Greedy-value Pickings performs exceedingly well. For most practical situations, say for example, we have 100,000 chains to choose 10 items from, and chains with depth around 10, we would prefer using Greedy-value Pickings, which takes 10 5 × 10 time steps, i.e., 1 10 the time as DP, and makes nearly the same (good) recommendations. If we wish to save even more on time, say for example we need to make live recommendations on the web, we might prefer performing both Top-down Pickings and Breadth-first Pickings and doing a Merge. (If we are implementing Top-down Pickings, then there is no good reason to not use Breadth-first Pickings and Merge, since both of these have significantly lower time complexity.) If we simply need to make fast recommendations, we would opt for Breadth-first Pickings. We have the following results:. • Alg. 2 performs better than Alg. 1 and 3, and almost the same as top3 • When k is small, Alg. 3 performs better than Alg. 1, with the reverse holding true when k is large.. • When the number of chains and the number of items to be picked are both similar, Alg. 3 performs almost as well as Alg. 2.. • top2 does better than Alg. 2 when the number of items and number of chains are small.. • On varying the number of chains, all algorithms perform similarly.. • All algorithms are within 20% of each other. Fig 8(a), Fig 8(b) and Fig. 8(c) show the variation with increasing p from 0.05 to 0.65. The vertical axis shows the score returned by each algorithm as a fraction of the best possible score, averaged over 500 graph instances. For Fig. 8(a) and Fig. 8(b) , we set n = 40, while for Fig. 8(c) , we set n = 100. For Fig. 8(a) and Fig. 8(c) , we set k = 20 while k = 40 for Fig. 8(b) The maximum number of items in a chain, m is set to be 10 for all the algorithms. In all three plots, we find that Alg. 2 performs the best among the three algorithms, nearly indistinguishable from top3. However, Alg. 3 follows Alg. 2 very closely, with less than 5% difference. For example, on setting p = 0.4 in Fig 8(a) , on average Alg. 1 returns a set with score 80% of the score of the no-prereq set, while Alg. 2 and Alg. 3 return sets with score 90% and 92% respectively.. In fact, in Fig. 8(b) , Alg. 3 performs better than Alg. 2 (even though it is not clearly distinguishable in the plot) when p is small. However, note that when the number of chains are large, Alg. 2 does the best, as is evident from Fig. 8(c) . (In this case, Alg. 1 does better than Alg. 3.) We then tried to examine the variation in performance with increasing number of chains. We set n = 100, m = 10 and p = 1, and repeated the experiment over 500 random graph instances. Fig 9(a) shows the variation with increasing number of items being picked. As is expected, when the items being picked becomes large, Alg. 1 starts performing better than Alg. 3, with two plots intersecting when k = 60. Fig 9(b) shows the variation for the extreme case when both the number of chains and the number of items to be picked are small, i.e., k = 3, n = 3, m = 3, repeated over 500 trials. In this case, top3 and top2 (indistinguishable in the graph) do better than the rest by almost 1%. Fig 9(c) shows the variation of the algorithms on increasing the number of chains for k = 20, p = 1, m = 10 over 500 trials. As expected, all three algorithms improve when the number of chains increase because they have more shots at picking the best items.. While we have not implemented the merge algorithm for AND-OR graphs, we believe that it will give us a further boost compared to top2, thereby narrowing the gap to Alg. 2. We are not aware of any prior work in the area of set recommendations that take prerequisites into account.. However, there is a large body of work on traditional recommendation systems, aimed at coming up with a single 'score' for each item, combining approaches that look at using ratings given by other 'similar' users [17] , other 'similar' items that the user liked [16] , and other approaches [6] . All of these techniques could be used in generation of the score function that we use as a black box, therefore our work builds on top of other recommender systems work.. The body of work on Top-N recommendation systems [8] solve a different problem. Their aim is: given a user X item matrix of scores, and given the set of items that a given user has consumed, recommend an ordered set of up to N items that the user has not consumed. In this case there is no inherent ordering of items that needs to be respected when recommending N items, which is the case in our problem.. Ziegler et. al. [20] consider recommending lists of items taking into account diversity among items in the list. Prerequisites are not considered; additionally, our algorithms can be generalized to handle the case of complex scoring functions where the score of a set is not just the sum of scores of the items contained in the set.. There has been some recent work on incorporation additional constraints into the recommender systems problem, for example, group recommendations [3, 11] dealing with the problem of recommending items to a group of people with diverse interests, out-ofthe-box recommendations and recommending items that are nonobvious and diverse [18, 19] , and the work on recommendation of paper assignment to reviewers [7] . Some of the recommendation questions we pose can be written in RQL (Recommendation Query Language) [2] , or expressed as constraints [9] , however, our aim in this paper is to consider efficient algorithms that solve those recommendation questions, and not posing those questions themselves.. Our problem is an instance of preference-based optimization [5, 4] , which considers preferences between subsets of items. However, we leverage the fact that the subsets that we recommend have to satisfy specific constraints, i.e., prerequisites to provide efficient algorithms. Additionally, considering all subsets of items in our case is computationally hard.

O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O B O O O O O O B O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O


Optimizing extreme learning machines via ridge regression and batch intrinsic plasticity Extreme learning machines are randomly initialized single-hidden layer feedforward neural networks where the training is restricted to the output weights in order to achieve fast learning with good performance. This contribution shows how batch intrinsic plasticity, a novel and efficient scheme for input specific tuning of non-linear transfer functions, and ridge regression can be combined to optimize extreme learning machines without searching for a suitable hidden layer size. We show that our scheme achieves excellent performance on a number of standard regression tasks and regression applications from robotics. Huang et al. introduce to use the extreme learning machine (ELM) [1] which is a learning scheme based on random projections. It is appealing because of the high efficiency, conceptual simplicity and the good learning results (a survey on ELM techniques can be found in [2] ). As opposed to random projections for dimensionality reduction, which have been considered in [3, 4] , it is characteristic for the ELM to use high-dimensional projections, which often actually increase the feature dimensionality. The differences of the models are mentioned in [5] . The relation between the ELM approach and earlier proposed feedforward random projection methods is further discussed in [6, 7] .. Despite the apparent simplicity of the ELM approach, its task performance strongly depends on the random initialization and the size of the hidden layer. A good performance is usually achieved by manually tuning the ELM parameters to a task-suitable regime which can lead to good generalization results (e.g. see [8, 9] ) but in a clearly heuristic way.. Since the ELM is based on the empirical risk minimization principle [10] , it leads to overfitting of the data, in particular if the task does not comprise many training samples. To match this challenge, variations to the ELM have recently been developed that are based on the idea to change the hidden layer size or to regularize the output weights in order to improve the generalization ability.. Different ways to determine a suitable hidden layer size were already introduced and benchmarked: Huang shows in [11] that the universal function approximation ability of the ELM is preserved when incrementally updating the size of the hidden layer, in a model named incremental extreme learning machine (I-ELM). Related ideas to improve ELMs are the optimally pruned extreme learning machine (OP-ELM) [12] reducing the hidden layer size and the error minimized extreme learning machine (EM-ELM) [13] which aims at increasing the hidden layer size, optionally in groups of neurons.. Methods based on the introduction of an additional weight decay term in the error function are the regularized extreme learning machine (RELM) [14] and the recently developed Tikhonov regularized optimally pruned extreme learning machine (TROP-ELM) [15] , while the TROP-ELM approach combines the idea of regularization with the OP-ELM. Both use Tikhonov regularization [16] to control the norm of the output weights, a technique that is also called ridge regression (RR). The method is well known and established also in other domains of neural network research [17] and machine learning in general [18] .. However, the random initialization (RND) -i.e. the input weights and the biases of the non-linear transfer functions -have a great influence on the task performance as well. Methods only controlling the network size and the output matrix are insufficient in tuning the neurons to a good regime, where the encoding is optimal. Additional methods to improve the encoding by adapting the neurons' parameters therefore have a great potential for a better performing ELM. The experiments in this contribution show that saturated and almost constant hidden layer neurons lead to an encoding where the prediction capability is poor. This motivates techniques to tune the output distributions of hidden layer neurons in a regime where the encoding is suited for good generalization.. To achieve this goal, we are inspired by a biologically plausible mechanism first introduced by Triesch [19] under the notion of intrinsic plasticity (IP). It is shown in [20] , that IP enhances the encoding in recurrent neural networks. The output is forced by IP to approximate exponential distributions. This maximizes the network's information transmission, caused by the high entropy of the distribution. Inspired by IP, recently, a novel method called batch intrinsic plasticity (BIP) [21] was introduced to optimize ELMs. BIP is used for pretraining and adapts the activation function of the hidden layer neurons analytically by a pseudo inverse technique such that desired output distributions are achieved. This makes BIP highly efficient.. This contribution shows that ELMs pretrained by BIP have a significantly better generalization ability than a randomly initialized ELM when trained with RR without tuning the size of the hidden layer on different real world tasks. The approach is also compared with respect to performance and computational time with other state of the art optimization techniques for ELMs. This contribution proposes to use BIP as optimization method for ELMs with a fixed hidden layer size and especially motivates the use of shaping output distributions for hidden layer neurons in an ELM. It is further shown that the additional use of output regularization can lead to good and stable performance over different network initializations. The method is compared to other ELM techniques and the timing of the algorithm is analyzed for real world regression tasks.. BIP is a recently developed and unsupervised scheme to pretrain ELMs. The method is efficient and can therefore be used to initialize the networks input weights and biases without detailed knowledge about the task. It was already shown that the production of sparse codes in the hidden layer of a neural network by producing exponential distributions with low fixed mean can lead to good generalization results [20] . This was done for recurrent neural networks by IP which was introduced by Triesch in [26] . IP is based on computationally expensive gradient descent and therefore unsuited for ELMs. BIP overcomes the problem of slow learning dynamics by formulating a regression problem. The experiments show that the new learning method produces the desired output distributions to some extend and leads to an improvement of the learning for ELMs which are additionally regularized by ridge regression. Especially networks with a large hidden layer have a better generalization ability when pretrained with BIP.. Since every hidden layer neuron is updated separately, BIP is well suited for methods optimizing ELMs by incrementally growing the network without recomputation of the already obtained biases and slopes. BIP complements those methods and could -combined with other optimization methods -lead to even better learning results for ELMs. In addition, every neuron can be trained by a different desired output distribution in order to produce a more diverse encoding in the hidden layer.. Only the desired distribution f des and the inverse of the activation f −1 is needed for the method, which points out the high flexibility of the method. The generic formulation might be used to analyze the performance of the method with respect to other desired output distributions and activation functions. This will lead to different codes in the hidden layer and has a huge impact on the network's performance.

O O B O O B I O B I I O B O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O B I I O O O O O O O O O O O O O O B I O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O B O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O B O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O B O O O O O O O O O O O O B O O O O O O B O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O B I O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O B O O O O O O O O O O O O O O O O B O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


AUTOMATIC DETECTION OF HANDWRITING FORGERY USING A FRACTAL NUMBER ESTIMATE OF WRINKLINESS We investigate the detection of handwriting forged by novices. To facilitate document examination it is important to develop an automated system to identify forgeries, or at least to identify those handwritings that are likely to be forged. Because forgers often carefully copy or trace genuine handwriting, we hypothesize that good forgeries -those that retain the shape and size of genuine writing -are usually written more slowly and are therefore wrinklier (less smooth) than genuine writing. From online handwriting samples we find that the writing speed of the good forgeries is significantly slower than that of the genuine writings. From corresponding offline samples we find that the wrinkliness of the good forgeries is significantly greater than that of the genuine writings, showing that this feature can help identify candidate forgeries from scanned documents. Using a total of eight handwriting distance features, including the wrinkliness feature, we train a neural network to achieved 89% accuracy on detecting forged handwriting on test samples from ten writers. Since questioned document examinations play an important investigative and forensic role in many types of crime [1, 2] , it is necessary to build a system that objectively identifies forged handwriting from offline images. Various automatic writer identification computer techniques, feature extraction, comparison, and performance evaluation methods have been studied (see [3, 4] for an extensive survey). In a study to establish the individuality in handwriting, Srihari, et al.,. successfully designed two models to establish the individuality with high confidence: a writer identification system and a writer verification system [5, 6] . However, these models were based on the assumption that subjects provide their handwriting samples in their natural handwriting style, and the study did not cover forgery and disguised writing.. It is unknown whether writership can be verified from offline images if some of the writing samples are forgeries. For this reason, we conducted a preliminary study to measure the capability of humans and machines to detect forgery [7] . There were three stages in this study: i) collecting handwriting samples, ii) developing a classification system, and iii) running experiments. Subjects were asked to write test samples in their natural handwriting style and to forge other subjects' handwriting samples. The resulting handwriting samples were scanned and stored digitally. Wordlevel features were then computed from the writing samples, and a neural network was trained using the dichotomy model [5, 6, 8] to distinguish between genuine and forged handwriting.. We recently extended the study of the individuality of handwriting by developing a pilot system to automatically detect handwriting forgery [7, 9] . One of the interesting features of this study was a measure of the variability of the handwriting on a small scale. Although one can copy the shape of another's handwriting, it is difficult to mimic the dynamic aspects, such as speed and acceleration. Because forged handwriting tends to be drawn slowly, it should be wigglier than genuine handwriting. This wrinkliness feature can be measured using a fractal dimension measure. For example, in the paper, "How long is the coastline of Britain?" a fractal measure of the wrinkliness of the coastline was suggested [10] . Because the measured length of the coastline depends upon the size of the measuring stick, this problem can be answered in terms of fractal dimension. Hence, we applied this measure as one of the features to detect forgery. While fractal dimensions have been used for handwriting analysis and style recognition [11, 12] , our study is the first to use them to detect forgeries.. The key idea of this study is that successful forgers, especially novice ones, often forge handwriting shape and size by carefully copying or tracing the genuine handwriting. Our first hypothesis, therefore, is that good forgeries -that is, those that retain the shape and size of genuine writing -tend to be written more slowly than genuine writing. Based on the first hypothesis, our second hypothesis is that good forgeries are also likely to be wrinklier (less smooth) than genuine handwriting. We examine these hypotheses by utilizing both online and offline data from the same handwriting samples. Our objective is to develop algorithms that work with offline images. We use online data only to verify that novices write forgeries slower than usual to support the correctness of the wrinkliness hypothesis. This paper is organized as follows. In section 2, we explain the method of collecting genuine and forged handwriting samples. Section 3 discusses the features extracted from the handwriting. Section 4 describes the experiments that verify the speed and wrinkliness hypotheses and that test whether forgery can be detected automatically. Finally, section 5 draws conclusions of this work. In this paper, we developed and tested an automatic forgery detection system. From the experiments, we observed the ease of forging handwriting, and found that many subjects can successfully forge the handwriting of others in terms of shape and size by tracing the genuine handwriting. We also observed that even though the handwriting shape can easily be copied or traced by forgers, the exact dynamics of speed and acceleration are difficult to mimic. To capture a measure of writing speed, we proposed a measure of wrinkliness, and showed that forged handwriting tends to be wrinklier than natural handwriting.. We obtained experimental handwriting data from subjects writing samples in their natural style and writing forgeries of other subjects' handwriting. These handwritings were digitally scanned and stored in an image database. Eight distance features were computed using various types of features including wrinkliness. A neural network was trained using a dichotomy model to distinguish between genuine and forged handwriting, and we achieved 89% accuracy in detecting the forgeries.. In summary, using a fractal measure we found that the wrinkliness of good forgeries is significantly greater than that of genuine writings, corresponding to the writing speed of good forgeries being significantly slower than that of genuine writings. Also, … (SUNG, COMPLETE THIS SENTENCE DESCRIBING YOUR NEW RESULT). However, in the dichotomy system the forgery detection accuracy with the added wrinkliness measure (total of eight features) was about the same as that without the wrinkliness measure (seven features), probably because novice forgeries are easy to detect and the other features combined were stronger. Nevertheless, the overwhelming evidence clearly shows that the wrinkliness measure can be valuable in detecting forgeries in scanned documents.

O O O O O O O B O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O B O O O O O O O O O O O O O O O B O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O B O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O B O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O


An introduction to the construction and verification of Alphard programs The programming language Alphard is designed to provide support for both the methodologies of "wellstructured" programming and the techniques of formal program verification. Language constructs allow a programmer to isolate an o~straotion, specifying its behavior publicly while localizing knowledge about its implementation. The verification of such an abstraction consists of showing that its implementation behaves in accordance with its public specifications; the abstraction can then be used with confidence in constructing other programs, and the verification of that use employs only the public specifications. This paper introduces Alphard by developing and verifying a data structure definition and a program that uses it.It shows how each language construct contributes to the development of the abstraction and discusses the way the language design and the verification methodology were tailored to each other. It serves not only as an introduction to Alphard, but also as an example of the symbiosis between verification and methodology in language design. The strategy of program structuring, illustrated for Alphard, is also applicable to most of the "data abstraction" mechanisms now appearing.390

O O O O O O B O O O O O B O O O O O B O O O O O O O O O O O O B B B O O O B O O O O O O B O O O B O O B O B O O O B O O O O O B O O O O O B O O B O O O O O O O O O O O O B O O B O O O B O O B O O O O O O O O B B O O B O O O O O O B O O O O O O O B O O O O O B I O O B B O O O O O O O O O O O O O O O O O O O O O O O B O B O B I O O O B O O O O O O O O O O O O B O O O