This document summarizes a research paper that presents a type inference algorithm for session types. Session types model communication between processes as sequences of message types. The paper presents a system that assigns type schemes to programs, allowing type inference without type declarations. An algorithm is provided that computes the principal type scheme for any typable program, proving soundness and completeness. The algorithm has been implemented in Haskell and partially verified in Agda. The paper focuses on a fragment of session types that includes channel delegation but not choice or recursion.
A simple library implementation of binary sessionsJeff Cacer
This document describes a simple approach to embedding session type checking into programming languages with parametric polymorphism. It defines a core functional language called FuSe that combines multi-threading, session communication primitives, and runtime checks for endpoint linearity. FuSe types are represented in a way that allows the duality between session types to be expressed through type equality. The document outlines how FuSe is given an ML-style type system using encoded session types and how this ensures safety and progress for well-typed FuSe programs under the assumption of linear endpoint usage. It also describes an implementation of FuSe primitives in OCaml that allows writing session-based programs without a built-in session type system by leveraging features of OCaml
This document presents a family of gossiping algorithms whose members can be tuned by assigning different permutation classes to participants. This allows the amount of communication parallelism, or algorithmic parallelism, to be scaled dynamically. The document introduces a procedure called hybrid gossiping to match the algorithmic parallelism to the physical parallelism provided by the deployment platform. By optimally tuning the algorithmic parallelism, resource utilization can be maximized and problems like message collisions avoided. Examples of permutations producing different levels of parallelism, like identity and pipelined permutations, are provided to illustrate this tuning approach.
This document summarizes a research paper on improving regular expression matching using a look-ahead finite automata approach. It proposes LaFA, which optimizes regular expression detection by allowing out-of-order detection, systematically reordering the detection sequence, and sharing states among automata. LaFA uses three main modules - a timestamp lookup module to detect non-repeating patterns, a character lookup module to check individual characters, and a repetition detection module to handle repeating patterns. The system architecture involves capturing packets, extracting payloads, and using these modules in parallel to match regular expressions and improve detection speed for intrusion detection systems.
This document presents a probabilistic content model using a hidden Markov model to model topic structures in text. It applies this model to two tasks: sentence ordering and extractive summarization. For sentence ordering, it generates all possible orders, computes the probability of each, and ranks them to evaluate how well the original sentence order is recovered. For summarization, it assigns topic probabilities to sentences based on topic distributions and extracts sentences with high topic probabilities in summaries. Evaluation shows the content model outperforms baselines on both tasks, demonstrating it effectively captures text structure.
Research on word representation models, word embeddings, has gained a lot of attention in the recent years thanks to Word2Vec by Mikolov et al. The main purpose of this work is to validate previously proposed experiments for the English language and then trying to figure out if it is possibile to reproduce the same accuracy and performance with the Italian language.
Definite Clause Grammars For Language AnalysisRePierre
This document compares definite clause grammars (DCGs) and augmented transition networks (ATNs) for language analysis. DCGs extend context-free grammars by allowing non-terminals to be terms rather than just atoms, and allow procedure calls in rule right-hand sides. DCGs are more powerful, concise, efficient and flexible than ATNs, while also being well-suited for theoretical linguistic work.
Language Interaction and Quality Issues: An Exploratory StudyMarco Torchiano
This document explores language interaction in software projects. It analyzes the Apache Hadoop project to address three research questions. RQ1 finds that over 50% of commits involve more than one language. RQ2 finds that C, SH, properties, and XML files interact most with other languages. RQ3 finds that while cross-language modules generally are not more defect-prone, some language pairs like C-Java have significantly more defects in cross-language modules. The study provides initial evidence on language interactions in software but notes threats from confounding factors and the single-project scope.
Lean Logic for Lean Times: Varieties of Natural LogicValeria de Paiva
This document discusses using logic to analyze natural language text. It proposes a Knowledge Inference Management Language (KIML) that represents text as concepts, roles, and contexts. KIML aims to model quantification, propositional attitudes, and inference in a way that corresponds to natural language semantics. The document also discusses using contextual constructive description logics and connexive logic to model textual entailment relationships.
A simple library implementation of binary sessionsJeff Cacer
This document describes a simple approach to embedding session type checking into programming languages with parametric polymorphism. It defines a core functional language called FuSe that combines multi-threading, session communication primitives, and runtime checks for endpoint linearity. FuSe types are represented in a way that allows the duality between session types to be expressed through type equality. The document outlines how FuSe is given an ML-style type system using encoded session types and how this ensures safety and progress for well-typed FuSe programs under the assumption of linear endpoint usage. It also describes an implementation of FuSe primitives in OCaml that allows writing session-based programs without a built-in session type system by leveraging features of OCaml
This document presents a family of gossiping algorithms whose members can be tuned by assigning different permutation classes to participants. This allows the amount of communication parallelism, or algorithmic parallelism, to be scaled dynamically. The document introduces a procedure called hybrid gossiping to match the algorithmic parallelism to the physical parallelism provided by the deployment platform. By optimally tuning the algorithmic parallelism, resource utilization can be maximized and problems like message collisions avoided. Examples of permutations producing different levels of parallelism, like identity and pipelined permutations, are provided to illustrate this tuning approach.
This document summarizes a research paper on improving regular expression matching using a look-ahead finite automata approach. It proposes LaFA, which optimizes regular expression detection by allowing out-of-order detection, systematically reordering the detection sequence, and sharing states among automata. LaFA uses three main modules - a timestamp lookup module to detect non-repeating patterns, a character lookup module to check individual characters, and a repetition detection module to handle repeating patterns. The system architecture involves capturing packets, extracting payloads, and using these modules in parallel to match regular expressions and improve detection speed for intrusion detection systems.
This document presents a probabilistic content model using a hidden Markov model to model topic structures in text. It applies this model to two tasks: sentence ordering and extractive summarization. For sentence ordering, it generates all possible orders, computes the probability of each, and ranks them to evaluate how well the original sentence order is recovered. For summarization, it assigns topic probabilities to sentences based on topic distributions and extracts sentences with high topic probabilities in summaries. Evaluation shows the content model outperforms baselines on both tasks, demonstrating it effectively captures text structure.
Research on word representation models, word embeddings, has gained a lot of attention in the recent years thanks to Word2Vec by Mikolov et al. The main purpose of this work is to validate previously proposed experiments for the English language and then trying to figure out if it is possibile to reproduce the same accuracy and performance with the Italian language.
Definite Clause Grammars For Language AnalysisRePierre
This document compares definite clause grammars (DCGs) and augmented transition networks (ATNs) for language analysis. DCGs extend context-free grammars by allowing non-terminals to be terms rather than just atoms, and allow procedure calls in rule right-hand sides. DCGs are more powerful, concise, efficient and flexible than ATNs, while also being well-suited for theoretical linguistic work.
Language Interaction and Quality Issues: An Exploratory StudyMarco Torchiano
This document explores language interaction in software projects. It analyzes the Apache Hadoop project to address three research questions. RQ1 finds that over 50% of commits involve more than one language. RQ2 finds that C, SH, properties, and XML files interact most with other languages. RQ3 finds that while cross-language modules generally are not more defect-prone, some language pairs like C-Java have significantly more defects in cross-language modules. The study provides initial evidence on language interactions in software but notes threats from confounding factors and the single-project scope.
Lean Logic for Lean Times: Varieties of Natural LogicValeria de Paiva
This document discusses using logic to analyze natural language text. It proposes a Knowledge Inference Management Language (KIML) that represents text as concepts, roles, and contexts. KIML aims to model quantification, propositional attitudes, and inference in a way that corresponds to natural language semantics. The document also discusses using contextual constructive description logics and connexive logic to model textual entailment relationships.
This document is a resume for Sara Refaeli, providing an overview of her qualifications and experience in sales and business development. She has over 25 years of experience in sales, business development, account management, and new client acquisition across multiple industries. Her most recent role was as a Business Development Manager at Seashore Fruit & Produce, where she increased revenue by 30% and brought in over $1 million in new business.
The document provides a compare and contrast essay analyzing the animated Disney films Snow White and the Seven Dwarfs and Sleeping Beauty. Both films feature princesses who are threatened by jealous villains and placed under spells, but are rescued by prince's kisses. The princesses also take refuge in cottages in the woods and are helped by non-human helpers like dwarfs and fairies. Overall, the essay finds similarities in the motives of the villains, settings, helpers, and endings of the two classic animated films.
City staff is presenting an amendment to the Tree Preservation regulations to clarify that the $2,000 per tree fee cap for properties paying a fee in lieu of onsite mitigation only applies to existing or proposed single-family structures in the MF-D zoning district, not multi-family projects, in response to City Council concerns about clear-cutting.
The document discusses the benefits of meditation for reducing stress and anxiety. Regular meditation practice can help calm the mind and body by lowering heart rate and blood pressure. Making meditation a part of a daily routine, even if just 10-15 minutes per day, can offer improvements to mood, focus, and overall feelings of well-being over time.
Presentation on Traditional Marketing in a Digital World given in 2014. Featuring content on marketing strategies and tactics including; word of mouth, referrals, LinkedIn, public relations, editorial calendars, content calendars, by-lined articles, press releases, trade shows, thought leadership and authority. Content provided by Veracity (formerly Rosenberg Marketing).
Agrarian Organics aims to change conventional agriculture practices by providing organic farming products that enable safe and affordable food production. Their ocean-harvested mineral products are designed to replace chemical fertilizers and replenish depleted soils. By supplementing soils and crops with minerals and nutrients, they hope to repair ecosystems and secure the future food supply in a sustainable way. Field tests show their products increase crop yields while allowing reduced use of fertilizers and pesticides.
The document discusses 6 key topics related to sustainability in Chinese cities: 1) urban planning, 2) energy distribution and efficiency, 3) food safety, 4) accessible and affordable healthcare, 5) efficient transportation, and 6) waste management. It provides references on sustainability in China and future cities from Forbes, Student Pulse, and Asia Society.
Get unlimited traffic through marking you site to others site.
I will MANUALLY submit your blog or site to quality 30+ social
bookmarking sites with PR6 - PR10 like Twitter, Reddit, Stumbleupon, Diggo, Tumblr, Delicious, BuzzNet, Friendfeed, Plurk, etc... I will Submit all manually with thoughtful comments that is best to create huge traffic and google ranking and get indexed in Google and other search engines for your site.
This document outlines an assignment for a group research project comparing two similar businesses in different geographical locations. Students will form groups to conduct primary and secondary research on their chosen businesses. They must visit the business locations, interview owners/managers, and incorporate at least 10 sources in their 2,500-3,000 word written report. Students will also present their findings to the class. The report will be assessed based on topic content, format, and the in-class presentation. Detailed guidelines are provided on the research methodology, report structure, and assessment criteria.
Missions to space cost a lot of money - but you get a lot of bang for your buck when you're on a trip to Mars! Take a look at how the cost of space travel stacks up against other expensive, and decidedly more terrestrial, things.
Source: http://blog.ignitespot.com/and-you-thought-your-business-was-expensive-infographic
This document discusses opportunities and challenges for community organizations in engaging with the changing healthcare environment for aging populations. It outlines how community organizations are well-positioned to innovate through person-focused care, mitigate financial risk for healthcare entities, help transition patients through different care settings, and support end-of-life needs. However, key challenges include engaging healthcare partners who have different cultures, financially aligning, sharing data, and translating awareness of opportunities into concrete actions through organizational reinvention. The document provides strategies for community organizations to build partnerships and their business case for engagement.
The document is a notice with the last date of December 31, 2015. It provides a final deadline of the 31st of December in the year 2015 for an unspecified purpose or task. The short document focuses on communicating this single date as a limiting criteria.
The Menomonie Theater Guild is Menomonie's oldest community theater organization, founded over 55 years ago in part to restore the Mabel Tainter Center for the Arts. The guild produces plays for community enjoyment and provides opportunities for participants. Their upcoming production of Next to Normal will explore mental illness and aims to develop compassion. The director notes the cast gives their all night after night. Actors describe their roles and what the experience has meant to them as they prepare to move the production to the Mabel Tainter stage.
Задатак за израду PowerPoint презентације, којом се уносе основни мултимедијални елементи (слика, звук, филм, транзиција, анимација) у захтевану презентацију.
САМО ЗА ВЕЖБАЊЕ!
A taxonomy of suffix array construction algorithmsunyil96
This document provides a taxonomy and overview of suffix array construction algorithms (SACAs). It describes the key classes of SACAs, including prefix-doubling algorithms and recursive algorithms. Prefix-doubling algorithms perform successive h-sorts, doubling h each time, to fully sort the suffixes. Recursive algorithms break the string into substrings to recursively compute the suffix array. The document aims to concisely describe the various SACA techniques and compare their time complexities and space usage.
Understanding Natural Languange with Corpora-based Generation of Dependency G...Edmond Lepedus
This document discusses training a dependency parser using an unparsed corpus rather than a manually parsed training set. It develops an iterative training method that generates training examples using heuristics from past parsing decisions. The method is shown to produce parse trees qualitatively similar to conventionally trained parsers. Three avenues for future research using this corpus-based generation method are proposed.
This document is a resume for Sara Refaeli, providing an overview of her qualifications and experience in sales and business development. She has over 25 years of experience in sales, business development, account management, and new client acquisition across multiple industries. Her most recent role was as a Business Development Manager at Seashore Fruit & Produce, where she increased revenue by 30% and brought in over $1 million in new business.
The document provides a compare and contrast essay analyzing the animated Disney films Snow White and the Seven Dwarfs and Sleeping Beauty. Both films feature princesses who are threatened by jealous villains and placed under spells, but are rescued by prince's kisses. The princesses also take refuge in cottages in the woods and are helped by non-human helpers like dwarfs and fairies. Overall, the essay finds similarities in the motives of the villains, settings, helpers, and endings of the two classic animated films.
City staff is presenting an amendment to the Tree Preservation regulations to clarify that the $2,000 per tree fee cap for properties paying a fee in lieu of onsite mitigation only applies to existing or proposed single-family structures in the MF-D zoning district, not multi-family projects, in response to City Council concerns about clear-cutting.
The document discusses the benefits of meditation for reducing stress and anxiety. Regular meditation practice can help calm the mind and body by lowering heart rate and blood pressure. Making meditation a part of a daily routine, even if just 10-15 minutes per day, can offer improvements to mood, focus, and overall feelings of well-being over time.
Presentation on Traditional Marketing in a Digital World given in 2014. Featuring content on marketing strategies and tactics including; word of mouth, referrals, LinkedIn, public relations, editorial calendars, content calendars, by-lined articles, press releases, trade shows, thought leadership and authority. Content provided by Veracity (formerly Rosenberg Marketing).
Agrarian Organics aims to change conventional agriculture practices by providing organic farming products that enable safe and affordable food production. Their ocean-harvested mineral products are designed to replace chemical fertilizers and replenish depleted soils. By supplementing soils and crops with minerals and nutrients, they hope to repair ecosystems and secure the future food supply in a sustainable way. Field tests show their products increase crop yields while allowing reduced use of fertilizers and pesticides.
The document discusses 6 key topics related to sustainability in Chinese cities: 1) urban planning, 2) energy distribution and efficiency, 3) food safety, 4) accessible and affordable healthcare, 5) efficient transportation, and 6) waste management. It provides references on sustainability in China and future cities from Forbes, Student Pulse, and Asia Society.
Get unlimited traffic through marking you site to others site.
I will MANUALLY submit your blog or site to quality 30+ social
bookmarking sites with PR6 - PR10 like Twitter, Reddit, Stumbleupon, Diggo, Tumblr, Delicious, BuzzNet, Friendfeed, Plurk, etc... I will Submit all manually with thoughtful comments that is best to create huge traffic and google ranking and get indexed in Google and other search engines for your site.
This document outlines an assignment for a group research project comparing two similar businesses in different geographical locations. Students will form groups to conduct primary and secondary research on their chosen businesses. They must visit the business locations, interview owners/managers, and incorporate at least 10 sources in their 2,500-3,000 word written report. Students will also present their findings to the class. The report will be assessed based on topic content, format, and the in-class presentation. Detailed guidelines are provided on the research methodology, report structure, and assessment criteria.
Missions to space cost a lot of money - but you get a lot of bang for your buck when you're on a trip to Mars! Take a look at how the cost of space travel stacks up against other expensive, and decidedly more terrestrial, things.
Source: http://blog.ignitespot.com/and-you-thought-your-business-was-expensive-infographic
This document discusses opportunities and challenges for community organizations in engaging with the changing healthcare environment for aging populations. It outlines how community organizations are well-positioned to innovate through person-focused care, mitigate financial risk for healthcare entities, help transition patients through different care settings, and support end-of-life needs. However, key challenges include engaging healthcare partners who have different cultures, financially aligning, sharing data, and translating awareness of opportunities into concrete actions through organizational reinvention. The document provides strategies for community organizations to build partnerships and their business case for engagement.
The document is a notice with the last date of December 31, 2015. It provides a final deadline of the 31st of December in the year 2015 for an unspecified purpose or task. The short document focuses on communicating this single date as a limiting criteria.
The Menomonie Theater Guild is Menomonie's oldest community theater organization, founded over 55 years ago in part to restore the Mabel Tainter Center for the Arts. The guild produces plays for community enjoyment and provides opportunities for participants. Their upcoming production of Next to Normal will explore mental illness and aims to develop compassion. The director notes the cast gives their all night after night. Actors describe their roles and what the experience has meant to them as they prepare to move the production to the Mabel Tainter stage.
Задатак за израду PowerPoint презентације, којом се уносе основни мултимедијални елементи (слика, звук, филм, транзиција, анимација) у захтевану презентацију.
САМО ЗА ВЕЖБАЊЕ!
A taxonomy of suffix array construction algorithmsunyil96
This document provides a taxonomy and overview of suffix array construction algorithms (SACAs). It describes the key classes of SACAs, including prefix-doubling algorithms and recursive algorithms. Prefix-doubling algorithms perform successive h-sorts, doubling h each time, to fully sort the suffixes. Recursive algorithms break the string into substrings to recursively compute the suffix array. The document aims to concisely describe the various SACA techniques and compare their time complexities and space usage.
Understanding Natural Languange with Corpora-based Generation of Dependency G...Edmond Lepedus
This document discusses training a dependency parser using an unparsed corpus rather than a manually parsed training set. It develops an iterative training method that generates training examples using heuristics from past parsing decisions. The method is shown to produce parse trees qualitatively similar to conventionally trained parsers. Three avenues for future research using this corpus-based generation method are proposed.
Lectura 3.5 word normalizationintwitter finitestate_transducersMatias Menendez
This document describes a system for normalizing Spanish tweets using finite-state transducers. The system consists of three main components: 1) An analyzer that tokenizes tweets and identifies standard words, 2) Transducers that generate candidate words for out-of-vocabulary tokens by implementing linguistic models of spelling variation, 3) A statistical language model that selects the most probable sequence of words. The transducers are based on weighted finite-state automata and implement models of texting features such as logograms, shortenings, and non-standard spellings. An evaluation shows the system is effective at normalizing Spanish tweets.
Introduction to complexity theory that solves your assignment problem it contains about complexity class,deterministic class,big- O notation ,proof by mathematical induction, L-Space ,N-Space and characteristics functions of set and so on
This document discusses probabilistic topic modeling and document clustering techniques. It begins by introducing topic modeling as a probabilistic generative model that represents documents as mixtures of topics. The key assumptions of topic modeling are then outlined, including that documents belong to multiple topics with probabilities and that topics are distributions over terms. Popular topic modeling algorithms like probabilistic latent semantic indexing (PLSI) and latent Dirichlet allocation (LDA) are then described at a high level.
A REVIEW OF APPLICATIONS OF THEORY OF COMPUTATION AND AUTOMATA TO MUSICDr. Michael Agbaje
Theory of Computation and Automata is a theoretical branch of computer science. It established its roots during 20th Century when mathematicians began developing theoretically and literally machines which mimic certain features of man, completing calculations more quickly and reliably. The word automaton is closely related to the word "automation", meaning automatic processes carrying out the production of specific processes. Automata theory deals with the logic of computation with respect to simple machines, referred to as automata. Through automata, computer scientists are able to understand how machines compute functions and solve problems and more importantly, what it means for a function to be defined as computable or for a question to be described as decidable (Stanford(2004),Cristopher(2013))
This document provides a summary of lectures presented at a workshop on protocol specification, testing and verification. The following key points were discussed:
- Several formal techniques for modeling concurrent systems and specifying protocols were presented, including interval logic, selection/resolution models, behavioral description languages, structured finite state automata, and Petri nets.
- Methods for analyzing protocols were discussed, including reachability analysis, structural reduction, step-wise refinement, and modeling elapsed time.
- Papers addressed verification of protocols using techniques such as automated verification systems, logic specifications, and validation tools.
- Performance analysis and reliability of protocols for industrial networks and data link layers were also covered.
This document summarizes a conference on protocol specification, testing and verification. It discusses several approaches that were presented, including interval logic for protocol specification, a selection/resolution model for specifying and analyzing the alternating bit protocol, modeling elapsed time, step-wise refinement for constructing communicating state machines, comparing communicating state machines and calculus of communicating systems, using structural reduction to verify protocols, and specifying protocols using finite state automata, abstract data types, process algebra and Petri nets. The conference brought together participants from universities, government labs and computer companies in 10 countries.
This document provides an overview and summary of a project report on text clustering. The report describes a system that takes in a collection of documents as input, clusters the documents into groups based on similarity, and allows the user to iteratively explore and refine the clusters to find relevant documents. The system represents documents as vectors, uses cosine similarity to initially cluster documents, and applies Bayesian machine learning to further refine the clusters. It aims to allow users to efficiently browse and retrieve relevant documents without viewing the entire collection.
An expert system for automatic reading of a text written in standard arabicijnlc
In this work we present our expert system of Automatic reading or speech synthesis based on a text
written in Standard Arabic, our work is carried out in two great stages: the creation of the sound data
base, and the transformation of the written text into speech (Text To Speech TTS). This transformation is
done firstly by a Phonetic Orthographical Transcription (POT) of any written Standard Arabic text with
the aim of transforming it into his corresponding phonetics sequence, and secondly by the generation of
the voice signal which corresponds to the chain transcribed. We spread out the different of conception of
the system, as well as the results obtained compared to others works studied to realize TTS based on
Standard Arabic.
FellowBuddy.com is an innovative platform that brings students together to share notes, exam papers, study guides, project reports and presentation for upcoming exams.
We connect Students who have an understanding of course material with Students who need help.
Benefits:-
# Students can catch up on notes they missed because of an absence.
# Underachievers can find peer developed notes that break down lecture and study material in a way that they can understand
# Students can earn better grades, save time and study effectively
Our Vision & Mission – Simplifying Students Life
Our Belief – “The great breakthrough in your life comes when you realize it, that you can learn anything you need to learn; to accomplish any goal that you have set for yourself. This means there are no limits on what you can be, have or do.”
Like Us - https://www.facebook.com/FellowBuddycom
This work constructs the membership functions of the system characteristics of a batch-arrival queuing system with multiple servers, in which the batch-arrival rate and customer service rate are all fuzzy numbers. The -cut approach is used to transform a fuzzy queue into a family of conventional crisp queues in this context. By means of the membership functions of the system characteristics, a set of parametric nonlinear programs is developed to describe the family of crisp batch-arrival queues with multiple servers. A numerical example is solved successfully to illustrate the validity of the proposed approach. Because the system characteristics are expressed and governed by the membership functions, the fuzzy batch-arrival queues with multiple servers are represented more accurately and the analytic results are more useful for system designers and practitioners.
This document summarizes the MIT/GNU Scheme reference manual. It describes Scheme as a programming language with static scoping, latent types, and objects with unlimited extent. Procedures are first-class objects that can be passed as arguments and returned as values. Scheme uses prefix notation and parentheses to denote programs and data. The manual outlines notational conventions used for examples and entries describing variables, special forms, and procedures.
Analysis of single server fixed batch service queueing system under multiple ...Alexander Decker
This document analyzes a single server queueing system with fixed batch service, multiple vacations, and the possibility of catastrophes. The system uses a Poisson arrival process and exponential service times. The server provides service in batches of size k. If fewer than k customers remain after service, the server takes an exponential vacation. If a catastrophe occurs, all customers are lost and the server vacations. The document derives the generating functions and steady state probabilities for the number of customers when the server is busy or vacationing. It also provides closed form solutions for performance measures like mean number of customers and variance. Numerical studies examine these measures for varying system parameters.
The document discusses propositional logic as a knowledge representation language. It defines key concepts in propositional logic including: syntax, semantics, validity, satisfiability, interpretation, models, and entailment. It explains that propositional logic uses symbols to represent facts about the world and connectives to combine symbols into sentences. Sentences can then be evaluated based on the truth values assigned to symbols to determine if the overall sentence is true or false. Propositional logic allows new sentences to be deduced from existing sentences through inference rules while maintaining logical validity.
The document discusses topics related to .NET Framework and C# programming. It contains questions and answers on .NET Framework architecture, Common Language Runtime (CLR), namespaces, data types in C#, type conversions, and boxing/unboxing. Key points include:
- .NET Framework consists of CLR, base class library and APIs. CLR manages execution of .NET programs and provides memory management, security and exception handling.
- Namespaces are used to organize code and avoid naming collisions. Base class library contains common classes for tasks like I/O, strings, collections etc.
- C# supports value types (stored on stack) and reference types (stored on heap). Implicit conversions occur for compatible
4-Chapter Four-Syntactic Parsing and Semantic Analysis.pptmilkesa13
The document discusses syntactic parsing and semantic analysis. It provides an outline and introduction to syntactic parsing, including basic concepts, rule-based parsing, and algorithms like CYK and Earley's. It discusses the differences between parsing natural languages and computer languages. It also covers semantic analysis topics like lexical semantics, compositional semantics, and semantic role labeling.
TEXT ADVERTISEMENTS ANALYSIS USING CONVOLUTIONAL NEURAL NETWORKSijdms
In this paper, we describe the developed model of the Convolutional Neural Networks CNN to a
classification of advertisements. The developed method has been tested on both texts (Arabic and Slovak
texts).The advertisements are chosen on a classified advertisements websites as short texts. We evolved a
modified model of the CNN, we have implemented it and developed next modifications. We studied their
influence on the performing activity of the proposed network. The result is a functional model of the
network and its implementation in Java and Python. And analysis of model results using different
parameters for the network and input data. The results on experiments data show that the developed model
of CNN is useful in the domains of Arabic and Slovak short texts, mainly for some classification of
advertisements.
The document discusses computing the longest common prefix array (LCP array) directly from the Burrows-Wheeler transform (BWT) of a string, rather than first constructing the suffix array. It presents the first algorithm that computes the LCP array in linear time O(n) directly from the wavelet tree of the BWT-transformed string, requiring approximately 2.2n bytes of space. This is more efficient than previous approaches that first constructed the suffix array and then derived the LCP array, requiring at least 5n bytes of space.
Similar to Principal Type Scheme for Session Types (20)
How to Download & Install Module From the Odoo App Store in Odoo 17Celine George
Custom modules offer the flexibility to extend Odoo's capabilities, address unique requirements, and optimize workflows to align seamlessly with your organization's processes. By leveraging custom modules, businesses can unlock greater efficiency, productivity, and innovation, empowering them to stay competitive in today's dynamic market landscape. In this tutorial, we'll guide you step by step on how to easily download and install modules from the Odoo App Store.
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...TechSoup
Whether you're new to SEO or looking to refine your existing strategies, this webinar will provide you with actionable insights and practical tips to elevate your nonprofit's online presence.
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxOH TEIK BIN
(A Free eBook comprising 3 Sets of Presentation of a selection of Puzzles, Brain Teasers and Thinking Problems to exercise both the mind and the Right and Left Brain. To help keep the mind and brain fit and healthy. Good for both the young and old alike.
Answers are given for all the puzzles and problems.)
With Metta,
Bro. Oh Teik Bin 🙏🤓🤔🥰
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...EduSkills OECD
Andreas Schleicher, Director of Education and Skills at the OECD presents at the launch of PISA 2022 Volume III - Creative Minds, Creative Schools on 18 June 2024.
Gender and Mental Health - Counselling and Family Therapy Applications and In...PsychoTech Services
A proprietary approach developed by bringing together the best of learning theories from Psychology, design principles from the world of visualization, and pedagogical methods from over a decade of training experience, that enables you to: Learn better, faster!
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
Principal Type Scheme for Session Types
1. Alvaro Tasistro, Ernesto Copello & Nora Szasz
International Journal of Logic and Computation (IJLP), Volume (3) : Issue (1) : 2012 34
Principal Type Scheme for Session Types
Álvaro Tasistro tasistro@ort.edu.uy
Universidad ORT Uruguay
11100, Montevideo, Uruguay
Ernesto Copello copello@ort.edu.uy
Universidad ORT Uruguay
11100, Montevideo, Uruguay
Nora Szasz szasz@ort.edu.uy
Universidad ORT Uruguay
11100, Montevideo, Uruguay
Abstract
Session types as presented in [1] model communication between processes as a structure of
dialogues. The dialogues are specified by sequences of types of messages, where each type
describes the format and direction of the message. The resulting system imposes a type
discipline that guarantees compatibility of interaction patterns between processes of a well-typed
program. The system is polymorphic in Curry’s style, but no formal treatment of this aspect has
been provided yet. In this paper we present a system assigning type schemes to programs and
an algorithm of inference of the principal type scheme of any typable program for a significant
fragment of the calculus which allows delegation of communication, i.e. transmission of channels.
We use classical syntax for variables and channels, i.e. just one sort of names in each case for
either bound of free occurrences. We prove soundness and completeness of the algorithm,
working on individual terms rather than on α-equivalence classes. The algorithm has been
implemented in Haskell and partially checked in the proof assistant Agda.
Keywords: types, principal type scheme, type inference algorithm.
1. INTRODUCTION
Systems of (dyadic) session types allow to structure programs which consist of communicating
processes as networks of dialogues. Each such dialogue is called a session and is carried out
through a specific sort of communication entity called a channel. Channels are created by a
special kind of interaction occurring at ordinary ports, which we explain at once: using syntax
close to that in the original presentation of session types [2], we write acc a(k).P to represent a
process that is willing to accept a session at port a. This can interact with concurrent req a(k’).Q
which can be thought of requesting such session. As a consequence of the interaction, a new
channel is created that will communicate the continuation processes P and Q. In these
processes, the names k and k’ will (respectively) represent the two ends of the newly created
channel. Thus, and as a consequence of the dialogue restriction, each channel end in the system
belongs to one and only one process.
Once the channel is created, the session takes place, i.e. a sequence of messages is
interchanged. The system of types allows characterizing each session as a sequence of message
formats, where each format specifies the direction and type of contents of the message. Such
characterization is a session type. A process like P or Q above can in turn be characterized by
the (session) types of its (free) channels, which are determined by the actions performed by the
process at each of its channel ends. Let us call the set of channel types of a process its typing.
Now, in acc a(k).P and req a(k).P the name k becomes bound and the process ceases to depend
on it; that is to say, the typing of acc a(k).P shall not mention k anymore. The port a is, however,
assigned the type of k. And thus it becomes in principle possible to check whether two processes
acc a(k).P and req a(k’).Q that expect to establish a session through a do indeed hold compatible
2. Alvaro Tasistro, Ernesto Copello & Nora Szasz
International Journal of Logic and Computation (IJLP), Volume (3) : Issue (1) : 2012 35
interactions. Compatible means actually dual, i.e. an output in one process must be mirrored by
an input in the other, and with contents of the same type. Thereby, type correctness ensures
absence of compatibility errors in communication and freedom from interference of third parties in
the dialogues. The safety property can be characterized as freedom from dead-lock in the case
that sessions do not overlap.
As already said, session types appeared in [3,2]. Next to that, [4] allowed the transmission of
channels in sessions, i.e. the possibility of implementing delegation: a process can then delegate
a session to another process that takes over the dialogue. It does so by sending the second
process the corresponding channel end (which is then definitely lost by the original process.)
The system of types was later refined in [1], following ideas of [5]. That is the system that we shall
consider in this paper. The problem to study is that of type inference, i.e. of performing type
checking even when (some) type declarations are omitted. Actually the system in [1] is
polymorphic in Curry’s style and admits a definition of principal type scheme. The principal type
scheme can be computed for each well-formed process, even without any type declaration of
variables, channels or ports. Such is the contribution of this paper: a formal treatment of session
type polymorphism, in which we give an inference algorithm and prove its soundness and
completeness. We here carry out the work for a fragment of the original type system including
channel delegation but not choice or recursion. These restrictions are not essential, as we shall
indicate. We have implemented our algorithm in Haskell and in the proof assistant Agda [6], in
which the proof of soundness has been completely fomalized.
This kind of work has not been done elsewhere, as far as we know. In [5] a type checking (not
inference) algorithm is given and its soundness proven, for a system more expressive than the
one considered here, since it allows for subtyping in the session types. In [7] a simple version of
session types is studied. in which only two implicit channels can be simultaneously used. As a
consequence of this, delegation of channels is not possible. The type system is also simplified not
allowing recursive types. In this work type safety is proven and an OCaml implementation of an
inference algorithm is presented, for which proofs of some basic results are given.
There are some other related works that embed session types in other programming languages.
In [8] and [9] session types are implemented in Haskell, making use of its powerful polymorphic
type system and type classes with functional dependencies [10]. In the first work only one
channel is implemented and soundness of the embedded system is proven. In the second one
multiple channels are allowed but no soundness property is given. In [11] a more general
technique is given to embed session types with multiple channels, thus earning more portability in
the host language. In particular, any polymorphic language can be used as host. Soundness is
proven but only for one channel.
The rest of the paper is organized as follows: in the next section we introduce the process
language and the type system, adapted from the one in [1]. We notice it is polymorphic and then
introduce the notion of type scheme, employing type variables. In section 3 we formulate our
algorithm of type inference which computes, for every typable program, its principal type scheme,
i.e. a type scheme assignable to the program and from which every other typing of the program
can be obtained as a type substitution instance. We give detailed proofs of soundness and
completeness of the algorithm. We expose conclusions and remaining work in section 4.
2. SESSION TYPES
Syntax of processes is as follows:
P : − 0 | k!e ; P | k?x. P | k!!k’ ; P | k??k’. P | acc a(k). P | req a(k). P | P |Q
3. Alvaro Tasistro, Ernesto Copello & Nora Szasz
International Journal of Logic and Computation (IJLP), Volume (3) : Issue (1) : 2012 36
We now informally explain their meaning. In what follows channel and channel end are used
interchangeably:
0 is the inactive process.
In the term k!e ; P, k is a channel end and e an expression whose value is data to be sent along
k. Then the process continues behaving as P.
In k?x. P, data is received in the channel end k. The variable x is bound in the term.
The term k!!k’ ; P sends the channel end k’ along the channel k and then becomes P.
Dually, k??k’. P receives a channel in the channel end k. The name k’ becomes bound in the
term.
The meaning of acc a(k). P and req a(k). P is related to session initiation and has already been
explained. The name k is bound in both terms.
Finally, P |Q, is the parallel composition of processes P and Q.
As usual, we assume denumerable sets of channel names and of variables. Also, as is evident
from the syntax above, we assume a class of data expressions to be specified separately.
The syntax has been chosen so as to include those cases that are essential for the study of
compatibility of interaction. In this regard, the only constructs that could be said missing are the
choice operators. But consideration of these adds only technical difficulties that lie somehow
beside the problem we are interested in. Also for completing a sufficiently expressive language
we should include recursion or replication. We shall comment on this later.
We now turn to the consideration of types. We shall assume that an appropriate type system
exists for the data expressions, whose properties are to be stated when necessary. Let for the
moment δ stand for data types. Then session types are as follows:
α,β : − 1 | ↑δ ; α | ↓δ ; α | ↑α ; β | ↓α ; β
i.e. they are finite sequences of message formats, each of which specifies the direction (↑ = out, ↓
= in) and type of the contents of the message (type of data or type of a channel being sent or
received in delegation). 1 stands for impossibility of communication. Should we consider
recursion, we would have to allow for (finite descriptions of) infinite sequences. Also if we
considered choice there would have to be a branching construct.
The dual α of a type α is defined as follows:
1 = 1
↑δ; α = ↓δ; α
↓δ; α = ↑δ; α
↑α; β = ↓α; β
↓α; β = ↑α; β
A typing judgement is of the form Γ; Π |– P ∆, where:
P is the program being typed.
∆ is the channel context, recording the types of the free channels of the program P.
Γ is the data context, containing the declarations of the free (data) variables of P.
Π is the port context, with the declarations of the ordinary ports of P.
Data contexts Γ are finite partial functions from data variables to data types. The application of
function F to argument a will be written F a. The union of two data contexts Γ, Γ’ is still a valid data
context when Γ x = Γ’ x for every variable x which is defined (declared) in both Γ and Γ’. Port
contexts Π are, similarly, finite partial functions from sort names to session types.
Channel contexts ∆ are instead total functions from channel names to channel types, 1 almost
everywhere. This choice proves to be convenient and reflects the fact that unused and unusable
(inactive) channels are indistinguishable. In particular, 1 is the constant function everywhere
equal to 1. Two channel typings ∆ and ∆’ are disjoint, to be written ∆ / ∆’ iff for every channel k, at
4. Alvaro Tasistro, Ernesto Copello & Nora Szasz
International Journal of Logic and Computation (IJLP), Volume (3) : Issue (1) : 2012 37
least one of ∆k and ∆’k is 1. The union of two disjoint channel typings, to be written ∆.∆’, is such
that for every channel k, (∆.∆’)k is the sum of ∆k and ∆’k, where sum has 1 as (left and right)
identity element. Overriding a function F with a pair (a, b) is written F≺+a → b and gives value F x
for every x ≠ a, whereas it gives value b for argument a. In the case of channel and data contexts,
we will write : in overridings instead of the symbol →. When treating channel contexts it will prove
sometimes convenient to use a notation for a strong form of overriding to be written · and that can
be called extension. Specifically, ∆ · k : α means the overriding of ∆ with the pair (k, α) but
requiring further ∆k = 1.
The type system is exposed in Figure 1.
inact:
Γ; Π |– 0 1
snd:
Γ |– e : δ Γ; Π |– P ∆
Γ ; Π |– k!e ; P ∆ ≺+ k:δ ; ∆k
rcv:
Γ≺+ x: δ ; Π |– P ∆
Γ ; Π |– k?x. P ∆ ≺+ k:↓δ ; ∆k
thrw:
Γ ; Π |– P ∆
Γ ; Π |– k!!k’ ; P ∆ ≺+ k:↑α ; Δk · k’:α
ctch:
Γ ; Π |– P ∆ · k’:α
Γ ; Π |– k??k’. P ∆ ≺+ k: ↓α ; ∆k
acc:
Γ ; Π |- P ∆ · k: Πa
Γ; Π |– acc a(k). P ∆
req:
Γ ; Π |- P ∆ · k: Πa
Γ; Π |– req a(k). P ∆
conc:
Γ ; Π |– P ∆ Γ ; Π |– Q ∆’
∆/∆’
Γ; Π |– P | Q ∆.∆’
FIGURE 1: The Type System
We proceed to explain the rules:
First, the rule inact establishes that any channel is completed (no longer usable) in process 0.
The next snd rule corresponds to the event of sending data through the channel k. We assume
the existence of a type system for data expressions in which it is possible to type these under
declarations of its variables, which are of course the variables of our programs. That explains
the first premise of the rule. The second premise types the continuation process P, and then the
conclusion updates the typing of P with the new type of k, obtained by prefixing ↑δ to the type
sequence characterizing k in the continuation process.
The third rule rcv corresponds to receiving data through a channel. A variable x is used and its
declaration updates the data context in the typing of the continuation process P. The type
declared to x is of course the type of the data received in the resulting typing in the conclusion
of the rule.
Next comes the rule thrw corresponding to sending (throwing) a channel end through a channel.
The thrown channel end must be named with a fresh identifier, i.e. one not occurring in the
continuation process P. This reflects the fact that the channel end will no longer belong to the
process that just threw it over. In the rule the condition is imposed by the use of the extension
operator · in the conclusion. Notice that the rule can be applied for whatever type is associated
to the thrown channel.
5. Alvaro Tasistro, Ernesto Copello & Nora Szasz
International Journal of Logic and Computation (IJLP), Volume (3) : Issue (1) : 2012 38
The next rule ctch is for receiving (catching) a channel sent over by a communicating process.
The name k’ used to represent the received channel end becomes bound, which is reflected in
the fact that it cannot appear in the typing ∆. Syntactically, this is enforced by use of the
extension operator in the premise. In fact, the names k and k’ could coincide (since after all no
restriction should be placed in the choice of the name k’). In this case the resulting typing of the
process at hand depends on k and reflects that it becomes unusable after the catching.
The rule acc is for accepting a session. The channel end k becomes bound and similar
considerations as above apply. But there is a detail to comment, which concerns the type
assigned to k in order to type the continuation process. This type is the same that the port a has
in the port context Π. This means two things: firstly, a has to be declared in Π, and this ought to
be made explicit as a side condition to the rule. The reason why we have omitted this has to do
only with brevity of the presentation and will become clearer below. Secondly, the rule reflects
that the typing of the ordinary ports is the type of the channel end created by interaction at that
port.
This is to be linked to the next, dual, rule req for typing a request of session. What we require in
this case is that the channel behaves in a manner dual to the type of the port, and that will make
it dual to the type of the opposite end of the channel created at the interaction of acceptance
and request. That is to say, in a parallel composition of an acceptance and a request of a
session the port is typed uniformly in both cases, and it is the channel ends which have to
receive dual types.
Finally, the rule conc of concurrent composition of processes requires that no channel end
belongs to more than one process (disjointness of the channel typings) and that all variables
and ports are uniformly typed in both processes.
Notice that no type declaration is required in the syntax of terms for any of the variables, ports or
channels. This is coincident with the formulation in [1], of which the system presented here is a
slight variant. The system is thus polymorphic à la Curry. Examples of polymorphic terms are: acc
a(k).k?x.k!x; 0 and acc a(k).acc b(k’). . . . k!!k’; P .
This motivates the investigation of type schemes. We therefore consider a denumerable set of
type variables a
t
and define the (session) type schemes as follows:
α : − a
t
| a
t
| 1 |↑δ ; α| ↓δ; α| ↑α ; α| ↓α ; α
The scheme a
t
is there just to stand as the dual of type variable a
t
(and its dual is of course a
t
).
We then consider the type system given before with two modifications: first, we assign type
schemes in place of types; and, secondly, only for the sake of simplicity of the treatment, we shall
consider port contexts as total functions from port names to type schemes. The (new) port
contexts shall be built by successive instantiations from an original context in which every port
name has associated a different type variable. We call this the void or purely generic port context
and write it Ω. It can be implemented by assuming that each port name a can be encoded
uniquely as a type variable a
t
. We define dom Π = {a | Πa a
t
} for port context Π. This set will
always be finite. We further define two port contexts Π and Π´ to be compatible when for every
port a, either Πa = Π´a or one of them is a type variable. For compatible port contexts Π and Π´,
define the union Π.Π´ to take, for each port a, the common value at a of Π and Π´ if such is the
case, or the more instantiated one otherwise. We insist in that these considerations are only for
simplicity in the treatment to be presented below and are not essential to it. Otherwise, the
system with type schemes is exactly like the one above. In particular, the rules are the same as
displayed in Figure 1.
We have also to consider type substitutions. These are finite partial functions from type variables
to type schemes and their action on type schemes is defined in the obvious way. We only have to
remark that substitution of type scheme α for a
t
in a
t
yields α.
6. Alvaro Tasistro, Ernesto Copello & Nora Szasz
International Journal of Logic and Computation (IJLP), Volume (3) : Issue (1) : 2012 39
Finally, we assume that a similar extension to type schemes can be applied to the system of
typing of data expressions. Then the following two basic results are obtained, provided they hold
too for the system of data expressions:
Lemma 1 (Weakening). If Γ; Π |– P ∆ and Γ Γ’ then Γ’; Π |– P ∆.
Proof. Immediate induction on the type system. Use that Γ ≺+ x: δ Γ’ ≺+ x: δ if Γ Γ’.
Lemma 2 (Closure under type substitution). If Γ; Π |– P ∆ then for any type substitution θ,
Γθ; Πθ |– P ∆θ.
Proof. Induction on the type system. Use that for any type substitution σ and type scheme α, ασ =
ασ.
3. TYPE INFERENCE
An inference algorithm for the given type system is displayed in Figure 2.
We make use of the form of judgement Γ; Π P ∆ with the obvious meaning, i.e. given
program P the algorithm infers (if possible) the contexts Γ, Π and ∆. Further, as shall be proven
presently, the typing inferred in case of success is the most general that can be assigned to P in
the type system, i.e. it is the principal type scheme of P. This means that every other typing of P
can be obtained from the one inferred by applying to this a suitable type substitution.
A simple inspection reveals that for each program P the inferred typing is unique up to the choice
of the type variables used to construct it. The type variables are introduced in the (conclusions of
the) rules rcv2 and thrw, and as will be shown, the choice of particular names is immaterial once
certain basic conditions of freshness are ensured, namely that the names are fresh w.r.t. the set
of type variables used in each rule’s premise. This allows us to make the following convention in
order to simplify the presentation: in rules with two premises, no type variable is used in both
premises. And in rules in which we introduce type variables, these are fresh w.r.t. the set of type
variables used in the premises.
inact:
; Ω 0 1
snd:
Γ e δ Γ’; Π P ∆
Γθ
Γ’
Γθ Γ’θ; Πθ k!e ; P ∆θ ≺+ k:δθ ; (Δθ)k
rcv1:
Γ ; Π P ∆
x dom Γ
Γ x ; Π k?x. P ∆ ≺+ k:↓Γx ; ∆k
rcv2:
Γ ; Π P ∆
x dom Γ
Γ ; Π k?x. P ∆ ≺+ k:↓a
t
; ∆k
thrw:
Γ ; Π P ∆
Γ ; Π k!!k’ ; P ∆ ≺+ k:↑a
t
; ∆k · k’:a
t
ctch:
Γ ; Π P ∆
Γ ; Π k??k’ ; P ∆ k’ ≺+ k: ↓∆k’ ; (∆k’)k
acc:
Γ ; Π P ∆
Πa θ
∆k
Γθ; Πθ acc a(k). P ∆θ k
req:
Γ ; Π P ∆
Πa θ
∆k
Γθ; Πθ req a(k). P ∆θ k
7. Alvaro Tasistro, Ernesto Copello & Nora Szasz
International Journal of Logic and Computation (IJLP), Volume (3) : Issue (1) : 2012 40
conc:
Γ ; Π P ∆ Γ’ ; Π’ Q ∆’
∆/∆’ , (Γ,Π) θ
(Γ’,Π’)
Γθ Γ’θ; Πθ.Π’θ P | Q ∆θ.∆’θ
FIGURE 2: The Inference Algorithm
We now explain the rules. The general idea is of course to infer the minimal and most general
contexts that fit the given program.
First, the rule inact assigns to 0 the void contexts.
In the snd (send) rule use is made of inference of type of data expressions –we assume such
algorithm to be available– which gives the first premise. The second premise corresponds to the
(recursive) inference of typing of the continuation process P. Then the condition for success of
the rule is that the two inferred contexts Γ and Γ’ unify, i.e. that the (data) type schemes at their
common variables unify. This is (we assume) standard first order unification, which is decidable
and yields in case of success a most general unifier θ. This is what is expressed by the side
condition Γθ
Γ' to the rule. The conclusion obtains immediately by realizing that every context
has to be instantiated by θ and Γ and Γ’ have to be put together. Besides, the typing of the
process at hand has to be updated with the type inferred for the channel k.
For the rcv (receive) rule there are two subcases. Once the continuation process P has been
recursively typed one checks whether the data variable x is used in P or not. In the first case, the
type assigned to x in the data context is recorded in the type of the channel as being received. If
otherwise the variable is not used in P, then any type does since any value can be received.
Therefore we update the channel k with the mark of input of a fresh type variable. According to
the convention given above, this variable can be any one not occurring in the premise of the rule.
A situation entirely similar to this last subcase arises in the next rule, in which the thrown out
channel k’ can be typed with any type whatsoever.
In the rule catch the point is to delete the bound name k’ so that it does not occur in the resulting
channel context. The rest of the manipulation has to do with considering the case in which the
names k and k’ coincide.
In the rest of the rules the novelty is the use of a unification algorithm over session types. This is
expressed in the side conditions to the rules. Now session types are also first order trees if data
types are and therefore such algorithm exists under the assumptions that we have established.
This is actually the point on which all our development rests.
We can now prove the full correctness of our algorithm. For this we have to suppose correct the
algorithm of data type inference.
Proposition 3 (Soundness of Type Inference). If Γ; Π P ∆ then Γ; Π |– P ∆.
Proof. By induction on the rules of the inference algorithm.
Case inact: Immediate.
Case snd: Assume Γ |– e : δ (soundness of expression type inference) and Γ’ ; Π |– P ∆
(induction hypothesis). Assume further Γ θ
Γ’ (side condition to the rule in the inference
algorithm.) We then know both Γθ |– e : δθ and Γ’θ; Πθ |– P ∆θ because of the property of
preservation of typing under type substitution in both type systems (expressions and session
types). Now, since Γ and Γ’ unify under θ, Γθ ∪ Γ’θ is defined and, by weakening of both type
systems, we get Γθ ∪ Γ’θ |– e : δθ and Γθ ∪ Γ’θ; Πθ |– P ∆θ. Hence, by rule snd of the session
type system, Γθ ∪ Γ’θ; Πθ |– k!e; P ∆ ≺+ k: ↑ δθ; (∆θ)k, as required.
Case rcv1: Assume Γ; Π |– P ∆ (induction hypothesis) and x ∈ dom Γ (side condition to the
rule.) We then know Γ = Γ x ≺+ x : Γx and therefore, because of the rule rcv of the type system,
we have Γ x; Π |– k?x.P ∆ ≺+ k : ↓Γx; ∆k, as required.
Case rcv2: Assume Γ; Π |– P ∆ (induction hypothesis) and the side condition x dom Γ. Also,
as indicated before, assume a
t
fresh in (Γ, Π, ∆). Then Γ ⊆ Γ≺+ x : a
t
and therefore by weakening,
8. Alvaro Tasistro, Ernesto Copello & Nora Szasz
International Journal of Logic and Computation (IJLP), Volume (3) : Issue (1) : 2012 41
Γ≺+ x: a
t
; Π |– P ∆. Now, using rule rcv of the type system, we arrive at the desired Γ; Π |–
k?x.P ∆ ≺+ k: ↓a
t
; ∆k.
Case thrw: Immediate. Notice that the side condition needs not be used.
Case ctch: Immediate once one writes ∆ = (∆ k’)· k’ : ∆k’ .
Case acc: Assume Γ; Π |– P ∆ and side condition Πa θ
∆k. By preservation of typing under
type substitutions we know Γθ; Πθ |– P ∆θ. Now ∆θ = (∆θ k) · k: (∆θ)k. And (∆θ)k = (∆k)θ =
(since Πa θ
∆k) = (Πa)θ = (Πθ)a, whence the required Γθ; Πθ |– acc a(k).P ∆θ k by use of the
rule acc of the type system.
Case req: Identical to the preceding one.
Case conc: Use the unification side condition, preservation of typing under type substitution, and
weakening, just the same as in case snd.
Proposition 4 (Completeness of Type Inference). Γ; Π |– P ∆ implies Γ1; Π1 P → ∆1 for
contexts Γ1, Π1, ∆1 and type substitution θ such that Γ1θ ⊆ Γ, Π1θ = Π and ∆1θ = ∆.
Proof. By induction on the rules of the type system.
Case inact: Define θa
t
= Πa for every a ∈ dom Π.
Case snd: Assume Γ1 ← e → δ1 with Γ1θ ⊆ Γ and δ1θ= δ for appropriate type substitution θ (this
corresponds to completeness of the data expression type inference system.) Assume the
induction hypothesis, i.e. Γ1’ ; Π1’ ← P → ∆1’ with Γ1’θ’ ⊆ Γ, Π1’θ’ = Π and ∆1’θ’ = ∆ for appropriate
type substitution θ’. Assume further that the type variables employed in Γ1 and Γ1’ are disjoint.
Hence without loss of generality we can also take θ and θ’ to possess disjoint domains. Now the
union σ of these two substitutions makes both Γ1σ ⊆ Γ and Γ1’σ ⊆ Γ, which means that there is a
subcontext of Γ that is a type substitution instance of both Γ1 and Γ1’. Hence these two have a
most general unifier ζ and we can apply rule snd of the inference algorithm to obtain Γ1ζ ∪ Γ1’ζ ;
Π1’ζ ← k!e ; P → ∆1’ζ ≺+ k : ↑ δζ ; (∆1’ζ )k. Also because ζ is the m.g.u. of Γ1 and Γ1’, we know
that there exists ζ’ such that σ = ζζ’. Further, since θ’ is the subset of σ acting on the type
variables of Γ1’, Π1’ and ∆1’, we have Γ1’θ’ = Γ1’ζζ’ and similarly for Π1’ and ∆1’. Therefore in the
inference above we have what is required to prove, namely (Γ1ζ Γ1’ζ)ζ’ = Γ1ζζ’ Γ1’ζζ’ = Γ1θ
Γ1’θ’ ⊆ Γ , Π1’ζζ’ = Π1’θ’ = Π and [∆1’ζ ≺+ k : ↑δζ ; (∆1’ζ)k]ζ’ = ∆ ≺+ k : ↑δ; ∆k, where the latter can
be easily checked by just distributing the substitution ζ’.
Case rcv: Assume the induction hypothesis, i.e. Γ1; Π1 P → ∆1 with Γ1θ ⊆ Γ≺+x: δ, Π1θ= Π and
∆1θ = ∆ for appropriate type substitution θ.
If now x ∈ dom Γ1 then we can apply rule rcv1 of the inference algorithm to get Γ1x; Π1 ← k?x.P
→ ∆1 ≺+ k : ↓Γ1x; ∆1k. Moreover, we have (Γ1x)θ ⊆ Γ, which follows from Γ1θ ⊆ Γ≺+x: δ, and, by
hypothesis, Π1θ= Π. Finally, [∆1≺+ k: ↓Γ1x; ∆1k]θ = ∆ ≺+k: ↓δ; ∆k, which can be checked by
distributing θ and using ∆1θ = ∆ as well as (Γ1x)θ = (Γ1θ)x = δ.
If otherwise x dom Γ1, we choose a sufficiently fresh type variable a
t
and apply rule rcv2 to get
Γ1; Π1 ← k?x.P → ∆1 ≺+ k: ↓a
t
; ∆1k and taking θ’ = θ · a
t
δ, the required conditions Γ1θ’ ⊆ Γ,
Π1θ’= Π, and [∆1≺+ k: ↓a
t
; ∆1k]θ’ = ∆ ≺+ k: ↓δ; ∆k all hold.
Notice that here is a place where we introduce type variables into the inferred type scheme. It
should be clear that the procedure works whatever freshness conditions are imposed to type
variable a
t
besides the basic one we have agreed upon, namely that a
t
is fresh in the contexts Γ1,
Π1 and ∆1.
Case thrw: Similar to the last case above. A sufficiently fresh type variable is introduced.
Case ctch: Immediate once one notes that (∆ · x : α) x= ∆.
Case acc: Assume the induction hypothesis, i.e. Γ1 ; Π1 ← P → ∆1 , with Γ1θ ⊆ Γ, Π1θ = Π and
∆1θ=∆ · k: Πa. Notice that (Π1a)θ = (Π1θ)a = Πa = (∆1θ)k = (∆1k)θ. Therefore, Π1a ζ
∆1k and θ =
ζζ’. We can then apply rule acc of the inference algorithm to obtain Γζ ; Πζ ← acc a(k). P → ∆ζ
k. And, besides, Γ1ζζ’ ⊆ Γ, Π1ζζ’ = Π and (∆1ζ k)ζ’ =∆ζζ’ k= ∆, as required.
Case req: Identical to the preceding one.
Case conc: Similar to first case snd.
Soundness and completeness, together with unicity of inference of typing (up to choice of type
variables) give the result on principal type scheme. Actually a principal type scheme for P is, by
9. Alvaro Tasistro, Ernesto Copello & Nora Szasz
International Journal of Logic and Computation (IJLP), Volume (3) : Issue (1) : 2012 42
definition, one that is assignable to P and that satisfies the conditions exposed in the
completeness theorem for all the typings Γ; Π |– P ∆ assignable to P.
4. CONCLUSION
The classical result of (implicitly) simply typed λ calculus, of existence and effective computability
of principal type scheme of any typable term can be extended to session types. This fact has
been mentioned in passing in [4] and [1] but only now has it been proven formally. What remains
for us to make this result complete is to extend our present development to types of choice
(branching) and recursive types. Of these, the latter seem to constitute the interesting problem.
But, as pointed out above, the key point on which the given algorithm and proofs rest is the
existence of a unification algorithm for session types. And, as remarked out in e.g. [12], this
algorithm can be extended to unification of regular trees with all other details of the proof holding
without modifications.
We have also formalized a great part of the present development in the proof assistant Agda [6],
which implements a version of constructive type theory. Besides, we have implemented the
inference algorithm in Haskell. All this is available in [13] and we expect to soon complete the
formalization of the whole development. Notice that the treatment presented in this paper does
not depend on identifying α-convertible terms and is therefore amenable to direct formalization.
Acknowledgements Ernesto Copello was partially supported by a graduate student
scholarship from ANII (Agencia Nacional de Investigación e Innovación), Uruguay.
5. REFERENCES
[1] N. Yoshida and V. T. Vasconcelos. “Language primitives and type discipline for structured
communication-based programming revisited: Two systems for higher-order session
communication”. In 1st International Workshop on Security and Rewriting Techniques, volume
171(4) of ENTCS, pages 73–93. Elsevier, 2007.
[2] K. Takeuchi, K. Honda, and M. Kubo. “An interaction-based language and its typing system”. In
Constantine Halatsis, Dimitris G. Maritsas, George Philokyprou, and Sergios Theodoridis,
editors, PARLE, volume 817 of Lecture Notes in Computer Science, pages 398–413. Springer,
1994.
[3] K. Honda. “Types for dyadic interaction”. In Eike Best, editor, CONCUR’93, volume 715 of
Lecture Notes in Computer Science, pages 509–523. Springer Berlin / Heidelberg, 1993.
10.1007/3-540-57208-2_35.
[4] K. Honda, V. T. Vasconcelos, and M. Kubo. “Language primitives and type disciplines for
structured communication-based programming”. In ESOP’98, volume 1381 of LNCS, pages 22–
138. Springer, 1998.
[5] S. J. Gay and M. Hole. “Subtyping for session types in the pi calculus”. Acta Inf., pages 191–
225, 2005.
[6] U. Norell. “Towards a practical programming language based on dependent type theory”. PhD
thesis, Department of Computer Science and Engineering, Chalmers University of Technology,
SE-412 96 Göteborg, Sweden, September 2007.
[7] L. G. Mezzina. “How to infer finite session types in a calculus of services and sessions”. In
Proceedings of the 10th international conference on Coordination models and languages,
COORDINATION’08, pages 216–231, Berlin, Heidelberg, 2008. Springer-Verlag.
[8] M. Neubauer and P. Thiemann. “An implementation of session types”. In Bharat Jayaraman,
editor, PADL, volume 3057 of Lecture Notes in Computer Science, pages 56–70. Springer,
2004.
10. Alvaro Tasistro, Ernesto Copello & Nora Szasz
International Journal of Logic and Computation (IJLP), Volume (3) : Issue (1) : 2012 43
[9] M. Sackman and S. Eisenbach. “Session Types in Haskell: Updating Message Passing for the
21st Century”. Technical report, June 2008.
[10] M. P. Jones. “Type classes with functional dependencies”. In Proceedings of the 9th European
Symposium on Programming Languages and Systems, ESOP ’00, pages 230–244, London,
UK, 2000. Springer-Verlag.
[11] R. Pucella and J. A. Tov. “Haskell session types with (almost) no class”. SIGPLAN Not.,
44(2):25–36, September 2008.
[12] F. Cardone and M. Coppo. “Type inference with recursive types: Syntax and semantics”. Inf.
Comput., 92(1):48–80, 1991.
[13] Ernesto Copello. Inferencia de tipos de sesión. Master’s thesis, Universidad ORT Uruguay,
2012.