Skip to content

Instantly share code, notes, and snippets.

View tchomphoochan's full-sized avatar

Thanadol (Pleng) Chomphoochan tchomphoochan

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tchomphoochan on github.
  • I am tcpc (https://keybase.io/tcpc) on keybase.
  • I have a public key whose fingerprint is FAD6 4375 6D8E E9D9 E4A8 595C 5A05 4AC1 4D33 3C67

To claim this, I am signing this object:

Require Import List Lia Arith.
Import ListNotations.
Fixpoint prefix_sum (l : list nat) :=
match l with
| nil => nil
| cons d l' => cons d (map (fun x => x+d) (prefix_sum l'))
end.
Goal prefix_sum [3; 2; 7; 6; 8] = [3; 5; 12; 18; 26].