2026-03-29 15:32:35 +00:00
|
|
|
|
// #import "@preview/polylux:0.4.0": *
|
|
|
|
|
|
#import "@preview/simplebnf:0.1.1": *
|
|
|
|
|
|
// #import "@preview/zebraw:0.5.0": *
|
|
|
|
|
|
// #show: zebraw
|
|
|
|
|
|
#import "@preview/curryst:0.6.0": rule, prooftree, rule-set
|
2026-04-04 13:07:15 +00:00
|
|
|
|
#import "@preview/xarrow:0.4.0": xarrow, xarrowDashed, xarrowSquiggly
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
= Формальная модель используемого языка
|
|
|
|
|
|
|
2026-04-04 13:07:15 +00:00
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: check correctnes for path, mem & type ??
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
== Syntax
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
#let isCorrect = `isCorrect`
|
|
|
|
|
|
|
|
|
|
|
|
#let isRead = `isRead`
|
|
|
|
|
|
#let isAlwaysWrite = `isAlwaysWrite`
|
|
|
|
|
|
#let isPossibleWrite = `isPossibleWrite`
|
|
|
|
|
|
#let isRef = `isRef`
|
|
|
|
|
|
#let isCopy = `isCopy`
|
|
|
|
|
|
#let isIn = `isIn`
|
|
|
|
|
|
#let isOut = `isOut`
|
|
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
#let mode = `mode`
|
|
|
|
|
|
#let expr = `expr`
|
2026-03-29 15:32:35 +00:00
|
|
|
|
#let stmt = `stmt`
|
|
|
|
|
|
#let decl = `decl`
|
|
|
|
|
|
#let prog = `prog`
|
|
|
|
|
|
#let path = `path`
|
2026-04-11 13:17:15 +00:00
|
|
|
|
#let type = `type`
|
2026-03-29 15:32:35 +00:00
|
|
|
|
#bnf(
|
|
|
|
|
|
Prod(`read`,
|
2026-04-11 13:17:15 +00:00
|
|
|
|
// NOTE: not three modalities for write, because read does not change value
|
|
|
|
|
|
// => it is not important to observe rsult, no differenc between always and maybe
|
2026-03-29 15:32:35 +00:00
|
|
|
|
{ Or[Read][read passed value]
|
2026-04-11 13:17:15 +00:00
|
|
|
|
Or[$not$ Read][] } ),
|
2026-03-29 15:32:35 +00:00
|
|
|
|
Prod(`write`,
|
|
|
|
|
|
{ Or[$square$ Write][in all cases there is a write to passed variable] // always write, requre at least one write in each flow variant
|
|
|
|
|
|
Or[$diamond$ Write][in some cases there is a write to passed variable] // possible write, no requirements (?)
|
|
|
|
|
|
Or[$not$ Write][] } ), // no write, require n owrites in all flow variants
|
|
|
|
|
|
Prod(`copy`,
|
|
|
|
|
|
{ Or[Ref][pass reference to the value]
|
|
|
|
|
|
Or[Value][pass copy of the value] } ),
|
|
|
|
|
|
Prod(`in`,
|
|
|
|
|
|
{ Or[In][parameter value used as input]
|
2026-04-11 13:17:15 +00:00
|
|
|
|
Or[$not$ In][] } ),
|
2026-03-29 15:32:35 +00:00
|
|
|
|
Prod(`out`,
|
2026-04-11 13:17:15 +00:00
|
|
|
|
{ Or[Out][parameter value returned]
|
|
|
|
|
|
Or[$not$ Out][] } ),
|
2026-03-29 15:32:35 +00:00
|
|
|
|
Prod(
|
2026-04-11 13:17:15 +00:00
|
|
|
|
`mode`,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
{
|
|
|
|
|
|
Or[`read` #h(3pt) `write` #h(3pt) `copy` #h(3pt) `in` #h(3pt) `out`][]
|
|
|
|
|
|
}
|
|
|
|
|
|
),
|
|
|
|
|
|
Prod(
|
|
|
|
|
|
`path`,
|
|
|
|
|
|
{
|
2026-04-11 13:17:15 +00:00
|
|
|
|
// NOTE: global vars & local vars names could be used with one constructor
|
|
|
|
|
|
// Or[$\#x$][funciton or global variable itself]
|
|
|
|
|
|
Or[$@ X$][function argument or variable itself]
|
2026-04-04 13:07:15 +00:00
|
|
|
|
Or[$* path$][reference insede path]
|
2026-03-29 15:32:35 +00:00
|
|
|
|
Or[$path . n$][access $n$-th cell of the tuple]
|
2026-04-04 13:07:15 +00:00
|
|
|
|
// Or[$path : n$][access $n$-th cell of the union] // TODO: another notation ??
|
2026-03-29 15:32:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
),
|
|
|
|
|
|
Prod(
|
2026-04-11 13:17:15 +00:00
|
|
|
|
`type`,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
{
|
|
|
|
|
|
Or[$()$][simple type representing all primitive types] // `Unit`
|
2026-04-11 13:17:15 +00:00
|
|
|
|
Or[\& #h(3pt) `mode` #h(3pt) `type`][reference to structure, contains copy / ref choice] // `Ref`
|
2026-04-11 14:51:56 +00:00
|
|
|
|
Or[$[type+]$][tuple type] // `Prod`
|
2026-04-11 13:17:15 +00:00
|
|
|
|
// Or[`type` $times$ `type`][pair type, allows to make tuples] // `Prod`
|
|
|
|
|
|
// Or[`type` $+$ `type`][union type (important in some way ???)] // `Sum` // TODO ?
|
|
|
|
|
|
|
|
|
|
|
|
// NOTE: do not use names in type
|
|
|
|
|
|
// Or[$lambda_((x type)+)$][type of lambda or function pointer, defined by function declaration] // `Fun`
|
2026-04-14 11:32:28 +00:00
|
|
|
|
Or[$lambda type+$][type of lambda or function pointer, defined by function declaration] // `Fun`
|
2026-03-29 15:32:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
),
|
2026-04-11 13:17:15 +00:00
|
|
|
|
// FIXME: replace with expr
|
2026-03-29 15:32:35 +00:00
|
|
|
|
Prod(
|
2026-04-11 13:17:15 +00:00
|
|
|
|
`expr`,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
{
|
2026-04-11 13:17:15 +00:00
|
|
|
|
Or[$()$][value of simple type] // `Unit`
|
|
|
|
|
|
Or[$path$][value from variable] // `Path`
|
|
|
|
|
|
Or[$\& #h(3pt) expr$][reference expr] // `Ref`
|
2026-04-11 14:51:56 +00:00
|
|
|
|
Or[$[expr+]$][tuple expr] // `Prod`
|
2026-04-11 13:17:15 +00:00
|
|
|
|
// NOTE: replaced with simple path value
|
|
|
|
|
|
// Or[$lambda_path$][function value from variable] // `Fun`
|
2026-03-29 15:32:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
),
|
|
|
|
|
|
Prod(
|
|
|
|
|
|
`stmt`,
|
|
|
|
|
|
{
|
2026-04-11 13:17:15 +00:00
|
|
|
|
Or[`CALL` $f space expr+$][call function]
|
2026-03-29 15:32:35 +00:00
|
|
|
|
Or[`WRITE` $path$][write to variable]
|
|
|
|
|
|
Or[`READ` $path$][read from variable]
|
2026-04-11 13:17:15 +00:00
|
|
|
|
Or[$stmt ; stmt$][control flow operator, xecution ]
|
|
|
|
|
|
Or[$stmt | stmt$][control flow operator, excution of one statements]
|
2026-03-29 15:32:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
),
|
|
|
|
|
|
Prod(
|
|
|
|
|
|
`decl`,
|
|
|
|
|
|
{
|
2026-04-11 13:17:15 +00:00
|
|
|
|
// TODO: path not allowed ??
|
|
|
|
|
|
Or[$"var" X : type = expr$][global variable declaration]
|
|
|
|
|
|
Or[$"fun" X ((X : type)+) = stmt$][function declaration]
|
2026-03-29 15:32:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
),
|
|
|
|
|
|
Prod(
|
|
|
|
|
|
`prog`,
|
|
|
|
|
|
{
|
2026-04-11 13:17:15 +00:00
|
|
|
|
Or[$decl stmt$][declarations and executet statement]
|
|
|
|
|
|
}
|
|
|
|
|
|
),
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
== Value Model
|
|
|
|
|
|
|
2026-04-14 11:32:28 +00:00
|
|
|
|
#let rf = $\& #h(3pt)$
|
|
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
// FIXME: check & add details
|
2026-04-14 11:32:28 +00:00
|
|
|
|
#let deepvalue = `deepvalue`
|
2026-04-11 13:17:15 +00:00
|
|
|
|
#let value = `value`
|
|
|
|
|
|
#bnf(
|
|
|
|
|
|
Prod(
|
2026-04-14 11:32:28 +00:00
|
|
|
|
$deepvalue$,
|
2026-04-11 13:17:15 +00:00
|
|
|
|
{
|
2026-04-14 11:32:28 +00:00
|
|
|
|
Or[$0$][valid value of simple type] // `Unit`
|
|
|
|
|
|
Or[$\#$][valid or spoiled value of simple type] // `Unit`
|
|
|
|
|
|
Or[$bot$][spoiled value of simple type] // `Unit`
|
|
|
|
|
|
Or[$lambda type+ stmt$][function pointer value] // `Fun`
|
|
|
|
|
|
Or[$rf deepvalue$][reference value, contains label of the value in the memory] // `Ref`
|
|
|
|
|
|
Or[$[deepvalue+]$][tuple value] // `Prod`
|
|
|
|
|
|
}
|
|
|
|
|
|
),
|
|
|
|
|
|
Prod(
|
|
|
|
|
|
$value_mu$,
|
|
|
|
|
|
{
|
|
|
|
|
|
Or[$0$][valid value of simple type] // `Unit`
|
|
|
|
|
|
Or[$\#$][valid or spoiled value of simple type] // `Unit`
|
|
|
|
|
|
Or[$bot$][spoiled value of simple type] // `Unit`
|
|
|
|
|
|
Or[$lambda type+ stmt$][function pointer value] // `Fun`
|
|
|
|
|
|
Or[$rf LL$][reference value, contains label of the value in the memory] // `Ref`
|
2026-04-11 14:51:56 +00:00
|
|
|
|
Or[$[value+]$][tuple value] // `Prod`
|
2026-03-29 15:32:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
),
|
|
|
|
|
|
)
|
2026-04-11 13:17:15 +00:00
|
|
|
|
|
2026-04-14 11:32:28 +00:00
|
|
|
|
#deepvalue - полное значение, #value - слой значения, привязан к конкретной памяти $mu$
|
|
|
|
|
|
|
|
|
|
|
|
Значения, могут лежать в переменных и передаваться как аргументы функций (то, во что вычисляется $expr$)
|
|
|
|
|
|
|
|
|
|
|
|
$v in value$ - произвольное значение
|
|
|
|
|
|
|
|
|
|
|
|
Получение #value по #deepvalue:
|
|
|
|
|
|
- $rf LL xarrowSquiggly(mu)_#[deep] rf mu[LL]$
|
|
|
|
|
|
- $* xarrowSquiggly(mu)_#[deep] *$
|
|
|
|
|
|
где $*$ - произвольный конструктор значения кроме $rf$
|
2026-04-11 13:17:15 +00:00
|
|
|
|
|
|
|
|
|
|
== Memory Model
|
|
|
|
|
|
|
2026-04-14 11:32:28 +00:00
|
|
|
|
#let cl = $chevron.l$
|
|
|
|
|
|
#let cr = $chevron.r$
|
2026-04-11 13:17:15 +00:00
|
|
|
|
|
2026-04-11 14:51:56 +00:00
|
|
|
|
#let mem = `mem`
|
2026-04-11 13:17:15 +00:00
|
|
|
|
|
2026-04-14 11:32:28 +00:00
|
|
|
|
- $LL$ - множество меток памяти
|
|
|
|
|
|
- $mem := LL -> value, space mu : mem$ - память, частично определённая функция
|
|
|
|
|
|
- $l in LL$ - новый тег памяти (ранее не использованный)
|
|
|
|
|
|
- `next` - получение следующей неиспользованной метки
|
|
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ add value to memory],
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
2026-04-14 11:32:28 +00:00
|
|
|
|
$l' = #[next] (l)$,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
2026-04-14 11:32:28 +00:00
|
|
|
|
// TODO: check that access is what required ??
|
|
|
|
|
|
$cl mu, l cr xarrowSquiggly(v)_#[add] cl mu [l <- v], l' cr$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
2026-04-11 14:51:56 +00:00
|
|
|
|
== Semantics
|
|
|
|
|
|
|
2026-04-11 14:54:39 +00:00
|
|
|
|
// $V := memelem$ - значения памяти
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
$X$ - можество переменных
|
|
|
|
|
|
|
2026-04-14 11:32:28 +00:00
|
|
|
|
// FIXME: TMP
|
|
|
|
|
|
#let valuemem = `valuemem`
|
|
|
|
|
|
#let memelem = `memelem`
|
|
|
|
|
|
#let pathenvmode = `pathenvmode`
|
|
|
|
|
|
#let pathenvval = `pathenvval`
|
|
|
|
|
|
#let pathenvmem = `pathenvmem`
|
|
|
|
|
|
#let pathenvtype = `pathenvtype`
|
|
|
|
|
|
|
2026-04-11 14:51:56 +00:00
|
|
|
|
#let env = `env`
|
2026-04-14 11:32:28 +00:00
|
|
|
|
$sigma : env := X -> LL times type, space sigma : env$ - #[ метки памяти и типы значений пеерменных контекста, частично определённая функция ]
|
2026-04-11 13:17:15 +00:00
|
|
|
|
|
2026-04-14 11:32:28 +00:00
|
|
|
|
// $DD : X -> decl$ - глобальные определения, частично определённая функция
|
2026-04-11 13:17:15 +00:00
|
|
|
|
|
2026-04-14 11:32:28 +00:00
|
|
|
|
// $d in decl, $
|
|
|
|
|
|
$s in stmt, f in X, x in X, a in X$
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
2026-04-14 11:32:28 +00:00
|
|
|
|
// FIXME ??
|
|
|
|
|
|
// $d space @ space overline(x)$ - запись применения функции (вида #decl) к аргументам
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
2026-04-11 14:51:56 +00:00
|
|
|
|
=== Path Accessors
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
2026-04-11 14:51:56 +00:00
|
|
|
|
Набор частично определённых фунций для работы с путями.
|
|
|
|
|
|
Для удобства значение, получаемое из текущего применением пути, будем называть полем.
|
|
|
|
|
|
// Все эти функции используются с префиксом `path.`.
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
2026-04-14 11:32:28 +00:00
|
|
|
|
#let eqmu = $attach(=, br: mu)$
|
|
|
|
|
|
#let arrmu = $attach(->, br: mu)$
|
|
|
|
|
|
|
|
|
|
|
|
#let ttype = $attach(tack.r, br: type)$
|
|
|
|
|
|
#let tpath = $attach(tack.r, br: path)$
|
|
|
|
|
|
#let tmode = $attach(tack.r, br: mode)$
|
|
|
|
|
|
|
|
|
|
|
|
#let val = `val`
|
|
|
|
|
|
#let label = `label`
|
|
|
|
|
|
#let tval = $attach(tack.r, br: val)$
|
|
|
|
|
|
#let tlabel = $attach(tack.r, br: label)$
|
|
|
|
|
|
|
|
|
|
|
|
#let tetype = $attach(tack.r.double, br: type)$
|
|
|
|
|
|
#let temode = $attach(tack.r.double, br: mode)$
|
|
|
|
|
|
|
|
|
|
|
|
#let teval = $attach(tack.r.double, br: val)$
|
|
|
|
|
|
#let telabel = $attach(tack.r.double, br: label)$
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: env mem label ??, env mem value ??
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: FIXME: backwards, deconstruction ??
|
|
|
|
|
|
- #[ Конструирование путей по переменой
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ variable path],
|
|
|
|
|
|
|
|
|
|
|
|
$x tpath @x$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ reference path],
|
|
|
|
|
|
|
|
|
|
|
|
$x tpath p$,
|
|
|
|
|
|
$x tpath rf p$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ access path],
|
|
|
|
|
|
|
|
|
|
|
|
$x tpath p$,
|
|
|
|
|
|
|
|
|
|
|
|
$x tpath p.i$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
]
|
2026-04-11 14:51:56 +00:00
|
|
|
|
|
|
|
|
|
|
- #[ Получение типа поля
|
2026-04-14 11:32:28 +00:00
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ variable typing],
|
|
|
|
|
|
|
|
|
|
|
|
$x : t_x ttype @x : t_x$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ reference typing],
|
|
|
|
|
|
|
|
|
|
|
|
$x tpath p$,
|
|
|
|
|
|
$x : t_x ttype p : rf mode t_p$,
|
|
|
|
|
|
$x : t_x ttype *p : t_p$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ access typing],
|
|
|
|
|
|
|
|
|
|
|
|
$x tpath p$,
|
|
|
|
|
|
$x : t_x ttype p : [t_1, ... t_n]$,
|
|
|
|
|
|
$x : t_x ttype p.i : t_i$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
2026-04-11 14:51:56 +00:00
|
|
|
|
]
|
2026-04-14 11:32:28 +00:00
|
|
|
|
|
|
|
|
|
|
- #[ Получение тега поля
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ variable typing],
|
|
|
|
|
|
|
|
|
|
|
|
$t_x = rf mode t$,
|
|
|
|
|
|
$x : t_x tmode @x -> mode$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ reference typing],
|
|
|
|
|
|
|
|
|
|
|
|
$x tpath p$,
|
|
|
|
|
|
$x : t_x tmode p : rf mode t_p$,
|
|
|
|
|
|
$x : t_x tmode *p : t_p$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ access typing],
|
|
|
|
|
|
|
|
|
|
|
|
$x tpath p$,
|
|
|
|
|
|
$x : t_x tmode p : [t_1, ... t_n]$,
|
|
|
|
|
|
$x : t_x tmode p.i : t_i$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
2026-04-11 14:51:56 +00:00
|
|
|
|
]
|
2026-04-14 11:32:28 +00:00
|
|
|
|
|
|
|
|
|
|
- #[ Получение значения поля
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ variable typing],
|
|
|
|
|
|
|
|
|
|
|
|
$x eqmu v_x tval @x eqmu v_x$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ reference typing],
|
|
|
|
|
|
|
|
|
|
|
|
$x tpath p$,
|
|
|
|
|
|
$x eqmu v_x tval p eqmu rf l$,
|
|
|
|
|
|
$x eqmu v_x tval *p eqmu mu[l]$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ access typing],
|
|
|
|
|
|
|
|
|
|
|
|
$x tpath p$,
|
|
|
|
|
|
$x eqmu v_x tmode p eqmu [v_1, ... v_n]$,
|
|
|
|
|
|
$x eqmu v_x tmode p.i eqmu v_i$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
2026-04-11 14:51:56 +00:00
|
|
|
|
]
|
2026-04-14 11:32:28 +00:00
|
|
|
|
|
|
|
|
|
|
- #[ Получение метки поля
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ variable typing],
|
|
|
|
|
|
|
|
|
|
|
|
$v_x = rf l$,
|
|
|
|
|
|
|
|
|
|
|
|
$x eqmu v_x tval p eqmu rf l$,
|
|
|
|
|
|
$x eqmu v_x tmode p arrmu l$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
2026-04-11 14:51:56 +00:00
|
|
|
|
]
|
2026-04-14 11:32:28 +00:00
|
|
|
|
|
2026-04-11 14:51:56 +00:00
|
|
|
|
- #[ Получение типа поля по окружению
|
2026-04-14 11:32:28 +00:00
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ access typing],
|
|
|
|
|
|
|
|
|
|
|
|
$x tpath p$,
|
|
|
|
|
|
$x : sigma[x].2 ttype p : t$,
|
|
|
|
|
|
$sigma tetype p : t$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
2026-04-11 14:51:56 +00:00
|
|
|
|
]
|
2026-04-14 11:32:28 +00:00
|
|
|
|
|
|
|
|
|
|
- #[ Получение тега поля по окружению
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ access typing],
|
|
|
|
|
|
|
|
|
|
|
|
$x tpath p$,
|
|
|
|
|
|
$x : sigma[x].2 tmode p -> mode$,
|
|
|
|
|
|
$sigma temode p -> mode$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
2026-04-11 14:51:56 +00:00
|
|
|
|
]
|
2026-04-14 11:32:28 +00:00
|
|
|
|
|
|
|
|
|
|
- #[ Получение значения поля по окружению
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ access typing],
|
|
|
|
|
|
|
|
|
|
|
|
$x tpath p$,
|
|
|
|
|
|
$x eqmu sigma[x].1 tval p eqmu v$,
|
|
|
|
|
|
$sigma, mu teval p eqmu x$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
2026-04-11 14:51:56 +00:00
|
|
|
|
]
|
2026-04-14 11:32:28 +00:00
|
|
|
|
|
|
|
|
|
|
- #[ Получение метки поля по окружению
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ access typing],
|
|
|
|
|
|
|
|
|
|
|
|
$x tpath p$,
|
|
|
|
|
|
$x eqmu sigma[x].1 tlabel p arrmu l$,
|
|
|
|
|
|
$sigma, mu telabel p arrmu l$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
2026-04-11 14:51:56 +00:00
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
=== Mode Correctness
|
|
|
|
|
|
|
|
|
|
|
|
Функции проверки тегов, имеют тип $mode -> #[bool]$:
|
|
|
|
|
|
|
|
|
|
|
|
#let modevar = $(r space w space c space i space o)$
|
|
|
|
|
|
|
|
|
|
|
|
$ isRead modevar = r == "Read" $
|
|
|
|
|
|
$ isAlwaysWrite modevar = w == square "Write" $
|
|
|
|
|
|
$ isPossibleWrite modevar = w == diamond "Write" || w == square "Write" $
|
|
|
|
|
|
$ isRef modevar = c == "Ref" $
|
|
|
|
|
|
$ isCopy modevar = c == "Copy" $
|
|
|
|
|
|
$ isIn modevar = i == "In" $
|
|
|
|
|
|
$ isOut modevar = o == "Out" $
|
|
|
|
|
|
|
|
|
|
|
|
Требования к тегам:
|
|
|
|
|
|
|
|
|
|
|
|
$ isOut mode -> isAlwaysWrite mode $
|
|
|
|
|
|
$ isRead mode -> isIn mode $
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: rest conditions ??
|
|
|
|
|
|
|
|
|
|
|
|
=== Eval Rules
|
|
|
|
|
|
|
|
|
|
|
|
// FIXME: make connected to syntax
|
|
|
|
|
|
*TODO*
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
#let args = `args`
|
|
|
|
|
|
|
|
|
|
|
|
#[
|
|
|
|
|
|
|
|
|
|
|
|
#let ref = `ref`
|
|
|
|
|
|
#let copy = `copy`
|
|
|
|
|
|
#let read = `read`
|
|
|
|
|
|
|
|
|
|
|
|
// #align(center, grid(
|
|
|
|
|
|
// columns: 3,
|
|
|
|
|
|
// gutter: 5%,
|
|
|
|
|
|
// align(bottom, prooftree(
|
|
|
|
|
|
// ...
|
|
|
|
|
|
// )),
|
|
|
|
|
|
// align(bottom, prooftree(
|
|
|
|
|
|
// ...
|
|
|
|
|
|
// )),
|
|
|
|
|
|
// align(bottom, prooftree(
|
|
|
|
|
|
// ...
|
|
|
|
|
|
// )),
|
|
|
|
|
|
// ))
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: introduce spep env argument ??
|
|
|
|
|
|
|
2026-04-04 13:07:15 +00:00
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
=== Correctness
|
|
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
// TODO: FIXME: well formatness for mode, extract
|
|
|
|
|
|
// TODO: FIXME: check for mode, is recursion required ??
|
|
|
|
|
|
// TODO: FIXME: check mode & access corectness in os correct
|
|
|
|
|
|
|
2026-04-04 13:07:15 +00:00
|
|
|
|
// TODO: check all requirements
|
2026-03-29 15:32:35 +00:00
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ is correct],
|
2026-04-11 13:17:15 +00:00
|
|
|
|
$isOut mode -> isAlwaysWrite mode$, // NOTE; strong requirment should write
|
|
|
|
|
|
$isRead mode -> isIn mode$,
|
2026-04-11 14:51:56 +00:00
|
|
|
|
$isPossibleWrite mode and (isOut mode or not isCopy mode) -> isAlwaysWrite pathenvmode(sigma, x)$, // NOTE: may mode => should sigma(x)
|
|
|
|
|
|
$isRead mode -> pathenvval(mu, sigma, x) != bot and pathenvval(mu, sigma, x) != X$,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
$isCorrect_(cl sigma, mu cr) (mode, x)$,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
2026-04-04 13:07:15 +00:00
|
|
|
|
=== Call Initialization
|
|
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
Отсутствующий нижний индекс ($ref$, $copy$) означает произвольный индекс.
|
2026-04-04 13:07:15 +00:00
|
|
|
|
Считается, что выбранный индекс одинаков в рамках одного правила.
|
|
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
// NOTE: no empty type
|
2026-04-03 10:05:23 +00:00
|
|
|
|
// #align(center, prooftree(
|
|
|
|
|
|
// vertical-spacing: 4pt,
|
|
|
|
|
|
// rule(
|
|
|
|
|
|
// name: [ add paths init],
|
|
|
|
|
|
|
2026-04-04 13:07:15 +00:00
|
|
|
|
// $cl sigma, mu, l cr stretch(~>)^nothing cl sigma, mu, l cr$,
|
2026-04-03 10:05:23 +00:00
|
|
|
|
// )
|
|
|
|
|
|
// ))
|
|
|
|
|
|
|
2026-04-04 13:07:15 +00:00
|
|
|
|
// #h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ add paths field by copy],
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: check that access is what required ??
|
2026-04-11 14:51:56 +00:00
|
|
|
|
$cl sigma, mu, l cr xarrowSquiggly(p : ())_copy cl pathenvmem(sigma, p) <- l, mu [l <- 0], l + 1 cr$,
|
2026-04-04 13:07:15 +00:00
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
2026-04-03 10:05:23 +00:00
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
2026-04-04 13:07:15 +00:00
|
|
|
|
// NOTE: do nothing, ref init by default
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ add paths field by reference],
|
|
|
|
|
|
|
|
|
|
|
|
$cl sigma, mu, l cr xarrowSquiggly(p : ())_ref cl sigma, mu, l cr$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ add paths ref],
|
|
|
|
|
|
$cl sigma, mu, l cr xarrowSquiggly(*p : t)_ref cl sigma', mu', l' cr$,
|
2026-04-11 13:17:15 +00:00
|
|
|
|
$isRef mode$,
|
2026-04-04 13:07:15 +00:00
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
$cl sigma, mu, l cr xarrowSquiggly(p : \& mode t) cl sigma', mu', l' cr$,
|
2026-04-04 13:07:15 +00:00
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ add paths ref],
|
|
|
|
|
|
$cl sigma, mu, l cr xarrowSquiggly(*p : t)_copy cl sigma, mu, l cr$,
|
2026-04-11 13:17:15 +00:00
|
|
|
|
$isCopy mode$,
|
2026-04-04 13:07:15 +00:00
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
$cl sigma, mu, l cr xarrowSquiggly(p : \& mode t) cl sigma', mu', l' cr$,
|
2026-04-04 13:07:15 +00:00
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ add paths tuple],
|
|
|
|
|
|
$cl sigma, mu, l cr xarrowSquiggly(p.1 : t_1) cl sigma_1, mu_1, l_1 cr$,
|
|
|
|
|
|
$...$,
|
|
|
|
|
|
$cl sigma_(n - 1), mu_(n - 1), l_(n - 1) cr xarrowSquiggly(p.n : t_n) cl sigma_n, mu_n, l_n cr$,
|
|
|
|
|
|
|
|
|
|
|
|
$cl sigma, mu, l cr xarrowSquiggly(p : [t_1, ... t_n]) cl sigma_n, mu_n, l_n cr$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ add paths funciton pointer],
|
|
|
|
|
|
|
|
|
|
|
|
$cl sigma, mu, l cr xarrowSquiggly(F_x) cl sigma, mu, l cr$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
=== Call Finalization
|
|
|
|
|
|
|
2026-03-29 15:32:35 +00:00
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ spoil init],
|
|
|
|
|
|
$mu stretch(=>)^nothing_(cl sigma, mu cr) mu$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ spoil step],
|
|
|
|
|
|
|
|
|
|
|
|
$mu stretch(=>)^args_sigma gamma$,
|
|
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
$isPossibleWrite mode$, // NOTE: weak requirement: may write
|
|
|
|
|
|
$not isCopy mode$,
|
|
|
|
|
|
$not isOut mode$,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
$isCorrect_(cl sigma, mu cr) (mode, x)$,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
// gamma - memory (as mu)
|
2026-04-11 14:51:56 +00:00
|
|
|
|
$gamma stretch(=>)^((mode, x) : args)_sigma pathenvval(gamma, sigma, x) <- bot]$
|
2026-03-29 15:32:35 +00:00
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ fix step],
|
|
|
|
|
|
|
|
|
|
|
|
$mu stretch(=>)^args_sigma gamma$,
|
|
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
$isAlwaysWrite mode$, // NOTE: strong requirement: should write
|
|
|
|
|
|
$isOut mode$,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
$isCorrect_(cl sigma, mu cr) (mode, x)$,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
// gamma - memory (as mu)
|
2026-04-11 14:51:56 +00:00
|
|
|
|
$gamma stretch(=>)^((mode, x) : args)_sigma pathenvval(gamma, sigma, x) <- 0]$
|
2026-03-29 15:32:35 +00:00
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ skip step],
|
|
|
|
|
|
|
|
|
|
|
|
$mu stretch(=>)^args_sigma gamma$,
|
|
|
|
|
|
|
|
|
|
|
|
$not "spoil step"$,
|
|
|
|
|
|
$not "fix step"$,
|
|
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
$isCorrect_(cl sigma, mu cr) (mode, x)$,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
// mu
|
2026-04-11 13:17:15 +00:00
|
|
|
|
$gamma stretch(=>)^((mode, x) : args)_sigma gamma$
|
2026-03-29 15:32:35 +00:00
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
2026-04-04 13:07:15 +00:00
|
|
|
|
=== Function Evaluation
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
2026-04-04 13:07:15 +00:00
|
|
|
|
name: [ $(lambda a : t. d) m$],
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
2026-04-04 13:07:15 +00:00
|
|
|
|
// TODO: verify that type of m is t ??
|
|
|
|
|
|
|
|
|
|
|
|
$cl sigma [a <- (m, t)], mu, l cr
|
|
|
|
|
|
xarrowSquiggly(t)
|
|
|
|
|
|
cl sigma', mu', l' cr$,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
$cl sigma', mu', l' cr
|
|
|
|
|
|
xarrowDashed(d space @ space overline(y))
|
|
|
|
|
|
cl sigma'', mu'', l'' cr$,
|
|
|
|
|
|
|
2026-04-11 13:17:15 +00:00
|
|
|
|
$isRead mode$,
|
|
|
|
|
|
$not isCopy mode$,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
// NOTE: correctness checked in CALL f
|
|
|
|
|
|
|
|
|
|
|
|
$cl sigma, mu, l cr
|
|
|
|
|
|
xarrowDashed((lambda a. d) space @ space x space overline(y))
|
|
|
|
|
|
cl sigma'', mu'', l'' cr$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [decl body],
|
|
|
|
|
|
|
|
|
|
|
|
$cl sigma, mu, l cr
|
|
|
|
|
|
attach(stretch(->)^overline(s), tr: *)
|
|
|
|
|
|
cl sigma', mu', l' cr$,
|
|
|
|
|
|
|
|
|
|
|
|
$d = overline(s)$,
|
|
|
|
|
|
|
|
|
|
|
|
$cl sigma, mu, l cr
|
|
|
|
|
|
xarrowDashed(d space @)
|
|
|
|
|
|
cl sigma', mu', l' cr$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
2026-04-04 13:07:15 +00:00
|
|
|
|
=== Statement Evaluation
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ CALL $f space overline(x)$],
|
|
|
|
|
|
|
|
|
|
|
|
$cl [], mu, l cr
|
|
|
|
|
|
xarrowDashed(d space @ space overline(x))
|
|
|
|
|
|
cl sigma', mu', l' cr$,
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: FIXME define args in some way
|
|
|
|
|
|
$mu attach(stretch(=>)^args_sigma, tr: *) gamma$,
|
|
|
|
|
|
|
|
|
|
|
|
$DD(f) := d$,
|
|
|
|
|
|
|
|
|
|
|
|
$cl sigma, mu, l cr
|
|
|
|
|
|
xarrow("CALL" f space overline(x))
|
|
|
|
|
|
cl sigma, gamma, l cr$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ CALL_LAM $y space overline(x)$],
|
|
|
|
|
|
|
2026-04-11 14:51:56 +00:00
|
|
|
|
$pathenvtype(sigma, y) = F_f$,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
$cl sigma, mu, l cr
|
|
|
|
|
|
xarrow("CALL" f space overline(x))
|
|
|
|
|
|
cl sigma, gamma, l cr$,
|
|
|
|
|
|
|
|
|
|
|
|
$cl sigma, mu, l cr
|
|
|
|
|
|
xarrow("CALL_LAM" y space overline(x))
|
|
|
|
|
|
cl sigma, gamma, l cr$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ READ $x$],
|
|
|
|
|
|
|
2026-04-11 14:51:56 +00:00
|
|
|
|
$pathenvval(mu, sigma, x) != bot$,
|
|
|
|
|
|
$pathenvval(mu, sigma, x) != X$,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
$cl sigma, mu, l cr
|
|
|
|
|
|
xarrow("READ" x)
|
|
|
|
|
|
cl sigma, mu, l cr$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ WRITE $x$],
|
|
|
|
|
|
|
2026-04-04 13:07:15 +00:00
|
|
|
|
$isPossibleWrite sigma(x)$,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
$cl sigma, mu, l cr
|
|
|
|
|
|
xarrow("WRITE" x)
|
2026-04-11 14:51:56 +00:00
|
|
|
|
cl sigma, pathenvval(mu, sigma, x) <- 0, l cr$,
|
2026-03-29 15:32:35 +00:00
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
|
|
|
|
|
#let combine = `combine`
|
|
|
|
|
|
|
|
|
|
|
|
#align(center, prooftree(
|
|
|
|
|
|
vertical-spacing: 4pt,
|
|
|
|
|
|
rule(
|
|
|
|
|
|
name: [ CHOICE $overline(s)$ $overline(t)$],
|
|
|
|
|
|
|
|
|
|
|
|
$cl sigma, mu, l cr
|
|
|
|
|
|
attach(stretch(->)^overline(s), tr: *)
|
|
|
|
|
|
cl sigma_s, mu_s, l_s cr$,
|
|
|
|
|
|
|
|
|
|
|
|
$cl sigma, mu, l cr
|
|
|
|
|
|
attach(stretch(->)^overline(t), tr: *)
|
|
|
|
|
|
cl sigma_t, mu_t, l_t cr$,
|
|
|
|
|
|
|
|
|
|
|
|
$l_t = l_s$,
|
|
|
|
|
|
$sigma_s = sigma_t$,
|
|
|
|
|
|
|
|
|
|
|
|
// TODO changes ?? two ways ??
|
|
|
|
|
|
$cl sigma, mu, l cr
|
|
|
|
|
|
xarrow("CHOICE" overline(s) space overline(t))
|
|
|
|
|
|
cl sigma, combine(mu_s, mu_t), l cr$,
|
|
|
|
|
|
)
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
#h(10pt)
|
|
|
|
|
|
|
2026-04-04 13:07:15 +00:00
|
|
|
|
=== Combination
|
|
|
|
|
|
|
2026-03-29 15:32:35 +00:00
|
|
|
|
$ combine(mu_1, mu_2)[i] = combine_e (mu_1[i], mu_2[i]) $
|
|
|
|
|
|
$ combine_e (bot, bot) = bot $
|
|
|
|
|
|
$ combine_e (0, 0) = 0 $
|
|
|
|
|
|
$ combine_e (\_, \_) = X $
|
|
|
|
|
|
|
|
|
|
|
|
]
|