Skip to content
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

Hanfor's Specification Language #244

Open
Eevan-zq opened this issue Feb 24, 2023 · 3 comments
Open

Hanfor's Specification Language #244

Eevan-zq opened this issue Feb 24, 2023 · 3 comments
Assignees
Labels
docs Something related to the documentation question Further information is requested

Comments

@Eevan-zq
Copy link

Hello hauff,
I have two questions. First, if you look at the red underlined sentences in the following figure, I want to know the difference between "Once EXPR becomes satisfied, ..." and "If EXPR holds, ..." (My understanding is that Once EXPR stands for the occurrence of an event, and if EXPR stands for the state of a variable is true). In my understanding, there is little difference between the two.
image

The second question is whether it can be directly extended in pattern.py when extending the pattern of hanfor.

image

@hauff hauff self-assigned this Feb 24, 2023
@hauff
Copy link
Contributor

hauff commented Feb 24, 2023

Hello @Eevan-zq,

regarding your first question:

Yes, you are right there is a difference between the two patterns

  • EdgeResponseBoundL2
    Globally, it is always the case that once "R" becomes satisfied, "S" holds for at least "5" time units
  • InvarianceBoundL2
    Globally, it is always the case that if "R" holds, then "S" holds for at least "5" time units

The pattern EdgeResponseBoundL2 requires a rising edge for the observable R, which means that its valuation alters from false to true.
The pattern InvarianceBoundL2 does not require a rising edge for the observable R, which means that the precondition of this pattern is fulfilled whenever R evaluates to true.

The EXPR can be replaced by a boolean expression over observables, which means it always evaluates either to true or to false.

@hauff
Copy link
Contributor

hauff commented Feb 24, 2023

@Eevan-zq

Regarding your second question:

I'm not sure that I understand what you are trying to do, so I think it would be error-prone to answer yes or no to this question at this time.

Perhaps you can give me some more information about your extension?

@hauff hauff added question Further information is requested docs Something related to the documentation labels Feb 24, 2023
@Eevan-zq
Copy link
Author

So my second question is that if I want to formalise this requirement: "if P holds for less than 3s, then Q holds at least 10s."
And you know that there is no pattern which hanfor specification language can use. So if I want add this pattern likes "If EXPR holds for at most DURATION, then EXPR holds afterwards for at least DURATION" and how can I do it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Something related to the documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants