-
Notifications
You must be signed in to change notification settings - Fork 5
/
dfa_spec.c
51 lines (38 loc) · 1.37 KB
/
dfa_spec.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include<string.h>
/*@
predicate matchhere(char* r, char* s) =
(r[0]=='\0') ||
(r[0]!='\0' && r[1]=='*' &&
(\exists int i; 0 <= i <= strlen(s) && matchhere(r+2, s+i) &&
(r[0]=='.' || (\forall int j; 0 <= j < i ==> r[0]==s[j])))) ||
(r[0]=='$' && r[1]=='\0' && s[0]=='\0') ||
((s[0]!='\0' && (r[0]=='.' || r[0]==s[0])) &&
matchhere(r+1, s+1));
*/
/*@
requires strlen(r)>=0 && \valid(r+(0..strlen(r)));
requires strlen(s)>=0 && \valid(s+(0..strlen(s)));
requires r[0]=='.' && r[1]=='*' && r[2]=='A' && r[3]=='A' && r[4]=='B' && r[5]=='\0';
requires s[0]=='A' && s[1]=='A' && s[2]=='B' && s[3]=='\0';
ensures matchhere(r, s);
assigns \nothing;
*/
void dfa_spec_aab1(char* r, char* s) {}
/*@
requires strlen(r)>=0 && \valid(r+(0..strlen(r)));
requires strlen(s)>=0 && \valid(s+(0..strlen(s)));
requires r[0]=='.' && r[1]=='*' && r[2]=='A' && r[3]=='A' && r[4]=='B' && r[5]=='\0';
requires s[0]=='A' && s[1]=='A' && s[2]=='A' && s[3]=='B' && s[4]=='\0';
ensures matchhere(r, s);
assigns \nothing;
*/
void dfa_spec_aab1_1(char* r, char* s) {}
/*@
requires strlen(r)>=0 && \valid(r+(0..strlen(r)));
requires strlen(s)>=0 && \valid(s+(0..strlen(s)));
requires r[0]=='.' && r[1]=='*' && r[2]=='A' && r[3]=='A' && r[4]=='B' && r[5]=='\0';
requires s[0]=='A' && s[1]=='A' && s[2]=='X' && s[3]=='\0';
ensures !matchhere(r, s);
assigns \nothing;
*/
void dfa_spec_aab0(char* r, char* s) {}