-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from cmsc430/ziggy
Ziggy This merges the Ziggy branch into main. There are still problems with Ziggy, but it's time to put them on main.
- Loading branch information
Showing
385 changed files
with
4,259 additions
and
13,159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#lang racket | ||
(provide main) | ||
|
||
(require redex) | ||
|
||
(define-language L) | ||
|
||
;; A reduction relation that just relates elements | ||
;; of the list to their successors | ||
(define (r ls) | ||
(define i 0) | ||
(reduction-relation L | ||
(--> any_i | ||
any_j | ||
(where any_j | ||
,(begin | ||
(set! i (add1 i)) | ||
(list-ref ls (min i (sub1 (length ls))))))))) | ||
|
||
|
||
;; reads log file from stdin | ||
(define (main) | ||
(define ls | ||
(let loop () | ||
(if (eof-object? (read)) | ||
'() | ||
(cons (read) (loop))))) | ||
|
||
;; replace instr indices with their instructions | ||
(define ls1 | ||
(map (λ (s) | ||
(map (λ (p) | ||
(match p | ||
[(list 'instr i) | ||
(list 'instr (list-ref (list-ref ls 0) | ||
(add1 i)))] | ||
[_ p])) | ||
s)) | ||
ls)) | ||
|
||
;; run the stepper | ||
(stepper (r (rest ls1)) (first (rest ls1)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#lang racket | ||
(provide Int) | ||
(provide Lit) | ||
|
||
;; type Expr = (Int Integer) | ||
(struct Int (i) #:prefab) | ||
;; type Expr = (Lit Integer) | ||
|
||
(struct Lit (i) #:prefab) |
Oops, something went wrong.