Skip to content

Instantly share code, notes, and snippets.

View kmicinski's full-sized avatar

Kristopher Micinski kmicinski

View GitHub Profile
#lang racket
;; PRACTICE Midterm 1 solutions
;; Part (a)
(define (mul-list l k)
(if (empty? l)
'()
(cons (* (first l) k) (mul-list (rest l) k))))
#lang racket
;; Some example λ calculus terms in Racket
;; ID (identity) applied to ID
;; ((λ (x) x) (λ (x) x))
;; can't run this, y is free--but I can still β reduce it
;;((λ (x) y) (λ (z) y))
;; ⟶β y <-- error, in Racket, because we don't know what y is
;; CIS352 -- Feb 27, 2023
;; Definitional interpreters for Scheme (warmup to e3)
#lang racket
(define (expr? e)
(match e
[(? number? n) #t]
[`(+ ,(? expr? e0) ,(? expr? e1)) #t]
[(? symbol? x) #t]
;; (let ([x (+ y z)]) x)
;; Exercise 2
;; CIS 352 -- Spring 2024
#lang racket
(provide (all-defined-out))
;;
;; Maps
;;
;; Exercise 2
;; CIS 352 -- Spring 2024
#lang racket
(provide (all-defined-out))
;;
;; Maps
;;
#lang racket
;; (list-ref '(1 2 3) 0) => 1
;; (list-ref '(1 2 3) 1) => 2
;; (list-ref '(1 2 3) 2) => 3
;; assume i < (length l)
(define (list-ref l i)
(if (equal? i 0)
(first l)
;; should be a call to (list-ref (cdr l) ...)
#lang racket
(define l '(2 7 1))
(define l0 (cons 2 (cons 7 (cons 1 '()))))
(define (sum-list-of-length-3 l)
(define x0 (first l))
(define x1 (second l))
(define x2 (third l))
(+ x0 x1 x2))
Notes for our 2PM reading group tomorrow. (Also CCing Darshana and Oliver, two DB collaborators of mine from UBuffalo) Very off-the-cuff thoughts here. I read this paper a few weeks ago and finally went through it again this afternoon to write up my thoughts.
Wow, very interesting paper. I am excited to discuss this. My highest level thoughts are that the restriction to circuits is doing a lot of the heavy lifting here, the authors say they are working on a compiler but it's not obvious to me that this won't hamper incrmentality in practice. Especially as you write richer programs that need to mix various data structures with varying concerns and space/materialization trade-offs.
PAPER TITLE: "DBSP: Automatic Incremental View Maintenance for Rich Query Languages"
SUMMARY
This paper presents a new approach to providing incremental view maintenance as a Rust library to a user. The high-level idea of incrementalization is being able to write programs that automatically work in terms of deltas--instead of ha
-- ------ u
-- P
-- ------ ∧I ------- k
-- P × P R
-- ------------- ∨I2 ------- ∨I₁
-- (R ⊎ (P × P)) (R ⊎ (P × P))
-- k ---------- -------------------------------
-- (P ⊎ R) (R ⊎ (P × P))
-- ∨Eᵘᵐ ----------------------------------
-- (R ⊎ (P × P))
module foo where
open import Relation.Nullary
open import Data.Sum.Base
import Data.String as String
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; cong; sym)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; step-≡; _∎)
open import Data.Nat using (ℕ; zero; suc; _+_; _*_; _∸_;_^_)
data _≤_ : ℕ → ℕ → Set where