aboutsummaryrefslogtreecommitdiff
path: root/org/What I've Learned About Formal Methods In Half a Year/outline.org
blob: 255ad05534b1635487587bae75d0fd81f0d4bc03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
* Outline
** Introduction
- Where are you in school right now?
  - CSCI 1951X last semester
  - CSCI 1710 now
  - Doing research on formal methods with Shriram Krishnamurti, Rob Lewis, and Nikos Vasilakis
- What are formal methods and why are the classes you took considered "formal methods classes".
** Preliminaries
*** What are specifications?
** Lightweight formal methods: SAT/SMT solvers like Alloy
https://people.csail.mit.edu/dnj/publications/alloy-journal.pdf
*** What makes these methods "lightweight"?
*** What are they, in principle?
*** Forge versus Alloy
*** How do they work?
*** Application: Memory Management
*** Margrave
http://www.margrave-tool.org/
** Heavyweight formal methods: specification and theorem proving
*** Specification
*** Programming Language Semantics
**** Big-Step
**** Small-Step
**** Denotational
*** Theorem Proving
**** Lean
**** Coq
*** Refinement
*** Application: Proving the Correctness of a Scheme Program
"what I did for the final project was somewhat natural, so we'll dive into that and then explain how it's similar to refinement"
**** Parsing Lisp
**** Modeling Scheme
**** A Type-Theoretic Representation for Programs
**** A Type-Theoretic Representation for Programs
**** A (Sketch of a) Realized Interpreter
**** A Proof of Correctness for Factorial
** What I hope to learn, eventually
While I feel I'm leaving with a good understanding of the underlying concepts..

Ultimately, I'd like to bring what I learn back to work. There's a big push for [[https://inl.gov/digital-engineering/][digital engineering]] where I sit.

And I think there are a few specific tools that would be especially useful in my line of work.
*** TLA+
*** EasyCrypt
*** VerifPal
Christine described it as the "one with an anime mascot" once.
** Conclusion
** Appendix: Tooling on Gentoo
*** Forge

I didn't bother packaging it. I just use =raco= to update.

I use =alloy-mode=, which is pretty broken, but sufficient for my needs.

#+BEGIN_SRC elisp
(use-package alloy-mode
  :straight (alloy-mode :type git :host github :repo "torus/alloy-mode"
                        :fork (:host github :repo "dwwmmn/alloy-mode"))
  ;; For some reason, `alloy-mode' indents with tabs of width 3. Let's change
  ;; that to something more sensical.
  :init
  (setq alloy-basic-offset 4)
  :hook
  (alloy-mode-hook . (lambda () (setq indent-tabs-mode nil)))
  ;; Use alloy-mode for Forge files as well.
  :config
  (add-to-list 'auto-mode-alist '("\\.frg\\'" . alloy-mode)))
#+END_SRC

*** Lean

Lean 3 is packaged in Gentoo and =lean-mode= works out of the box, but my experience has been that Lean 4 is way better.

**** =lean4-mode=

This probably also works out of the box but I hate =lsp-mode=, so I hacked together some code to get a functional goal buffer.

# TODO

I hear that [[https://proofgeneral.github.io/][Proof General]] might be getting Lean support soon, and I'm 50/50 on whether or not I'd switch. It's a very nice interface to Coq, but I think my fingers might get an extra year or two of life if I don't have to =C-c C-.= every time I want to update the goal buffer

**** ebuild

© 2015 - 2026 Jakob L. Kreuze