------------------------------------------------------------------------

valueToSC ::
  Sym ->
  W4.ProgramLoc ->
  OverrideFailureReason CJ.JVM ->
  Cryptol.TValue ->
  JVMVal ->
  OverrideMatcher CJ.JVM w Term
valueToSC sym _ _ Cryptol.TVBit (IVal x) =
  do b <- liftIO $ W4.bvIsNonzero sym x
      -- TODO: assert that x is 0 or 1
     st <- liftIO (sawCoreState sym)
     liftIO (toSC sym st b)
valueToSC ::
  Sym ->
  W4.ProgramLoc ->
  OverrideFailureReason CJ.JVM ->
  Cryptol.TValue ->
  JVMVal ->
  OverrideMatcher CJ.JVM w Term
valueToSC sym _ _ Cryptol.TVBit (IVal x) =
  do b <- liftIO $ W4.bvIsNonzero sym x
      -- TODO: assert that x is 0 or 1
     st <- liftIO (sawCoreState sym)
     liftIO (toSC sym st b)
valueToSC sym _ _ Cryptol.TVBit (IVal x) =
  do b <- liftIO $ W4.bvIsNonzero sym x
      -- TODO: assert that x is 0 or 1
     st <- liftIO (sawCoreState sym)
     liftIO (toSC sym st b)