racket / racket/redex

internal error via judgment form

Open
#135 8 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

Racket Version

6.12.0.3--2018-02-07(-/f) [3m].

Program


(define-language Flow
  (p ::= ((node x e) ... (solve x x e)))
  (e ::= x integer (edge x e))
  (x ::= (variable-except node edge solve))
  #:binding-forms
  ((node x_n e_n) #:refers-to (shadow x_n ...) ...
   (solve x_from x_to e #:refers-to (shadow x_n ...))))

(define-judgment-form Flow
  #:mode (⊢p I)
  [------------------------------------------------- p
   (⊢p ((node x_n e_n) ... (solve x_from x_to e)))])

(judgment-holds (⊢p ((node b (edge d 30)) (solve a d argmax))))

Expected

a Boolean

Got

  expected: list?
  given: 'b«0»

Hints

  1. Removing integer makes the problem disappear.
  2. (judgment-holds (⊢p ((node b (edge d 30)) (node d) (solve a d argmax)))) also makes the problem disappear.

The above is distilled down from about 5 pages. I tried to make it smaller and couldn't.

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

Start by reproducing the judgment-holds example with define-language, define-judgment-form, and the integer production, then compare it with the two hint variants. Trace the source of the second: contract violation and determine why the judgment form returns 'b«0» instead of a Boolean. Done means the original example returns a Boolean without regressing the hint cases.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
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.