Introduction Simply typed Higher-order type systems Concluding remarks

A comparison between ITT and CoC Categorical models of type theories

Category Theory 2015 · Aveiro, PORTUGAL

Nino Guallart

July of 2015

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Index

1 Introduction

2 Simply typed lambda calculus

3 Higher-order type systems

4 Concluding remarks

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Index

1 Introduction

2 Simply typed lambda calculus

3 Higher-order type systems

4 Concluding remarks

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Index

1 Introduction

2 Simply typed lambda calculus

3 Higher-order type systems

4 Concluding remarks

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Index

1 Introduction

2 Simply typed lambda calculus

3 Higher-order type systems

4 Concluding remarks

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Índice

1 Introduction

2 Simply typed lambda calculus

3 Higher-order type systems

4 Concluding remarks

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Introduction

What is a ? Formal system of elements (terms), each of one belonging to a certain type. Originally proposed as an alternative to naïve set theory (Russell's paradox), we will see type theories formulated in λ calculus.

Everything is a Church's λC was intended to study computable functions. It is Turing-complete and can be seen as an abstract model of a functional (Landin, 1965). Whereas λC is untyped, simply typed lambda calculus (STLC) is typed, and therefore can be seen as the basis of typed languages (Haskell, ML). beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Introduction

What is a type theory? Formal system of elements (terms), each of one belonging to a certain type. Originally proposed as an alternative to naïve set theory (Russell's paradox), we will see type theories formulated in λ calculus.

Everything is a function Church's λC was intended to study computable functions. It is Turing-complete and can be seen as an abstract model of a functional programming language (Landin, 1965). Whereas λC is untyped, simply typed lambda calculus (STLC) is typed, and therefore can be seen as the basis of typed functional programming languages (Haskell, ML). beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Semantics of type theories

In this talk we will focus on the categorial semantics of STLC, before moving on a discussion of the categorical interpretation of more complex type theories.

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Índice

1 Introduction

2 Simply typed lambda calculus

3 Higher-order type systems

4 Concluding remarks

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Simply typed lambda calculus

λ→

e,f := x|c|λxτ .e|ef |

σ,τ := β|σ → τ

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Simply typed lambda calculus

λσ

τ e,f := x|c|λx .e|ef |(e,f )|π1e|π1e

σ,τ := β|σ → τ|σ × τ

λC syntax: λ→ and →. Type constructors: →, ×,(+). Base types. Void type: 0, with no terms. Unit type: 1, with one term, *. beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Simply typed lambda calculus

λσ

τ e,f := x|c|λx .e|ef |(e,f )|π1e|π1e

σ,τ := β|σ → τ|σ × τ

λC syntax: λ→ and →. Type constructors: →, ×,(+). Base types. Void type: 0, with no terms. Unit type: 1, with one term, *. beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Simply typed lambda calculus

λσ

τ e,f := x|c|λx .e|ef |(e,f )|π1e|π1e

σ,τ := β|σ → τ|σ × τ

λC syntax: λ→ and →. Type constructors: →, ×,(+). Base types. Void type: 0, with no terms. Unit type: 1, with one term, *. beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Simply typed lambda calculus

λσ

τ e,f := x|c|λx .e|ef |(e,f )|π1e|π1e

σ,τ := β|σ → τ|σ × τ

λC syntax: λ→ and →. Type constructors: →, ×,(+). Base types. Void type: 0, with no terms. Unit type: 1, with one term, *. beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Simply typed lambda calculus

There are well-formed (pre)terms which are not well-typed, giving error: (λx : σ.x)(a : τ). From the set of preterms, let's consider the set Λ of well-typed terms, or simply terms.

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Simply typed lambda calculus

Typing rules for → (application and abstraction):

Γ,x : σ ` e : τ ABS Γ ` (λx : σ.e):(σ → τ)

e f Γ ` : σ → τ Γ ` : σ APP Γ ` ef : τ

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Simply typed lambda calculus

Typing rules for × (introduction and elimination):

t A u B Γ ` : Γ ` : PROD-INT Γ ` (t,u): A × B

Γ ` (t,u): A × B PROD-EL1 π1(t,u): A Γ ` (t,u): A × B PROD-EL2 π2(t,u): B

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Simply typed lambda calculus

Unlike LC, is decidable and non Turing-complete -> its evaluation always halts. Normalising: the reduction of a preterm always terminates. If is a term, it ends giving the normal form of the term. If not, giving out some kind of error or unspecied behaviour.

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Term evaluation

Based on β−reduction:

(λx : σ.E)F E-APP E[x := F ]

t t0 t t0 → E-APP1 → E-APP2 tu → t0u ut → ut0

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Syntax and semantics

A STLC for natural numbers:

` 0 : N

x N Γ ` : SUCC Γ ` sx : N

Γ ` x : N Γ ` y : N SUM Γ ` x + y : N ... beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Syntax and semantics

A STLC for natural numbers:

` 0 : N

x N Γ ` : SUCC Γ ` sx : N

Γ ` x : N Γ ` y : N SUM Γ ` x + y : N ... beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Syntax and semantics

A STLC for natural numbers:

` 0 : N

x N Γ ` : SUCC Γ ` sx : N

Γ ` x : N Γ ` y : N SUM Γ ` x + y : N ... beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Curry-Howard isomorphism

Predicates-as-types, link between type theory and logical calculus:

Intuitionistic interpretation. If a type A has at least a term a, a : A, a is a proof of A. Lambda abstraction: hypotheses introduction. Term application equates to modus ponens:

e f Γ ` : σ → τ Γ ` : σ APP Γ ` ef : τ

Rules for introduction and elimination of pairs (product) are

akin to those of conjunction of predicates. beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Curry-Howard isomorphism

σ,τ ::= β|σ → τ|σ × τ|σ + τ|0|1

p,q ::= b|p → q|p ∧ q|p ∨ q|⊥|> Types can be seen as propositions. Terms can be interpreted intuitionistically (BHK) as proofs (algorithms) of their corresponding types. For example, λxα .x is a proof of α → α, which is a tautology (taulologies equate to combinators). Given a set of basic proofs with their types/propositions, we can build a proof of the propositions derived from them. beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Categorical model of STLC

Syntax-semantics duality between STLC and CCC (Lambek, 1970). More precisely, type theories can be interpreted using category theory, and conversely, we can formalise categories in the language of type theories. Generally, we can say that the relation between a type theory and its corresponding category is akin to syntax vs semantics . We can show this studying the relationship between STLC with pairs and Cartesian closed categories (Cfr. Lambek and Scott, 1988).

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Lambek-Lawvere isomorphism

Given Λ, let C be a Cartesian closed category with: Product and exponential. Terminal object 1. Interpretation Λ → C : Types are interpreted as objects, i.e. [[β]] ∈ Ob(C ). A term e : σ is interpreted uniquely as a morphism 1 → [[σ]]. Application of terms: composition of morphisms. Pairs of terms: pair of morphisms.

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Lambek-Lawvere isomorphism

Given a CCC C , its internal language is the smallest TT preserving its structure: Types are the objects of C . Terms are the morphisms of C . The composition of morphisms is given by term aplication. A pair of morphisms is described by a pair of terms.

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Lambek-Lawvere isomorphism

The functors Syn (or Con) and Lang are dual to each other, so: The interpretation of Λ , Syn(Λ), is a CCC C 0. Conversely, the structure of a given CCC C can be described using a Λ0 of STLC, Λ0 = Lang(C ). Λ0 is the internal language of C .

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Lambek-Lawvere isomorphism

The functors Syn (or Con) and Lang are dual to each other, so: The interpretation of Λ , Syn(Λ), is a CCC C 0. Conversely, the structure of a given CCC C can be described using a Λ0 of STLC, Λ0 = Lang(C ). Λ0 is the internal language of C .

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Lambek-Lawvere isomorphism

The functors Syn (or Con) and Lang are dual to each other, so: The interpretation of Λ , Syn(Λ), is a CCC C 0. Conversely, the structure of a given CCC C can be described using a Λ0 of STLC, Λ0 = Lang(C ). Λ0 is the internal language of C .

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Lambek-Lawvere isomorphism

Type theory Category theory Types Objects Unit type (> or 1) Terminal object Product type A × B Product of objects A × B A → B Exponential object BA Terms Morphisms Pair of terms (f ,g) Pair of morphisms (f ,g) Projections of terms, π1and π2 Projections of morphisms, π1and π2 Abstraction λx A.f : B Arrow f : A → B with a free variable x : A Application fg Composition of arrows fg beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks C-H and L-L isomorphisms

All of them form a kind of triangular relationship between propositional calculus, type theory and category theory. Important in the areas of logic and computation (morphisms as algorithms).

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Índice

1 Introduction

2 Simply typed lambda calculus

3 Higher-order type systems

4 Concluding remarks

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Higher-order type systems

Note the rigid distinction between types and terms in STLC:

λxα .x : α → α

λ(xy)N×N .x + y : N × N → N

Why do we should want to explore these systems?

More expressivity: terms on types, types on terms... Disadvantage: systems can be non-normalising.

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Higher-order type systems

Note the rigid distinction between types and terms in STLC:

λxα .x : α → α

λ(xy)N×N .x + y : N × N → N

Why do we should want to explore these systems?

More expressivity: terms on types, types on terms... Disadvantage: systems can be non-normalising.

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Higher-order type systems

Note the rigid distinction between types and terms in STLC:

λxα .x : α → α

λ(xy)N×N .x + y : N × N → N

Why do we should want to explore these systems?

More expressivity: terms on types, types on terms... Disadvantage: systems can be non-normalising.

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks systems

Some relevant authors: Martin-Löf, P. (1984), Intuitionistic Type Theory, Bibliopolis. Cocquand, T.; Huet, G. (1988), The Calculus of Constructions, Information and Computation, Vol. 76, Issue 2-3. Barendregt, H.P. (1991), Introduction to generalized type systems, Journal of Functional Programming, 1(2):125-154.

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Pure type systems

PTS blurrs or erases the distinction between types and terms, thus allowing to predicate over types. The concept of type must be generalised: Sorts: ?,  (Prop / Type). Kinds:  → ?,  → , ... We will focus on a specic family of normalising type systems.

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Barendregt's λ−cube

λω λPω

λ2 λP2

Polymorphism λσ λPσ

Type constructors

λ→ Dependence λP

H.P. Barendregt, Introduction to generalized type systems, Journalbeamer-icsi-logo of Functional Programming, 1(2):125-154, 1991.

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Polymorphism

Universal quantication over types.

Identity function Instead of an identity function for each type, there is a single one:

Λαλxα .x : ∀α.α → α

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Dependent types

Types depending of terms. Π types: expands the idea of generalisation and arrow.

Πx:AB(x)

∀x ∈ AB(x)

x : A −→ B(x):  If A is a type, B is such that, for each x : A there is a type B(x), i.e., B gives out a family of types indexed over A. A b : B has the form λx .T . If b :Πx:AB(x) and a : A, then ba : B(a). beamer-icsi-logo If B(x) gives out constant types, it equates to A → B.

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Dependent types

All application and abstraction rules of these systems can be summarised as follows if we consider the whole cube system (Cfr. (Roorda, 2000)):

Γ,x : A ` b : B Γ ` (Πx : A.B): t ∈ {?, }  ABS Γ ` (λx : A.b):Πx : A.B

Γ ` f : (Πx : A.B): t Γ ` a : A APP Γ ` fa : B[x ::= A]

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Categorical model of dependent types: Locally CCC

A category C whose slice categories C /x are all Cartesian closed. The dependent type Πx:AB(x) can be interpreted as an object in the slice category C /x, since it can be interpreted as a morphism B → A.

C /x B A

In the same way that we did whith STLC, we can consider functors Syn and Lang, so Syn(DTT ) is a lCCC, and for a given lCCC, Lang(lCCC) is a DTT. Also, relationship to intuitionistic quantied PL. beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Martin-Löf's ITT (impredicative)

Constructive foundations of mathematics (Martin-Löf,1971). Also continuation of the idea of isomorphism between propositions and types within an intuitionistic framework (terms are proofs of propositions). Extension of STLC by adding universes. A universe [idea taken from Grothendieck] contains as objects the previous types. So if σ and τ are elements of universe U, they are types. Universe closed under construction of types:

Γ ` f : A : U Γ ` B : U Γ ` A → B : U

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Martin-Löf's ITT (impredicative)

Showed to be inconsistent when

U : U is considered. (Girard,1971) showed its inconsistency (the expansion of the term does not reach a normal form).

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Girard's paradox

Not at the same time: Universal quantication over all propositions. Isomorphism between types and propositions. Alternatives: ITT (predicative): not universal quantication over all propositions. Prop and Type are identied, a hierarchy of universes. CoC (impredicative): the relationship between propositions and types is weaker than isomorphism: every proposition is identied with the type of its roofs, but there are non-propositional types (data types). beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Intuitionistic type theory

The predicative version of this theory (Martin-Löf,1975) has a predicative hierarchy of universes. Dependent and function types. Dependent sum and sum types. Unit and empty types. Strongly normalising. Identication of types and (quantied) propositions (CH isomorphism). Terms of a certain types are seen as proofs of them. The rules of formation of complex types are akin to the rules of intuitionistic rst-order logic. Equality types and identity types: won't be discussed here. beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Category of ITT: Locally CCC

Extensionally, the aforementioned locally closed Cartesian categories (lCCC) can provide a model for ITT. Intensional versions are more much complicated (won't be considered here).

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Calculus of constructions

Created by Thierry Coquand. Type of propositions P (small types), hierarchy of types of types (large types) and the type T of large types. K ::= ?|i (i ≥ 1)

M N x K x x Mτ MN σ,τ, , ::= | |Π : σ.τ|λ : σ. | τ[x:σ] Proofs have as a type P. Predicates are functions that give out propositions.

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Calculus of constructions

Some features: Pure . Strongly normalising. Dependent types. Empty and unit type. Non-propositional types: e.g. data types. Distinction between: Impredicative type * (type of propositions). Predicative hierarchy  (types of types).

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Calculus of constructions

Propositions can be seen as types, extending thus the CH isomorphism to quantied PL, but not all types are to be read as propositions. Rejection of the identication between propositions and types (Coquand, 1986):

Typei and Prop are terms, and also for terms M and N, then (MN), ΠM.N and λx.M are terms. T is not a term, is only a type. Predicativity and non-predicativity are not contradictory concepts: simply, the level of proposition may be non-predicative and the level of type must be predicative. (Coquand, 1986) beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Model

The model of CoC has to deal with a predicative structure of types and a predicative universe T. Locally CCC for the hierarchy of types. Appropiate structure for the impredicativity: collections of subsets.

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Índice

1 Introduction

2 Simply typed lambda calculus

3 Higher-order type systems

4 Concluding remarks

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks Concluding remarks

Concluding remarks Problems with the categorical model of dependent types. Dierences between the predicative hierarchy of ITT and the impredicative universe of CoC. CH isomorphism and its variants: relationship between propositions and types.

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC Introduction Simply typed lambda calculus Higher-order type systems Concluding remarks

That's all! Thank you very much!

beamer-icsi-logo

Category Theory 2015 · Aveiro, PORTUGAL A comparison between ITT and CoC