  In this paper, we study classes of discrete convex functions: submodular
functions on modular semilattices and L-convex functions on oriented modular
graphs. They were introduced by the author in complexity classification of
minimum 0-extension problems. We clarify the relationship to other discrete
convex functions, such as $k$-submodular functions, skew-bisubmodular
functions, L$^\natural$-convex functions, tree submodular functions, and
UJ-convex functions. We show that they are actually viewed as
submodular/L-convex functions in our sense. We also prove a sharp iteration
bound of the steepest descent algorithm for minimizing our L-convex functions.
The underlying structures, modular semilattices and oriented modular graphs,
have rich connections to projective and polar spaces, Euclidean building, and
metric spaces of global nonpositive curvature (CAT(0) spaces). By utilizing
these connections, we formulate an analogue of the Lov\'asz extension,
introduce well-behaved subclasses of submodular/L-convex functions, and show
that these classes can be characterized by the convexity of the Lov\'asz
extension. We demonstrate applications of our theory to combinatorial
optimization problems that include multicommodity flow, multiway cut, and
related labeling problems: these problems have been outside the scope of
discrete convex analysis so far.
