Giter VIP home page Giter VIP logo

Comments (5)

sorawee avatar sorawee commented on August 17, 2024 2

raco symtrace by default doesn't run the test submodule ((module+ test ...)). To run it, you need to invoke it with the -m option. I.e. raco symtrace -m test <your-file.rkt>.

from rosette.

gparmer avatar gparmer commented on August 17, 2024

I forgot to say: thank you so much for rosette and for maintaining it! Great, amazing tool. I'm having a wonerful time using it. My productivity at this point is hampered by not being able to introspect on assertions, but I'm really impressed with the system. As someone who oversees large code bases in academia, I'm really impressed with rosette.

from rosette.

sorawee avatar sorawee commented on August 17, 2024

A couple of things:

  1. automaton.rkt has nothing to run. The file simply declares many functions, but it doesn't really execute anything. demo.rkt is the actual entrypoint.
  2. However, demo.rkt also doesn't show anything, and that appears to be because there is really no exception occurred during symbolic evaluation.
  3. "Web Server stopped." is totally expected. The web server is only needed to launch the initial page, so it shuts down right after that. Rosette does continue to communicate with the page via the WebSocket protocol.
  4. Try some examples in https://docs.racket-lang.org/rosette-guide/ch_error-tracing.html to see how symtrace works.

from rosette.

gparmer avatar gparmer commented on August 17, 2024

Thanks! Indeed, you're right that the following does result in useful symtrace output. (I include this below as the example on the webpage is almost, but not quite, self-contained).

The examples I'm using are much larger and are generated by Serval. Given your feedback, I'm hacked my examples apart and found that

  1. symtrace does not run properly with:
;; ... lots of code, and included symbex of C code including the check-retype-from-untyped function

(define cos-tests
  (test-suite+ "Tests for cos.c"
               (test-case+ "check-retype-from-untyped" (check-retype-from-untyped))))

(module+ test
  (time (run-tests cos-tests)))
  1. symtrace gives feedback for assertions when I remove the test harness above and instead directly do:
(check-retype-from-untyped)

Given this, I'm guessing the test harness code for serval or rackunit doesn't play well with symtrace in some way (e.g. code pulled in from https://github.com/uw-unsat/serval/blob/master/serval/lib/unittest.rkt#L49). I'm assuming the issue is with the serval and/or unit test harness, not Rosette, so I believe we can close this issue.

I'm happy to provide any information you may like, but I believe we can close the issue. I can't thank you enough for your guidance.

Example that works with symtrace derived from Rosette Guide

#lang rosette/safe

(define-symbolic xs integer? #:length 4)

(define (select xs n)
  (cond
    [(empty? xs) (assert #f "unexpected empty list")]
    [else (define pivot (first xs))
          (define non-pivot (rest xs))
          (define <pivot (filter (λ (x) (< x pivot)) non-pivot))
          (define >=pivot (filter (λ (x) (>= x pivot)) non-pivot))
          (define len< (length <pivot))
          (cond
            [(= n len<) pivot]
            [(< n len<) (select <pivot)] ; Bug: should be (select <pivot n).
            [else (select >=pivot (- n len< 1))])]))
(define-symbolic n k integer?)
(assume
 (and (<= 0 n (sub1 (length xs)))
      (= k (select xs n))))
(verify
 (assert (= k (list-ref (sort xs <) n))))

Included for completeness.

from rosette.

gparmer avatar gparmer commented on August 17, 2024

Very much appreciated. Closing.

from rosette.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.