You can write your prompts in code or formal logic or whatever if you want, assuming you’re capable of expressing your meaning sufficiently clearly with those languages too.
But the LLM won't interpret it formally; it doesn't know the semantics of any of the programming languages it can generate code for, it just "knows" that certain patterns occur more or less frequently. You can prompt it with invalid code and it will still sometimes give you a meaningful response.