modify to enhance error chcking for PATTERN-MATCHER-MATCH function and UNIQUE-SYMBOL function
modify to introduce looking-up relations using index and to optimize performance with it.