41 research outputs found

    Set-theoretic Types for Erlang

    Full text link
    Erlang is a functional programming language with dynamic typing. The language offers great flexibility for destructing values through pattern matching and dynamic type tests. Erlang also comes with a type language supporting parametric polymorphism, equi-recursive types, as well as union and a limited form of intersection types. However, type signatures only serve as documentation, there is no check that a function body conforms to its signature. Set-theoretic types and semantic subtyping fit Erlang's feature set very well. They allow expressing nearly all constructs of its type language and provide means for statically checking type signatures. This article brings set-theoretic types to Erlang and demonstrates how existing Erlang code can be statically typechecked without or with only minor modifications to the code. Further, the article formalizes the main ingredients of the type system in a small core calculus, reports on an implementation of the system, and compares it with other static typecheckers for Erlang.Comment: 14 pages, 9 figures, IFL 2022; latexmk -pdf to buil

    Deriving overloaded success type schemes in Erlang

    Get PDF
    Erlang is a programming language which brings together the features of functional programming and actor-based concurrency. Although it is a dynamically-typed language, there exists a tool (Dialyzer) that analyses Erlang programs in order to detect type discrepancies at compile-time. This tool is based on the notion of success types, which are overapproximations to the actual semantics of expressions, so that the evaluation of an ‘ill-typed’ expression will eventually fail at runtime. Dialyzer allows programmers to provide their own type specifications. Although such specifications can be polymorphic and overloaded (i.e., reflecting different executing branches) for documentation purposes, the type analysis disregards the information provided by polymorphic type schemes and so does, in some cases, with overloaded types. In this paper we introduce: (1) a type system that allows us to obtain polymorphic overloaded success type schemes for programs, (2) a semantic definition of this kind of types, and (3) correctness results that prove that the adequacy of the obtained types w.r.t. the semantics of expressions

    Logic-based Technologies for Multi-agent Systems: A Systematic Literature Review

    Get PDF
    Precisely when the success of artificial intelligence (AI) sub-symbolic techniques makes them be identified with the whole AI by many non-computerscientists and non-technical media, symbolic approaches are getting more and more attention as those that could make AI amenable to human understanding. Given the recurring cycles in the AI history, we expect that a revamp of technologies often tagged as “classical AI” – in particular, logic-based ones will take place in the next few years. On the other hand, agents and multi-agent systems (MAS) have been at the core of the design of intelligent systems since their very beginning, and their long-term connection with logic-based technologies, which characterised their early days, might open new ways to engineer explainable intelligent systems. This is why understanding the current status of logic-based technologies for MAS is nowadays of paramount importance. Accordingly, this paper aims at providing a comprehensive view of those technologies by making them the subject of a systematic literature review (SLR). The resulting technologies are discussed and evaluated from two different perspectives: the MAS and the logic-based ones

    A Semantic Framework to Debug Parallel Lazy Functional Languages

    Get PDF
    It is not easy to debug lazy functional programs. The reason is that laziness and higherorder complicates basic debugging strategies. Although there exist several debuggers for sequential lazy languages, dealing with parallel languages is much harder. In this case, it is important to implement debugging platforms for parallel extensions, but it is also important to provide theoretical foundations to simplify the task of understanding the debugging process. In this work, we deal with the debugging process in two parallel languages that extend the lazy language Haskell. In particular, we provide an operational semantics that allows us to reason about our parallel extension of the sequential debugger Hood. In addition, we show how we can use it to analyze the amount of speculative work done by the processes, so that it can be used to optimize their use of resources

    Applications and extensions of context-sensitive rewriting

    Full text link
    [EN] Context-sensitive rewriting is a restriction of term rewriting which is obtained by imposing replacement restrictions on the arguments of function symbols. It has proven useful to analyze computational properties of programs written in sophisticated rewriting-based programming languages such asCafeOBJ, Haskell, Maude, OBJ*, etc. Also, a number of extensions(e.g., to conditional rewritingor constrained equational systems) and generalizations(e.g., controlled rewritingor forbidden patterns) of context-sensitive rewriting have been proposed. In this paper, we provide an overview of these applications and related issues. (C) 2021 Elsevier Inc. All rights reserved.Partially supported by the EU (FEDER), and projects RTI2018-094403-B-C32 and PROMETEO/2019/098.Lucas Alba, S. (2021). Applications and extensions of context-sensitive rewriting. Journal of Logical and Algebraic Methods in Programming. 121:1-33. https://doi.org/10.1016/j.jlamp.2021.10068013312

    Robust Communications in Erlang

    Get PDF
    Erlang is a dynamically-typed functional and concurrent programming language lauded by its proponents for its relatively simple syntax, process isolation, and fault tolerance. The functional aspect has rich features like pattern matching and tail-call optimisation, while the concurrent aspect uses isolated processes and asynchronous message passing to share state between system components. The two meet with pattern matching on mailboxes, which allows for a process to pick a message from its mailbox - potentially out of order - based on its structure, value, type, or a mixture thereof. A strongly and dynamically typed language like Erlang can experience many kinds of runtime errors, such as ill-typed operands to arithmetic operators. The interaction between Erlang's type system and process mailboxes can lead to a more subtle runtime error which is harder to detect: orphan messages. As the types of messages are not checked either at compile time or runtime, a process can be sent a message which it will never receive. Essentially, non-trivial type discrepancies in Erlang programs can cause subtle bugs when communication is involved. These problems can be hard to detect and fix, with current solutions such as extensive testing and exhaustive model checking. This thesis reports on work to detect communication-related type discrepancies in Erlang programs. A fragment of the Core Erlang intermediate format is modelled formally so that we can reason about the out-of-order communication in Erlang systems, particularly the dependencies between sent messages when determining whether orphan messages exist. Afterwards, a sub-typing relation based on Erlang's type system is introduced to clearly define the notion of an orphan message, forming the foundation of a system for automatic detection via a mix of static analysis and runtime verification. This culminates in automatic tooling to detect certain cases of communication discrepancies via static analysis, and automatic instrumentation of concurrent programs to detect and recover from more complicated cases at runtime

    The 5th Conference of PhD Students in Computer Science

    Get PDF

    Syntactic Sugar Programming Languages' Constructs

    Get PDF
    Software application development is a daily task done by developers and code writers all over the world. A valuable portion of developers‘ time is spent in writing repetitive keywords, debugging code, trying to understand its semantic, and fixing syntax errors. These tasks become harder when no integrated development environment (IDE) is available or developers use remote access terminals like UNIX and simple text editors for code writing. Syntactic sugar constructs in programming languages are found to offer simple and easy syntax constructs to make developers' lives easier and smoother. In this study we propose a new set of syntactic sugar constructs, and try to find if they really can help developers in reducing syntax errors, make code shorter, more readable, easier to write, and can help in debugging and semantic understanding. Our methodology was to construct a new syntactic sugar constructs set extracted from existing programming languages' syntax in addition to other syntactic enhancements proposed by us, then we verified the efficiency of the new syntactic sugar constructs set through executing an exploratory case study with students and professional programmers. The exploratory case study results showed positive indicators for using the new proposed syntactic sugar constructs set to write programs' syntax. They helped in reducing syntax errors, making the code more readable, easier to write, and to understand.تطوير البرمجيات التطبيقية ىي ميمة يومية يقوم بيا المطورون والمبرمجون في كافة انحاء العالم، و ييدر جزء ال بأس بو من وقت المبرمجين في كتابة كممات مفتاحية بشكل متكرر في الجمل التركيبية لمبرامج وتصحيح األخطاء في بناء الجمل التركيبية، و محاولة فيم دالالت البرامج. ىذه الميام تصبح أكثر صعوبة إذا لم تكن ىناك بيئة تطوير متكاممة متاحة لإلستخدام، أو عندما يقوم المطورون بكتابة البرامج بإستخدام محررات نصوص بسيطة، وكذلك في حالة تطوير البرامج عن بعد بإستخدام برمجيات االتصال الطرفي كما في نظام التشغيل يونيكس مثلا. لقد أوجدت محسنات بناء الجمل التركيبية في لغات البرمجة لتقدم تركيبات نصية بسيطة وسيمة وجعل حياة المطورين أسيل. بناءاٌ عمى ذلك، نقترح في ىذه الدراسة مجموعة جديدة من محسنات بناء الجمل التركيبية، ونحاول معرفة ما إذا كانت ىذه المحسنات تساىم في التقميل من االخطاء اكثر وضوحاا النصية وجعل تركيب الجمل في لغات البرمجة ابسط و واسيل لمق ارءة والكتابة والتتبع وفيم دالالت البرامج. منيجية البحث المتبعة في ىذه الدراسة تقوم عمى إيجاد مجموعة من محسنات بناء الجمل التركيبية والمستخرجة من بعض لغات البرمجة المستخدمة ، إضافة الى عدد من التحسينات المقترحة، ومن ثم محاولة التحقق من فعالية ىذه المحسنات من خلل إجراء دراسة حالة استكشافية مع عدد من الدارسين والمطورين ذوي الخبرة. ولقد اظيرت نتائج الدراسة مؤشرات ايجابية واضحة حول استخدام محسنات بناء الجمل التركيبية في كتابة البرمجيات، ولقد ساعدت ىذه المحسنات في الحد من األخطاء النصية وجعل تركيب الجمل في لغات البرمجة اكثر وضوحاا واسيل لمق ارءة والكتابة والتتبع وفيم الدالالت

    Fundamental Approaches to Software Engineering

    Get PDF
    This open access book constitutes the proceedings of the 24th International Conference on Fundamental Approaches to Software Engineering, FASE 2021, which took place during March 27–April 1, 2021, and was held as part of the Joint Conferences on Theory and Practice of Software, ETAPS 2021. The conference was planned to take place in Luxembourg but changed to an online format due to the COVID-19 pandemic. The 16 full papers presented in this volume were carefully reviewed and selected from 52 submissions. The book also contains 4 Test-Comp contributions
    corecore