Markdown for LLMs
LDC-Q4005 — The predicate is applied to the wrong number of arguments
The source Markdown for this article. Copy it into your assistant or download it as a text file.
# LDC-Q4005 — The predicate is applied to the wrong number of arguments
## What it means
A declared predicate takes a fixed number of arguments, and every use
must supply exactly that many: fewer leaves a participant unnamed, more
adds one the declaration never defined. When the count differs, the engine
stops and reports both numbers — how many the declaration takes and how
many the question gave.
Adjust the argument list to the declared count. The predicate name and
the surrounding question stay as written.
## Example
```lawql
query q over "demo.diagnostics" { for x: Applicant; where resident(x); select resident(x, x); }
```
## Fix
```lawql
from r in rules select r
```
## Engine message
The engine reports this in its own wording:
```text
LDC-Q4005: resident: expected 1 args, got 2.
```
## Related
- [Questions to the engine](/constructs/queries/) — the shape of a question over a package.
- [LDC-Q4004](/diagnostics/LDC-Q4004/) — when the predicate itself is unknown.