@@ -961,6 +961,8 @@ applyUnintApp sym app0 v =
961
961
VCtorApp i ps xv -> foldM (applyUnintApp sym) app' =<< traverse force (ps++ xv)
962
962
where app' = suffixUnintApp (" _" ++ (Text. unpack (identBaseName (primName i)))) app0
963
963
VNat n -> return (suffixUnintApp (" _" ++ show n) app0)
964
+ VBVToNat w v' -> applyUnintApp sym app' v'
965
+ where app' = suffixUnintApp (" _" ++ show w) app0
964
966
TValue (suffixTValue -> Just s)
965
967
-> return (suffixUnintApp s app0)
966
968
VFun _ _ ->
@@ -1399,6 +1401,7 @@ data ArgTerm
1399
1401
-- ^ length, element type, list, index
1400
1402
| ArgTermPairLeft ArgTerm
1401
1403
| ArgTermPairRight ArgTerm
1404
+ | ArgTermBVToNat Natural ArgTerm
1402
1405
1403
1406
-- | Reassemble a saw-core term from an 'ArgTerm' and a list of parts.
1404
1407
-- The length of the list should be equal to the number of
@@ -1468,6 +1471,10 @@ reconstructArgTerm atrm sc ts =
1468
1471
do (x1, ts1) <- parse at1 ts0
1469
1472
x <- scPairRight sc x1
1470
1473
return (x, ts1)
1474
+ ArgTermBVToNat w at1 ->
1475
+ do (x1, ts1) <- parse at1 ts0
1476
+ x <- scBvToNat sc w x1
1477
+ pure (x, ts1)
1471
1478
1472
1479
parseList :: [ArgTerm ] -> [Term ] -> IO ([Term ], [Term ])
1473
1480
parseList [] ts0 = return ([] , ts0)
@@ -1519,6 +1526,15 @@ mkArgTerm sc ty val =
1519
1526
do x <- termOfTValue sc tval
1520
1527
pure (ArgTermConst x)
1521
1528
1529
+ (_, VNat n) ->
1530
+ do x <- scNat sc n
1531
+ pure (ArgTermConst x)
1532
+
1533
+ (_, VBVToNat w v) ->
1534
+ do let w' = fromIntegral w -- FIXME: make w :: Natural to avoid fromIntegral
1535
+ x <- mkArgTerm sc (VVecType w' VBoolType ) v
1536
+ pure (ArgTermBVToNat w' x)
1537
+
1522
1538
_ -> fail $ " could not create uninterpreted function argument of type " ++ show ty
1523
1539
1524
1540
termOfTValue :: SharedContext -> TValue (What4 sym ) -> IO Term
0 commit comments