The application of Genetic Programming (GP) to the discovery of empirical laws most often suffers from two limitations. The
first one is the size of the search space; the second one is the growth of non-coding segments, the introns, which exhausts
the memory resources as GP evolution proceeds.
These limitations are addressed by combining Genetic Programming and Stochastic Grammars. On one hand, grammars are used to
represent prior knowledge; for instance, context-free grammars can be used to enforce the discovery of dimensionally consistent
laws, thereby significantly restricting GP search space. On the other hand, in the spirit of distribution estimation algorithms,
the grammar is enriched with derivation probabilities. By exploiting such probabilities, GP avoids the intron phenomenon.
The approach is illustrated on a real-world like problem, the identification of behavioral laws in Mechanics.