positive_infinity() is a function. It returns the value of \infty.
It really doesn't have much purpose. One place you can use it is in a variable declaration. Suppose you have scale variable, sigma, that's lower bounded by 0. This is how I'd write it:
parameters {
real<lower = 0> sigma;
}
You could write this, which isn't recommended, but you could still do this:
parameters {
real<lower = 0, upper = positive_infinity()> sigma;
}
Since Stan is a language, I'm sure there are many other use cases that I haven't thought about.
Daniel