fib
fib
in the logicfib
is terminating.
You can write fib
in the refinements.
The logic does not know the definition of fib
for all inputs (for decidable checking), but ...
... calling fib i
in Haskell unfolds the definition of fib
on i
in the logic.
fib
Q: Can you prove fib 2 == 1
?
fibEq
look like a proofUsing operators from Equational
Using operators from Equational
fib
is increasing
fib
is monotonicQ: Can you fix the proof?
Q: Can you generalize for every increasing function?
fib
is monotonic!
Liquid Haskell allows theorem proving within Haskell about Haskell functions!
Theorems are refinement types and
proofs are just Haskell functions!
Application: Verification of MapReduce