Is there a specific standard name for a mathematical space "$(\mathcal S, f)$"
consisting of a set $\mathcal S$ and a function $f : \mathcal{S \times S} \rightarrow \mathbb R$;
perhaps together with the ("obvious") additional property that $\forall A \in \mathcal S: f[~A, A~] = 0$
?
Some remarks:
The space "$(\mathcal S, f)$" I'm asking about presents a further generalization of the notion of a metric space "$(\mathcal M, d)$", including its various apparently more well-known generalizations since for all of them the function $d : \mathcal{M \times M} \rightarrow \mathbb R_{(\ge~0)}$, so they all involve the property $\forall A, B \in \mathcal M: d[~A, B~] \ge 0$.
In physics there's a well-known example of the kind of mathematical space I'm asking about, namely the space "$(\mathcal E, s^2)$", consisting of a (any suitable) set $\mathcal E$ of spacetime events and the function $s^2 : \mathcal{E \times E} \rightarrow \mathbb R$ expressing suitable spacetime intervals. This is of course known as (or at least closely related to) Minkowski space.
However, by definition of spacetime interval values $s^2$ they are applicable only to flat spacetime, i.e. with the additional property that for any 6 events $\in \mathcal E$ the corresponding Cayley-Menger determinant in terms of their 15 pairwise interval values vanishes. In other words, Minkowski space describes flat spacetime. But my question is concerned more generally with spaces which aren't necessarily flat.