New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here


by: Miss Emery VonRueden


Miss Emery VonRueden
GPA 3.55


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in ComputerScienence

This 13 page Class Notes was uploaded by Miss Emery VonRueden on Tuesday October 13, 2015. The Class Notes belongs to CSC 4101 at Louisiana State University taught by Staff in Fall. Since its upload, it has received 19 views. For similar materials see /class/222869/csc-4101-louisiana-state-university in ComputerScienence at Louisiana State University.




Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/13/15
Programming Languages Tevfik Kosar Lecture XXVIII May 4th 2006 Final Exam Date May 11th Thursday Time 1230pm 230pm Place 215 TUREAUD HALL Final will be comprehensive It will cover everything we have learned this semester Final will be open book You can use your book during the exam but no other notes Check the class notes Anything not covered in the class will not be asked Expect similar questions to the homework assignments and quizzes Hints Be sure that you know how to write regular expressions how to generate NFA and DFA from regular expressions how to generate parse trees difference between topdown and bottomup parsing LL vs LR grammars difference between static vs dynamic scoping how to generate attribute grammars decorate parse trees and generate syntax trees expression evaluation orders applicative vs normalorder evaluation basic scheme functions lists searching and scoping in Scheme Hints cont type equivalence structural and name equivalence type inference memory layout for records structures and variant records Unions basic prolog functions resolution unification lists and arithmetic OOP object initialization static vs dynamic binding concurrent programming data parallelism vs function parallelism threads vs processes shared memory sychronization Regular Expressions Write a regular expression which captures all odd numbers in the binary format Answer 011 Context Free Grammars Write a CFG which captures all odd numbers in the binary format Answer Odd 9 Digits 1 Digits 9 Digit Digits 3 Digit 9 0 1 Finite Automaton Convert the regular expression 011 to a DFA 1 Convert regular expr to NFA 2 Convert NFA to DFA 3 Optimize NFA Construction Rules Concatenation Alternation Kleene Closure Parse Trees Consider the same CFG Odd a Digits 1 Digits 9 Digit Digits 8 Digit 9 0 1 Show the parse tree for input string 1101 o Is it ambiguous Attribute Grammars Consider the same CFG Odd 9 Digits 1 Digits 9 Digit Digits 3 Digit 9 0 1 Show the attribute grammar which would accumulate the decimal value of the binary input string into a val attribute of the root of the pare tree Attribute Grammars cont Answer Odd 9 Digits 1 Oddval Digitsval 1 Digits 9 Digit Digits Digits1val Digitval2 DigitslenDigits2val Digits1len Digits2len 1 Digits 9 s Digitsval 0 Digitslen 0 Digit 9 O Digitval 0 Digit 9 1 Digitval 1 Scope Rules Static vs Dynamic program scopes input output var a integer procedure first a 1 Static 1 end Dynamic 2 procedure second var a integer begin first end begin a 2 second writea end Scope Rules cont program scopes input output var a integer procedure first begin if a lt 4 a 4 else a1 end procedure second var a integer begin a2first writea end Static 12421 procedure third Dynamic 14141 var a integer begin a3 secondend begin first writea second write a third writea Evaluation Order Applicativeorder evaluation Evaluate arguments before passing them to subroutine Normalorder evaluation Evaluate them only when it is needed Evaluation Order cont Consider the following Scheme definition gtgt define test xy if X 3 1 y Write the output of the following call to this function gtgt test 315 0 assuming normalorder evaluation is used 1 assuming applicativeorder evaluation is used Error Division by Zero Basic Scheme Functions Show the return values of the following Scheme expressions a car cdr 1 2 3 4 2 b cdr car 1 2 34 0 c cons car 12cdr 3 4 14 d car list 12 3 4 12 e cdr append 1 2 3 4 234 Basic Scheme Functions cont Write the output of the following Scheme programs a gtgt leta 2 b 5 c 9 Output 10 433 b gtgt let a 2 b 5 c 9 let a 3 b a c b let a 4 C a b C a b C Output 12 444 Memory Allocation in Arrays amp Variants Suppose we are compiling for a machine with 1byte characters 2 byte shorts 4byte integers and 8byte reals and with alignment rules that require the address of every primitive data element to be an even multiple of the element s size Suppose further that the compiler is not permitted to reorder fields How much space will be consumed by the following array A array 09 of record 5 c t short d r l integer OOP Static vs Dynamic Method Binding onsider the followingclass hierarchy classperson class student public person c essproressor public person void personprintlebel void profeso 39 Llabel mi void studentprintlebelint studentid students Whichprinuaoel H 39quotL quot uponthe effect 39ntilabell intlabel t bell ntlebel x Q E i a lllll r 1printlabell ntlebel Prolog Unification Patternmatching process used to associate variables with their values studentjoe studentX X joe Unification Rules A constant unifies only with itself Two structures unify iff same functor and same of arguments and corresponding arguments unify recursively A variable unifies with anything Prolog Unification a a yes a b no fooa b fooa b yes X a X a no fooa b fooX b a No A B 123 B 123 Prolog Lists a b c can be expressed as using vertical bar notation a b C a b C1 a b C 1 memberX XIT memberX HIT memberX T sorted sorted X sortedA B T Alt B sortedB T Prolog Lists appendL A A appendH T A H L appendT A L appenda b c d e L Labcde appendX d e a b c d e X a b c appenda b c Y a b c d e Y d e Prolog predicates do not have a clear distinction between input and output arguments Prolog Arithmetic Builtin is predicate unifies its first argument with the arithmetic value of its second argument isX 12 lterrorgt Yis12 Xis Y Y 3 23 Concurrency Data Parallelism TASK1 a b c for I 1lt60 1 k 0I li llt 20 ammo on i am b ic 1 TASKZ f0ri21 llt40 l aibi ci Decompose DATA inTo pieces All The Tasks perform The TASKS same compuTaTion operaTing wiTh Their own piece of dam 39 4 lt80 quot ammo cm gt 24 Concurrency Function Parallelism ab1 aac a2a d5d ed 1 ee1 gf3 ff1 ff4 Decompose COMPUTATIONS into pieces functions Data are taken to the tasks where they are needed 25


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Amaris Trozzo George Washington University

"I made $350 in just two days after posting my first study guide."

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.