-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support verifying specifications using multiple triggers with the same name #74
Comments
The more I think about this, the less sure I am how to support this. To explain what I mean, let me first recap what
Both of these properties assume that a trigger function is fired at most once, but this assumption no longer holds in general after Copilot-Language/copilot#572, which allows for a trigger function to be fired multiple times. How, then, should the properties above be updated to reflect this? I think there is a reasonable story for updating property (1). Rather than checking if each trigger is invoked one or zero times, we would record the total number of times each trigger function is invoked and check that that number is the same in both the original Copilot specification and the C code. I am much less sure of how to update property (2). Consider this example: x :: Stream Word8
x = extern "x" Nothing
spec :: Spec
spec = do
trigger "t" true [arg x]
trigger "t" true [arg (x * 2)] Note that the
This approach works perfectly well when there is exactly one set of expected and actual arguments, but what if there are multiple sets? In that case, the override may be run multiple times, and it's not obvious which invocations of the override corresponds to which sets of arguments. I suppose we could check if the actual arguments equals one of the expected sets of arguments, but this could be more expensive than we want if there are many invocations of a single trigger. Figuring out how to do this precisely requires some more thought. For now, I think I am going to add a check to |
Although `copilot-c99` added the ability to invoke multiple triggers with the same name in Copilot-Language/copilot#572, it is not yet clear how best to support this in `copilot-verifier`. In the meantime, this adds an explicit check that rules out specifications that use multiple triggers with the same name to prevent the verifier from becoming confused by them. The remaining task of fully supporting such specifications is tracked in #74.
…gers-same-name Reject multiple triggers with the same name. Refs #74.
Now that Copilot-Language/copilot#572 has landed, a
copilot-c99
–generated trigger can fire multiple times in a single time step. We will need to updatecopilot-verifier
to account for this, as the verifier currently assumes that a trigger can only fire at most once in a single time step:copilot-verifier/copilot-verifier/src/Copilot/Verifier.hs
Lines 728 to 737 in 9021bcc
The text was updated successfully, but these errors were encountered: