To build on @LN , a slightly more general purpose solution to getting the form name and form version from 'inside the form' is to use the XPath expressions:
form name: /*[1]/@id
form version: /*[1]/@version
You can use these expressions anywhere, eg calculation, relevent, required, ...
In case yer curious, the first /
selects the document root, the *[1]
selects the first node under it (which will be your primary form instance), and the @id
and @version
give you the corresponding property values.