### Create a StudySoup account

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

Already have a StudySoup account? Login here

# Programming Language Concepts 22C 111

UI

GPA 3.87

### View Full Document

## 10

## 0

## Popular in Course

## Popular in ComputerScienence

This 58 page Class Notes was uploaded by Tamia Bernhard on Friday October 23, 2015. The Class Notes belongs to 22C 111 at University of Iowa taught by Staff in Fall. Since its upload, it has received 10 views. For similar materials see /class/228052/22c-111-university-of-iowa in ComputerScienence at University of Iowa.

## Popular in ComputerScienence

## Reviews for Programming Language Concepts

### 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/23/15

2202111 Proof Rules for the Sample Language 1 Axiom of Assignment For each assertion Q and assignment statement X E I QXgtE XE Q ASN II Sequential Execution Inference Rule For any assertions P Q and R and program fragments H1 and H2 I P H1 0 and I Q 112 R I Pm1 n2R SEQ III Ifthenelse Inference Rule For any assertions P and Q and program fragments H1 and H2 I P A Egt0 111 Q and I P A E50 112 Q I P if E then 111 else 112 fi Q ITE IV While Inference Rule For each assertion P called the loop invarianf and program fragment TI P Egt0 P A H WHL I P while E do TI od P E50 V Strengthen Precondition Inference Rule For any assertions P Q and R and program fragments TI P gt O and Q R H STR I P H R VI Weaken Postcondition Inference Rule O gt R and P Q H WKN I P H R Note that we do not distinguish between logically equivalent assertions Also since we are interested in focusing on the program proving steps we avoid proofs about integers and take these facts as premises Regular Expressions and Finite Automata Background for Lexical Analysis Teodor Rus ruscsuiowaedu The University of Iowa Department of Computer Science 22Cl 11 Programming Language Concepts 7p 1439 Source language structuring The set of strings that belong to a SL has threelevel structure 1 Language lexicon collection of symbols that can be used to denote program entities 2 Language constructs speci ed by a nite set of patterns used to generate them from lexical elements and other valid language constructs 3 Program one of the language constructs that is implicitly declared executable 22Cl 11 Programming Language Concepts 7 p2439 Target language structuring The TL itself can be structured on three levels 1 Language lexicon a nite set of hardwarerecognized codes that denote machine operations registers memory locations and literals usually small integers 2 IIlStl39llCthIl set a nite set of patterns used to generate instructions machineoperations and machinedata representations from lexicon elements 3 Machine language program a set of sequences of machine instructions and data together with an instruction that may start program execution Note Java Virtual Machine is a good example for this pattern 22Cl 11 Programming Language Concepts 7 p3439 Compiler structuring A threephase structure shown in Figure 1 IR Optimizer IR V V BackEnd gt Target Source gt FrontEnd Figure 1 Structure of a threephase compiler Note language structuring implies that each box can be implemented by three boxes that process language elements accordingly incrementally 22Cl 11 Programming Language Concepts 7 p4439 FrontEnd components Scanner Program text gt Stream of lexical tokens Parser Stream of tokens gt language construct Parse Tree Constructor Construct gt Abstract Syntax Tree AST Semantic Analyzer AST gt I R where I R stands for Intermediate Representation Note I R is usually an AST where each node is labeled by the triple type scope value 22Cl 11 Programming Language Concepts 7 p5439 Optimizer components Optimizer a sequence of I R gt I R transformations that performs such tasks as Common expression elimination Loop invariants identi cation Dead code elimination Note one or more of such transformations can be seen as an optimizing component 22C1 11 Programming Language Concepts 7 p6439 BackEnd components Address assignment Register allocation 0 Instruction selection and generation 0 Instruction scheduling Machine dependent code improvement such as peephole optimization Note BackEnd is also called code generation 22Cl 11 Programming Language Concepts 7 p7439 Speci cation mechanisms Regular expressions RE ContextFree Grammars CFG Attribute Grammars AG 0 Tree gt Tree Transformations TTT Regular tree grammars RTG We are interested in this class only in RES regular expressions and CFGS context free grammars 22Cl 11 Programming Language Concepts 7 p8439 Implementation mechanisms 0 Deterministic Finite Automata DFA Deterministic Pushdown Automata PDA Patternmatchers in strings and in trees Attribute Graph Evaluators AGE Finite Tree Transductors FTT Finite Tree Automata FTA Only DFAs and PDAs are of interest in this class 22Cl 11 Programming Language Concepts 7 p9439 Pairing mechanisms Speci cation mechanisms are paired With the implementations mechanism as shown in Table 2 22C 1 1 1 Programming Language Concepts 7 p 10439 Pairing mechanisms Speci cation mechanisms are paired With the implementations mechanism as shown in Table 2 Compiler task Speci cation Implementation Figure 2 Task speci cation and implementation 22C 1 l 1 Programming Language Concepts 7 p 10439 Pairing mechanisms Speci cation mechanisms are paired With the implementations mechanism as shown in Table 2 Compiler task Speci cation Implementation Lexical analysis RE DFA Figure 2 Task speci cation and implementation 22C 1 l 1 Programming Language Concepts 7 p 10439 Pairing mechanisms Speci cation mechanisms are paired With the implementations mechanism as shown in Table 2 er cation ementatlon RE DFA CFG PDA Figure 2 Task speci cation and implementation 22C 1 l 1 Programming Language Concepts 7 p 10439 Pairing mechanisms Speci cation mechanisms are paired With the implementations mechanism as shown in Table 2 er cation ementatlon RE DFA CFG PDA AG AGE Figure 2 Task speci cation and implementation 22C 1 l 1 Programming Language Concepts 7 p 10439 Pairing mechanisms Speci cation mechanisms are paired With the implementations mechanism as shown in Table 2 er cation ementatlon RE DFA CFG PDA AG AGE TTT FTT Figure 2 Task speci cation and implementation 22C 1 l 1 Programming Language Concepts 7 p 10439 Pairing mechanisms Speci cation mechanisms are paired With the implementations mechanism as shown in Table 2 er cation ementatlon RE DFA CFG PDA AG AGE TTT FTT RTG FTA Figure 2 Task speci cation and implementation 22C 1 l 1 Programming Language Concepts 7 p 10439 Architecture of a compiler The architecture of a modern compiler is in Figure 3 FrontEnd Optimizer BackEnd A E A R T T T L L H i i i INFRASTRUCTURE SymTabs Trees Graphs Grammars Sets Figure 3 Compiler s architecture 22C 1 11 Programming Language Concepts 7 p 1 1439 Facts Each component of the SL is speci ed by a mathematically well de ned abstraction Each component of the SL is implemented by a mathematically well de ned transformation of the component source speci cation into component target speci cation This pairing allows us to develop tools for automatic language implementation 22C 1 l 1 Programming Language Concepts 7 p 12439 Regular Expressions Consider 2 an alphabet A regular expression R over X is de ned recursively by the rules Recursion basis 1 For any a E Z a is a regular expression describing the language La a 2 e is a regular expression describing the language Le e 3 0 is a regular expression describing the empty language L 0 22C 1 l 1 Programming Language Concepts 7 p 13439 Form a continuation Recursion body 4 If R1 and R2 are regular expressions evaluating to the languages LR1 and LR2 then a 191le is a regular expression that evaluates to the language LR1 U LR2 l is called the choice regular operator b R1 0 R2 is a regular expression that evaluates to the language LR1 o LR2 o is called the concatenation regular operator and it is usually discarded 0 RT is a regular expressions that evaluates to the language U 20LR173 where LR173 LRl73 1 o LR1 and LRlO e is called Kleene star regular operator Note a de nition of this form is called an inductive de nition 22C 1 l 1 Programming Language Concepts 7 p 14439 Examples Consider the alphabet D 0 1 23 56 789 1 e and 0 are regular expressions by rules 2 and 3 and languages generated by them are Le e L 0 0 1 2 9 are regular expressions by rule 1 and languages generated by them are L0 0L1 1 L9 E1 019 E2 E118 E3 E217 are regular expressions by rule 4a and languages generated by them are LE1 09 LE2 098 ME 093 7 E4 0 1 E5 1 E2 E6 E1 E are regular expressions by rule 4b and language generated by them are LE4 01 LE5 101918LE6 0009080790999897 E7 1 E8 Ef are regular expressions by the rule 40 and the languages generated by them are LE7 6 1 11 111 and LE8 60900099099000009090099 22C 1 l 1 Programming Language Concepts 7 p 15439 Potential confusions Do not confuse the regular expressions 6 and D l 6 represent the language that contains just one element the empty string 2 0 is the regular expression that represent the language with no elements the empty language Note the distinction between R and LR R is an expression and LR is the set of strings speci ed by R 22C 1 l 1 Programming Language Concepts 7 p 16439 More examples Regular expressions and languages over the alphabet Z 0 1 l 2 3 9094 010 L0 10 contains exactly a single 1 Z1Z LZ1Z contains at least one 1 Z001Z LZ001Z contains the string 001 as a substring 22V LZZ is a string of even length SEXY LZZZ the length ofw is a multiple ofthree 01101 L0101 01 01 Is this right 0210112111011 L0201E101 starts and ends with the same symbol 0101 L0 1 01 U1 010116 L0 1 60 101 22C 1 l 1 Programming Language Concepts 7 p 17439 Identities If R is a regular expression then the following identities take place 39 10 L1 0 In English concatenating the emptyset to any set yields the empty set 0 L In English 6 is in the star operation applied on any language if that language has no strings 6 becomes the only element of the resulting language 39 LR U 0 LR In English adding empty language to the language L does not change L 39 LR o e LR In English concatenating a string 11 with the empty string does not change 11 22C 1 ll Programming Language Concepts 7 p 18439 Facts 1 LR u 6 7A LR Example ifR 0 then LR 0 LR U 6 0 e 2 LR o 0 7A LR Example ifR 0 then LR 0 but LR o 0 0 22C 1 1 1 Programming Language Concepts 7 p 19439 Application Lexicons of programming languages are described by regular expressions Example numerical constants can be described by eDDDDDDDD Where D 0 1 2 34 56789 From the lexicon description by regular expressions on can generate lexical analyzers 22C 1 l 1 Programming Language Concepts 7 p20439 Example lexicon speci cation Clite lexicon OpSign epsilon LetterabzABZ Digitl9 Zero O Char OpSign Letter Digit OtherASCII Boolean true false Identifier Letter Identified Letter Identifier Digit Digits Digit Digits D Digits Zero Integer OpSign Digits Float Integer Integer Literal Integer Boolean Float Char Example Identi ers a12bc avd3bc Not identi ers 123abd abc Integers 1234 1234 1234 Not integers 01234 01234 211234 Float 12341234 Not oats 1234E1234 0123123 22C 1 11 Programming Language Concepts 7 p21439 Finite automata Are machines composed of ve parts We illustrate them With an automatic door Figure 4 Front Rear pad pad door Figure 4 Controller of an automatic door 22C 1 l 1 Programming Language Concepts 7 p22439 DFA components 1 A set of states Example open closed An input alphabet that indicates the allowed symbols Example front rear both neither Transition rules that show state change depending upon the input symbol called state transitions see Figure 5 It has a start state Example the door is closed It has a set of accept states Example open closed Note the only way of storing info in this machine is its set of states 22C 1 l 1 Programming Language Concepts 7 p23439 DFA transition illustration rear front both rear neither both front A gt V neither Figure 52 Controller s state transition diagram Table representation Tnm n states X m alphabet letters SA front rear both neither open open open open closed closed open closed closed closed 22C 1 l 1 Programming Language Concepts 7 p24439 Formal de nition A nite automaton is a 5tuple Q E 6 10 F where 1 Q is a nite set called the set of states 2 Z is a nite set called the alphabet 3 6 Q X Z gt Q is the transition function 4 go E Q is the start state also called initial state 5 F Q Q is the set of accept states also called the nal states 22C 1 l 1 Programming Language Concepts 7 p25439 Observations Since the set F can be emptyset D a nite automaton may have zero accept states 0 Since transitions are described by a function the function 6 speci es exactly one next state for each possible combination of state and input symbol 0 In applications the transition function may be represented by a table Why 22C 1 l 1 Programming Language Concepts 7 p26439 Example nite automaton The automaton M1 q1q2q3016q1q2 can be represented by the following table where qS denotes start state and qF denotes nal states State sAlphabet 0 1 If 11 lt12 lt15 q3 lt12 13 12 12 M1 is also represented by the transition diagram in Figure 6 0 1 1 0 5 9 Figure 62 The nite automaton M1 22C 1 l 1 Programming Language Concepts 7 p27439 DFA computation Let M Q E 6 go F be a nite automaton and w UJ1UJ2 10 be a string over 2 M accepts w E 2 if a sequence of states 71371 rn exist in Q such that the followmg hold 1 r0 qo machine starts in the startstate 2 603115 T 1 fOI39i 01 n 1 machine operates according to its transition function 3 m E F Completely consumed input leaves the machine in a nal state If A is the set of all strings that a machine M accepts we say that A is the language offhe machine M and write LM A Example LM contains at least one 1 and an even number of Os follow the last 1 22C 1 l 1 Programming Language Concepts 7 p28439 Equivalence of RE and DFA For any regular expression R that generates a language LR there is a DFA D R that recognizes the language LR that is LDR LR 22C 1 l 1 Programming Language Concepts 7 p29439 Notation and construction Notation 39 We use both graph and table notation of thes DFA that follows 39 In the graph notation start state is speci ed by an arrow from nowhere to the start state and nal states are enclosed in double circles 39 In the table notation start and nal states are shown by S and F exponents at state line labels Construction convert a regular expression R into an DFA D R by a sevenstep procedure 22C 1 l 1 Programming Language Concepts 7 p30439 Step 1 HR D then LR D and the NFA N that recognizes LR is in Figure 7 o Figure 72 he NFA N recognizing 0 22C 1 11 Programming Language Concepts 7 p31439 Formal construction Formally N Q 26q D where 6039 Dforanyr E Qandb E 2 Table the table representing D R is empty 22C 1 1 1 Programming Language Concepts 7 p32439 Step 2 HR 6 then LR e and the NFA N that recognizes LR is in Figure 8 Figure 82 The NFA N recognizing 6 22C 1 1 1 Programming Language Concepts 7 p33439 Formal construction Formally N ql26q1q1 where 6r b D for any 7 6 Q1 and b E 2 Table representation StateAlphabet SF 11 22C 1 l 1 Programming Language Concepts 7 p34439 Step 3 HR a E 2 then LR a and the NFA N recognizing LR is in Figure 9 Figure 92 NFA N recognizing a Note this is an NFA but not a DFA because it has states With no exiting arrow for each possible input symbol 22C 1 1 1 Programming Language Concepts 7 p35439 Formal construction Formally N q1q2 26q1 q2 where 6Q17a Q2 6rb Dforr E q1qQr7 q1andbE Elm 0 Table representation StateAlphabet a Jig 12 V V lt15 22C 1 l 1 Programming Language Concepts 7 p36439 Step 4 R1 R2 then U Note in View with the inductive nature of R we may assume that 1 N1 Q1 261q1F1 is an NFA that recognizes LR1 2 N2 Q2 2 62 qg F2 is an NFA that recognizes LR2 The NFA N recognizes LR1R2 is given in Figure 10 22C 1 1 1 Programming Language Concepts 7 p37439 NFA recognizing LR1 U LR2 10C Oo OO 6 OO O 0 Co E o O 0 00C 00C Figure 102 Construction of N to recognize LR1 U R2 22C 1 1 1 Programming Language Concepts 7 p38439 Construction procedure Table representation from the tables Table 1 Transition Table N 1 StateAlphabet 6 a1 aZ am If V qf q qvtn 1591 Table 2 Transition Table N2 StateAlphabet 6 a1 aZ am 7 Q r i 7f rfn F F r1 rp 22C 1 l 1 Programming Language Concepts 7 p39439 Results Construct the transition table TN1N2 Table 3 Transition Table of N1N2 StateAlphabet 6 a1 0139 am lt15 117 T1 9 V V V 11 qf qf qfn 1591 71 Q rf 7f rfn if 22C 1 1 1 Programming Language Concepts 7 p40439 Step 5 HR R10 R2 then LR LR1 o LR2 Note in View with the inductive nature of R we may assume that 1 N1 Q1 261q1F1 is an NFA that recognizes LR1 2 N2 Q2 2 62 qg F2 is an NFA that recognizes LR2 The NFA N that recognizes LR1 0 R2 is given in Figure 11 22C 1 11 Programming Language Concepts 7 p41439 NFA recognizing LR1 o LR2 N1 N2 OO 0 80 00 Figure 1 12 Construction of N to recognize LR1 0 R2 22C 1 1 1 Programming Language Concepts 7 p42439 Results Transition table T N1 0 N2 Table 4 Transition Table of N1 0 N2 StateAlphabet 6 a1 0139 am lt15 11 T1 Q Q Q Q Q 11 Q qf qf qfn 11 quot1k T1 71 Q Ti 7quot rfn Fur 22C 1 l 1 Programming Language Concepts 7 p43439 Step 6 then UiZOLltR1i Note in View with the inductive nature of R we may assume that 1 N1 Q1 261q1F1 is an NFA that recognizes LR1 The NFA N that recognizes MB is given in Figure 12 22C 1 1 1 Programming Language Concepts 7 p44439 NFA recognizing MR N N1 Figure 122 Construction of N to recognize LRi Transition table of N1 is obtained from the transition table of N using an ob vious procedure 22C 1 1 1 Programming Language Concepts 7 p45439 Step 7 Map the automaton constructed by steps 1 through 6 into a DFA This is outside of our concern here We assume that we construct a DFA 22C 1 1 1 Programming Language Concepts 7 p46439 DFA simulation by program Let TTn m be the transition table of a DFA DFA q1q2 qn a1a2 amTnmq0F where Tz j 6qz39 aj The following Clike code simulates the behavior of this DFA while working on the input 111 11111112 wn int C q C getcw q q0 qO is the line of T representing the start state while C not EOF q C if q final accept otherwise reject TTqC getcw Discussion how would you design and implement Clite scanner using REs 22C 1 l 1 Programming Language Concepts 7 p47439 22C2111 Example Axiomatic Program Proof The Fibonacci numbers are a sequence of integers defined recursively by b0 O b1 1 and bN bN 1 bN 2 for Ngt1 The naturally corresponding recursive program in any language for this definition is clearly correct but so highly inefficient that it is of no practical use even for small eg two digit arguments We prove that the following iterative program fragment in Louden39s Sample language is correct its performance is clearly directly proportional to the size of the argument N N20 NEW 1 01D 0 1 O l 1 while N I do 1 1 1 NEW NEWOID OLDz NEW 01D od OLD bN Proof read as it is provable that m discover the loop invariant 1P Informally the idea of the loop is that as I is incremented the variables NEW and OLD are revised to maintain the value of bI and bl We also include a technical condition relating I and N that s needed in the last step Take P a OsIsN A NEWfibI1 A OLD bI Step 1 Show N20 NEW1 OLDO 10 1P Exercise 7 takes several steps using ASN and SEQ m Show 1 while OLDfibN ie prove the post condition This step is established through several intermediate steps Step 2A Find Q1 and Q2 to show ie l is a loop invariant P A N IgtO II1 Q1 NEWz NEWOID Q2 OlDz NEWOLD P page 1 of2 22C2111 Example Axiomatic Program Proof Step 2Ai formulate Q1 After I is incremented but NEW and OLD have not yet been changed the Fibonacci indicies of NEW and OLD are one step behind Take Q1 5 OsIsN A NEW bI A OLDfibI1 Step 2Aii Show I A Ilt N 1 11 Q1 It can be seen that I A IltN gt Q l I1 so by ASN and STR step 2Aii holds Step 2Aiii formulate Q2 At this point the index I and the variable NEW have been updated but the variable OLD is still a step behind Take Q2 5 OsIsN A NEW bI1 A OLD bI1 Step 2Aiv show Q1 NEWz NEWOLD 2 This is a direct application ofASN Step 2sz show Q2 OLDz NEW OLD 1 One can see that Q2 gt IPOLD NEW OLD so that by ASN and STR this step is proven Step 2Avi by steps 2Aii 2Aiv and 2Av and SEQ applied twice the proof of step 2A is complete Step 2B by step 2A and WHL we have 1 while I A N IO Now I A N IO implies this is where we need OglgN included in the loop invariant IN A OLD bI Therefore I A IzN gt OLD bN ie the value of I is immaterial at the end Step 3 By steps 1 and 2 and WKN the program is proven This presentation has illustrated how to discover the program proof and determine the needed steps A valid logic proof would require reordering all the individual steps so that each is either an axiom or is derived from previous steps by a rule of inference page 2 of 2 22C111 String Notations For a set C of characters the notation C denotes the set of all finite strings over C Each XEC c has a length lenxZO the number of characters in string x The null string which has length 0 is included in C and is written as s For strings uvEC their concatenation is quC u followed by v and lenuv lenu lenv Also for wEC and n 2 0 an integer wn ww w n copies is the n fold concatenation of w with itself and w0 2 Note that wnwm wnm for all mn Z 0 A language is just a subset of C Since a language L is a set we may speak of its cardinality number of elements cardL For sets of strings STQ C we perform the usual settheoretic operations of union intersection and complementation We also perform set concatenation S 0 T to get a new set S 0 T st 565 and tET We can observe that cardS 0 T S cardS cardT We also use the notation Sn to denote the set of strings S 0 S 0 0 S n copies where S0 2 And set iteration or star is defined as an arbitrary number of iterations S S0 U S1 U U Sn U The laws of exponents are valid for the power notation for set concatenation as well as string concatenation Regular Expressions The set operations U 0 and are called the regular expression operations A regular expression is a prototypical description of a language A regular expression over a character set C is a formula or pattern involving characters from C plus several auxiliary symbols constructed according to the following rules 1 each AEC is a regular expression and auxiliary symbols 2 and Q are regular expressions 2 using additional auxiliary symbols l or 0 concatenation star and parenthesis if A and B are regular expressions then so are a A I B b A 0 B and c A 3 only formulas constructed by repeated application of rules 1 and 2 are regular expressions The formal rules for writing regular expressions as given above require a fully parenthesized form To provide a more practical format the regular expression operations are given precedence so that parenthesis can often be omitted is highest 0 is intermediate and l is lowest also in place of A 0 B we normally write AB Each regular expression A denotes a language LA C referred to as a regular language as defined by LA A for AEC Ls 12 L Q if A B l C then LA LB U LC if A BOC then LA LB 0 LC ifA 3 then LA LB page 1 of 2 22C111 Examples For all these examples we take the character set C 01 Note that a regular expression written in precedenceoriented shorthand such as 00 1 in the fully parenthesized form of the formal definition would be written as 001 We use precedence conventions in these examples I 001 I 010 I 100 denotes the language with three strings 001 010 100 I 0 I 1 denotes the infinite language consisting of all strings 2 0 1 00 01 I 00 I 1 denotes the infinite language consisting of all strings beginning with 39039 I 0 I 11 denotes the infinite language consisting of all strings ending with 39139 I 01010 denotes the infinite language consisting of all strings having an even number of 391 39s I 0 I 1 I 00 I 10 I 10 I 11 denotes the infinite language consisting of all strings with the same first and last character page 2 of 2

### 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

#### "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."

#### "Selling my MCAT study guides and notes has been a great source of side revenue while I'm in school. Some months I'm making over $500! Plus, it makes me happy knowing that I'm helping future med students with their MCAT."

#### "I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

#### "Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

### Refund Policy

#### STUDYSOUP CANCELLATION 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 support@studysoup.com

#### STUDYSOUP REFUND POLICY

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: support@studysoup.com

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 support@studysoup.com

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.