# Syntax checking expressed mathematically

1) Set B is the finite set of all rules for a particular programming language.

2) Set A is the infinite set of all valid strings of that language and is defined by Set B.

I'm having a problem defining expressing that mathematically.

My so far unsuccessful idea:

• Define a set C - the set of all possible strings.
• set A is a finite union between infinite sets A_i such that for every rule B_i

$B_i ( C ) = A_i$

can It be defined with an implication ? for every rule B_i of B applied to every string c_i of C, if $B_i ( c_j ) \implies c_j$

• To make this easier to read use latex formatting around your functions( put a dollar sign on each side of the function A_i becomes $A_i$ ) – lPlant Jun 27 '14 at 15:38
• Also initially you say $A$ is the set of rules and $B$ is a set of strings, but then refer to rule $B_i$ applying a string to it to get a new rule which does not make sense. – lPlant Jun 27 '14 at 15:48
• Can you explain in words the meaning of what you write formally. What are your rules supposed to look like and be used. What does it mean and/or produce when you apply a rule to a string. What is the meaning of defining something with an implication. Math is to some extent a Lego game, but you have to understand the shapes of the bricks to fit them together meaningfully. I am asking what shape you see to the bricks you propose to use, and how you propose to assemble them. – babou Jun 27 '14 at 17:44