Skip to content

Commit

Permalink
copilot-verifier-demo: Fix warnings in Demo2
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanGlScott committed May 17, 2024
1 parent 770c7b0 commit 5d02009
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion copilot-verifier-demo/src/Demo2.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ temp = extern "temperature"
ctemp :: Stream Float
ctemp = (unsafeCast temp * constant (150.0/255.0)) - constant 50.0

-- width of the sliding window
window :: Int
window = 5

-- Compute the sliding average of the last 5 temps
-- (Here, 19.5 is the average of 18.0 and 21.0, the two temperature extremes
-- that we check for in the spec.)
avgTemp :: Stream Float
avgTemp = (sum 5 (replicate 5 19.5 ++ ctemp)) / fromIntegral 5
avgTemp = (sum 5 (replicate 5 19.5 ++ ctemp)) / fromIntegral window

spec :: Spec
spec = do
Expand Down

0 comments on commit 5d02009

Please sign in to comment.