Permalink
Browse files

renaming of arguments.

  • Loading branch information...
1 parent c6516f6 commit d0f1549445544c4788d924981b69dcbb4108d84b @leepike committed Feb 21, 2013
View
@@ -73,7 +73,7 @@ divTest = smartCheck args prop_div
-- { maxSuccess = 1000
-- , maxSize = 20 }
, format = PrintString
- , extrap = True
+ , runForall = True
}
-- Get the minimal offending sub-value.
View
@@ -65,7 +65,7 @@ prop_p :: B -> Property
prop_p p = pre p ==> test p
main :: IO ()
-main = smartCheck scStdArgs { extrap = False, constrGen = False } prop_p
+main = smartCheck scStdArgs { runForall = False, constrGen = False } prop_p
-- smartCheck scStdArgs { format = PrintString
-- , scMaxDepth = Just 20
-- }
View
@@ -50,15 +50,15 @@ smartCheck args propT = do
-- Run the smart reduction algorithm.
d <- smartRun args r prop'
-- If we asked to extrapolate values, do so.
- valIdxs <- if extrap args
+ valIdxs <- if runForall args
then -- Extrapolate with the original property to see if we
-- get a previously-visited value back.
extrapolate args d prop
else return []
-- If we asked to extrapolate constructors, do so, again with the original
-- property.
- csIdxs <- if constrGen args
+ csIdxs <- if runExists args
then constrsGen args d prop valIdxs
else return []
@@ -38,21 +38,21 @@ data ScArgs =
-- for failure in the reduction stage.
--------------
-- Extrapolation
- , extrap :: Bool -- ^ Should we extrapolate?
+ , runForall :: Bool -- ^ Should we extrapolate?
--------------
- , scMaxExtrap :: Int -- ^ How hard (number of rounds) to look
+ , scMaxForall :: Int -- ^ How hard (number of rounds) to look
-- for failures during the extrapolation
-- and constructor generalization stages.
--------------
- , scMinExtrap :: Int -- ^ Minimum number of times a property's
+ , scMinForall :: Int -- ^ Minimum number of times a property's
-- precondition must be passed to
-- generalize it.
--------------
-- Constructor generalization
- , constrGen :: Bool -- ^ Should we try to generalize
+ , runExists :: Bool -- ^ Should we try to generalize
-- constructors?
--------------
- , scConstrMax :: Int -- ^ How hard (number of rounds) to look
+ , scMaxExists :: Int -- ^ How hard (number of rounds) to look
-- for failing values with each
-- constructor. For "wide" sum types, this
-- value should be increased.
@@ -70,12 +70,12 @@ scStdArgs = ScArgs { format = PrintTree
---------------------
, scMaxReduce = 100
---------------------
- , extrap = True
- , scMaxExtrap = 20
- , scMinExtrap = 10
+ , runForall = True
+ , scMaxForall = 20
+ , scMinForall = 10
---------------------
- , constrGen = True
- , scConstrMax = 20
+ , runExists = True
+ , scMaxExists = 20
}
--------------------------------------------------------------------------------
@@ -86,7 +86,7 @@ arbSubset :: (SubTypes a, Generic a, ConNames (Rep a))
-> S.Set String -> IO (Result a)
arbSubset args a idx prop constrs =
liftM snd $ iterateArbIdx a (idx, scMaxDepth args)
- (scConstrMax args) (scMaxSize args) prop'
+ (scMaxExists args) (scMaxSize args) prop'
where
prop' b = newConstr b Q.==> prop b
-- Make sure b's constructor is a new one.
@@ -43,15 +43,15 @@ extrapolate args d origProp = do
-- least one test passes a precondition, and for every test in which the
-- precondition is passed, it fails. We test values of all possible sizes, up
-- to Q.maxSize.
- test _ idx = iterateArbIdx d (idx, scMaxDepth args) (scMaxExtrap args)
+ test _ idx = iterateArbIdx d (idx, scMaxDepth args) (scMaxForall args)
(scMaxSize args) origProp
-- Control-flow.
-- None of the tries satisfy prop (but something passed the precondition).
-- Prevent recurring down this tree, since we can generalize.
next _ (i, FailedProp) forest' idx idxs
- | scMinExtrap args < i =
+ | scMinForall args < i =
nextIter (forestReplaceChildren forest' idx False) idx (idx : idxs)
next _ _ forest' idx idxs = nextIter forest' idx idxs

0 comments on commit d0f1549

Please sign in to comment.