4,679 research outputs found

    Transporting Functions across Ornaments

    Get PDF
    Programming with dependent types is a blessing and a curse. It is a blessing to be able to bake invariants into the definition of data-types: we can finally write correct-by-construction software. However, this extreme accuracy is also a curse: a data-type is the combination of a structuring medium together with a special purpose logic. These domain-specific logics hamper any effort of code reuse among similarly structured data. In this paper, we exorcise our data-types by adapting the notion of ornament to our universe of inductive families. We then show how code reuse can be achieved by ornamenting functions. Using these functional ornament, we capture the relationship between functions such as the addition of natural numbers and the concatenation of lists. With this knowledge, we demonstrate how the implementation of the former informs the implementation of the latter: the user can ask the definition of addition to be lifted to lists and she will only be asked the details necessary to carry on adding lists rather than numbers. Our presentation is formalised in a type theory with a universe of data-types and all our constructions have been implemented as generic programs, requiring no extension to the type theory

    Ornaments for Proof Reuse in Coq

    Get PDF
    Ornaments express relations between inductive types with the same inductive structure. We implement fully automatic proof reuse for a particular class of ornaments in a Coq plugin, and show how such a tool can give programmers the rewards of using indexed inductive types while automating away many of the costs. The plugin works directly on Coq code; it is the first ornamentation tool for a non-embedded dependently typed language. It is also the first tool to automatically identify ornaments: To lift a function or proof, the user must provide only the source type, the destination type, and the source function or proof. In taking advantage of the mathematical properties of ornaments, our approach produces faster functions and smaller terms than a more general approach to proof reuse in Coq

    Huta Tomok Tourism Pier as Samosir Tourism Gate

    Get PDF
    Samosir is one of the famous tourist attraction for the beautiful view of nature of Lake Toba and some traditional cultural sites. Samosir began to start independent and has they have managing system for every area, and one of them is a tourist attraction. This area has the infrastructure that should be available very well, the most important thing in tourist attraction context in Samosir Island is the water crossing terminal because water transportation is the main part of tourist attractions life in Samosir Island. Tomok Village’s dock is one of the main doors that very busy with so many visits from the passenger. To provide a decent service, this dock is still far from expectations. Can be seen from the limit of the passengers this dock can afford, with the increasing intensity of passengers. However, this region needs to redevelopment using every single available potential. In the end, the dockyard should be attractive and give a great experience of Batak Toba culture. The designer will create the cultural experience through the display of the buildings. The designer hopes to facilitate passengers to cross the lake to Samosir island using Tomok village’s dockyard

    Laying Tiles Ornamentally: An approach to structuring container traversals

    Get PDF
    Having hardware more capable of parallel execution means that more program scheduling decisions have to be taken to utilize that hardware efficiently. To this end, compilers implement coarse-grained loop transformations in addition to traditionally used fine-grained instruction reordering. Implementors of embedded domain specific languages have to face a difficult choice: to translate operations on collections to a low-level language naively hoping that its optimizer will do the job, or to implement their own optimizer as a part of the EDSL.<br /><br />We turn ourselves to the concept of loop tiling from the imperative world and find its equivalent for recursive functions. We show the construction of a <em>tiled</em> functorial map over containers that can be naively translated to a corresponding nested loop.<br /><br />We illustrate the connection between <em>untiled</em> and tiled functorial maps by means of a type-theoretic notion of <em>algebraic ornament</em>. This approach produces an family of container traversals indexed by <em>tile sizes</em> and serves as a basis of a proof that untiled and tiled functorial maps have the same semantics.<br /><br />We evaluate our approach by designing a language of tree traversals as a DSL embedded into Haskell which compiles into C code. We use this language to implement tiled and untiled tree traversals which we benchmark under varying choices of tile sizes and shapes of input trees. For some tree shapes, we show that a tiled tree traversal can be up to 50% faster than an untiled one under a good choice of the tile size

    Female choice of a non-bodily ornament: an experimental study of cichlid sand craters in Cyathopharynx furcifer

    Get PDF
    In many species of East African cichlids, males build sand craters or "bowers” to attract females for spawning. It is commonly assumed that these exaggerated sexual traits have a function similar to bodily ornaments. In non-bodily ornaments, however, the behaviour creating the structure may serve as an additional source of information to potential partners, providing multiple signals for mate choice. We tested whether and to what extent females use these signals for choosing males by observing the individual sampling behaviour of female Cyathopharynx furcifer in the field. In addition, we experimentally manipulated crater characteristics in the field and laboratory. We found that females spawn preferably with owners of large and well-maintained craters, but when crater size was enlarged or reduced, the resulting building activity of crater owners affected female choice more strongly than the manipulated crater size per se. We discuss the importance of multiple signals in species constructing extended phenotype
    • …
    corecore