How to implement "subst" and "subst_exp" functions in haskell?

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

How to implement "subst" and "subst_exp" functions in haskell?

Post by answerhappygod »

How to implement "subst" and "subst_exp" functions in
haskell?
How To Implement Subst And Subst Exp Functions In Haskell 1
How To Implement Subst And Subst Exp Functions In Haskell 1 (51.44 KiB) Viewed 51 times
79 substVars :: [Var] => [Var] -> Base -> Base 80 81 substVars vs' vs phi : = foldi ((flip.uncurry) subst) phi (zip vs' vs) 82 83 subst phi y x = phi[y/x] 84 subst :: Exp -> Var -> Base -> Base 85 86 87 subst yxf = error "TODO" 88 89 90 91 subst_exp :: Exp -> Var -> Exp -> Exp 92 subst_exp el x e2 = error "TODO: FILL THIS IN" רח
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply