LEAF: A Language which Integrates Logic, Equations and Functions