Skip to content

Generating random expressions sometimes results in an infinite loop #248

@joshuaharry

Description

@joshuaharry

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions