• Aucun résultat trouvé

Centre de Recherche en Informatique Ecole des Mines de Paris

N/A
N/A
Protected

Academic year: 2022

Partager "Centre de Recherche en Informatique Ecole des Mines de Paris"

Copied!
56
0
0

Texte intégral

(1)

Submitted for publication in Information and Computation, Academic Press, 1994.

The Type and Eect Discipline

Jean-Pierre Talpin

And

Pierre Jouvelot

Centre de Recherche en Informatique Ecole des Mines de Paris

35, rue Saint Honore, F-77305 Fontainebleau.

E-Mail:

talpin@ensmp.fr

and

jouvelot@ensmp.fr

November 10th, 1993

Current Address: Jean-Pierre Talpin, European Computer-Industry Research Center (ECRC GmbH), Arabella Strae 17, D-81925 Munchen. E-mail: jp@ecrc.de

1

(2)

Abstract

The type and eect discipline is a new framework for reconstructing the principal type and the minimal eect of expressions in implicitly typed polymorphic functional languages that support imperativeconstructs. The type and eect discipline outperforms other polymorphic type systems. Just as types abstract collections of concrete values,eectsdenote imperative operations on regions. Regionsabstract sets of possibly aliased memory locations.

Eects are used to control type generalization in the presence of imperative constructs while regions delimit observable side-eects. The observable eects of an expression range over the regions that are free in its type environment and its type eects related to local data structures can be discarded during type reconstruction. The type of an expression can be generalized with respect to the type variables that are not free in the type environment or in the observable eect.

Introducing the type and eect discipline, we dene both a dynamic and a static se- mantics for an ML-like language and prove that they are consistently related. We present a reconstruction algorithm that computes the principal type and the minimal observable eect of expressions. We prove its correctness with respect to the static semantics.

3

(3)

Contents

1 Introduction 6

2 Related Work 6

3 A Core Language and its Semantics 7

3.1 Syntax : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 8 3.2 Store operations : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 8 3.3 Formulation of the Dynamic Semantics : : : : : : : : : : : : : : : : : : : : : 9 3.4 Semantic Objects : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 9 3.5 Axioms and Rules of the Dynamic Semantics : : : : : : : : : : : : : : : : : : 10 3.6 Dynamic Semantics of Store Operations : : : : : : : : : : : : : : : : : : : : 10

4 Static Semantics 11

4.1 Free Variables and Substitutions : : : : : : : : : : : : : : : : : : : : : : : : : 12 4.2 Type Schemes and Environments : : : : : : : : : : : : : : : : : : : : : : : : 13 4.3 Type Generalization : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 14 4.4 Rules of the Static Semantics : : : : : : : : : : : : : : : : : : : : : : : : : : 14 4.5 Static Semantics of Store Operations : : : : : : : : : : : : : : : : : : : : : : 15 4.6 Observation Criterion : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 16

5 Formal Properties of the Static Semantics 17

6 Consistency of Dynamic and Static Semantics 19

7 The Reconstruction Algorithm 32

7.1 Constrained Type Schemes : : : : : : : : : : : : : : : : : : : : : : : : : : : : 32 7.2 Constrained Type Schemes of Store Operations : : : : : : : : : : : : : : : : 33 7.3 The Reconstruction Algorithm : : : : : : : : : : : : : : : : : : : : : : : : : : 33

8 Constraint Resolution 34

8.1 Well-Formed Constraint Sets : : : : : : : : : : : : : : : : : : : : : : : : : : : 35 8.2 Unication Algorithm : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 38

9 Correctness of the Reconstruction Algorithm 40

10 Examples 47

5

(4)

11 Comparison with the Related Work 49

11.1 Comparative Examples : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 50 11.2 Benchmarks : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 51

12 Extensions 53

13 Conclusion 54

6

(5)

1 Introduction

Type inference Milner, 1978] is the process that automatically reconstructs the type of expressions in programming languages. Polymorphic type inference in functional languages becomes problematic in the presence of imperative constructs and much investigations have been devoted to this issue Tofte, 1987, Leroy & Weis, 1991, Wright, 1992].

