set FormulaValue and FormulaVariable to terminal elements.