%% g2.pl %% This is a context-free grammar for strings of balanced parentheses where %% the symbol 'o' represents the open parenthesis '(' and %% the symbol 'c' represents the closed parenthesis ')'. %% The grammar is: %% s -> lambda | o s c s variable(s). terminal(o). terminal(c). rule(s, []). rule(s, [o, s, c, s]).