test for is_legal_term/1