language.tex 14.9 KB
Newer Older
Giuseppe Castagna's avatar
Giuseppe Castagna committed
1
2
\subsection{Types}

Mickael Laurent's avatar
Mickael Laurent committed
3
\begin{definition}[Type syntax]\label{def:types} The set of types are the terms $t$ coinductively produced by the following grammar
Giuseppe Castagna's avatar
Giuseppe Castagna committed
4
5
\[
\begin{array}{lrcl}
6
\textbf{Types} & t & ::= & b\alt t\to t\alt t\times t\alt t\vee t \alt \neg t \alt \Empty 
Giuseppe Castagna's avatar
Giuseppe Castagna committed
7
8
9
10
11
12
\end{array}
\]
and that satisfy the following conditions
\begin{itemize}
\item (regularity) the term has a finite number of different sub-terms;
\item (contractivity) every infinite branch of a type contains an infinite number of occurrences of the
13
arrows or product type constructors.
Giuseppe Castagna's avatar
Giuseppe Castagna committed
14
15
16
17
\end{itemize}
\end{definition}
We introduce the following abbreviations for types: $
    t_1 \land t_2 \eqdef \neg (\neg t_1 \vee \neg t_2)$, 
Mickael Laurent's avatar
typos    
Mickael Laurent committed
18
    $t_ 1 \setminus t_2 \eqdef t_1 \wedge \neg t_2$, $\Any \eqdef \neg \Empty$.
Giuseppe Castagna's avatar
Giuseppe Castagna committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32
%
We refer to $ b $ and $ \to $ as \emph{type constructors}
and to $ \lor $, $ \land $, $ \lnot $, and $ \setminus $
as \emph{type connectives}.



\subsubsection{Subtyping}

\subsubsection{Operators for type constructors}

Let $t$ be a functional type (i.e., $t\leq\Empty\to\Any$) then

\begin{eqnarray}
Giuseppe Castagna's avatar
Giuseppe Castagna committed
33
\dom t & = & \max \{ u \alt t\leq u\to \Any\} 
Giuseppe Castagna's avatar
Giuseppe Castagna committed
34
35
36
37
38
39
40
\\
\apply t s & = &\min \{ u \alt t\leq s\to u\}
\\
\worra t s & = &\min\{u\leq \dom t\alt t\circ(\dom t\setminus u)\leq \neg s\}
\end{eqnarray}


41
42
\subsubsection{Type schemes}

Mickael Laurent's avatar
Mickael Laurent committed
43
44
Given a value $v$, the set of types $t$ such that $v \in t$ has no smallest element in general.
Indeed, the standard derivation rule for $\lambda$-abstraction values is:
45
46
47
48

\begin{mathpar}
  \Infer[Abs]
      {t=(\wedge_{i\in I}\arrow {s_i} {t_i})\land (\wedge_{j\in J} \neg (\arrow {s'_j} {t'_j}))\\t\not\leq \Empty}
Mickael Laurent's avatar
Mickael Laurent committed
49
      {\vdash \lambda^{\wedge_{i\in I}\arrow {s_i} {t_i}}x.e : t}
50
51
52
53
      {}
  \\
\end{mathpar}

Mickael Laurent's avatar
Mickael Laurent committed
54
55
56
In the next parts, we will need an algorithmic type system.
In order for it to be complete in regards to lambda-abstractions, we'll need to use a
new syntactic category, called \textbf{type schemes}, that denotes a set of types.
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109

\[
\begin{array}{lrcl}
  \textbf{Type schemes} & \ts & ::= & t \alt \tsfun {\arrow t t ; \cdots ; \arrow t t} \alt \ts \tstimes \ts \alt \ts \tsor \ts \alt \tsempty
\end{array}
\]

\begin{definition}[Interpretation of type schemes]
  We define a function $\tsint {\_}$ that maps type schemes to set of types.

  \begin{align*}
    \begin{array}{lcl}
    \tsint t &=& \{s\alt t \leq s\}\\
    \tsint {\tsfunone {t_i} {s_i}_{i=1..n}} &=& \{s\alt
    \exists s_0 = \bigwedge_{i=1..n} \arrow {t_i} {s_i}
    \land \bigwedge_{j=1..m} \neg (\arrow {t_j'} {s_j'}).\ 
    \Empty \not\simeq s_0 \leq s \}\\
    \tsint {\ts_1 \tstimes \ts_2} &=& \{s\alt \exists t_1 \in \tsint {\ts_1}\ 
    \exists t_2 \in \tsint {\ts_2}.\ \pair {t_1} {t_2} \leq s\}\\
    \tsint {\ts_1 \tsor \ts_2} &=& \{s\alt \exists t_1 \in \tsint {\ts_1}\ 
    \exists t_2 \in \tsint {\ts_2}.\ {t_1} \vee {t_2} \leq s\}\\
    \tsint \tsempty &=& \varnothing
    \end{array}
  \end{align*}

