I have a grammar rules like that;
S -> S and S
S -> S or S
S -> (S)
S -> true | false
-- and , or , ( , ) , true ,false are terminals --
I can find out that this grammar is ambiguous, but how can I modify this grammar to solve the ambiguity?
The standard approach is to give them precedence/associativity:
S -> S or A | A
A -> A and P | P
P -> (S)
P -> true | false