mirror of
https://github.com/ProgramSnail/pass_strategy_synthesis.git
synced 2026-04-28 08:52:08 +00:00
control flow semantics draft
This commit is contained in:
parent
9b9c6927cf
commit
869bffb0df
1 changed files with 22 additions and 12 deletions
|
|
@ -7,9 +7,7 @@
|
||||||
|
|
||||||
= Формальная модель используемого языка
|
= Формальная модель используемого языка
|
||||||
|
|
||||||
*TODO: добавить лямбды, control flow, локальные переменные в каком-то виде*
|
*TODO: проверить, что всё нужное добавлено*
|
||||||
|
|
||||||
*TODO: проблемы с добавлением if в будущем: как записать write and not write ?*
|
|
||||||
|
|
||||||
Нужно будет добавить во write-flag модальности: `not write` | `may write` | `always write`
|
Нужно будет добавить во write-flag модальности: `not write` | `may write` | `always write`
|
||||||
|
|
||||||
|
|
@ -69,8 +67,9 @@
|
||||||
Prod(
|
Prod(
|
||||||
`value`,
|
`value`,
|
||||||
{
|
{
|
||||||
Or[$0$][cell with some value]
|
Or[$0$][cell with some value (always)]
|
||||||
Or[$bot$][spoiled cell]
|
Or[$X$][cell with possible value or $bot$]
|
||||||
|
Or[$bot$][spoiled cell (always)]
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
// Prod(
|
// Prod(
|
||||||
|
|
@ -387,7 +386,8 @@ $d space @ space overline(x)$ - запись применения функции
|
||||||
rule(
|
rule(
|
||||||
name: [ READ $x$],
|
name: [ READ $x$],
|
||||||
|
|
||||||
$mu(sigma(x)) != bot$,
|
$mu[sigma(x)] != bot$,
|
||||||
|
$mu[sigma(x)] != X$,
|
||||||
|
|
||||||
$cl sigma, mu, l cr
|
$cl sigma, mu, l cr
|
||||||
xarrow("READ" x)
|
xarrow("READ" x)
|
||||||
|
|
@ -412,8 +412,8 @@ $d space @ space overline(x)$ - запись применения функции
|
||||||
|
|
||||||
#h(10pt)
|
#h(10pt)
|
||||||
|
|
||||||
// TODO: FIXME
|
#let combine = `combine`
|
||||||
// TODO: anyway choice is actually on the top level ??
|
|
||||||
#align(center, prooftree(
|
#align(center, prooftree(
|
||||||
vertical-spacing: 4pt,
|
vertical-spacing: 4pt,
|
||||||
rule(
|
rule(
|
||||||
|
|
@ -421,17 +421,27 @@ $d space @ space overline(x)$ - запись применения функции
|
||||||
|
|
||||||
$cl sigma, mu, l cr
|
$cl sigma, mu, l cr
|
||||||
attach(stretch(->)^overline(s), tr: *)
|
attach(stretch(->)^overline(s), tr: *)
|
||||||
cl sigma_s, gamma_s, l_s cr$,
|
cl sigma_s, mu_s, l_s cr$,
|
||||||
|
|
||||||
$cl sigma, mu, l cr
|
$cl sigma, mu, l cr
|
||||||
attach(stretch(->)^overline(t), tr: *)
|
attach(stretch(->)^overline(t), tr: *)
|
||||||
cl sigma_t, gamma_t, l_t cr$,
|
cl sigma_t, mu_t, l_t cr$,
|
||||||
|
|
||||||
|
$l_t = l_s$,
|
||||||
|
$sigma_s = sigma_t$,
|
||||||
|
|
||||||
// TODO changes ?? two ways ??
|
// TODO changes ?? two ways ??
|
||||||
$cl sigma, mu, l cr
|
$cl sigma, mu, l cr
|
||||||
xarrow("CHOICE" overline(s) overline(t))
|
xarrow("CHOICE" overline(s) space overline(t))
|
||||||
cl sigma, mu, l cr$,
|
cl sigma, combine(mu_s, mu_t), l cr$,
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
#h(10pt)
|
||||||
|
|
||||||
|
$ 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 $
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue