1,163 research outputs found
Type Classes for Lightweight Substructural Types
Linear and substructural types are powerful tools, but adding them to
standard functional programming languages often means introducing extra
annotations and typing machinery. We propose a lightweight substructural type
system design that recasts the structural rules of weakening and contraction as
type classes; we demonstrate this design in a prototype language, Clamp.
Clamp supports polymorphic substructural types as well as an expressive
system of mutable references. At the same time, it adds little additional
overhead to a standard Damas-Hindley-Milner type system enriched with type
classes. We have established type safety for the core model and implemented a
type checker with type inference in Haskell.Comment: In Proceedings LINEARITY 2014, arXiv:1502.0441
Multi-Objective Water Management in Idaho\u27s Henrys Fork Watershed: Leveraging Reservoir Operation and Groundwater Pathways to Benefit Aquatic Habitat
Multi-user water management is a challenging arena further complicated by climate change. This research is based in the Henrys Fork, Snake River, Idaho—an agricultural watershed that exemplifies those throughout the semi-arid American West. This dissertation uses an integrated approach that considers groundwater-river relationships, farm-scale decisions and basin-scale outcomes, upstream reservoir operation for downstream aquatic habitat, water rights, and collaborative stakeholder management to identify drought adaptation strategies accordingly.
Chapter 2 uses an interdisciplinary approach to quantify how improvements to irrigation efficiency at the farm-scale (i.e., converting from flood to sprinkler irrigation) can add up to affect hydrology at the landscape-scale and alter groundwater-surface water relationships. Motivated to improve economic efficiency, irrigators began converting from surface to center-pivot sprinkler irrigation in the 1950s, with rapid adoption of center-pivot sprinklers through 2000. Between 1978–2000 and 2001–2022, annual surface-water diversion decreased by 2,521 acre-ft (23%) and annual return flow to the river decreased by 2,431 acre-ft.
Chapter 3 uses streamflow predictions, local reservoir operation standards, and the relationship between groundwater and river flows to quantify 1) the potential to conduct aquifer recharge in the lower watershed under a warming climate and 2) resulting streamflow response from groundwater. Water for recharge was largely available in April and October, reducing peak springtime streamflow at the watershed outlet by 10–14% after accounting for groundwater return. Streamflow contribution from recharge peaked in July and November, increasing July–August streamflow by 6–14% and November–March streamflow by 9–14%. I demonstrate recharge can recover groundwater return flows when applied as flood irrigation on agricultural land with senior water rights.
Chapter 4 developed relationships between streamflow and habitat for three fish species in a reach where irrigation-season flows are managed by releases from an upstream reservoir. I used these relationships to 1) quantify aquatic habitat at different streamflows and 2) assess the differences in aquatic habitat across two different streamflow management histories. Using these relationships, I demonstrated that moving the management target\u27s location and flow amount will contribute to more consistently suitable fish habitat in the reach while continuing to meet upstream management objectives
Type-safe Linking and Modular Assembly Language
Linking is a low-level task that is usually vaguely specified, if at all, by language definitions. However, the security of web browsers and other extensible systems depends crucially upon a set of checks that must be performed at link time. Building upon the simple, but elegant ideas of Cardelli, and module constructs from high-level languages, we present a formal model of typed object files and a set of inference rules that are sufficient to guarantee that type safety is preserved by the linking process.
Whereas Cardelli's link calculus is built on top of the simply-typed lambda calculus, our object files are based upon typed assembly language so that we may model important low-level implementation issues. Furthermore, unlike Cardelli, we provide support for abstract types and higher-order type constructors - features critical for building extensible systems or modern programming languages such as ML.Engineering and Applied Science
Recommended from our members
Comparing Mostly-copying and Mark-sweep Conservative Collection
Many high-level language compilers generate C code and then invoke a C compiler for code generation. To date, most, of these compilers link the resulting code against a conservative mark-sweep garbage collector in order to reclaim unused memory. We introduce a new collector, MCC, based on an extension of mostly-copying collection.We analyze the various design decisions made in MCC and provide a performance comparison to the most widely used conservative mark-sweep collector (the Boehm-Demers-Weiser collector). Our results show that a good mostly-copying collector can outperform a mature highly-optimized mark-sweep collector when physical memory is large relative to the live data. A surprising result of our analysis is that cache behavior can have a greater impact on overall performance than either collector time or allocation time.Engineering and Applied Science
TWAM: A Certifying Abstract Machine for Logic Programs
Type-preserving (or typed) compilation uses typing derivations to certify
correctness properties of compilation. We have designed and implemented a
type-preserving compiler for a simply-typed dialect of Prolog we call T-Prolog.
The crux of our approach is a new certifying abstract machine which we call the
Typed Warren Abstract Machine (TWAM). The TWAM has a dependent type system
strong enough to specify the semantics of a logic program in the logical
framework LF. We present a soundness metatheorem which constitutes a partial
correctness guarantee: well-typed programs implement the logic program
specified by their type. This metatheorem justifies our design and
implementation of a certifying compiler from T-Prolog to TWAM.Comment: 41 pages, under submission to ACM Transactions on Computational Logi
Recommended from our members
Typed Closure Conversion
Closure conversion is a program transformation used by compilers to separate code from data. Previous accounts of closure conversion use only untyped target languages. Recent studies show that translating to typed target languages is a useful methodology for building compilers, because a compiler can use the types to implement efficient data representations, calling conventions, and tag-free garbage collection. Furthermore, type-based translations facilitate security and debugging through automatic type checking, as well as correctness arguments through the method of logical relations. We present closure conversion as a type-directed, and type preserving translation for both the simply-typed and the polymorphic λ--calculus. Our translations are based on a simple "closures as objects" principle: higher-order functions are viewed as objects consisting of a single method (the code) and a single instance variable (the environment). In the simply-typed case, the Pierce-Turner model of object typing where objects are packages of existential type suffices. In the polymorphic case, more careful tracking of type sharing is required. We exploit a variant of the Harper-Lillibridge "translucent type" formalism to characterize the types of polymorphic closures.Engineering and Applied Science
Recommended from our members
Mechanized Verification with Sharing
We consider software verification of imperative programs by theorem proving in higher-order separation logic. Separation logic is quite effective for reasoning about tree-like data structures, but less so for data structures with more complex sharing patterns. This problem is compounded by some higher-order patterns, such as stateful iterators and visitors, where multiple clients need to share references into a data structure. We show how both styles of sharing can be achieved without sacrificing abstraction using mechanized reasoning about fractional permissions in Hoare Type Theory.Engineering and Applied Science
Interval Parsing Grammars for File Format Parsing
File formats specify how data is encoded for persistent storage. They cannot
be formalized as context-free grammars since their specifications include
context-sensitive patterns such as the random access pattern and the
type-length-value pattern. We propose a new grammar mechanism called Interval
Parsing Grammars IPGs) for file format specifications. An IPG attaches to every
nonterminal/terminal an interval, which specifies the range of input the
nonterminal/terminal consumes. By connecting intervals and attributes, the
context-sensitive patterns in file formats can be well handled. In this paper,
we formalize IPGs' syntax as well as its semantics, and its semantics naturally
leads to a parser generator that generates a recursive-descent parser from an
IPG. In general, IPGs are declarative, modular, and enable termination
checking. We have used IPGs to specify a number of file formats including ZIP,
ELF, GIF, PE, and part of PDF; we have also evaluated the performance of the
generated parsers.Comment: To appear on PLDI'2
- …