223 research outputs found
A Behavioral Test of Contamination Fear in Excessive Health Anxiety
Hypochondriasis and health anxiety are characterized by preoccupation with the fear of currently having a serious physical illness. The Diagnostic and Statistical Manual of Mental Disorders conceptualization of hypochondriasis does not include consideration of the fear of acquiring an illness; however, many individuals with severe health anxiety report concern about contamination, suggesting that the current conceptualization of hypochondriasis may be incomplete. The present study utilized behavior approach tasks (BATs) to examine the degree to which contamination fear is present in severe health anxiety. Additionally, perceived vulnerability to disease (PVD) and disgust were tested as potential mechanisms in health anxiety and contamination fear. Results showed that health anxious individuals were similarly avoidant of sources of contamination, and reported similar anxiety and disgust in response to the BATs. Regression analyses showed that PVD, but not disgust, potentiated the effect of both health anxiety and contamination fear in the prediction of disgust experienced during the BATs. The theoretical and clinical implications of these findings are discussed
Practical implementation of a dependently typed functional programming language
Types express a program's meaning, and checking types ensures that a program has the intended meaning. In a dependently typed programming language types are predicated on values, leading to the possibility of expressing invariants of a program's behaviour in its type. Dependent types allow us to give more detailed meanings to programs, and hence be more confident of their correctness. This thesis considers the practical implementation of a dependently typed programming language, using the Epigram notation defined by McBride and McKinna. Epigram is a high level notation for dependently typed functional programming elaborating to a core type theory based on Lu๙s UTT, using Dybjer's inductive families and elimination rules to implement pattern matching. This gives us a rich framework for reasoning about programs. However, a naive implementation introduces several run-time overheads since the type system blurs the distinction between types and values; these overheads include the duplication of values, and the storage of redundant information and explicit proofs. A practical implementation of any programming language should be as efficient as possible; in this thesis we see how the apparent efficiency problems of dependently typed programming can be overcome and that in many cases the richer type information allows us to apply optimisations which are not directly available in traditional languages. I introduce three storage optimisations on inductive families; forcing, detagging and collapsing. I further introduce a compilation scheme from the core type theory to G-machine code, including a pattern matching compiler for elimination rules and a compilation scheme for efficient run-time implementation of Peano's natural numbers. We also see some low level optimisations for removal of identity functions, unused arguments and impossible case branches. As a result, we see that a dependent type theory is an effective base on which to build a feasible programming language
Idris 2: Quantitative Type Theory in Practice (Artifact)
Dependent types allow us to express precisely what a function is intended to do. Recent work on Quantitative Type Theory (QTT) extends dependent type systems with linearity, also allowing precision in expressing when a function can run. This is promising, because it suggests the ability to design and reason about resource usage protocols, such as we might find in distributed and concurrent programming, where the state of a communication channel changes throughout program execution.
Idris 2 is a new version of Idris, implemented in itself, and based on Quantitative Type Theory. The paper introduces Idris 2 and describes how QTT has influenced its design, as well as giving several examples of how to use QTT in practice. The artifact, correspondingly, provides an implementation of Idris 2, running on a virtual machine, along with runnable examples from the paper. This document explains how to install the artifact, how to run the examples, and suggests some small ways to experiment with and modify the examples
Type driven development of concurrent communicating systems
This work was kindly supported by SICSA (the Scottish Informatics and Computer Science Alliance) and EPSRC grant EP/N024222/1 (Type-driven Verification of Communicating Systems).Modern software systems rely on communication, for example mobile applications communicating with a central server, distributed systems coordinating a telecommunications network, or concurrent systems handling events and processes in a desktop application. However, reasoning about concurrent programs is hard, since we must reason about each process and the order in which communication might happen between processes. In this paper, I describe a type-driven approach to implementing communicating concurrent programs, using the dependently typed programming language Idris. I show how the type system can be used to describe resource access protocols (such as controlling access to a file handle) and verify that programs correctly follow those protocols. Finally, I show how to use the type system to reason about the order of communication between concurrent processes, ensuring that each end of a communication channel follows a defined protocol.Publisher PDFPeer reviewe
Idris 2 : Quantitative Type Theory in practice
Funding: This work was funded by EPSRC grant EP/T007265/1.Dependent types allow us to express precisely what a function is intended to do. Recent work on Quantitative Type Theory (QTT) extends dependent type systems with linearity, also allowing precision in expressing when a function can run. This is promising, because it suggests the ability to design and reason about resource usage protocols, such as we might find in distributed and concurrent programming, where the state of a communication channel changes throughout program execution. As yet, however, there has not been a full-scale programming language with which to experiment with these ideas. Idris 2 is a new version of the dependently typed language Idris, with a new core language based on QTT, supporting linear and dependent types. In this paper, we introduce Idris 2, and describe how QTT has influenced its design. We give examples of the benefits of QTT in practice including: expressing which data is erased at run time, at the type level; and, resource tracking in the type system leading to type-safe concurrent programming with session types.Publisher PD
Fast magnetoacoustic waves in curved coronal loops: II. Tunneling modes
Copyright © 2006 ESO / EDP SciencesAims. Fast magnetoacoustic waves in curved coronal loops are investigated and the role of lateral leakage in wave damping, which includes the mechanism of wave tunneling, is explored.
Methods. A coronal loop is modeled as a curved, magnetic slab in the zero plasma- β limit. In this model and for an arbitrary piece-wise continuous power law equilibrium density profile, the wave equation governing linear vertically polarised fast magnetoacoustic waves is solved analytically. An associated dispersion relation is derived and the frequencies and eigenfunctions of the wave modes are characterised.
Results. For some equilibria, the waves are shown to be all damped due to lateral leakage. It is demonstrated that waves either leak straight out into the external medium or have to overcome an evanescent barrier, which is linked to wave tunneling. The wave solutions consist of alternating vertically polarised kink and sausage branches. Fast kink oscillations may have a non-zero density perturbation when averaged across the loop. The calculated damping rate of fast magnetoacoustic kink oscillations is shown to be consistent with related numerical simulations and show that lateral leakage may explain the observed damping of (vertically polarised) fast magnetoacoustic kink oscillations
A Framework for Resource Dependent EDSLs in a Dependently Typed Language (Pearl)
Idris' Effects library demonstrates how to embed resource dependent algebraic effect handlers into a dependently typed host language, providing run-time and compile-time based reasoning on type-level resources. Building upon this work, Resources is a framework for realising Embedded Domain Specific Languages (EDSLs) with type systems that contain domain specific substructural properties. Differing from Effects, Resources allows a language’s substructural properties to be encoded within type-level resources that are associated with language variables. Such an association allows for multiple effect instances to be reasoned about autonomically and without explicit type-level declaration. Type-level predicates are used as proof that the language’s substructural properties hold. Several exemplar EDSLs are presented that illustrates our framework’s operation and how dependent types provide correctness-by-construction guarantees that substructural properties of written programs hold
A Framework for Resource Dependent EDSLs in a Dependently Typed Language (Artifact)
Idris' Effects library demonstrates how to embed resource dependent algebraic effect handlers into a dependently typed host language, providing run-time and compile-time based reasoning on type-level resources. Building upon this work, Resources is a framework for realising Embedded Domain Specific Languages (EDSLs) with type systems that contain domain specific substructural properties. Differing from Effects, Resources allows a language’s substructural properties to be encoded within type-level resources that are associated with language variables. Such an association allows for multiple effect instances to be reasoned about autonomically and without explicit type-level declaration. Type-level predicates are used as proof that the language’s substructural properties hold. Several exemplar EDSLs are presented that illustrates our framework’s operation and how dependent types provide correctness-by-construction guarantees that substructural properties of written programs hold
Seismology of curved coronal loops with vertically polarised transverse oscillations
Aims. Using a model of vertically polarised fast magnetoacoustic waves in curved coronal loops, the method of coronal seismology is applied to observations of transverse loop oscillations.
Methods. A coronal loop is modeled as a curved magnetic slab in the zero plasma-β limit. For an arbitrary piece-wise continuous power law equilibrium density profile, the dispersion relation governing linear vertically polarised fast magnetoacoustic kink waves is derived. The ways in which this model can be used for coronal seismology are explored and applied to two observational examples.
Results. The Alfvén speed and equilibrium density profile are determined from observations. It is shown that the mechanism of lateral leakage of fast magnetoacoustic kink oscillations described in this model is efficient. In fact, the damping is so efficient that in order to match predicted values with observational ones, either the loop needs to be highly contrasted or the transverse Alfvén speed profile needs to be close to linear. Possible improvements to make the modeling of lateral wave leakage in loops more realistic, allowing a lower damping efficiency, are discussed
Frex: dependently-typed algebraic simplification
We present an extensible, mathematically-structured algebraic simplification
library design. We structure the library using universal algebraic concepts: a
free algebra -- fral -- and a free extension -- frex -- of an algebra by a set
of variables. The library's dependently-typed API guarantees simplification
modules, even user-defined ones, are terminating, sound, and complete with
respect to a well-specified class of equations. Completeness offers intangible
benefits in practice -- our main contribution is the novel design. Cleanly
separating between the interface and implementation of simplification modules
provides two new modularity axes. First, simplification modules share thousands
of lines of infrastructure code dealing with term-representation,
pretty-printing, certification, and macros/reflection. Second, new
simplification modules can reuse existing ones. We demonstrate this design by
developing simplification modules for monoid varieties: ordinary, commutative,
and involutive. We implemented this design in the new Idris2 dependently-typed
programming language, and in Agda
- …