From 8efe23399e04d6bb6f8830854c37dd3d306dd175 Mon Sep 17 00:00:00 2001 From: Rob Simmons Date: Thu, 26 Dec 2024 20:35:59 -0500 Subject: [PATCH] Allow underscores in asserted predicates --- src/client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.ts b/src/client.ts index 4196d5d..b43d946 100644 --- a/src/client.ts +++ b/src/client.ts @@ -144,9 +144,9 @@ export class Dusa { let arity = this.prog.arities[fact.name]; if (!arity) { - if (!fact.name.match(/^[a-z][A-Za-z0-9]*$/)) { + if (!fact.name.match(/^[a-z][A-Za-z0-9_]*$/)) { throw new DusaRuntimeError( - `Asserted predicates must start with a lowercase letter and include only alphanumeric characters, '${fact.name}' does not.`, + `Asserted predicates must start with a lowercase letter and include only alphanumeric characters and underscores, '${fact.name}' does not.`, ); } arity = { args: nArgs, value: hasValue };