Eect systems Giord & al., 1987, Lucassen, 1987, Lucassen & Giord, 1988] aim at a safe integration of imperative programming features in functional languages. Just as types describe what expressions compute, eects describe how expressions compute and both can be statically reconstructed Jouvelot & Giord, 1991, Talpin & Jouvelot, Sept. 1992].

We introduce the type and eect discipline, a new framework for reconstructing the prin- cipal type and the minimal eect of expressions in implicitly typed polymorphic functional languages that support imperative constructs. Just as types structurally abstract collections of concrete values, regions abstract sets of possibly aliased memory locations while eects denote imperative operations on regions. Eects control type generalization in the presence of imperative constructs while regions are used to report their only observable side-eects.

The observable eects of an expression range over the regions that are free in its type environment and its type. Eects related to local data structures can be discarded during type reconstruction. The type of an expression can be generalized with respect to the variables that are neither free in the type environment nor in the observable eect.

In this paper, section 2 presents the related work. Then, we describe the dynamic (sec- tion 3) and static (sections 4 and 5) semantics of the language. We state that the static and dynamic semantics are consistent (section 6), and that our reconstruction algorithm, presented in sections 7 and 8, is correct with respect to the static semantics (section 9). We give some examples (sections 10 and 11) that show that our approach surpasses previous techniques before suggesting some extensions (section 12) and concluding (section 13).

2 Related Work

Short of the ad-hoc techniques used in the rst type inference systems, the imperative type discipline Tofte, 1987] is the classical way to deal with the problem of type generalization for polymorphic functional languages in the presence of non referentially transparent constructs.

Its extension, based on weak type variables, is used in the implementation of Standard ML Appel & Mac Queen, 1990]. A dierent approach, suggested in Leroy & Weis, 1991], consists in labeling the type of each function with the set of the types of the value identiers that occur in its body, and then to track the dangerous type variables of references.

7

(6)

All those approaches build conservative approximations of value types that may be ac- cessible from the global store by relating the typing of references to syntactic information.

A more intuitive and integrated approach is to infer a more semantically meaningful infor- mation by recording and and keeping track of the types of values referenced in the store, as soon as the store is expanded and as long as its locations are used. The quest for such a type system has for long been the subject of many investigations Damas, 1985, O'Toole, 1989, Wright, 1992]. Eect inference allows us to approximate the store by regions and types and, as such, can be used to decide when to perform type generalization.

The FX system Lucassen & Giord, 1988, Giord & al., 1987] suggests a static seman- tics for polymorphic type and eect checking. In Jouvelot & Giord, 1991], the authors show that eect reconstruction can be seen as a constraint satisfaction problem. However, the exact matching of eects required by the static semantics, together with the use of explicit polymorphism, imply the non-existence of syntactic principal types it also somewhat limits the kind of accepted programs. We present in Talpin & Jouvelot, Sept. 1992] an algorithm that computes the maximal type and the minimal eect of expressions, using subsumption on eects to overcome this particular problem of eect matching.

In thetype and eect discipline, we apply the technique of type, region and eect inference to the problem of typing references in ML-like languages in the presence of polymorphiclet constructs. We determine the principal type and the minimal observable eects of expres- sions. We use eect information to perform type generalization. By using eect information together with an observation criterion, our type system is able to precisely delimit the scope of side-eecting operations, thus allowing type generalization to be performed inletexpres- sions in a more ecient and uniform way than previous systems. It is shown with some simple examples (section 10) that our system improves over earlier type generalization policies for ML-like languages.

3 A Core Language and its Semantics

Reasoning on the complete denition of a functional language such as Standard ML or FX would have been complex and tedious. In order to simplify the presentation and to ease the formal reasoning, this section introduces a core language. It is an attempt to trade between integrating the principal features of functional and imperative programming, and being simple. This section introduces its syntax and its dynamic semantics together with a series of conventions and notations that are used in this paper.

8

(7)

3.1 Syntax

The expressions of the language, written e possibly with a prime or a subscript, are the ele- ments of the term algebraExp generated by the grammar described below. It uses enclosing parentheses in the reminiscence of Scheme Rees & al., 1988].

e ::= x j value identier

(op e) j operation

(e e0) j application

(lambda (x) e) j abstraction

(let (x e) e0) lexical value binding

