Skip to content

giordan12/EECS-662-Project1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File for project 2 of EECS 662 with professor Perry
Name: Giordanno Castro
KUID: 2738180

Project is divided in 2 parts:
Test Cases for part 1:
> (interp-cfae (app(fun 'x (id 'x)) (num 4)) mt-env)
(numV 4)
> (interp-cfae (if0 (app (fun 'x (sub (id 'x) (num -1))) (num -1)) (num 4) (num -2)) mt-env)
(numV 4)
> (interp-cfae (if0 (app (fun 'x (sub (id 'x) (num -1))) (num -2)) (num 4) (num -2)) mt-env)
(numV -2)
> (interp-cfae (app (fun 'x (app(fun 'y (add (id 'x) (id 'y))) (num 3))) (num 5)) mt-env)
(numV 8)
> (interp-cfae(app (fun 'x (app (fun 'y (add (id 'x) (id 'y))) (id 'x))) (num 4)) mt-env)
(numV 8)

Test Cases for part 2:
> (eval-cfwae (cadd (capp (cid 'inc) (cnum 4)) (cid 'pi)))
(numV 8.141592)
> (eval-cfwae (cadd (capp (cid 'inc) (cnum 2)) (cid 'pi)))
(numV 6.141592)
> (eval-cfwae (cadd (capp (cid 'area) (cnum 2)) (cid 'pi)))
(numV 15.70796)
> (eval-cfwae (cond0 (list (try (cadd(cnum 1) (cnum -1)) (cnum 1)) (try (csub (cnum 2) (cnum 4)) (cnum 2))) (cnum -1)))
(numV 1)
> (eval-cfwae (cond0 (list (try (cadd(cnum 1) (cnum -2)) (cnum 1)) (try (csub (cnum 2) (cnum 4)) (cnum 2))) (cnum -1)))
(numV -1)
> (eval-cfwae (with 'x (cnum 0)(cond0 (list (try (cadd(cnum 1) (cnum -2)) (cnum 1)) (try (cid 'x) (cnum 2))) (cnum -1))))
(numV 2)
> (eval-cfwae(capp (cfun 'x (cid 'x))(cnum 8)))
(numV 8)
> (eval-cfwae (cond0 (list (try (cnum 1) (cnum 2)) (try (cnum 0) (cond0 (list (try (cnum 0) (cnum -1))) (cnum -2)))) (cnum 7)))
(numV -1)
> (eval-cfwae (with 'x (cnum 0) (with 'y (cnum 1) (cadd (cid 'x) (cid 'y)))))
(numV 1)

About

First publication

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages