From c029028b6e7f65e5d6c3deb1429632e554591bbf Mon Sep 17 00:00:00 2001 From: "Tomoya Matsuura(MacBookPro)" Date: Mon, 28 Aug 2023 01:16:27 +0900 Subject: [PATCH] [obsidian] vault backup: 2023-08-28 01:16:27 --- ...g of digital signal processing algorithms.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/content/The w-calculus a synchronous framework for the verified modelling of digital signal processing algorithms.md b/content/The w-calculus a synchronous framework for the verified modelling of digital signal processing algorithms.md index 629edcd5..392bdcae 100644 --- a/content/The w-calculus a synchronous framework for the verified modelling of digital signal processing algorithms.md +++ b/content/The w-calculus a synchronous framework for the verified modelling of digital signal processing algorithms.md @@ -101,10 +101,12 @@ let rec imachine : expr → env → value = fun ptr → imachine e (ptr :: env) | App (p,ef,ea) → let va = imachine ea env in - shift_one heap ptr va; imachine ef env ptr + shift_one heap ptr va; + imachine ef env ptr | Feed (ptr,e) → let v = imachine e (ptr::env) in - shift_one heap ptr v; v + shift_one heap ptr v; + v |... let rec repeat : int → (unit → 'a) → 'a = @@ -116,6 +118,17 @@ let rec repeat : int → (unit → 'a) → 'a = let eval e env n = repeat n (fun () → imachine e env) ``` +これAppの引数は`p`じゃなくて`ptr`だよな + +```ocaml:10-13 + | App (p,ef,ea) → + let va = imachine ea env in + shift_one heap ptr va; + imachine ef env ptr +``` + +これ、Rustで改めて簡単に実装してみて思ったけど、heapの中のデータ構造がどうなってるか(初めにどうやってどのサイズのヒープを確保すべきか)が一番重要なのにそこに触れられていないのでは、、、 + #### C:[[MetaOCaml]]での多段階インタプリタ ```ocaml