Parsing is pervasive in computing and fundamental in several software artifacts. This dissertation reports the first step in our ultimate goal: a formally verified toolset for parsing regular and context free languages based on derivatives. Specifically, we describe the formalization of Brzozowski and Antimirov derivative based algorithms for regular expression parsing, in the dependently typed language Agda. The formalization produces a proof that either an input string matches a given regular expression or that no matching exists. A tool for regular expression based search in the style of the well known GNU Grep has been developed using the certified algorithms. Practical experiments conducted using this tool are reported. ObjectivesThe main objective of this dissertation is to formalize, in the dependently typed language Agda, algorithms for RE parsing using Brzozowski's derivatives and Antimirov's partial derivatives. [9] [3] The certified algorithms should be used in a RE-based text search tool in the style of the well-known GNU Grep. ContributionsOur contributions are:• A formalization of Brzozowski derivatives based RE parsing in Agda. The certified algorithm presented produces as a result either a proof term (parse tree) that is * s = λ: In this case the conclusion follows by rule StarBase.
This article discusses the problem of constraint-set satisfiability (CS-SAT ) -that is, the problem of determining whether a given constraint-set is satisfiable in a given typing context -in the context of systems with support for overloading and parametric polymorphism. The paper reviews previous works on constraint-set satisfiability, showing that overloading policies used in order to guarantee decidability of CS-SAT have been generally too restrictive. An algorithm is proposed that does not impose a severe restriction on possible overloadings and decides CS-SAT in an expectedly vast majority of cases of practical interest. In cases for which satisfiability cannot be decided, a configurable limit on the number of iterations is used in order to guarantee termination.
This paper discusses ambiguity in the context of languages that support context-dependent overloading, such as Haskell. A type system for a Haskell-like programming language that supports context-dependent overloading and follow the Hindley-Milner approach of providing contextfree type instantiation, allows distinct derivations of the same type for ambiguous expressions. Such expressions are usually rejected by the type inference algorithm, which is thus not complete with respect to the type system. Also, Haskell's open world approach considers a definition of ambiguity that does not conform to the existence of two or more distinct type system derivations for the same type. The article presents an alternative approach, where the standard definition of ambiguity is followed. A type system is presented that allows only context-dependent type instantiation, enabling only one type to be derivable for each expression in a given typing context: the type of an expression can be instantiated only if required by the program context where the expression occurs. We define a notion of greatest instance type for each occurrence of an expression, which is used in the definition of a standard dictionary-passing semantics for core Haskell based on type system derivations, for which coherence is trivial. Type soundness is obtained as a result of disallowing all ambiguous expressions and all expressions involving unsatisfiability in the use of overloaded names. Following the standard definition of ambiguity, satisfiability is tested-i.e., "the world is closed"-if only if overloading is (or should have been) resolved, that is, if and only if there exist unreachable vari
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
hi@scite.ai
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.