Skip to content

Add an 'is string' type check #22

Open

Description

@Trosper3

Problem

A definition can check that a field is a set, multiset, list or int, but there's no way to say "this field is a single value, not a collection". Several Redux definitions already write S is string (the DFA and NFA definitions, for example), but string isn't a keyword. The grammar reads it as a name (a TERM), so is string doesn't do the type check its author meant.

Wanted

  • is string as a built-in type check, next to int in coll.g4 and ConstraintDescriptor. It accepts a single value (a word such as kitten or New York) and rejects a set or list, with a SpadeParseException like the other type checks (is int and is set constraints don't check their type #10 / fix(grammar): make is int, is set and is list check their type #15).
  • Docs in DefinitionString.md, and tests next to TypeConstraintTests.cs.
  • Optional, could be a separate issue: quoted values. Today a value can't contain , { } ( ), so free text like "hello, world" can't be part of an instance. Something like "hello, world" would let a field hold any text. Redux's Lossless Data Compression needs this. Nothing else does yet.

Redux context

Redux is replacing its plain-English instance grammars with real SPADE definitions, so that the planned per-part instance editor can split every problem's instance (ReduxISU/Redux#851). Edit Distance, (x, y) where x and y are strings, needs is string, and so do the existing DFA and NFA definitions. #18 should report this type for each name like the others.

Activity

  1. added this to the 0.2.0 milestone on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions