Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
research:software:gradual-unions [2017/05/02 10:44] – [Combining gradual unions and the unknown type] mtororesearch:software:gradual-unions [2019/06/24 16:09] (current) etanter
Line 1: Line 1:
 ====== Gradual Unions: A Gradual Interpretation of Union Types ====== ====== Gradual Unions: A Gradual Interpretation of Union Types ======
 +
 +See [[http://pleiad.dcc.uchile.cl/papers/2017/toroTanter-sas2017.pdf|A Gradual Interpretation of Union Types]] (SAS 2017)
  
 Union types allow to capture the possibility of a term to be of several possibly unrelated types. Traditional static approaches to union types are untagged and tagged unions, which present dual advantages in their use. Inspired by recent work on using abstract interpretation to understand gradual typing, we present a novel design for union types, called gradual union types. Gradual union types combine the advantages of tagged and untagged union types, backed by dynamic checks. Seen as a gradual typing discipline,  Union types allow to capture the possibility of a term to be of several possibly unrelated types. Traditional static approaches to union types are untagged and tagged unions, which present dual advantages in their use. Inspired by recent work on using abstract interpretation to understand gradual typing, we present a novel design for union types, called gradual union types. Gradual union types combine the advantages of tagged and untagged union types, backed by dynamic checks. Seen as a gradual typing discipline, 
Line 11: Line 13:
   * How to install the prototype implementation of GSEC<sup>+</sup>. This prototype shows interactive typing and reduction derivations for arbitrary source program.   * How to install the prototype implementation of GSEC<sup>+</sup>. This prototype shows interactive typing and reduction derivations for arbitrary source program.
   * An overview of the application and a basic presentation of the language syntax.   * An overview of the application and a basic presentation of the language syntax.
-  * Detailed examples of use. +  * Examples of use.
  
 +An online version of this document can be found [[https://pleiad.cl/research/software/gradual-unions|here]] 
 ===== Installation instructions ===== ===== Installation instructions =====
  
Line 159: Line 161:
  
  
-==== Errors ====+==== Static and dynamic errors ====
 The prototype implementation reports static errors after the "TYPECHECK!" button is clicked. For example: The prototype implementation reports static errors after the "TYPECHECK!" button is clicked. For example:
  
-{{:research:software:gradual-unions:static-error.png?700|}}+{{:research:software:gradual-unions:static-errors3.png?700|}}
  
 Now let us add an ascription to the boolean value: Now let us add an ascription to the boolean value:
Line 173: Line 175:
  
 ==== Combining gradual unions and the unknown type ==== ==== Combining gradual unions and the unknown type ====
-This is an example of combining the use of gradual unions and the unknown type. The applied lambda receives either a function that receives an Int, or a function that returns an Int. +This is an example of combining the use of gradual unions and the unknown type. The applied lambda receives either a function that receives an ''Int'', or a function that returns an ''Int''
  
 {{:research:software:gradual-unions:example3-1.png?500|}} {{:research:software:gradual-unions:example3-1.png?500|}}
  
-This program runs without errors as we are passing a function from Int to Int.+This program runs without errors as we are passing a function from ''Int'' to ''Int''.
 Now consider the following program: Now consider the following program:
  
 {{:research:software:gradual-unions:example3-2.png?500|}} {{:research:software:gradual-unions:example3-2.png?500|}}
  
-This time we are passing as argument a function from Bool to Int, so the program also run without errors.+This time we are passing as argument a function from ''Bool'' to ''Int'', so the program also run without errors.
 But if we consider this program: But if we consider this program:
  
Line 188: Line 190:
 {{:research:software:gradual-unions:gradual-unions:example3-25.png?700|}} {{:research:software:gradual-unions:gradual-unions:example3-25.png?700|}}
  
-We are now passing a function from Bool to Bool, so the program fails statically as (Int -> ?) + (? -> Int) is not consistent with Bool -> Bool.+We are now passing a function from ''Bool'' to ''Bool'', so the program fails statically as ''(Int -> ?) + (? -> Int)'' is not consistent with ''Bool -> Bool''.
 If we add an ascription to the argument: If we add an ascription to the argument:
  
 {{:research:software:gradual-unions:example3-3.png?700|}} {{:research:software:gradual-unions:example3-3.png?700|}}
  
-Then the program typechecks but fails at runtime as it fails to justify that (Int -> ?) + (? -> Int) is consistent with Bool -> Bool.+Then the program typechecks but fails at runtime as it fails to justify that ''(Int -> ?) + (? -> Int)'' is consistent with ''Bool -> Bool''.