op::= new j get jset operations on references Syntax

In this grammar,xandfrange over a countable set of identiers. The form(e e0)stands for the application of a functioneto an argumente0. The form(op e)applies the primitive operation op to the argument e. The expression (lambda (x) e) is the so-called lambda- abstraction that denes the rst-class function whose parameter is xand whose result is the value of e.

3.2 Store operations

The arithmetic operations over integers: + and -, the boolean operations: and and or, or even the if construct are typically represented by operators op, because their meaning cannot be explained easily by abstractions and applications. Store operations can also be dened by operators. They operate on reference values, which are indirection cells that can be dynamically allocated, read and written in place.

The operation (new e)initializes a fresh reference to the value of the expression e. The operation (get e) gets the value referenced by the pointer returned by e. The operation

((set e) e0) modies the content of the reference returned by e and sets it to the value of

e0. We use the convention that setreturns the unit value u.

9

(8)

3.3 Formulation of the Dynamic Semantics

In this section, we dene the dynamic semantics of our language. The dynamic semantics species the meaning of expressions. It is dened by an evaluation mechanism that relates expressions to values. To express this relation, we use the formalism of relational semantics Plotkin, 1981, Kahn, 1988]. It consists of a predicate between expressions and values dened by a set of axioms and inference rules called evaluation judgements. An evaluation judgment tells whether an expression evaluates to a given result.

3.4 Semantic Objects

We present the semantics objects on which the predicate of evaluation is dened. These semantic objects include values, environments, stores and traces.

Values are either the command valueu, reference valueslor closuresc. A closure (xeE) is composed of a value identier x, its formal parameter, an expression e, its body, and the environmentE where it is dened.

An environment E is represented by a nite map from identiers to values. In an envi- ronment E, we assume that all identiers are distinct. The empty mapping is written fg. The domain of the mapping E is written Dom(E) and its range Im(E). If x belongs to Dom(E), we write E(x) for the value associated with x inE. Finally, we write Ex for the exclusion of x fromE and Ex+fx7!vg for the extension of E to the mapping of x to v.

v 2 Value =fug+Ref+Closure values

c 2 Closure =IdExpEnv closures

l 2 Ref locations

E 2 Env =Id n! Value environments

s 2 Store =Ref n! Value stores Values, Environments, Stores and Traces

The presence of references requires the introduction of a notion of state in the dynamic semantics: the store. The store changes during the evaluation of a program and it tells the current contents of all initialized references. We assume that we are given a countable set Refof locationsl. Then, a storesis represented by a nite map from references, or locations, in Refto values. Thus, we use for stores the same notations than for environments.

10

(9)

3.5 Axioms and Rules of the Dynamic Semantics

We present, in the vein of Tofte, 1987, Milner, 1991], the set of rules that inductively denes the predicate of evaluation sE ` e ! vs0 on the structure of expressions. Given a store

s and an environment E, the predicate sE ` e!vs0 associates each expression e with a valuev and a new store s0.

sE `x!E(x)s (var)

sE `(lambda (x) e)!(xeEx)s (abs)

sE `e!vs0 s0Ex+fx7!vg`e0!v0s00

sE `(let (x e) e0)!v0s00 (let)

sE `e!(xe00E0)s0 s0E `e0!v0s00 s00E0+fx7!v0g`e00!v00s000

sE `(e e0)! v00s000 (app)

Dynamic Semantics

The axiom (var) states that an identier x evaluates to the value E(x) bound to it in the environmentE, provided that this identier x belongs to the domain of E. Otherwise, the expression x has no meaning. By the axiom (abs), a function denition evaluates to a closure.

As stated by the rule (let), a let binding evaluates the rst argument e to a value v, binds it to the identierx, and then evaluates its second argument e0 in the environmentE extended withfx 7!vg. The resultv0 is the result of the let expression. In the case that the evaluation of the rst argument does not succeed, the evaluation of the let expression is not dened.

The rule of application (app) is more complex. First, the expression e must evaluate to a closure (xe00E0). Then, the argument e0 must evaluate to a value v0. Finally, the function body e00 must evaluate to a value v00 with the environment E0, captured in the closure, extended with the formal parameterx bound to v0.

3.6 Dynamic Semantics of Store Operations

Now, we can give the relational semantics for the operations on references. The semantics describes how the store is modied by the evaluation of expressions.

11

(10)

sE `e!vs0 l 62Dom(s0)

