sbv-13.1: SMT Based Verification: Symbolic Haskell theorem prover using SMT solving.
Copyright(c) Levent Erkok
LicenseBSD3
Maintainererkokl@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Documentation.SBV.Examples.Misc.LambdaArray

Description

Demonstrates how lambda-abstractions can be used to model arrays.

Synopsis

Documentation

memset :: SArray Integer Integer -> SInteger -> SInteger -> SInteger -> SArray Integer Integer Source #

Given an array, and bounds on it, initialize it within the bounds to the element given. Otherwise, leave it untouched.

memsetExample :: IO ThmResult Source #

Prove a simple property: If we read from the initialized region, we get the initial value. We have:

>>> memsetExample Q.E.D. 

outOfInit :: IO SatResult Source #

Get an example of reading a value out of range. The value returned should be out-of-range for lo/hi

>>> outOfInit Satisfiable. Model: mem = ([], 1) :: Array Integer Integer lo = 0 :: Integer hi = 0 :: Integer zero = 0 :: Integer idx = 1 :: Integer Read = 1 :: Integer