Note that $\tsint \ts$ is closed under subsumption and intersection (straightforward induction).
\end{definition}

\begin{definition}[Representant]
  We define a function $\tsrep {\_}$ that maps any non-empty type scheme to a type (a \textit{representant}).

  \begin{align*}
    \begin{array}{lcl}
    \tsrep t &=& t\\
    \tsrep {\tsfunone {t_i} {s_i}_{i\in I}} &=& \bigwedge_{i\in I} \arrow {t_i} {s_i}\\
    \tsrep {\ts_1 \tstimes \ts_2} &=& \pair {\tsrep {\ts_1}} {\tsrep {\ts_2}}\\
    \tsrep {\ts_1 \tsor \ts_2} &=& \tsrep {\ts_1} \vee \tsrep {\ts_2}\\
    \tsrep \tsempty && \textit{undefined}
    \end{array}
  \end{align*}

Note that $\tsrep \ts \in \tsint \ts$.
\end{definition}

\begin{lemma}
  Let $\ts$ be a type scheme and $t$ a type. We can compute a type scheme, written $t \tsand \ts$, such that:
  \[\tsint {t \tsand \ts} = \{s \alt \exists t' \in \tsint \ts.\ t \land t' \leq s \}\]
\end{lemma}

\begin{lemma}
  Let $\ts$ be a type scheme and $t$ a type. We can decide the assertion $t \in \tsint \ts$,
  which we also write $\ts \leq t$.
\end{lemma}
Giuseppe Castagna's avatar
Giuseppe Castagna committed
110
111
112
113
114

\subsection{Expressions}



Giuseppe Castagna's avatar
Giuseppe Castagna committed
115
\[
Giuseppe Castagna's avatar
Giuseppe Castagna committed
116
\begin{array}{lrcl}
117
118
119
\textbf{Expressions} & e & ::= & c\alt x \alt \lambda^{\bigwedge \arrow t t}x.e \alt \ite k t e e \alt e e\\
\textbf{Conditions} & k & ::= & c\alt x \alt \lambda^{\bigwedge \arrow t t}x.e \alt k k\\
\textbf{Values} & v & ::= & c \alt \lambda^{\bigwedge \arrow t t}x.e\\
Giuseppe Castagna's avatar
Giuseppe Castagna committed
120
\end{array}
Giuseppe Castagna's avatar
Giuseppe Castagna committed
121
122
\]

Giuseppe Castagna's avatar
Giuseppe Castagna committed
123
Let $e$ be an expression and $\varpi\in\{0,1\}^*$ a \emph{path}; we denote $\occ e\varpi$ the occurrence of $e$ reached by the path $\varpi$, that is
Giuseppe Castagna's avatar
Giuseppe Castagna committed
124
125
126
\[
\begin{array}{r@{\downarrow}l@{\quad=\quad}l}
e&\epsilon & e\\
Giuseppe Castagna's avatar
Giuseppe Castagna committed
127
e_0e_1& i.\varpi & \occ{e_i}\varpi\qquad i=0,1\\
Giuseppe Castagna's avatar
Giuseppe Castagna committed
128
129
130
131
\end{array}
\]
undefined otherwise

Giuseppe Castagna's avatar
Giuseppe Castagna committed
132

Mickael Laurent's avatar
Mickael Laurent committed
133
134
135
A type environment $\Gamma$ is a mapping from occurrences (i.e., expressions) to types, up to alpha-renaming (i.e., $\lambda^tx.x$ and $\lambda^ty.y$ are mapped to the same type, if any).
It is necessary to map alpha-equivalent expressions to the same type in order for our type system to be invariant by alpha-renaming.
We use $\Gamma_1,\Gamma_2$ for the type environment obtained by unioning the two type environments giving priority to $\Gamma_2$ (define formally).
Giuseppe Castagna's avatar
Giuseppe Castagna committed
136
137