sE `(new e)!l s0+fl7!vg (new)

sE `e!l s0 l 2Dom(s0)

sE `(get e)!s0(l)s0 (get)

sE`e !l s0 s0E `e0!vs00

sE`((set e) e0)!us00l +fl 7!vg (set) Dynamic Semantics of Store Operations

The rule (new) of reference initialization rst evaluates the initial valuevof the reference and then picks a fresh location l. This very step is non-deterministic but all choices of l are equivalent modulo a renaming of the locations in s0. The second step is then to extend the store with the binding ofl to vand to returnl as the value of the expression. The rule (get) evaluates its argument e to a location l, then returns the value v stored at this location in the store s. Finally, by the rule (set), the assignment operator evaluates its rst argument

e to a location l and its second argumente0 to a value v. Then, it updates the store at the location l, substituting the previous value by v. Note that, by denition of the rule (new),l must be in s when e evaluates to l.

4 Static Semantics

In this section, we present the static semantics of our language. We are rst going to equip the language with a type system. Then we will give the inference rules of the static semantics.

The rules of the static semantics associate the expressions of the language with their type and eect, in the same way as the rules of the dynamic semantics associate expressions with values. We begin by dening the term algebra for the three basic kinds of semantic objects:

regions, eects and types.

::=r j % regions

::= j init()j read() j write()j & j eects

::=unitj j ref() j ! types

Static Semantics Objects 12

(11)

The domain of regions is the disjoint union of a countable set of constants r and variables %. Every location corresponds to a given region in the static semantics. A region abstracts the memory locations that will be initialized at a given program point at runtime.

Eects can either be the constant , that represents the absence of eects, eect variables &, or store eects init(), read() and write(), that approximate memory side-eects on the region of references to values of type .

The eect init() (which could also be named alloc) statically records the allocation of a reference in a region and its initialization to a value of type . The eectsread() and write() keep track of how and when the references of a given region are used.

We dene the range of an eect , written Rng(), is the set of pairs () such that either init(), read() or write() is in . We write Regs() the set of regions such that () is in the range of.

Eects can be gathered together with the inx operator that denotes the union of ef- fects eects dene a set algebra. The equality on eects is thus dened modulo associativity, commutativity and idempotence with as the neutral element. We dene the set-inclusive relation of subsumption on eects: 0, or 0 , if and only if there exists an eect

00 such that =000.

The domain of types is composed of the constant unit, which denotes the type of the trivial value of commands in ML (like the type named comm in Algol), type variables , reference types ref() in region to values of type , function types ! 0 from to 0 with alatent eect . The latent eect of a function encapsulates the side-eects of its body and is the eect incurred when the function is applied.

4.1 Free Variables and Substitutions

We have dened three kinds of variables: type variables, region variables and eect variables.

When it is not necessary to specify if a variable represents a type, a region or an eect, we note it v. Also, we adopt the vector notation ~v to represent sequences of terms, such as sequences of variablesv.

We write fv() for the set of free type, region and eect variables in . This denition extends pointwise to regions and eects. The function fr is dened in a similar manner and computes the set of region constants and variables free in type and eect terms.

13

(12)

fv(unit) = fv( ) = f g

fv(ref()) = fv()fv()

fv( ! 0) = fv()fv(0)fv() fv(r) =

fv(%) = f%g

fv() =

fv(init()) = fv()fv() fv(read()) = fv()fv() fv(write()) = fv()fv() fv(0) = fv()fv(0) Free Variables

Substitutions map type variables to types, region variables%to regionsand eect variables & to eects . We write0 for the composition of the substitution and 0, so that 0( ) =(0( )). The identity is writtenId.

4.2 Type Schemes and Environments

We use type schemes, introduced by Milner, 1978], to generically represent the dierent types of an expression. A type scheme8~v: consists of a typewhich is universally quantied over a sequence ~v of type variables, region variables and eect variables. A type 0 is an instance of a type scheme 8~v:, written 0 8~v:, if the variables~v can be substituted by some substitution so that 0= .

