; Relational grammar rules for database dependencies.
; Uses rules from extended_grammar.

statement ::= dep terminate | statement

dep ::= pk_dep | mvd_dep | fd_dep | inc_eq_dep | inc_subs_dep

; primary key
pk_dep ::= pk param_start attribute_list param_stop relation_name
pk ::= "pk"

select_or_relation ::= (select param_start conditions param_stop relation_name) | relation_name

cond_dep_expr ::= param_start attribute_name delim attribute_name param_stop select_or_relation

; multivalued dependency
mvd_dep ::= mvd cond_dep_expr
mvd ::= "mvd"

; functional dependency
fd_dep ::= fd cond_dep_expr
fd ::= "fd"

inc_expr ::= param_start attribute_name delim attribute_name param_stop paren_left cond_dep_expr delim cond_dep_expr paren_right

; inclusion equivalence
inc_eq_dep ::= inc_eq inc_expr
inc_eq ::= "inc="

; inclusion subsumption
inc_subs_dep ::= inc_subs inc_expr
inc_subs ::= "inc⊆"
