A traditional Chinese medicine formula has the following requirements: (1) if there is a medicinal material A, then there must be medicinal material B; (2) if there is no medicinal material C, then there must be medicinal material D; (3) ginseng and Gastrodia elata cannot have both; (4) if there is no medicinal material A and there is medicinal material C, ginseng is needed.
If it contains Gastrodia elata, the formula contains C medicinal material.