Skip to content

Commit

Permalink
Added timeout handling and stopped individual property errors being f…
Browse files Browse the repository at this point in the history
…atal (#870)

* Added timeout handling and made it so properties continue to be verified if there is an error

* Add CHANGELOG

* Fixed import bug

* Add printing of stats
  • Loading branch information
MatthewDaggitt authored Dec 13, 2024
1 parent a9ca7d6 commit be98e43
Show file tree
Hide file tree
Showing 16 changed files with 298 additions and 202 deletions.
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@

* Improved the ordering of constraints in generated query files.

* Added better handling of verifier timeouts.

* If a verifier throws an error whilst verifying a property, Vehicle will now continue to try
verify the other properties in the file instead of immediately exiting.

* When multiple similar warnings are thrown at different indices of the same property vector (i.e. properties of type `Vector Bool n`), they are now collapsed into a single warning.

* When Vehicle has finished verifying a vector of properties, Vehicle will now output the stats about the number verified, falsified, timed-out and errored.

## Version 0.15

* Added functions `min` and `max` over rationals.
Expand Down
24 changes: 8 additions & 16 deletions vehicle/src/Vehicle/Verify/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Data.Map (Map)
import Data.Text (Text, unpack)
import GHC.Generics (Generic)
import Prettyprinter (brackets)
import System.FilePath ((<.>))
import System.FilePath ((<.>), (</>))
import Vehicle.Compile.Resource
import Vehicle.Data.Builtin.Core
import Vehicle.Data.QuantifiedVariable (NetworkElementVariable)
Expand Down Expand Up @@ -137,9 +137,13 @@ type QueryID = Int

type QueryAddress = (PropertyAddress, QueryID)

calculateQueryFileName :: QueryAddress -> FilePath
calculateQueryFileName (propertyAddress, queryID) = do
calculatePropertyFilePrefix propertyAddress <> "-query" <> show queryID <.> "txt"
calculateQueryFileName :: FilePath -> QueryAddress -> FilePath
calculateQueryFileName verificationCache (propertyAddress, queryID) = do
verificationCache
</> calculatePropertyFilePrefix propertyAddress
<> "-query"
<> show queryID
<.> "txt"

--------------------------------------------------------------------------------
-- Queries
Expand All @@ -164,15 +168,3 @@ createNetworkVarName networkName application inputOrOutput =
pretty networkName
<> pretty (fmap subscript (show application))
<> brackets (pretty inputOrOutput)

--------------------------------------------------------------------------------
-- Network assignments

{-
instance Pretty NetworkVariableAssignment where
pretty (NetworkVariableAssignment assignment) = do
vsep (prettyVariable <$> Map.toList assignment)
where
prettyVariable :: (NetworkVerifierVariable, Rational) -> Doc a
prettyVariable (var, value) = "x" <> pretty var <> ":" <+> pretty value
-}
2 changes: 1 addition & 1 deletion vehicle/src/Vehicle/Verify/Specification.hs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ specificationPropertyNames (Specification properties) = fmap fst properties
-- verification of an entire specification.
data SpecificationCacheIndex = SpecificationCacheIndex
{ resourcesIntegrityInfo :: ResourcesIntegrityInfo,
properties :: [(Name, MultiProperty ())]
properties :: [(PropertyName, MultiProperty ())]
}
deriving (Generic)

Expand Down
Loading

0 comments on commit be98e43

Please sign in to comment.