Unless you're using terms differently that what I understand you to mean, you're mistaken when you assert that "formulas don't refer to any specific variables in a dataset". They certainly do refer to specific variables, explicitly by name.
See this stackoverflow answer for some background information and where R formulas originate.
Formulas are used for many purposes in R, and a specific component of a formula (such as a variable name or an operator) may have a somewhat different meaning in a different context.
The meaning of the formula in
plot(y ~ x1 + x2, data=mydata) and in
lm(y ~ x1 + x2, data=mydata) and in
glm(y ~ x1 + x2, family=binomial, data=mydata) are all somewhat different ... and as you go further afield, meanings can change even more, even between packages doing very similar things.
So what that formula might mean in R is very context dependent -- and we don't have sufficient context.
(You don't even mention whether you're using a package in R or building something yourself.)
Given this is a naive Bayes classifier, your interpretation certainly makes sense (think in terms of logs, for example), and likely that's what I'd have anticipated it to mean, but that's not really anything to do with R unless you're using some particular package... whose specific interpretation of formulas we might then be able to explain.