91 research outputs found

    Two Techniques for Compiling Lazy Pattern Matching

    Get PDF
    Projet PARAIn ML~style pattern matching, pattern size is not constrained and ambiguous patterns are allowed. This generality leads to a clear and concise programming style but is challenging in the context of lazy evaluation. A first challenge concerns language designers: in lazy ML, the evaluation order of expressions follows actual data dependencies. That is, only the computations that are needed to produce the final result are performed. Once given a proper (that is, non-ambiguous) semantics, pattern matching should be compiled in a similar spirit: any value matching a given pattern should be recognized by performing only the minimal number of elementary tests needed to do so. This challenge was first met by A.~Laville. A second challenge concerns compiler designers. As it stands, Lavillés compilation algorithm cannot be incorporated in an actual lazy ML compiler for efficiency and completeness reasons. As a matter of fact, Lavillés original algorithm did not fully treat the case of integers in patterns and can lead to explosions both in compilation time and generated code size. This paper provides a complete solution to that second challenge. In particular, the well-known (and size-efficient) pattern matching compilation technique using backtracking automata is here introduced for the first time into the world of lazy pattern matching

    Algebraic Pattern Matching in Join Calculus

    Full text link
    We propose an extension of the join calculus with pattern matching on algebraic data types. Our initial motivation is twofold: to provide an intuitive semantics of the interaction between concurrency and pattern matching; to define a practical compilation scheme from extended join definitions into ordinary ones plus ML pattern matching. To assess the correctness of our compilation scheme, we develop a theory of the applied join calculus, a calculus with value passing and value matching. We implement this calculus as an extension of the current JoCaml system

    Fences in Weak Memory Models

    Get PDF
    We present here an axiomatic framework, implemented in the Coq proof assistant, for defining weak memory models in terms of several parameters: local reorderings of reads and writes, and visibility of inter and intra processor communications through memory. In this context, we provide formal definition of weak memory models induced by architectures, illustrated by definitions of SC and Sparc TSO. Moreover, we define a comparison over architectures, an architecture A1 being weaker than another one A2 when A1 allows more behaviours than A2. In addition, we provide a characterisation of behaviours allowed by A1 which are also valid on A2. By that means, we provide a simple characterisation of SC and TSO behaviours on any weaker architecture. We also provide an abstract notion of what should be the action and placement of fences to restore a given model from a weaker one. Our framework led us to a model of a significant fragment of PowerPC with fences. In the absence of any public formal model of PowerPC, we base our study on intensive testing. We illustrate our approach by providing several tests that highlight the parameters of our model

    Fences and Synchronisation Idioms in Weak Memory Models

    Get PDF
    We present an axiomatic framework, implemented in the Coq proof assistant, to define weak memory models in terms of several parameters: local reorderings of reads and writes, and visibility of inter and intra processor communications through memory, including full store atomicity relaxation. Thereby, we give a formal hierarchy of weak memory models, in which we provide a formal study of what should be the action and placement of fences to restore a given model such as SC from a weaker one. Finally, we provide formal requirements for abstract locks that guarantee SC semantics to data race free programs, and show that a particular implementation of locks matches these requirements

    Expressive Synchronization Types for Inheritance in the Join Calculus

    Get PDF
    In prior work, Fournet et al. proposed an extension of the join calculus with class-based inheritance, aiming to provide a precise semantics for concurrent objects. However, as we show here, their system suffers from several limitations, which make it inadequate to form the basis of a practical implementation. In this paper, we redesign the static semantics for inheritance in the join calculus, equipping class types with more precise information. Compared to previous work, the new type system is more powerful, more expressive and simpler. Additionally, one runtime check of the old system is suppressed in the new design. We also prove the soundness of the new system, and have implemented type inference

    Programming in JoCaml --- Extended Version

    Get PDF
    JoCaml is a language for concurrent and distributed programming. We here present a non-trival distributed application written in JoCaml: a ray~tracer. Thereby, we show how to program the coordination of multiple cooperating agents in a concise manner, in the spirit of functional programming. We also adress the issue of agent failure

    Information Hiding, Inheritance and Concurrency

    Get PDF
    We aim to provide information hiding support in concurrent object-oriented programming languages. We study the issue of information hiding at the object level and class level, in the context of an object-oriented extension of the Join calculus a process calculus in the tradition of the Pi-calculus. At the object level, we improve a privacy mechanism proposed in prior work by defining a simpler chemical semantics for privacy control. At the class level, we propose a hiding mechanism by designing a new operation on classes. We define its formal semantics in terms of alpha-converting hidden names to fresh names, and its typing in terms of eliminating hidden names from class types. We study the standard soundness property of the type system, as well as specific properties concerning hiding. Some, if not most, of our choices in designing our system are motivated by implementation. As an evidence of practical significance, we implement our model in a prototyping system. From that experience we draw guidelines for a full-scale implementation

    Ambiguous pattern variables

    Get PDF
    International audienceThe or-pattern (p | q) matches a value v if either p or q match v. It may happen that both p and q match certain values, but that they don’t bind their variables at the same places. OCaml specifies that the left pattern p then takes precedence, but users intuitively expect an angelistic, making the “best” choice. Subtle bugs arise from this mismatch. We here describe a technique based upon pattern matrices that detect such ambiguities. This technique is implemented as a new warning in the OCaml compiler

    Synchronising C/C++ and POWER

    Get PDF
    Shared memory concurrency relies on synchronisation primitives: compare-and-swap, load-reserve/store-conditional (aka LL/SC), language-level mutexes, and so on. In a sequentially consistent setting, or even in the TSO setting of x86 and Sparc, these have well-understood semantics. But in the very relaxed settings of IBM®, POWER®, ARM, or C/C++, it remains surprisingly unclear exactly what the programmer can depend on. This paper studies relaxed-memory synchronisation. On the hardware side, we give a clear semantic characterisation of the load-reserve/store-conditional primitives as provided by POWER multiprocessors, for the first time since they were introduced 20 years ago; we cover their interaction with relaxed loads, stores, barriers, and dependencies. Our model, while not officially sanctioned by the vendor, is validated by extensive testing, comparing actual implementation behaviour against an oracle generated from the model, and by detailed discussion with IBM staff. We believe the ARM semantics to be similar. On the software side, we prove sound a proposed compilation scheme of the C/C++ synchronisation constructs to POWER, including C/C++ spinlock mutexes, fences, and read-modify-write operations, together with the simpler atomic operations for which soundness is already known from our previous work; this is a first step in verifying concurrent algorithms that use load-reserve/store-conditional with respect to a realistic semantics. We also build confidence in the C/C++ model in its own terms, fixing some omissions and contributing to the C standards committee adoption of the C++11 concurrency model

    PERBEDAAN PENGGUNAAN MODEL PEMBELAJARAN TWO STAY TWO STRAY (TSTS) BERBANTUAN MEDIA AUDIO VISUAL DENGAN MODEL KONVENSIONAL TERHADAP PENGUASAAN MATERI PADA KOMPETENSI DASAR MENGURAIKAN PENTINGNYA KEMERDEKAAN MENGELUARKAN PENDAPAT SECARA BEBAS DAN BERTANGGUNG JAWAB (Studi Siswa Kelas VII di SMP Negeri 14 Surakarta Tahun Ajaran 2015/2016)

    Get PDF
    ABSTRAK Sartika Lusiana Dewi. K6412064. PERBEDAAN PENGGUNAAN MODEL PEMBELAJARAN TWO STAY TWO STRAY (TSTS)BERBANTUAN MEDIA AUDIO VISUAL DENGAN MODEL KONVENSIONAL TERHADAP PENGUASAAN MATERI PADA KOMPETENSI DASAR MENGURAIKAN PENTINGNYA KEMERDEKAAN MENGELUARKAN PENDAPAT SECARA BEBAS DAN BERTANGGUNG JAWAB (Studi Siswa Kelas VII di SMP Negeri 14 Surakarta Tahun Ajaran 2015/2016). Skripsi, Surakarta : Fakultas Keguruan dan Ilmu Pendidikan Universitas Sebelas Maret Surakarta, Juli 2016. Tujuan penelitian adalah untuk mengetahui perbedaan penggunaan model pembelajaran two stay two stray berbantuan media audio visual dengan model konvensional terhadap penguasaan materi pada kompetensi dasar menguraikan pentingnya kemerdekaan mengeluarkan pendapat secara bebas dan bertanggungjawab pada siswa kelas VII SMP Negeri 14 Surakarta pada tahun ajaran 2015/2016. Metode yang digunakan dalam penelitian ini adalah metode penelitian eksperimen, dengan desain penelitian yaitu true eksperimental design. Populasi penelitian adalah peserta didik kelas VII SMP Negeri 14 Surakarta. Sampel diambil dengan teknik pengambilan sampel berupa simple random sampling. Sampel dalam penelitian ini adalah sebanyak 80 peserta didik, 40 peserta didik sebagai kelompok eksperimen dan 40 peserta didik sebagai kelompok kontrol. Instrumen yang digunakan dalam penelitian ini berupa dokumentasi, observasi, tes objektif, dan angket. Validitas yang digunakan adalah validitas isi. Pengujian validitas tes dengan menggunakan rumus product moment dari Pearson dengan taraf signifikansi 5% atau (α=0,05), sedangkan uji reliabilitas dalam penelitian ini menggunakan rumus Spearman Brown. Hasil penelitian menunjukkan bahwa terdapat perbedaan secara signifikan antara penguasaan materi peserta didik dengan menggunakan model pembelajaran two stay two stray berbantuan media audio visual dengan penguasaan materi peserta didik dengan menggunakan metode konvensional.Hal tersebut didasarkan pada nilai rata-rata hasil belajar kelas eksperimen yang lebih tinggi jika dibandingkan dengan kelas kontrol, yaitu kelas eksperimen (86,75) > kelas kontrol (79,15). Perbedaan tersebut juga didasarkan pada hasil analisis data dengan uji t.test yang menyatakan bahwa t hitung ≥ t tabel, yaitu 4,2991 ≥ 1,99085. Berdasarkan hasil tersebut dapat disimpulkan bahwa dalam penelitian ini terdapat perbedaan yang signifikan antara penggunaan model pembelajaran two stay two stray berbantuan media audio visual dengan metode konvensional terhadap penguasaan materi pada kompetensi dasar menguraikan pentingnya kemerdekaan mengeluarkan pendapat secara bebas dan bertanngung jawab pada siswa kelas VII di SMP Negeri 14 Surakarta tahun ajaran 2015/2016. Kata Kunci:Two Stay Two Stray, Audio Visual, Model Konvensiona
    • …
    corecore