It is a fact that an integral domain $R$ is a principal ideal domain if and only if there is a Dedekind-Hasse function $|R|\setminus\{0\}\xrightarrow{\ \ \delta\ \ }\mathbb{N}$ on $R$, i.e. a function such that for $0\not=a\in R$ and $b\in R$ arbitrary either $a\mid b$ or $\delta(c)<\delta(a)$ for some $0\not=c\in(a,b)$.
Proof. Let $\delta$ be a Dedekind-Hasse function, $0\not=I\trianglelefteq R$ an ideal. Chose $0\not=a\in I$ of minimal degree. Clearly, $(a)\le I$. Conversely suppose $b\in I$, $b\notin (a)$. Then there exists $0\not=c\in(a,b)\le I$ of degree less then $a$, a contradiction.
If $R$ is a principal ideal domain, then it is factorial, so the definition $$a\longmapsto\text{Number of prime factors of }a$$ is meaningful. If $0\not=a,b\in R$ and $a\nmid b$, then $\gcd(a,b)$ properly divides $a$, hence has strictly less prime factors. But $\gcd(a,b)\in (a,b)$ by Bézout's Lemma. $\square$
Now it can be shown with some bit of commutative algebra that $\mathbb{R}[X,Y]/(X^2+Y^2+1)$ is a principal ideal domain, see for example here.
Is it possible to give a concrete description of a Dedekind-Hasse function on the ring $R=\mathbb{R}[X,Y]/(X^2+Y^2+1)$?
The most well-known application of the Dedekind-Hasse criterion is probably to some rings of integers of quadratic number fields, e.g. the algebraic norm is a Dedekind-Hasse function on $\mathcal{O}_{\mathbb{Q}(\sqrt{-19})} $.
Are there other applications of the Dedekind-Hasse criterion to find some non-obvious examples of principal ideal domains?