-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexamples.rkt
More file actions
24 lines (20 loc) · 1.05 KB
/
examples.rkt
File metadata and controls
24 lines (20 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#lang racket
(require "./terms.rkt")
(simpl-example (BinOp op+ (Number 2) (Number 4)))
(simpl-example (BinOp op+ (Number 2) (Variable 'x)))
(simpl-example (BinOp op+ (Variable 'x) (Variable 'x)))
(simpl-example (BinOp op+
(BinOp op+ (Variable 'x) (Variable 'x))
(BinOp op+ (Variable 'x) (BinOp op+ (Variable 'y) (Variable 'x)))))
(simpl-example (BinOp op+ (BinOp op+ (Number 2) (Variable 'x)) (Variable 'x)))
(simpl-example (BinOp op* (Number 3) (BinOp op+ (Number 2) (Number 4))))
(simpl-example (BinOp op+
(BinOp op+ (Number 4) (Variable 'x))
(BinOp op+ (Variable 'x) (Number 4))))
(simpl-example (BinOp op-
(BinOp op- (BinOp op+ (BinOp op* (Number 2) (Variable 'x)) (Number 4)) (Variable 'x))
(Variable 'x)))
(simpl-example (BinOp op+
(BinOp op+ (BinOp op+ (BinOp op* (Number 2) (Variable 'x)) (Number 4))
(BinOp op* (Number -1) (Variable 'x)))
(BinOp op* (Number -1) (Variable 'x))))