51 research outputs found

    Logic programming in the context of multiparadigm programming: the Oz experience

    Full text link
    Oz is a multiparadigm language that supports logic programming as one of its major paradigms. A multiparadigm language is designed to support different programming paradigms (logic, functional, constraint, object-oriented, sequential, concurrent, etc.) with equal ease. This article has two goals: to give a tutorial of logic programming in Oz and to show how logic programming fits naturally into the wider context of multiparadigm programming. Our experience shows that there are two classes of problems, which we call algorithmic and search problems, for which logic programming can help formulate practical solutions. Algorithmic problems have known efficient algorithms. Search problems do not have known efficient algorithms but can be solved with search. The Oz support for logic programming targets these two problem classes specifically, using the concepts needed for each. This is in contrast to the Prolog approach, which targets both classes with one set of concepts, which results in less than optimal support for each class. To explain the essential difference between algorithmic and search programs, we define the Oz execution model. This model subsumes both concurrent logic programming (committed-choice-style) and search-based logic programming (Prolog-style). Instead of Horn clause syntax, Oz has a simple, fully compositional, higher-order syntax that accommodates the abilities of the language. We conclude with lessons learned from this work, a brief history of Oz, and many entry points into the Oz literature.Comment: 48 pages, to appear in the journal "Theory and Practice of Logic Programming

    Calculating Correct Compilers II: Return of the Register Machines

    Get PDF
    In ‘Calculating Correct Compilers’ (Bahr & Hutton, 2015), we developed a new approach to calculating compilers directly from specifications of their correctness. Our approach only required elementary reasoning techniques and has been used to calculate compilers for a wide range of language features and their combination. However, the methodology was focused on stack-based target machines, whereas real compilers often target register-based machines. In this article, we show how our approach can naturally be adapted to calculate compilers for register machines

    Supporting Concurrency Abstractions in High-level Language Virtual Machines

    Get PDF
    During the past decade, software developers widely adopted JVM and CLI as multi-language virtual machines (VMs). At the same time, the multicore revolution burdened developers with increasing complexity. Language implementers devised a wide range of concurrent and parallel programming concepts to address this complexity but struggle to build these concepts on top of common multi-language VMs. Missing support in these VMs leads to tradeoffs between implementation simplicity, correctly implemented language semantics, and performance guarantees. Departing from the traditional distinction between concurrency and parallelism, this dissertation finds that parallel programming concepts benefit from performance-related VM support, while concurrent programming concepts benefit from VM support that guarantees correct semantics in the presence of reflection, mutable state, and interaction with other languages and libraries. Focusing on these concurrent programming concepts, this dissertation finds that a VM needs to provide mechanisms for managed state, managed execution, ownership, and controlled enforcement. Based on these requirements, this dissertation proposes an ownership-based metaobject protocol (OMOP) to build novel multi-language VMs with proper concurrent programming support. This dissertation demonstrates the OMOP's benefits by building concurrent programming concepts such as agents, software transactional memory, actors, active objects, and communicating sequential processes on top of the OMOP. The performance evaluation shows that OMOP-based implementations of concurrent programming concepts can reach performance on par with that of their conventionally implemented counterparts if the OMOP is supported by the VM. To conclude, the OMOP proposed in this dissertation provides a unifying and minimal substrate to support concurrent programming on top of multi-language VMs. The OMOP enables language implementers to correctly implement language semantics, while simultaneously enabling VMs to provide efficient implementations

    Refinement kinds: type-safe programming with practical type-level computation

    Get PDF
    UID/CEC/04516/2019 PTDC/EEICTP/4293/2014This work introduces the novel concept of kind refinement, which we develop in the context of an explicitly polymorphic ML-like language with type-level computation. Just as type refinements embed rich specifications by means of comprehension principles expressed by predicates over values in the type domain, kind refinements provide rich kind specifications by means of predicates over types in the kind domain. By leveraging our powerful refinement kind discipline, types in our language are not just used to statically classify program expressions and values, but also conveniently manipulated as tree-like data structures, with their kinds refined by logical constraints on such structures. Remarkably, the resulting typing and kinding disciplines allow for powerful forms of type reflection, ad-hoc polymorphism and type-directed meta-programming, which are often found in modern software development, but not typically expressible in a type-safe manner in general purpose languages. We validate our approach both formally and pragmatically by establishing the standard meta-theoretical results of type safety and via a prototype implementation of a kind checker, type checker and interpreter for our language.publishersversionpublishe

    Perspectives and experiences of gender inclusion for STEM programs through an intersectional lens

    Get PDF
    Background: STEM is becoming increasingly important in determining a country's economic and social progress. Despite decades of research and advocacy, women remain underrepresented in STEM education and professions. Such STEM gender gaps, with certain regional and subject differentiations, nevertheless remain as global issues further exacerbated by the COVID-19 pandemic. Informal educational initiatives on GIFSTEM (gender inclusion for STEM) emerged as part of the solution. In recent years, they also have attracted increasing partnership and investment interests from the public and private sectors. However, relatively little evidence exists to demonstrate how the impacts of GIFSTEM initiatives are experienced by different participants, particularly those outside the US. There are also increasing questions about the monolithic framing of gender in these programs. Research Design: This research evaluates the experiences of learners and project leaders of GIFSTEM organizations in a range of geographical settings through an intersectional lens. In this qualitative study, data is collected through 13 individual online semi-structured interviews. Participants represent two groups, those who are learners (both past and present), and those who are project organizers and leaders of different GIFSTEM organizations. Findings: Data from interviews show that learners find GIFSTEM programs helpful in three ways: community, networking-mentoring, as well as a broadened understanding of possible paths in STEM education and professions. Depending on their intersectional identities, learners also experience two barriers, heightened visibility and feelings of exclusion due to identity metrics other than gender, that make them feel uncertain about remaining in STEM. Furthermore, learner participants feel that GIFSTEM programs do little, sometimes even the opposite, in mitigating these issues. Project leader interviews demonstrate that, depending on the specific programming goals, different numerical metrics are used, in combination with qualitative data from individual participations, for impact measurements of their affiliated GIFSTEM organization. Project leaders also have to make a series of pragmatic considerations in the process of developing and implementing a sustainable GIFSTEM organization. For instance, decisions regarding target learner demographics, program contextualization, and navigating relationships with commercial partners. In the end, individual GIFSTEM organizations must make strategic and difficult decisions depending on their operational contexts to reach their respective end goals. Acronyms: GIFSTEM: gender inclusion for STEM GIFT: gender inclusion for Tech (a specific subset of GIFSTEM initiatives) CS: Computer Science EE: Electrical Engineering FAANG: An acronym describing five prominent American technology companies: Facebook(Meta), Amazon, Apple, Netflix, and Google (Hobbs, 2022)

    Calculating correct compilers

    Get PDF
    In this article we present a new approach to the problem of calculating compilers. In particular, we develop a simple but general technique that allows us to derive correct compilers from high- level semantics by systematic calculation, with all details of the implementation of the compilers falling naturally out of the calculation process. Our approach is based upon the use of standard equational reasoning techniques, and has been applied to calculate compilers for a wide range of language features and their combination, including arithmetic expressions, exceptions, state, various forms of lambda calculi, bounded and unbounded loops, non-determinism, and interrupts. All the calculations in the article have been formalised using the Coq proof assistant, which serves as a convenient interactive tool for developing and verifying the calculations

    Type Directed Specification Refinement

    Get PDF
    Specification languages serve a fundamentally different purpose than general-purpose programming languages, and their type systems reflect these needs. Specification type systems must record and track more information for us to reason about a system adequately, and this added expressiveness may lead to an undecidable typing analysis. System level design begins with a high-level specification that is continually refined and expanded with implementation details, constraints, and typing information, down to a concrete specification. During this refinement process, the system is underspecified, and many static analyses aren't applicable until the system is fully specified. However, partial specifications contain valuable information that can inform the refinement process--we can locally inspect parts of the specification from a typing perspective to look for inferrable information or inconsistencies early on to aid the refinement process. This work defines a typing analysis that gathers constraints and typing information to inform the specification refinement process. It explores localized techniques such as local type inference and tracking of values as a means of influencing the specification refinement process

    Proceedings of the ACM SIGPLAN Workshop on Approaches and Applications of Inductive Programming (AAIP 2009)

    Get PDF
    Inductive programming is concerned with the automated construction of declarative, often functional, recursive programs from incomplete specifications such as input/output examples. The inferred program must be correct with respect to the provided examples in a generalising sense: it should be neither equivalent to them, nor inconsistent. Inductive programming algorithms are guided explicitly or implicitly by a language bias (the class of programs that can be induced) and a search bias (determining which generalised program is constructed first). Induction strategies are either generate-and-test or example-driven. In generate-and-test approaches, hypotheses about candidate programs are generated independently from the given specifications. Program candidates are tested against the given specification and one or more of the best evaluated candidates are developed further. In analytical approaches, candidate programs are constructed in an example-driven way. While generate-and-test approaches can -- in principle -- construct any kind of program, analytical approaches have a more limited scope. On the other hand, efficiency of induction is much higher in analytical approaches. Inductive programming is still mainly a topic of basic research, exploring how the intellectual ability of humans to infer generalised recursive procedures from incomplete evidence can be captured in the form of synthesis methods. Intended applications are mainly in the domain of programming assistance -- either to relieve professional programmers from routine tasks or to enable non-programmers to some limited form of end-user programming. Furthermore, in the future, inductive programming techniques might be applied to further areas such as supporting the inference of lemmata in theorem proving or learning grammar rules. Inductive automated program construction has been originally addressed by researchers in artificial intelligence and machine learning. During the last years, some work on exploiting induction techniques has been started also in the functional programming community. Therefore, the third workshop on |Approaches and Applications of Inductive Programming| took place for the first time in conjunction with the ACM SIGPLAN International Conference on Functional Programming (ICFP 2009). The first and second workshop were associated with the International Conference on Machine Learning (ICML 2005) and the European Conference on Machine Learning (ECML 2007). AAIP´09 aimed to bring together researchers from the functional programming and the artificial intelligence communities, working in the field of inductive functional programming, and advance fruitful interactions between these communities with respect to programming techniques for inductive programming algorithms, the identification of challenge problems and potential applications. For everybody interested in inductive programming we recommend to visit the website: www.inductive-programming.org

    Semantics-driven design and implementation of high-assurance hardware

    Get PDF
    corecore