In the sequence~v, the variables are assumed to be distinct and their order of occurrence is not signicant. When that sequence is empty, we do not distinguish from 8:. We identify type schemes that dier only by a renaming of their quantied variables or that dier by the introduction or elimination of quantied variables that are not free in the body of the type scheme.

The context in which an expression is associated with a type and an eect is represented by a type environment E which maps value identiers to type schemes. The denitions of free variables and free regions are extended to type schemes by fv(8~v:) = fv()n~v and to environmentsE by considering that a type variable is free inE if and only if it is free inE(x) for some value identierx inDom(E). Substitutions are also extended to type schemes8~v:

by using alpha-renaming of quantied variables in type schemes to avoid capture of bound variables.

We extend substitutions to type schemes (8~v:) = 8v~0:00(0) using the renaming 0=

f~v7!

~

v 0

g of the bound variables~v by fresh variablesv~0, which are not free in and . The substitution00vof a variablevby00is dened as vifv2v~0and as v otherwise. The image

(E) of a type environmentE by a substitution is dened by ( E)(x) = (E(x)) for every 14

(13)

x inDom(E). Our extension of substitution on type schemes and environments satises the following lemma.

Lemma 1 (Substitution and Instantiation) If 1 (8~v :) then there exist 2 and

2

8~v: such that 1 =22.

Proof

By hypothesis, 1 (8~v:). By denition, (8~v:) = 8~v0:(00(0)) where the ~v0 are neither free in nor , where 0 = f~v 7! v~0g and where 00 is dened by v for every

v2fv()n~v. By denition of, there exists 01 dened on v~0 such that1 =01(00(0)). Let

0

2 =f~v7! 01v~0g and 2 =02. We have 2 8~v:. Let 2 the restriction of on fv(2)n~v. It veries that 1 =22

4.3 Type Generalization

The generalizationGen(E)() of a type is performed at letboundaries on some of the type, region and eect variables ~v that occur free in . A variable cannot be generalized when it is either free in the type environmentE or present in the eect.

Gen(E)() = let~v =fv()n(fv(E)fv()) in 8~v:

The rst condition is common for purely functional languages Gordon & al., 1979]. As for the second, just as types are bound to identiers in the type environment, types are bound to regions in the reconstructed eects. Thus, when these regions are observable from the context, i.e. in the type environmentE or the type of the returned value, those types cannot be generalized.

4.4 Rules of the Static Semantics

The next gure summarizes the rules of our static semantics. We formulate type and eect inference by a deductive proof system that assigns a type and an eect to every expression of the language. The context in which an expressions is associated with a type and an eect is represented by a type environment E which maps value identiers to types. Deductions produce conclusions of the formE `e : which are called typing judgments and read \in the type environmentE the expressione has type and eect".

15

(14)

E(x)

E `x: (var)

E `e: Ex+fx7!Gen(E)()g`e0:00

E `(let (x e) e0):00 (let)

Ex+fx7!g`e:0

E ` (lambda (x) e): ! 0 (abs)

E `e : ! 00 E `e0:00

E `(e e0):0000 (app) Static Semantics

In the rules (var) and (let), the static semantics manipulates type schemes by using the mechanism of generalization and instantiation specied in the previous section. The com- munication of the eects from a function denition to a function application is best viewed in the rules of abstraction (abs) and application (app), which show the interesting inter- play between types and eects. Via the abstraction rule, the eect of a lambda abstraction body is put inside the function type while, with the application rule, this embedded eect is extracted from the function type to be exercised at the point of call eects ow from the points where functions are dened to the points where they are used.

4.5 Static Semantics of Store Operations

The store operationsnew,getandsethave been dened by appropriate rules in the dynamic semantics. In the static semantics, they are best dened by using axioms.

E `new: init()! ref()

E `get:ref() read!()

