@ -62,21 +62,13 @@ checkers_list:
;
;
checker :
checker :
DEFINE_CHECKER IDENTIFIER ASSIGNMENT LEFT_BRACE clause_list RIGHT_BRACE
DEFINE_CHECKER identifier ASSIGNMENT LEFT_BRACE clause_list RIGHT_BRACE
{ let name = $ 2 in
{
let definitions = $ 5 in
Logging . out " \n Parsed checker definition " ;
Logging . out " \n Parsed checker definition: %s \n " name ;
let c = { name = $ 2 ; definitions = $ 5 } in
IList . iter ( fun d -> ( match d with
print_checker c ;
| Ctl_parser_types . CSet ( clause_name , phi )
c
| Ctl_parser_types . CLet ( clause_name , phi ) ->
}
Logging . out " %s= \n %a \n \n "
clause_name CTL . Debug . pp_formula phi
| Ctl_parser_types . CDesc ( clause_name , s ) ->
Logging . out " %s= \n %s \n \n " clause_name s )
) definitions ;
Logging . out " \n -------------------- \n " ;
{ name = name ; definitions = definitions }
}
;
;
clause_list :
clause_list :
@ -85,33 +77,34 @@ clause_list:
;
;
clause :
clause :
| SET IDENTIFIER ASSIGNMENT formula
| SET identifier ASSIGNMENT formula
{ Logging . out " \t Parsed set clause \n " ; CSet ( $ 2 , $ 4 ) }
{ Logging . out " \t Parsed set clause \n " ; CSet ( $ 2 , $ 4 ) }
| SET IDENTIFIER ASSIGNMENT STRING
| SET identifier ASSIGNMENT STRING
{ Logging . out " \t Parsed desc clause \n " ; CDesc ( $ 2 , $ 4 ) }
{ Logging . out " \t Parsed desc clause \n " ; CDesc ( $ 2 , $ 4 ) }
| LET IDENTIFIER ASSIGNMENT formula
| LET identifier ASSIGNMENT formula
{ Logging . out " \t Parsed let clause \n " ; CLet ( $ 2 , $ 4 ) }
{ Logging . out " \t Parsed let clause \n " ; CLet ( $ 2 , $ 4 ) }
;
;
atomic_formula :
atomic_formula :
| TRUE { Logging . out " \t Parsed True \n " ; CTL . True }
| TRUE { Logging . out " \t Parsed True \n " ; CTL . True }
| FALSE { Logging . out " \t Parsed False \n " ; CTL . False }
| FALSE { Logging . out " \t Parsed False \n " ; CTL . False }
| IDENTIFIER LEFT_PAREN params RIGHT_PAREN
| identifier LEFT_PAREN params RIGHT_PAREN
{ Logging . out " \t Parsed predicate \n " ; CTL . Atomic ( $ 1 , $ 3 ) }
{ Logging . out " \t Parsed predicate \n " ; CTL . Atomic ( $ 1 , $ 3 ) }
;
;
formula_id :
formula_id :
| IDENTIFIER { Logging . out " \t Parsed formula identifier '%s' \n " $ 1 ; CTL . Atomic ( $ 1 , [] ) }
| identifier { Logging . out " \t Parsed formula identifier '%s' \n " $ 1 ;
CTL . Atomic ( $ 1 , [ formula_id_const ] ) }
;
;
params :
params :
| { [] }
| { [] }
| IDENTIFIER { [ $ 1 ] }
| identifier { [ $ 1 ] }
| IDENTIFIER COMMA params { $ 1 :: $ 3 }
| identifier COMMA params { $ 1 :: $ 3 }
;
;
transition_label :
transition_label :
| IDENTIFIER { match $ 1 with
| identifier { match $ 1 with
| " Body " | " body " -> Some CTL . Body
| " Body " | " body " -> Some CTL . Body
| " InitExpr " | " initexpr " -> Some CTL . InitExpr
| " InitExpr " | " initexpr " -> Some CTL . InitExpr
| " Cond " | " cond " -> Some CTL . Cond
| " Cond " | " cond " -> Some CTL . Cond
@ -147,4 +140,13 @@ formula:
| NOT formula { Logging . out " \t Parsed NOT \n " ; CTL . Not ( $ 2 ) }
| NOT formula { Logging . out " \t Parsed NOT \n " ; CTL . Not ( $ 2 ) }
;
;
identifier :
| IDENTIFIER { if Str . string_match ( Str . regexp_string Ctl_parser_types . infer_prefix ) $ 1 0 then (
Logging . err
" ERROR: %s contains __infer_ctl_ that is a reserved keyword which cannot be used in identifiers. " $ 1 ;
assert false )
else $ 1
}
;
%%
%%