This paper introduces a design methodology for intelligent controllers, based on a hierarchical linguistic model of command translation by tasks-primitive tasks-primitive actions, and on a two-stage hierarchical learning stochastic automaton that models the translation interfaces of a three-level hierarchical intelligent controller. The methodology relies on the designer's a priori knowledge on how to implement by primitive actions the different primitive tasks which define the intelligent controller. A cost function applicable to any primitive task is introduced and used to learn on-line the optimal choices from the corresponding predesigned sets of primitive actions. The same concept applies to the optimal tasks for each command, whose choice is based on conflict sets of stochastic grammar productions. Optional designs can be compared using this performance measure. A particular design evolves towards the command translation (by tasks-primitive tasks-primitive actions) that minimizes the cost function.