E `set:ref()! 0write()! unit Static Semantics for Imperative Operations

16

(15)

These three axioms specify the types that can be assigned to the identiersnew,getand

set that implement store operations. For instance, the axiom for the identier new reads:

for any environment E, type , region and eect , the type of new is a function from objects of type to referencesref() that has at least the eect init() of initializing a reference in the region . The additional eects and 0 are used here to allow possible coercions to be performed.

4.6 Observation Criterion

The latent eect of a function derives statically from the state transforming operations that the expression it abstracts performs when it is executed. For example, store operations comprise the initialization, reading and writing of references which are approximated by regions.

Even if a value expression performs certain operations on the store, one may be able to detect that those operations cannot interfere with other expressions. This is the case when the regions over which the eect ranges are unreferenced in the rest of the program. If this is the case, then we shall mask eects which derive from those operations.

In our type and eect inference system, the static determination of the lexical scope of data regions is implemented by an observation criterion. The observation of eects consists of selecting an eect that ranges over regions that refer to data accessible in the environment of an expression or in its value. The accessible data are abstracted by the free regions of the type environment and of the value type of the expression.

In the static semantics, only side-eects that can aect the typing context of an expres- sion, i.e. its type environmentE and its value type, are worth reporting. The other eects of refer to local references that are freshly created and not exported from the expression

e.

E `e : 0Observe(E)()

E `e :0 (sub)

Observation and Subsumption Rule

The observation criterion is specied by the rule (sub) which tells that an expressionehas any eect 0bigger than the observable eects that can be inferred for it. Observe(E)() is the set of observable eects of .

17

(16)

Observe(E)() = finit(0)read(0)write(0)2j2fr(E)fr()g

f& 2j& 2fv(E)fv()g Observable Eects

The observable eects are the eect variables & that occur free in or E and the eects of the forminit(0),read(0) and write(0) where occurs free in or inE. We write Observe()() for Observe(fg)() and Observe()(0) for Observe(unit ! unit)(0). The function Observe has the following formal property which is widely used in the rest of this paper.

Lemma 2 (Observe and free variables) If0=Observe()()then fr()\Regs(n0) =

and fr(0)\Regs(n0) =.

Proof

By hypothesis, 0 = Observe()(). By denition of Observe and for any 2 Regs( n0), we have that 62 fr()fr(0). Thus, (fr()fr(0))\Regs( n0) = as expected

With the lemma 3, we show that observation is conserved under substitution, in that combinations of substitutionsto the functionObservecan be compared with the application of the function Observe to substituted terms.

Lemma 3 (Observe and substitution) (Observe()())Observe( )( ) for any .

Proof

Let us write00 =Observe( )( ). We proceed by case analysis. For every & 20 and by denition of Observe, we have & 2fv() and thus00 &. For everyinit(0)20 (respectively,read(0) andwrite(0)) and by denition ofObserve, we have that2fr() and thus 2fr( ). This implies that init( 0)200. This proves that 00 0

Note, however, that the containment is not proper. An example where we do not have

(Observe()()) = Observe( )( ) is = ref1(int), = init(1int)init(2unit) and

=f2 7!1g.

5 Formal Properties of the Static Semantics

The lemma of substitution is used both in the proof of consistency and in the proofs of correctness for the reconstruction algorithm.

Lemma 4 (Substitution) If E `e: then E `e: for any substitution . 18

Références

Documents relatifs

- Variations of the limiting sedimentation coeffi- cient S and the intrinsic viscosity [ q] with molecular weight (logarithmic scales) for linear polystyrene samples

dans la forêt de mangrove, les autres espèces observées sont communes au littoral.. Ces peuplements ont été à l’origine de la mosaïque de sociétés existant

User Logic SRAM Memory Cells Static Part FPGA AES Application K Encrypted Bitstream Non Volatile Memory (NVM) Bitstream K AES Encrypted Bitstream.. Figure 5.6:

Dans celle de PRIETO [24], elle a été utilisée chez 22 enfants, soit 95% des cas, avec deux cas ayant bénéficié d’une urétérostomie cutanée en préalable, l’échographie

Le portrait dressé par l’analyse de paysage de fitness permet d’analyser plus finement la relation de l’algorithme avec la structure du problème afin d’ap- préhender dans

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of

L’établissement des semis de Pinus pinea a été étudié in situ et sous des conditions contrôlées pour trois forêts au nord de la Tunisie (Mekna III, Ouchtata II et

Moreover, this mode of operation presupposes the strict separation of two institutionnal roles (regarding mathematics) within the teaching/learning relationship. Those