racket / racket/redex

Generating random expressions sometimes results in an infinite loop

Open
#248 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

Consider the following program:

#lang racket/base

(require redex/reduction-semantics)

(define-language L
  (self ::= (self)))

(define-judgment-form L
  #:mode (--> I O)
  #:contract (--> self self)
  [----------- "Do Nothing"
   (--> (self) (self))])

(define (f el)
  (printf "F ran!\n")
  (if (redex-match L val el) #true
      (= 1 (length (apply-reduction-relation --> el)))))

(printf "Start generation...\n")
(redex-check L self (f (term self)))

This code appears to print "Start generation..." before getting stuck while generating test cases.

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

Run the supplied Racket reproducer first and inspect the redex-check random-expression generation path. Trace why generation does not terminate for the self grammar, then verify that the same program completes instead of getting stuck.

Written by the indexing model from the issue text.

Assessment

Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.