Presburger Arithmetic and Its Use in Verification
Presburger Arithmetic and Its Use in Verification
Presburger Arithmetic and Its Use in Verification
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
APPENDIX B. SOURCE CODE OF EXPERIMENTS<br />
// Calculate lcm of a list of positive <strong>in</strong>teger.<br />
// Rewrite to use tail recursion.<br />
let lcms ls =<br />
let rec recLcms ls res =<br />
match ls with<br />
|[]−> res<br />
| l::ls’ −> recLcms ls’ (lcm(res, abs(l)))<br />
recLcms ls 1<br />
let lcma ls =<br />
Array.fold(fun acc l −> lcm(abs(l), acc)) 1 ls<br />
72