Last active
July 4, 2025 03:38
-
-
Save MasWag/1e2bb706a875fa1b1b1994b20bc51d5f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/symon -dnf | |
############################################################### | |
# Name | |
# need_resp.symon | |
# | |
# Description | |
# After an event A with a specific ID, we should receive a response B with the same ID within 5 time units. | |
# | |
# For instance, for the following input, symon detects an error for x0 == hoge3 and x0 == hoge0. | |
# A hoge1 3 | |
# A hoge0 4 | |
# B hoge1 5 | |
# A hoge2 6 | |
# A hoge3 7 | |
# B hoge2 8 | |
# B hoge3 13 | |
# | |
# Usage | |
# symon -dnf need_resp.symon -i log.txt | |
# | |
# Author | |
# Masaki Waga | |
############################################################### | |
var { | |
# We define a string parameter to represent the current ID. | |
current_id: string; | |
} | |
signature A { | |
id: string; | |
} | |
signature B { | |
id: string; | |
} | |
# A subexpression that ignores irrelevant A and B signatures. | |
expr ignore_irrelevant { | |
zero_or_more { | |
one_of { | |
A( id | id != current_id ) | |
} or { | |
B( id | id != current_id ) | |
} | |
} | |
} | |
# Ignore the A and B signatures that do not match the current_id. | |
ignore_irrelevant; | |
# Match the A signature that matches the current_id. | |
A( id | id == current_id ); | |
# We only have irrelevant A and B signatures for more than 5 time units, i.e., we have no relevant B within 5 time units. | |
within (> 5) { | |
within (<= 5) { | |
ignore_irrelevant | |
}; | |
one_of { | |
A( id ) | |
} or { | |
B( id ) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment