Proof-oriented Programming in F*

19 points by nextos


osa1

For a PL verification task (e.g. type system soundness) how do I choose betweek: Rocq, Lean, F*, ...?

I know what to look for in a PL, but I last time I did verification was a decade ago and I'd just picked Coq at the time as it had the resources (Software Foundations), and I have no idea what to look for in a proof assistant to use for PL verification.

rtpg
val max (x:int) (y:int) : int
let max x y = if x >= y then x else y

val max1 (x:int) (y:int)
  : z:int{ z >= x && z >= y && (z = x || z = y)}
let max1 x y = if x >= y then x else y

let max2 (x:int) (y:int)
  : z:int{ z = max x y }
  = if x > y
    then x
    else y

^ these refinement types are very neat.

It is a bit hard to deal with "SMT couldn't solve this"-style errors... would kinda hope that at least for simple stuff it would be able to spit out a counterexample in those cases. I wonder if it would be easy to wire up the SMT solver to go the other direction in those scenarios and attempt the counterexample

nextos

Also available as PDF, for those interested:

https://fstar-lang.org/tutorial/proof-oriented-programming-in-fstar.pdf