Well-formed-formula Definition

noun

(logic) A statement that is expressed in a valid, syntactically correct, manner.

This program works correctly on all well-formed formulas but it blows up on illegal input.
Wiktionary
other
Wiktionary