Skip to content

Commit be2d761

Browse files
chamecoandreistefanescu
authored andcommitted
Small fix to reflect recent Cryptol changes (#9)
1 parent 95e9cfe commit be2d761

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Verifier/SAW/Cryptol.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ exportValue ty v = case ty of
12271227

12281228
-- records
12291229
TV.TVRec fields ->
1230-
V.VRecord (exportRecordValue (Map.assocs (Map.fromList fields)) v)
1230+
V.VRecord (Map.fromList $ exportRecordValue (Map.assocs (Map.fromList fields)) v)
12311231

12321232
-- functions
12331233
TV.TVFun _aty _bty ->
@@ -1276,7 +1276,7 @@ exportFirstOrderValue fv =
12761276
| otherwise -> V.VSeq len (V.finiteSeqMap (map (V.ready . exportFirstOrderValue) vs))
12771277
where len = toInteger (length vs)
12781278
FOVTuple vs -> V.VTuple (map (V.ready . exportFirstOrderValue) vs)
1279-
FOVRec vm -> V.VRecord [ (C.packIdent n, V.ready $ exportFirstOrderValue v) | (n, v) <- Map.assocs vm ]
1279+
FOVRec vm -> V.VRecord $ Map.fromList [ (C.packIdent n, V.ready $ exportFirstOrderValue v) | (n, v) <- Map.assocs vm ]
12801280

12811281
importFirstOrderValue :: FirstOrderType -> V.Value -> IO FirstOrderValue
12821282
importFirstOrderValue t0 v0 = V.runEval (V.EvalOpts C.quietLogger V.defaultPPOpts) (go t0 v0)
@@ -1289,7 +1289,7 @@ importFirstOrderValue t0 v0 = V.runEval (V.EvalOpts C.quietLogger V.defaultPPOpt
12891289
(FOTVec _ ty , V.VSeq len xs) -> FOVVec ty <$> traverse (go ty =<<) (V.enumerateSeqMap len xs)
12901290
(FOTTuple tys , V.VTuple xs) -> FOVTuple <$> traverse (\(ty, x) -> go ty =<< x) (zip tys xs)
12911291
(FOTRec fs , V.VRecord xs) ->
1292-
do xs' <- Map.fromList <$> mapM importField xs
1292+
do xs' <- Map.fromList <$> mapM importField (Map.assocs xs)
12931293
let missing = Set.difference (Map.keysSet fs) (Map.keysSet xs')
12941294
unless (Set.null missing)
12951295
(fail $ unwords $ ["Missing fields while importing finite value:"] ++ Set.toList missing)

0 commit comments

Comments
 (0)