a b s t r a c tWe lay out the design of HasCasl, a higher order extension of the algebraic specification language Casl that serves both as a wide-spectrum language for the rigorous specification and development of software, in particular but not exclusively in modern functional programming languages, and as an expressive standard language for higher-order logic. Distinctive features of HasCasl include partial higher order functions, higher order subtyping, shallow polymorphism, and an extensive type-class mechanism. Moreover, HasCasl provides dedicated specification support for monad-based functional-imperative programming with generic side effects, including a monad-based generic Hoare logic.
IntroductionThe rigorous development of software from abstract requirements to executable code calls for wide-spectrum languages that are sufficiently powerful and flexible to support both an expressive specification logic and concepts appearing in advanced programming languages, including modern functional languages such as Haskell [59], but also imperative and object-oriented languages. Here, we discuss the design of such a wide-spectrum language, HasCasl. HasCasl is an extension of the standard algebraic specification language Casl (Common Algebraic Specification Language) [6,53] developed by the Common Framework Initiative (CoFI) of IFIP WG 1.3, and as such has been adopted by IFIP WG 1.3. It arguably constitutes 'the' natural higher order extension of Casl, and is intended, beyond its purpose as a software specification language, as an expressive standard language for higher order logic. In particular, HasCasl is presently the most expressive language in the logic graph underlying the Bremen heterogeneous tool set Hets [48] and as such serves as a central hub for the interchange of theories between various formalisms in the tool.The core of HasCasl is a higher order logic of partial functions built on top of Moggi's partial λ-calculus [44]. The semantics and proof theory of this logic have been developed in a companion paper [76]; essentially, one arrives at an intuitionistic partial higher order logic without choice principles (even without unique choice). The full HasCasl logic extends the core logic by subtyping and type-classed based shallow polymorphism, including higher-order type constructors and constructor classes; the semantics of the latter is based on models explicitly incorporating signature extensions [70]. Support for general recursive functions is bootstrapped in the style of HOLCF [64] by specifying a theory of fixed point recursion on complete partial orders. Extensive syntactical sugaring of these concepts yields an executable sublanguage which is in close correspondence with a large subset of Haskell.Part of the technical difficulties arising in the development of these concepts stems from the above-mentioned lack of unique choice in the core logic; in particular, additional effort is required in the construction of inductive datatypes and in setting up the theory of complete partial orders. We beli...