negations - university of tokyocontribution development of type systems refuting derivability in...
TRANSCRIPT
![Page 1: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/1.jpg)
Negationsin Refinement Type Systems
T. Tsukada (U. Tokyo)
18th Nov, 2015Oxford, UK
![Page 2: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/2.jpg)
This TalkAbout refinement intersection type systems that refute judgements of other type systems.
![Page 3: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/3.jpg)
BackgroundRefinement intersection type systems are the basis for
β’ model checkers for higher-order model checking (cf. [Kobayashi 09] [Broadbent&Kobayashi 11] [Ramsay+ 14]),
β’ software model-checker for higher-order programs (cf. MoCHi [Kobayashi+ 11]).
In those type systems,
β’ a derivation gives a witness of derivability,β’ but nothing witnesses that a given derivation is
not derivable.
![Page 4: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/4.jpg)
MotivationA witness of underivability would be useful for
β’ a compact representation of an error trace
β’ an efficient model-checker in collaboration with the affirmative system
β’ cf. [Ramsay+ 14] [Godefroid+ 10]
β’ development of a type system proving safetyβ’ In some cases (e.g. [T&Kobayashi 14]), a type system
proving failure is easier to be developed.
![Page 5: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/5.jpg)
ContributionDevelopment of type systems refuting derivability in some type systems such as
β’ a basic type system for the ππ-calculusβ’ a type system for call-by-value reachability
Theoretical study of the development
![Page 6: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/6.jpg)
Outlineβ’ Negations in type systems for
β’ the call-by-name ππβ-calculusβ’ Target languageβ’ Affirmative Systemβ’ Negative System
β’ the call-by-name ππβ-calculus + recursionβ’ a call-by-value language + nondeterminism
β’ Semantic analysis
β’ Discussions
![Page 7: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/7.jpg)
CbN ππβ-calculusA simply typed calculus equipped with π½π½π½π½-equivalence.
Kinds (i.e. simple types):
Terms:
![Page 8: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/8.jpg)
CbN ππβ-calculusA simply typed calculus equipped with π½π½π½π½-equivalence.
Typing rules:
![Page 9: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/9.jpg)
CbN ππβ-calculusA simply typed calculus equipped with π½π½π½π½-equivalence.
Equational theory:
![Page 10: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/10.jpg)
Outlineβ’ Negations in type systems for
β’ the call-by-name ππβ-calculusβ’ Target languageβ’ Affirmative Systemβ’ Negative System
β’ the call-by-name ππβ-calculus + recursionβ’ a call-by-value language + nondeterminism
β’ Semantic analysis
β’ Discussions
![Page 11: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/11.jpg)
Affirmative system for CbN ππβ
The type system for higher-order model checking (without the rule for recursion).
Types are parameterised by kinds and ground type sets:
We use the following syntax for types:
![Page 12: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/12.jpg)
Sets of Types via Refinement RelationLet A be a kind.The set Tyππ(π΄π΄) of types that refines A is given by
where is the refinement relation:
![Page 13: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/13.jpg)
SubtypingThe subtyping relation is defined by induction on kinds.
![Page 14: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/14.jpg)
Type EnvironmentsA (finite) map from variables to sets of types
(or intersection types).
![Page 15: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/15.jpg)
Typing rules
![Page 16: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/16.jpg)
Fact: Invariance under π½π½π½π½-equivalenceSuppose that ππ =π½π½π½π½ ππ. Then
β’ This fact will not be used in the sequel.
![Page 17: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/17.jpg)
Convention: Subtyping closureIn what follows, sets of types are assumed to be closed under the subtyping relation.
Now posets of types are simply defined by:
where
(cf. ππ β ππ implies βππ β½ βππ)
![Page 18: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/18.jpg)
Convention: Subtyping closureIn what follows, sets of types are assumed to be closed under the subtyping relation.
The rule for variables becomes simpler.
![Page 19: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/19.jpg)
Outlineβ’ Negations in type systems for
β’ the call-by-name ππβ-calculusβ’ Target languageβ’ Affirmative Systemβ’ Negative System
β’ the call-by-name ππβ-calculus + recursionβ’ a call-by-value language + nondeterminism
β’ Semantic analysis
β’ Discussions
![Page 20: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/20.jpg)
Negative Type SystemNegative types are those constructed from the negative ground types :
Typing rules are the same as the affirmative system.
![Page 21: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/21.jpg)
Negation of a typeWe define the two anti-monotone bijections on types
as follows:
![Page 22: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/22.jpg)
Negation
![Page 23: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/23.jpg)
Natural
![Page 24: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/24.jpg)
Natural
![Page 25: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/25.jpg)
Natural
β¦ β¦
![Page 26: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/26.jpg)
Negation of a typeWe define the two anti-monotone bijections on types
as follows:
![Page 27: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/27.jpg)
Negation of a typeWe define the two anti-monotone bijections on types
as follows:
![Page 28: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/28.jpg)
Main TheoremTheorem
β’ if and only if ,where
β’ Let . Then
Proof) By mutual induction on the structure of the term.
![Page 29: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/29.jpg)
Main TheoremTheorem
β’ if and only if ,where
β’ Let . Then
Proof) By mutual induction on the structure of the term.under a certain condition
![Page 30: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/30.jpg)
Outlineβ’ Negations in type systems for
β’ the call-by-name ππβ-calculusβ’ the call-by-name ππβ-calculus + recursionβ’ a call-by-value language + nondeterminism
β’ Semantic analysis
β’ Discussions
![Page 31: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/31.jpg)
ππβ + RecursionTerm:
Equational theory:
![Page 32: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/32.jpg)
Recursion Rule in Affirmative SystemThe rule for recursion is given by:
This is a co-inductive rule: a derivation can be infinite.
![Page 33: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/33.jpg)
Recursion Rule in Negative SystemThe rule for recursion is given by:
This is a inductive rule: a derivation must be finite.
![Page 34: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/34.jpg)
Main TheoremLemma
Theorem
β’ if and only if .
β’ Let . Then
![Page 35: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/35.jpg)
Outlineβ’ Negations in type systems for
β’ the call-by-name ππβ-calculusβ’ the call-by-name ππβ-calculus + recursionβ’ a call-by-value language + nondeterminism
β’ Semantic analysis
β’ Discussions
![Page 36: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/36.jpg)
Target LanguageKinds (or simple types):
Terms:
![Page 37: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/37.jpg)
Value judgements (Ξ β’ ππ:π΄π΄):
Computation judgements (Ξ β’ ππ:πππ΄π΄):
Simple Type System
![Page 38: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/38.jpg)
Reduction SemanticsBase cases:
Evaluation context:
![Page 39: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/39.jpg)
Affirmative SystemTypes (formally defined by induction on types):
Refinement relation:
![Page 40: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/40.jpg)
Let
Then ππ β· ππ β ππππ β ππππ.
Examples of derivable/underivable judgements
Example of a type
![Page 41: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/41.jpg)
Typing RulesValue judgements (Ξ β’ ππ: ππ with ππ β· π΄π΄):
Computation judgements (Ξ β’ ππ: ππ with ππ β· πππ΄π΄):
![Page 42: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/42.jpg)
Soundness and CompletenessTheorem
(where ππ β { π£π£ β£ ππ ββ π£π£ })
In particular,
![Page 43: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/43.jpg)
Negative SystemTypes (formally defined by induction on types):
Refinement relation:
![Page 44: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/44.jpg)
Typing RulesValue judgements (Ξ β’ ππ: ππ with ππ β· π΄π΄):
Computation judgements (Ξ β’ ππ: ππ with ππ β· πππ΄π΄):
![Page 45: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/45.jpg)
Typing rules (cont.)Rules for conditional branch:
![Page 46: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/46.jpg)
Typing rulesRule for let-expression:
![Page 47: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/47.jpg)
Soundness and CompletenessTheorem
(where ππ β { π£π£ β£ ππ ββ π£π£ })
In particular,
![Page 48: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/48.jpg)
Negation of a typeGiven a kind π΄π΄, let
We define two operations:
![Page 49: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/49.jpg)
Definition of the Negation
![Page 50: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/50.jpg)
Examples
![Page 51: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/51.jpg)
Examples
![Page 52: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/52.jpg)
Let
Then
Examples
![Page 53: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/53.jpg)
Main TheoremTheorem
β’ if and only if .
β’ Let . Then
![Page 54: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/54.jpg)
Some (Possible) Extensions1. CbV calculus with integers
β’ Straightforward.β’ One needs infinite intersection and union.
2. CbV calculus with recursion
β’ I believe that it is straightforward, though I have not yet checked.
![Page 55: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/55.jpg)
Outlineβ’ Negations in type systems for
β’ the call-by-name ππβ-calculusβ’ the call-by-name ππβ-calculus + recursionβ’ a call-by-value language + nondeterminism
β’ Semantic analysis
β’ Discussions
![Page 56: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/56.jpg)
How to Develop the Negative Systems1. The CbN system has a categorical description.
2. The negation induces an automorphism.
3. A CbV system is given by a monad on ScottLπ’π’.
4. The negative system is given by the monad
![Page 57: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/57.jpg)
Category ScottLπ’π’Definition The category ScottL is given by:
Object Poset (π΄π΄,β€π΄π΄).
Morphism An upward-closed relation
Composition Let . Then
![Page 58: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/58.jpg)
Interpretation of CbN ππβin ScottLπ’π’Fact ScottLπ’π’ is a cartesian closed category.
Interpretation of kinds is given by:
Hence .
Fact
![Page 59: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/59.jpg)
Negation Functor on ScottLπ’π’The functor ππ: ScottLπ’π’ β ScottLπ’π’ is defined by:
Lemma ππ is an isomorphism on ScottLπ’π’.
If R β π’π’ π΄π΄ ππππ Γ π΅π΅ and π΄π΄ = β , then
which is essentially the complement of π π .
![Page 60: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/60.jpg)
Monad and Call-by-ValueA monad on a category πΆπΆ is a functor πΆπΆ β πΆπΆ with some additional structures.
A (strong) monad on a CCC gives rise to a model of a call-by-value calculus [Moggi 91].
A monad on ScottLπ’π’ can be seen as a refinement type system for a call-by-value calculus.
![Page 61: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/61.jpg)
Negated Monad and Negative SystemLet ππ: ScottLπ’π’ β ScottLπ’π’ be a strong monad. Then
has the canonical monad structure. Furthermore the respective Kliesli categories are isomorphic
and the refinement type system corresponding to the right-hand-side is the negation of the left-hand-side.
![Page 62: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/62.jpg)
ExampleThe previous type system for CbV calculus is given by the following monad.
![Page 63: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/63.jpg)
Outlineβ’ Negations in type systems for
β’ the call-by-name ππβ-calculusβ’ the call-by-name ππβ-calculus + recursionβ’ a call-by-value language + nondeterminism
β’ Semantic analysis
β’ Discussions
![Page 64: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/64.jpg)
Automata complementationCorresponds to negation of a 2nd-order judgement.
![Page 65: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/65.jpg)
Boolean Closedness of TypesLet π΄π΄ be a kind and π΅π΅π΄π΄ be the set of all BΓΆhm trees of type π΄π΄. A language is a subset of π΅π΅π΄π΄.
Definition A language πΏπΏ β π΅π΅π΄π΄ is type-definable if there exists a type ππ such that
in the type system for higher-order model checking [Kobayashi&Ong 09] [T&Ong 14].
Corollary The class of type-definable languages are closed under Boolean operations on sets.
![Page 66: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/66.jpg)
Further ApplicationsThe technique presented in this talk is applicable to:
β’ the type system for the full higher-order model-checking [Kobayashi&Ong 09]
β’ a type system witnessing call-by-value reachability [T&Kobayashi 14]
β’ a dependent intersection type system in [Kobayashi+ 11], via the translation of dependent types to intersection and union types
![Page 67: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/67.jpg)
Consistency and InconsistencyThe negation of a "small" type can be very large. So the negation may not be efficiently computable.
The notion of consistency and inconsistency may be useful in the practical use:
Definition Let and . They are consistent if and inconsistent otherwise.
Proposition If ππ and οΏ½ππ are inconsistent, then
![Page 68: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/68.jpg)
Inductive Definition of Consistency
Inductive definition of inconsistency is now trivial.
![Page 69: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/69.jpg)
Related Work"Krivine machines and higher-order schemes" [Salvati&Walkiewicz 12]
β’ The notion of consistency and inconsistency can be found in their work (called complementarityfor the former and the latter has no name).
β’ This talk is partially inspired by their work.
![Page 70: Negations - University of TokyoContribution Development of type systems refuting derivability in some type systems such as β’ a basic type system for the ππ-calculus β’ a type](https://reader033.vdocuments.us/reader033/viewer/2022041708/5e4677226c4f5500a40555b7/html5/thumbnails/70.jpg)
ConclusionNegation is a definable operation in the refinement intersection type system for the call-by-name ππβ.
This observation leads to the construction of negative type systems for other refinement type systems, e.g.,
β’ call-by-name ππβ + recursionβ’ the type system for HOMCβ’ a type system for a call-by-value language
Application to verification needs some work.