Large Language Models (LLMs) are increasingly used for code generation, but their reliability drops in domain-specific languages that require reasoning. We address this limitation with a neuro-symbolic framework that integrates LLM-based generation, token-level syntactic validation, and element-level logical reasoning. The system generates ordered lists of domain-specific elements, encoded as JSON objects, while enforcing syntactic rules and domain constraints. Our method combines grammar-constrained decoding with a symbolic constraint solver that filters valid continuations during inference. We illustrate the approach on data processing pipelines for railway topology queries and outline how the framework can be extended and generalized in future work.
Kogler et al. (Thu,) studied this question.