summaryrefslogtreecommitdiffstats
path: root/content/zettel/3c3g5.md
blob: 33f352326d163450ce0c04d6a9fa8952541c5b2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
+++
title = "Update function for operators"
author = "Yann Herklotz"
tags = []
categories = []
backlinks = ["3c3g4"]
forwardlinks = ["3c3g6"]
zettelid = "3c3g5"
+++

Updating an existing abstract tree with an operation, which has the
following syntax $i =$ `Iop` $p$ $\mathit{op}$ $\vec{r}$ $d$, can then
be implemented as follows, where `Eop` $\mathit{op}$ $\vec{r}$ is the
equivalent abstract expression used in the abstract language. This is
done by using the following update function.

$$ \upsilon (f, i) \equiv f \# d \leftarrow (f \# d) \oplus_{p} ((\top,\texttt{Eop } \mathit{op}) \otimes_f (\texttt{fold} \otimes_l (f\ \#\#\\vec{r})\ (\top, []))) $$

This update function $\upsilon$ will update the correct node in the
abstract evaluation tree with the correct symbolic value, which is a
combination of the original symbolic value and the next.