|
|
|
|
|
by antonvs
7 days ago
|
|
You can quite easily implement static proofs for cases like the example in your second paragraph, using any language with a good enough type system. I vibe-coded a quick demo for that example (as I understand it), using Haskell because it makes such types easy and concise to prototype. Here it is: https://privatebin.net/?e19355429d608268#6vnv5LgavBnpM8NEfk7... (link will expire in a couple of days.) This uses phantom types (type parameters that aren't associated with values) like `Human` and `Agent`, as well as using GADTs, but that just makes for a clean/concise example - neither of those features are essential for something like this. You could implement it in say, Go or Java, it would just be a little noisier. It really isn't necessary to jump to Lean, and all the extra work that that entails (including linking to the actual code), to statically enforce such properties. This is an example of what Yaron Misky described around 2010 as "make illegal states unrepresentable", or really even what Robin Milner described in 1978 as "well-typed programs don't go wrong", although the latter assumes that "well-typed" means that the program's types match its specified constraints. |
|
The Lean theorem is that in the model, no sequence of operations, by anyone, ever yields a chain from an agent to a valid person. That's an induction over every possible history, which a type checker doesn't do.
It's been invaluable for us. It lets us think in a structured way and explore scenarios without writing all the code. It found design flaws before any code existed, and it lets us prove that things must be possible, not only forbidden.
I believe this kind of approach is going to be critical in security thinking (I think AWS's Cedar is doing more or less the same).