I followed the directions on the Rosette website to download rosette (https://docs.racket-lang.org/rosette-guide/ch_getting-started.html). It seems that I can run this program and get an output error free.
#lang rosette/safe
; Compute the absolute value of `x`.
(define (absv x)
(if (< x 0) (- x) x))
; Define a symbolic variable called y of type integer.
(define-symbolic y integer?)
; Solve a constraint saying |y| = 5.
(solve
(assert (= (absv y) 5)))
However, when I try running this or any similar program using more than the basic racket keywords I get unclear (to me) errors.
#lang rosette
(struct plus (left right) #:transparent)
(struct mul (left right) #:transparent)
(struct square (arg) #:transparent)
(define prog (plus (square 7) 3))
(define (interpret p)
(destruct p
[(plus a b) (+ (interpret a) (interpret b))]
[(mul a b) (* (interpret a) (interpret b))]
[(square a) (expt (interpret a) 2)]
[_ p]))
(interpret prog)
This gives me an error destruct: unbound identifier in: destruct
. What is going on? This code is not my own and is copy pasted from a tutorial so it should work I think. I have also tried example code copy pasted from the Rosette website and that gives similar errors. I've followed all the installation instructions and updated the environment path etc. Any help?