racket / racket/redex

`generate-term` + missnamed cross gives an internal error message

Open
#181 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
112
Forks
42
PR merge metrics
No merged PRs in 30d

Description

the program

#lang racket
(require redex/reduction-semantics)

(define-language L
  (b ::= a))

((generate-term L (cross b_1))
 1)

Gives the error

redex/private/rg.rkt:182:2: hash-ref: no value found for key
  key: 'b_1-b_1

Instead of complaining that b_1 isn't a non-terminal in L.

Also if I add a #:i-th:

#lang racket
(require redex/reduction-semantics)

(define-language L
  (b ::= a))

((generate-term L (cross b_1) #:i-th)
 1)

The error message points to the middle of the contract library:

collects/racket/contract/private/arrow-val-first.rkt:390:18: hash-ref: no value found for key
  key: 'b_1-b_1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the examples using generate-term with cross b_1 and with #:i-th, then inspect redex/private/rg.rkt around line 182. Confirm that the invalid non-terminal produces a clear diagnostic rather than an internal hash-ref error, including the #:i-th case.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.