-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.rkt
28 lines (25 loc) · 1007 Bytes
/
test.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#lang racket
(require racket/file
linear_diff/parser
linear_diff/lexer
linear_diff/expander
linear_diff/synthesis
linear_diff/ldegg
graph)
(provide parsed synthesized exprs eggs)
(require "example.rkt")
(define parsed (parse (tokenize "example.rkt" (open-input-file "example.rkt"))))
(define synthesized (synthesize parsed-system))
(define synthesized-top (synthesize-combined parsed-system))
(define exprs (expand-program parsed-system))
(define eggs (map (match-lambda [(list a expr) (expr->egg-expr expr '())]) exprs))
(println "***** separate *****")
(for-each pretty-display synthesized)
(println "***** top *****")
(for-each pretty-display synthesized-top)
(println "***** graph *****")
(match-define (list graph names) (flatten-results synthesized-top))
(println (graphviz graph
#:output (open-output-file "test.dot" #:exists 'replace)
#:vertex-attributes (list (list 'label names))
))