955 research outputs found

    Recursive Definitions of Monadic Functions

    Full text link
    Using standard domain-theoretic fixed-points, we present an approach for defining recursive functions that are formulated in monadic style. The method works both in the simple option monad and the state-exception monad of Isabelle/HOL's imperative programming extension, which results in a convenient definition principle for imperative programs, which were previously hard to define. For such monadic functions, the recursion equation can always be derived without preconditions, even if the function is partial. The construction is easy to automate, and convenient induction principles can be derived automatically.Comment: In Proceedings PAR 2010, arXiv:1012.455

    Polymonadic Programming

    Full text link
    Monads are a popular tool for the working functional programmer to structure effectful computations. This paper presents polymonads, a generalization of monads. Polymonads give the familiar monadic bind the more general type forall a,b. L a -> (a -> M b) -> N b, to compose computations with three different kinds of effects, rather than just one. Polymonads subsume monads and parameterized monads, and can express other constructions, including precise type-and-effect systems and information flow tracking; more generally, polymonads correspond to Tate's productoid semantic model. We show how to equip a core language (called lambda-PM) with syntactic support for programming with polymonads. Type inference and elaboration in lambda-PM allows programmers to write polymonadic code directly in an ML-like syntax--our algorithms compute principal types and produce elaborated programs wherein the binds appear explicitly. Furthermore, we prove that the elaboration is coherent: no matter which (type-correct) binds are chosen, the elaborated program's semantics will be the same. Pleasingly, the inferred types are easy to read: the polymonad laws justify (sometimes dramatic) simplifications, but with no effect on a type's generality.Comment: In Proceedings MSFP 2014, arXiv:1406.153

    Almost structural completeness; an algebraic approach

    Full text link
    A deductive system is structurally complete if its admissible inference rules are derivable. For several important systems, like modal logic S5, failure of structural completeness is caused only by the underivability of passive rules, i.e. rules that can not be applied to theorems of the system. Neglecting passive rules leads to the notion of almost structural completeness, that means, derivablity of admissible non-passive rules. Almost structural completeness for quasivarieties and varieties of general algebras is investigated here by purely algebraic means. The results apply to all algebraizable deductive systems. Firstly, various characterizations of almost structurally complete quasivarieties are presented. Two of them are general: expressed with finitely presented algebras, and with subdirectly irreducible algebras. One is restricted to quasivarieties with finite model property and equationally definable principal relative congruences, where the condition is verifiable on finite subdirectly irreducible algebras. Secondly, examples of almost structurally complete varieties are provided Particular emphasis is put on varieties of closure algebras, that are known to constitute adequate semantics for normal extensions of S4 modal logic. A certain infinite family of such almost structurally complete, but not structurally complete, varieties is constructed. Every variety from this family has a finitely presented unifiable algebra which does not embed into any free algebra for this variety. Hence unification in it is not unitary. This shows that almost structural completeness is strictly weaker than projective unification for varieties of closure algebras

    Automatic annotation of the Penn-treebank with LFG f-structure information

    Get PDF
    Lexical-Functional Grammar f-structures are abstract syntactic representations approximating basic predicate-argument structure. Treebanks annotated with f-structure information are required as training resources for stochastic versions of unification and constraint-based grammars and for the automatic extraction of such resources. In a number of papers (Frank, 2000; Sadler, van Genabith and Way, 2000) have developed methods for automatically annotating treebank resources with f-structure information. However, to date, these methods have only been applied to treebank fragments of the order of a few hundred trees. In the present paper we present a new method that scales and has been applied to a complete treebank, in our case the WSJ section of Penn-II (Marcus et al, 1994), with more than 1,000,000 words in about 50,000 sentences

    Carnap: an Open Framework for Formal Reasoning in the Browser

    Get PDF
    This paper presents an overview of Carnap, a free and open framework for the development of formal reasoning applications. Carnap’s design emphasizes flexibility, extensibility, and rapid prototyping. Carnap-based applications are written in Haskell, but can be compiled to JavaScript to run in standard web browsers. This combination of features makes Carnap ideally suited for educational applications, where ease-of-use is crucial for students and adaptability to different teaching strategies and classroom needs is crucial for instructors. The paper describes Carnap’s implementation, along with its current and projected pedagogical applications

    Towards Deciding Second-order Unification Problems Using Regular Tree Automata

    Get PDF
    International audienceThe second-order unification problem is undecidable [5]. While unification procedures, like Huet's pre-unification, terminate with success on unifiable problems, they might not terminate on non-unifiable ones. There are several decidability results for unification problems with infinitely-many pre-unifiers, such as for monadic second-order problems [3]. These results are based on the regular structure of the solutions of these problems and by computing minimal unifiers. Beyond the importance of the knowledge that searching for unifiers of decidable problems always terminates, one can also use this information in order to optimize unification algorithms, such as in the case for pattern unification [10]. Nevertheless, being able to prove that the unification problem of a certain class of unification constraints is decidable is far from easy. Some results were obtained for certain syntactic restrictions on the problems (see Levy [8] for some results and references) or on the unifiers (see Schmidt-Schauß [11], Schmidt-Schauß and Schulz [12, 13] and Je˙ z [7] for some results). Infinitary unification problems, like the ones we are considering, might suggest that known tools for dealing with the infinite might be useful. One such tool is the regular tree automaton. The drawback of using regular automata for unification is, of course, their inability to deal with variables. In this paper we try to overcome this obstacle and describe an ongoing work about using regular tree automata [1] in order to decide more general second-order unification problems. The second-order unification problems we will consider are of the form λz n .x 0 t. = λz n .C(x 0 s) where C is a non-empty context [2] and x 0 does not occur in t or s. We will call such problems cyclic problems. An important result in second-order unification was obtained by Ganzinger et al. [4] and stated that second-order unification is undecidable already when there is only one second-order variable occurring twice. The unification problem they used for proving the undecidability result was an instance of the following cyclic problem. Note that we chose to use in the definition only unary second-order variables but that this restriction should not be essential. x 0 (w 1 , g(y 1 , a)) = g(y 2 , x 0 (w 2 , a)) (1) Our decidability result is obtained by posing one further restriction over cyclic problems which is based on the existence and location of variables other than the cyclic one. A sufficient condition for the decidability of second-order unification problems was given by Levy [8]. This condition states that if we can never encounter, when applying Huet's pre-unification procedure [6] to a problem, a cyclic equation, then the procedure terminates. It follows from this result that deciding second-order unification problems depends on the ability to decide cyclic problems. The rules of Huet's procedure (PUA) are given in Fig. 1. Imitation partial bindings and projection partial bindings are defined in [14] and are denoted, respectively, by PB(f, α) and PB(i, α) where α is a type, Σ a signature f ∈ Σ and i > 0

    On the relationship of congruence closureand unification

    Get PDF
    Congruence closure is a fundamental operation for symbolic computation. Unification closureis defined as its directional dual, i.e., on the same inputs but top-down as opposed to bottom-up. Unifying terms is another fundamental operation for symbolic computation and is commonly computed using unification closure. We clarify the directional duality by reducing unification closure to a special form of congruence closure. This reduction reveals a correspondence between repeated variables in terms to be unified and equalities of monadic ground terms. We then show that: (1) single equality congruence closure on a directed acyclic graph, and (2) acyclic congruence closure of a fixed number of equalities, are in the parallel complexity class NC. The directional dual unification closures in these two cases are known to be log-space complete for PTIME. As a consequence of our reductions we show that if the number of repeated variables in the input terms is fixed, then term unification can be performed in NC; this extends the known parallelizable cases of term unification. Using parallel complexity we also clarify the relationship of unification closure and the testing of deterministic finite automata for equivalence

    On the Limits of Second-Order Unification

    Get PDF
    Second-Order Unification is a problem that naturally arises when applying automated deduction techniques with variables denoting predicates. The problem is undecidable, but a considerable effort has been made in order to find decidable fragments, and understand the deep reasons of its complexity. Two variants of the problem, Bounded Second-Order Unification and Linear Second-Order Unification ¿where the use of bound variables in the instantiations is restricted¿, have been extensively studied in the last two decades. In this paper we summarize some decidability/undecidability/complexity results, trying to focus on those that could be more interesting for a wider audience, and involving less technical details.Peer Reviewe
    corecore