Skip to content

Commit ff5aecf

Browse files
strakeIagoAbal
authored andcommitted
finite domain sorts
1 parent 3ec14bc commit ff5aecf

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/Z3/Base.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ module Z3.Base (
105105
, mkIntSort
106106
, mkRealSort
107107
, mkBvSort
108+
, mkFiniteDomainSort
108109
, mkArraySort
109110
, mkTupleSort
110111
, mkConstructor
@@ -743,7 +744,9 @@ mkBvSort c i
743744
| i >= 0 = liftFun1 z3_mk_bv_sort c i
744745
| otherwise = error "Z3.Base.mkBvSort: negative size"
745746

746-
-- TODO: Z3_mk_finite_domain_sort
747+
-- | Create a finite-domain type.
748+
mkFiniteDomainSort :: Context -> Symbol -> Word64 -> IO Sort
749+
mkFiniteDomainSort = liftFun2 z3_mk_finite_domain_sort
747750

748751
-- | Create an array type
749752
--

src/Z3/Base/C.hsc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ foreign import ccall unsafe "Z3_mk_int_sort"
243243
foreign import ccall unsafe "Z3_mk_real_sort"
244244
z3_mk_real_sort :: Ptr Z3_context -> IO (Ptr Z3_sort)
245245

246+
-- | Reference: <http://z3prover.github.io/api/html/group__capi.html#ga62166c0e3f9a8be4ba492eee5a52ce1b>
247+
foreign import ccall unsafe "Z3_mk_finite_domain_sort"
248+
z3_mk_finite_domain_sort :: Ptr Z3_context -> Ptr Z3_symbol -> CULLong -> IO (Ptr Z3_sort)
249+
246250
-- | Reference: <http://z3prover.github.io/api/html/group__capi.html#gaeed000a1bbb84b6ca6fdaac6cf0c1688>
247251
foreign import ccall unsafe "Z3_mk_bv_sort"
248252
z3_mk_bv_sort :: Ptr Z3_context -> CUInt -> IO (Ptr Z3_sort)

src/Z3/Monad.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ module Z3.Monad
6464
, mkIntSort
6565
, mkRealSort
6666
, mkBvSort
67+
, mkFiniteDomainSort
6768
, mkArraySort
6869
, mkTupleSort
6970
, mkConstructor
@@ -657,6 +658,10 @@ mkRealSort = liftScalar Base.mkRealSort
657658
mkBvSort :: MonadZ3 z3 => Int -> z3 Sort
658659
mkBvSort = liftFun1 Base.mkBvSort
659660

661+
-- | Create a finite-domain type.
662+
mkFiniteDomainSort :: MonadZ3 z3 => Symbol -> Word64 -> z3 Sort
663+
mkFiniteDomainSort = liftFun2 Base.mkFiniteDomainSort
664+
660665
-- | Create an array type
661666
--
662667
-- Reference: <http://research.microsoft.com/en-us/um/redmond/projects/z3/group__capi.html#gafe617994cce1b516f46128e448c84445>

0 commit comments

Comments
 (0)