Alexander Gryzlov,
IMDEA Software Institute
Celonis, Madrid, 19/10/2022
.LBB2_1:
cmp qword ptr [rbp - 32], 0
je .LBB2_3
mov rax, qword ptr [rbp - 32]
mov rax, qword ptr [rax + 8]
mov qword ptr [rbp - 16], rax
mov rcx, qword ptr [rbp - 24]
mov rax, qword ptr [rbp - 32]
mov qword ptr [rax + 8], rcx
mov rax, qword ptr [rbp - 32]
mov qword ptr [rbp - 24], rax
mov rax, qword ptr [rbp - 16]
mov qword ptr [rbp - 32], rax
jmp .LBB2_1
reverse :=
list A := nil
| :: of A & list A
rev nil = nil
rev x::xs = rev xs ++ x::nil
{is_list i l}
reverse
{is_list done (rev l)}
input to a program = string in a new language
the program itself = its interpreter
Language-Oriented Programming
Lin et al., Journal of Biological Engineering (2018)
"Synthesis of control unit for future biocomputer"
e.g., this paper from 2019 suggests 150+ papers could have wrong results:
"The error is the result of a simple file sorting problem. On operating systems without default file name sorting, the script fails to match the files containing a conformer’s free energy with its chemical shift – leading to an overall wrong value."
list A := nil
| :: of A & list A
rev nil = nil
rev x::xs = rev xs ++ x::nil
def rev[A] : List[A] => List[A] = {
case Nil => Nil
case (x::xs) => rev(xs) ++ List(x)
}
FP is executable specs:
cause => effect[result]
Applicatives
def pure[A](a: A): F[A] def apply[A, B](f: F[A => B]): F[A] => F[B]
Arrow[F[_, _]]
def lift[A,B](f: A => B): F[A,B]
def dimap[A,B,C,D](fab: F[A,B])
(f: C=>A)(g: B=>D): F[C,D]
def second[A,B,C]
(fa: F[A,B]): F[(C,A),(C,B)]
def split[A,B,C,D]
(f: F[A,B], g: F[C,D]): F[(A,C),(B,D)]
Capucci, Gavranovic, Hedges, Rischel [2021]
"Towards foundations of categorical cybernetics"