Mickael Laurent's avatar
Mickael Laurent committed
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
We suppose w.l.o.g that all variables abstracted in $\lambda$-abstractions are distincts (otherwise we can alpha-rename $\lambda$-abstractions).

\subsection{Declarative type system}

\begin{mathpar}
  \Infer[Occ]
      { }
      { \Gamma \vdash e: \Gamma(e) }
      { e\in\dom\Gamma }
  \qquad
  \Infer[Intersect]
      { \Gamma \vdash e:t_1\\\Gamma \vdash e:t_2 }
      { \Gamma \vdash e: t_1 \wedge t_2 }
      { }
  \qquad
  \Infer[Subs]
      { \Gamma \vdash e:t\\t\leq t' }
      { \Gamma \vdash e: t' }
      { }
  \qquad
  \\
  \Infer[EFQ]
  { }
  { \Gamma, (e:\Empty) \vdash e': t }
  { }
  \qquad
  \Infer[Const]
      { }
      {\Gamma\vdash c:\basic{c}}
      { }
  \qquad
  \Infer[App]
      {
        \Gamma \vdash e_1: \arrow {t_1}{t_2}\\
        \Gamma \vdash e_2: t_1
      }
      { \Gamma \vdash {e_1}{e_2}: t_2 }
      { }
      \\
  \Infer[Abs]
      {\Gamma,x:s_i\vdash e:t_i\\t\simeq \left(\bigwedge_{i\in I} \arrow {s_i} {t_i}\right)
      \land \left(\bigwedge_{j\in J} \neg (\arrow {s'_j} {t'_j})\right)\\t\not\simeq\Empty}
      {
      \Gamma\vdash\lambda^{\wedge_{i\in I}\arrow {s_i} {t_i}}x.e:\textstyle t
      }
      { }
      \\
%      \Infer[If]
%            {\Gamma\vdash e:t_0\\
%            %t_0\not\leq \neg t \Rightarrow
%            \Gamma \cvdash + e t e_1:t'\\
%            %t_0\not\leq t \Rightarrow
%            \Gamma \cvdash - e t e_2:t'}
%            {\Gamma\vdash \ite {e} t {e_1}{e_2}: t'}
%            { }
    \Infer[If]
        {\Gamma\vdash e:t_0\\
        %t_0\not\leq \neg t \Rightarrow
        \Gamma \evdash + e t \Gamma^+ \\ \Gamma^+ \vdash e_1:t'\\
        %t_0\not\leq t \Rightarrow
        \Gamma \evdash - e t \Gamma^- \\ \Gamma^- \vdash e_2:t'}
        {\Gamma\vdash \ite {e} t {e_1}{e_2}: t'}
        { }
  \\
  \Infer[Proj]
  {\Gamma \vdash e:(t_1,t_2)}
  {\Gamma \vdash \pi_i e:t_i}
  { }
  \qquad
  \Infer[Pair]
  {\Gamma \vdash e_1:t_1 \and \Gamma \vdash e_2:t_2}
  {\Gamma \vdash (e_1,e_2):\pair {t_1} {t_2}}
  { }
\end{mathpar}

\begin{center} \line(1,0){300} \end{center}

\begin{mathpar}
%        \Infer[Base]
%            { \Gamma \vdash e':t' }
%            { \Gamma \cvdash p e t e':t' }
%            { }
%            \qquad
%        \Infer[Path]
%            { \pvdash \Gamma p e t \varpi:t_1 \\ \Gamma,(\occ e \varpi:t_1) \cvdash p e t e':t_2 }
%            { \Gamma \cvdash p e t e':t_2 }
%            { }
    \Infer[Base]
226
227
228
229
      { }
      { \Gamma \evdash p e t \Gamma }
      { }
    \qquad
Mickael Laurent's avatar
Mickael Laurent committed
230
    \Infer[Path]
231
232
233
      { \pvdash {\Gamma'} p e t \varpi:t' \\ \Gamma \evdash p e t \Gamma' }
      { \Gamma \evdash p e t \Gamma',(\occ e \varpi:t') }
      { }
Mickael Laurent's avatar
Mickael Laurent committed
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
\end{mathpar}

\begin{center} \line(1,0){300} \end{center}

\begin{mathpar}
    \Infer[PIntersect]
        { \pvdash \Gamma p e t \varpi:t_1 \\ \pvdash \Gamma p e t \varpi:t_2 }
        { \pvdash \Gamma p e t \varpi:t_1\land t_2 }
        { }
        \qquad
    \Infer[PSubs]
        { \pvdash \Gamma p e t \varpi:t_1 \\ t_1\leq t_2 }
        { \pvdash \Gamma p e t \varpi:t_2 }
        { }
        \\
    \Infer[PTypeof]
        { \Gamma \vdash \occ e \varpi:t' }
        { \pvdash \Gamma p e t \varpi:t' }
        { }
        \qquad
    \Infer[PEps+]
        { }
        { \pvdash \Gamma + e t \epsilon:t }
        { }
        \qquad
    \Infer[PEps-]
        { }
        { \pvdash \Gamma - e t \epsilon:\neg t }
        { }
        \\
    \Infer[PAppR]
        { \pvdash \Gamma p e t \varpi.0:\arrow{t_1}{t_2} \\ \pvdash \Gamma p e t \varpi:t_2' \\ t_2\land t_2' \simeq \Empty }
        { \pvdash \Gamma p e t \varpi.1:\neg t_1 }
        { }
        \\
    \Infer[PAppL]
        { \pvdash \Gamma p e t \varpi.1:t_1 \\ \pvdash \Gamma p e t \varpi:t_2 }
        { \pvdash \Gamma p e t \varpi.0:\neg (\arrow {t_1} {\neg t_2}) }
        { }
        \qquad
    \Infer[PPairL]
        { \pvdash \Gamma p e t \varpi:\pair{t_1}{t_2} }
        { \pvdash \Gamma p e t \varpi.l:t_1 }
        { }
        \\
    \Infer[PPairR]
        { \pvdash \Gamma p e t \varpi:\pair{t_1}{t_2} }
        { \pvdash \Gamma p e t \varpi.r:t_2 }
        { }
        \qquad
    \Infer[PFst]
        { \pvdash \Gamma p e t \varpi:t' }
        { \pvdash \Gamma p e t \varpi.f:\pair {t'} \Any }
        { }
        \qquad
    \Infer[PSnd]
        { \pvdash \Gamma p e t \varpi:t' }
        { \pvdash \Gamma p e t \varpi.s:\pair \Any {t'} }
        { }
        \qquad
\end{mathpar}

Mickael Laurent's avatar
Mickael Laurent committed
296
\subsection{Algorithmic type system}
297

Mickael Laurent's avatar
Mickael Laurent committed
298
299
300
301
302
303
304
\begin{mathpar}
  \Infer[EFQ]
  { }
  { \Gamma, (e:\Empty) \vdash e': \Empty }
  { \text{With priority over other rules} }
  \\
  \Infer[Occ]
305
306
      { \Gamma\setminus\{e\} \vdash e : \ts }
      { \Gamma \vdash e: \Gamma(e) \tsand \ts }
Mickael Laurent's avatar
Mickael Laurent committed
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
      { e\in\dom\Gamma}
  \qquad
  \Infer[Const]
      { }
      {\Gamma\vdash c:\basic{c}}
      {c\not\in\dom\Gamma}
   \\
  \Infer[Abs]
      {\Gamma,x:s_i\vdash e:\ts_i'\\ \ts_i'\leq t_i}
      {
      \Gamma\vdash\lambda^{\wedge_{i\in I}\arrow {s_i} {t_i}}x.e:\textstyle\tsfun {\arrow {s_i} {t_i}}_{i\in I}
      }
      {\lambda^{\wedge_{i\in I}\arrow {s_i} {t_i}}x.e\not\in\dom\Gamma}
      \\
  \Infer[App]
      {
        \Gamma \vdash e_1: \ts_1\\
        \Gamma \vdash e_2: \ts_2\\
        \ts_1 \leq \arrow \Empty \Any\\
        \ts_2 \leq \dom {\ts_1}
      }
      { \Gamma \vdash {e_1}{e_2}: \ts_1 \circ \ts_2 }
      { {e_1}{e_2}\not\in\dom\Gamma}
      \\
  \Infer[If]
        {\Gamma\vdash e:\ts_0\\
        %\makebox{$\begin{array}{l}
        %  \left\{
        %    \begin{array}{ll} %\Gamma,
        %    \Refine + {e,t} \Gamma \vdash e_1 : \ts_1 & \text{ if } \ts_0 \not\leq \neg t\\
        %    \ts_1 = \Empty & \text{ otherwise}
        %  \end{array}\right.\\
        %  \left\{
        %    \begin{array}{ll} %\Gamma,
        %    \Refine - {e,t} \Gamma \vdash e_2 : \ts_2 & \text{ if } \ts_0 \not\leq t\\
        %    \ts_2 = \Empty & \text{ otherwise}
        %  \end{array}\right.
        %\end{array}$}
        \Refine + {e,t} \Gamma \vdash e_1 : \ts_1\\
        \Refine - {e,t} \Gamma \vdash e_2 : \ts_2}
        {\Gamma\vdash \ite {e} t {e_1}{e_2}: \ts_1\tsor \ts_2}
        %{\ite {e} t {e_1}{e_2}\not\in\dom\Gamma}
        {\texttt{if}\dots\not\in\dom\Gamma}
  \\
  \Infer[Proj]
  {\Gamma \vdash e:\ts\and \ts\leq\pair\Any\Any}
  {\Gamma \vdash \pi_i e:\bpi_{\mathbf{i}}(\ts)}
  {\pi_i e\not\in\dom\Gamma}
355

Mickael Laurent's avatar
Mickael Laurent committed
356
357
358
359
360
  \Infer[Pair]
  {\Gamma \vdash e_1:\ts_1 \and \Gamma \vdash e_2:\ts_2}
  {\Gamma \vdash (e_1,e_2):{\ts_1}\tstimes{\ts_2}}%\pair{t_1}{t_2}}
  {(e_1,e_2)\not\in\dom\Gamma}
\end{mathpar}
Giuseppe Castagna's avatar
Giuseppe Castagna committed
361
362
363

\[
\begin{array}{lcl}
Giuseppe Castagna's avatar
Giuseppe Castagna committed
364
365
  \typep+\epsilon{\Gamma,e,t} & = & t\\
  \typep-\epsilon{\Gamma,e,t} & = & \neg t\\
Mickael Laurent's avatar
Mickael Laurent committed
366
  \typep{p}{\varpi.0}{\Gamma,e,t} & = & \neg(\arrow{\Gp p{\Gamma,e,t}{(\varpi.1)}}{\neg \Gp p {\Gamma,e,t} (\varpi)})\\
Mickael Laurent's avatar
Mickael Laurent committed
367
368
369
370
371
372
373
  \typep{p}{\varpi.1}{\Gamma,e,t} & = & \worra{\tsrep {\tyof{\occ e{\varpi.0}}\Gamma}}{\Gp p {\Gamma,e,t} (\varpi)}\\
  \typep{p}{\varpi.l}{\Gamma,e,t} & = & \bpl{\Gp p {\Gamma,e,t} (\varpi)}\\
  \typep{p}{\varpi.r}{\Gamma,e,t} & = & \bpr{\Gp p {\Gamma,e,t} (\varpi)}\\
  \typep{p}{\varpi.f}{\Gamma,e,t} & = & \pair{\Gp p {\Gamma,e,t} (\varpi)}\Any\\
  \typep{p}{\varpi.s}{\Gamma,e,t} & = & \pair\Any{\Gp p {\Gamma,e,t} (\varpi)}\\ \\
  \Gp p {\Gamma,e,t} (\varpi) & = & \typep p \varpi {\Gamma,e,t} \land \tsrep {\tyof {\occ e \varpi} \Gamma}\\
  %\underbrace{\land \tyof {\occ e \varpi} {\Gamma\setminus\{\occ e \varpi\}}}_{\text{if $\occ e \varpi$ is not a variable}}}\\
Giuseppe Castagna's avatar
Giuseppe Castagna committed
374
375
\end{array}
\]
Giuseppe Castagna's avatar
Giuseppe Castagna committed
376

Mickael Laurent's avatar
Mickael Laurent committed
377
378
379
\begin{align*}
  &(\RefineStep p {e,t} (\Gamma))(e') = 
    \left\{\begin{array}{ll}
380
381
382
      %\tyof {e'} \Gamma \tsand
      \bigwedge_{\{\varpi \alt \occ e \varpi \equiv e'\}}
      \Gp p {\Gamma,e,t} (\varpi) & \text{if } \exists \varpi.\ \occ e \varpi \equiv e' \\
Mickael Laurent's avatar
Mickael Laurent committed
383
384
385
386
387
      \Gamma(e') & \text{otherwise, if } e' \in \dom \Gamma\\
      \text{undefined} & \text{otherwise}
    \end{array}\right.\\
  &\Refine p {e,t} \Gamma=\fixpoint_\Gamma (\RefineStep p {e,t})\qquad \text{(for the order $\leq$ on environments, defined in the proofs section)}
\end{align*}
Giuseppe Castagna's avatar
Giuseppe Castagna committed
388
389


390

Mickael Laurent's avatar
Mickael Laurent committed
391
All the functions above are defined iff all their subexpressions are (e.g., $\occ e{\varpi.i}$ must be defined).
Giuseppe Castagna's avatar
Giuseppe Castagna committed
392

Mickael Laurent's avatar
Mickael Laurent committed
393
394
395
396
397
398
399
400
401
The notation $\tyof{o}{\Gamma}$ denotes the type that can be deduced for the occurence $o$ under the type envirenment $\Gamma$.
That is, $\tyof{o}{\Gamma}=\ts$ if and only if $\Gamma\vdash o:\ts$ can be deduced by the typing rules.
\footnote{Note that the definition is well-founded.
This can be seen by analyzing the rule \Rule{If}: the definition of $\Refine + {e,t} \Gamma$ and  $\Refine - {e,t} \Gamma$ use
$\tyof{\occ e{\varpi}}\Gamma$, and this is defined for all $\varpi$ since the first premisses of \Rule{If} states that
$\Gamma\vdash e:\ts_0$ (and this is possible only if we were able to deduce under the hypothesis $\Gamma$ the type of every occurrence of $e$.)}


The reason for the definition of $\RefineStep p {e,t}$ is that the same subterm of $e$
402
403
may occur several times in $e$ and therefore we can collect for every
occurrence a different type constraint. Since all the constraints must
Giuseppe Castagna's avatar
Giuseppe Castagna committed
404
hold, then we take their intersection. For instance, if $f$ is a function
405
of type $(s_1\times s_2\to t)\wedge( s_3\to\neg t)$ and we test
Giuseppe Castagna's avatar
Giuseppe Castagna committed
406
407
whether $f(x,x)$ is of type $t$ or not, then the test succeed only if $(x,x)$ is of
type $s_1\times s_2$, that is, that $x$ has both type $s_1$ and type
408
409
$s_2$ and thus their intersection $s_1{\wedge}s_2$.\\

Giuseppe Castagna's avatar
Giuseppe Castagna committed
410
411
412
413
\subsection{Algorithms}
Define how to compute $t\circ s$ and $\worra t s$

If
Giuseppe Castagna's avatar
Giuseppe Castagna committed
414
\[ t \simeq \bigvee_{i\in I}\left(\bigwedge_{p\in P_i}(s_p\to t_p)\bigwedge_{n\in N_i}\neg(s_n'\to t_n')\right) \]
Mickael Laurent's avatar
Mickael Laurent committed
415
with \[\forall i\in I.\ \bigwedge_{p\in P_i}(s_p\to t_p)\bigwedge_{n\in N_i}\neg(s_n'\to t_n') \not\simeq \Empty\]
Giuseppe Castagna's avatar
Giuseppe Castagna committed
416
then
Giuseppe Castagna's avatar
Giuseppe Castagna committed
417
418
419
\begin{eqnarray*}
\dom{t}    & = & \bigwedge_{i\in I}\bigvee_{p\in P_i}s_p\\[4mm]
t\circ s   & = & \bigvee_{i\in I}\left(\bigvee_{\{Q\subsetneq P_i\alt s\not\leq\bigvee_{q\in Q}s_q\}}\left(\bigwedge_{p\in P_i\setminus Q}t_p\right)\right)\hspace*{1cm}\makebox[0cm][l]{(for $s\leq\dom{t}$)}\\[4mm]
Mickael Laurent's avatar
Mickael Laurent committed
420
\worra t s & = & \dom t \wedge\bigvee_{i\in I}\left(\bigwedge_{\{P\subset P_i\alt s\leq \bigvee_{p \in P} \neg t_p\}}\left(\bigvee_{p \in P} \neg s_p\right) \right)
Giuseppe Castagna's avatar
Giuseppe Castagna committed
421
\end{eqnarray*}
Giuseppe Castagna's avatar
Giuseppe Castagna committed
422
\beppe{Explain, especially the last one}