15-122: Principles of Imperative Computation,
Summer 2011
Assignment 8: The C0VM
William Lovas ([email protected])
Tom Cortina ([email protected])
Frank Pfenning ([email protected])
Out: Thursday, June 16, 2011
Due: Thursday, June 23, 2011 (11:59pm)
1 Overview
In this assignment y
15-122 : Principles of Imperative Computation, Spring 2016
Written Homework 2
Due: Monday 25th January, 2016
Name:
Andrew ID:
Section:
This written homework covers more reasoning using loop invariants and assertions, and the
C0 types int and bool as well
15-122 : Principles of Imperative Computation, Fall 2014
Written Homework 2
Due: Monday, September 8, 2014
Name:
Andrew ID:
Section:
This written homework covers more reasoning using loop invariants and assertions, and the
C0 types int and bool.
Revision
15-122 Homework 4
Page 1 of 10
15-122 : Principles of Imperative Computation, Spring 2013
Homework 4 Theory
Due: Thursday, March 7, 2013, at the beginning of lecture
Name:
Andrew ID:
Recitation:
The written portion of this weeks homework will give you som
15-122 Assignment 4
Page 1 of 8
15-122 : Principles of Imperative Computation
Summer 1 2012
Assignment 4
(Theory Part)
Due: Monday, June 11, 2012 in class
Name:
Andrew ID:
Recitation:
The written portion of this weeks homework will give you some practice
15-122 : Principles of Imperative Computation, Fall 2014
Written Homework 3
Due: Monday, September 15, 2014
Name:
Andrew ID:
Section:
This written homework covers specifying and implementing search in an array and how to
reason with contracts. You will us
15-122 Homework 1
Page 1 of 12
15-122: Principles of Imperative Computation, Spring 2013
Homework 1 Programming: Imagelab
Due: Monday, February 4, 2013 by 23:59
For the programming portion of this weeks homework, youll review how images are stored
in the
15-122 Homework 1
Page 1 of 6
15-122 : Principles of Imperative Computation, Spring 2013
Homework 1 Theory
Due: Tuesday, February 5, 2013, at the beginning of lecture
Name:
Andrew ID:
Recitation:
The written portion of this weeks homework will give you so
15-122 : Principles of Imperative Computation, Fall 2014
Written Homework 4
Due: Monday, September 22, 2014
Name:
Andrew ID:
Section:
This written homework covers big O notation and some reasoning about searching and
sorting algorithms. You will use some
15-122 Assignment 6
Page 1 of 5
15-122 : Principles of Imperative Computation
Fall 2012
Assignment 6 Selected Solutions
(Theory Part)
The following solutions are provided to you to help you study this semester. They are not
to be distributed to others out
15-122 : Principles of Imperative Computation, Fall 2014
Written Homework 5
Due: Monday, September 29, 2014
Name:
Andrew ID:
Section:
This written homework covers asymptotic complexity for a new algorithm, the visualization
of pointers in C0, and the use
15122: Principles of Imperative Computation
M IDTERM E XAM 1
S AMPLE S OLUTIONS
October 2, 2014
This exam is closed book with one sheet of notes permitted.
You have 80 minutes to complete the exam.
There are 12 pages in this examination, comprising 4 q
15-122: Principles of Imperative Computation, Spring 2017
Written Homework 1
Due:
rd
Monday 23
January, 2017 by 9pm
Name:
Andrew ID:
Section:
This written homework is the rst of two homeworks that will introduce you to the way we
reason about C0 code in 1
15-122: Principles of Imperative Computation
Recitation 3: Function Family Reunion
Spring 2017
3 February
Big-O denition
The denition of big-O has a lot of mathematical symbols in it, and so can be very confusing at rst.
Let's familiarize ourselves with t
15-122: Principles of Imperative Computation, Spring 2017
Written Homework 4
th
Due: Monday 13
February, 2017 by 9pm
Name:
Andrew ID:
Section:
This written homework covers big-O notation and some reasoning about searching and sorting algorithms.
You will
Lecture 8
Data Structures
15-122: Principles of Imperative Computation (Spring 2017)
Frank Pfenning, Andr Platzer, Rob Simmons, Iliano Cervesato
1
Introduction
In this lecture we introduce the idea of imperative data structures. So far, the
only interface
Spring 2017
15-122: Principles of Imperative Computation
Recitation 1: C0 Basics
23 January
Administrivia and general advice
Welcome to 15-122 recitation! Take a moment to ll in the particulars for this section, so that you know
which section you're in as
Spring 2017
15-122: Principles of Imperative Computation
Recitation 4: A Strange Sort of Proof
In class, we covered one quadratic sort,
selection sort.
10 February
Today, we'll look at the full correctness proof,
from beginning to end, for another type of
Spring 2017
15-122: Principles of Imperative Computation
Recitation 2: A Bit About Bytes
27 January
Converting between binary and decimal
To easily convert a number represented in binary notation, such as
10100[2] ,
we can employ Horner's
algorithm. At ea
15-122: Principles of Imperative Computation
Recitation Week 3
Rob Simmons
In class, we covered one quadratic sort, selection sort, and two O(n log n) sorts, quicksort and mergesort.
To practice with thinking about sorts in terms of loop invariants, today
Midterm II Exam
15-122 Principles of Imperative Computation
Tom Cortina and Rob Simmons
November 6, 2014
Name:
Andrew ID:
Recitation Section (specify letter):
Instructions
This exam is closed-book with one sheet of notes permitted.
You have 80 minutes t
15-122: Principles of Imperative Computation
Recitation Week 4
Nivedita Chopra, Rob Simmons
Checkpoint 0
Write a function to reverse a queue, using only the functions from the stack and queue interfaces.
1 void reverse(queue Q) cfw_
2
/ Hint : Allocate a
15-122: Principles of Imperative Computation
Recitation Week 2
Josh Zimmerman, Nivedita Chopra
Checkpoint 0
A water main break in GHC has, confusingly, broken the C0 compilers -d option! C0 contracts are
now being treated as comments, and the only way to
15-122: Principles of Imperative Computation, Spring 2017
Written Homework 11
Due: Thursday 13
th
April, 2017 by 9pm
Name:
Andrew ID:
Section:
This written homework provides practice with some introductory C concepts.
Instructions
You can prepare your sub
Midterm 1 Solutions
15-122 Principles of Imperative Computation
Saquib Razak, Rob Simmons, and Hyrum Wright
February 17, 2015
Name:
Andrew ID:
Harry Bovik
bovik
Recitation Section (specify letter or TA):
S
Instructions
This exam is closed-book with one s
Midterm 1 Solutions
15-122 Principles of Imperative Computation
Thursday 6th October, 2016
Name:
Andrew ID:
Recitation Section:
Harry Bovik
bovik
S
Instructions
This exam is closed-book with one sheet of notes permitted.
You have 80 minutes to complete
Midterm 1 Exam
15-122 Principles of Imperative Computation
Thursday 6th October, 2016
Name:
Andrew ID:
Recitation Section:
Instructions
This exam is closed-book with one sheet of notes permitted.
You have 80 minutes to complete the exam.
There are 4 pr
15-122: Principles of Imperative Computation, Spring 2017
Written Homework 2
th
Due: Monday 30
January, 2017 by 9pm
Name:
Andrew ID:
Section:
This written homework covers more reasoning using loop invariants and assertions, and the
C0 types int and bool a
15-122 Programming Homework 4
Page 1 of 9
15-122: Principles of Imperative Computation, Spring 2017
Programming Homework 4: DosLingos
Due: Thursday 16
th
February, 2017 by 9pm
This week we will do some relatively small exercises centered around searching
Spring 2017
15-122: Principles of Imperative Computation
Recitation 5: A queue_t Interface
17 February
A Wild struct Appears
Suppose we have the following denitions:
struct X cfw_
int a;
struct Y* b;
;
struct Y cfw_
int* c;
int d;
struct X* e;
;
struct X*
Lecture 8
Data Structures
15-122: Principles of Imperative Computation (Spring 2017)
Frank Pfenning, Andr Platzer, Rob Simmons, Iliano Cervesato
1
Introduction
In this lecture we introduce the idea of imperative data structures. So far, the
only interface
Lecture 10
Linked Lists
15-122: Principles of Imperative Computation (Spring 2017)
Frank Pfenning, Rob Simmons, Andr Platzer
1
Introduction
In this lecture we discuss the use of linked lists to implement the stack and
queue interfaces that were introduced
Final Exam
15-122 Principles of Imperative Computation
Frank Pfenning
December 14, 2012
Name:
Andrew ID:
Sample Solution
Section:
fp
Instructions
This exam is closed-book with one sheet of notes permitted.
You have 180 minutes to complete the exam.
The
Final Exam
15-122 Principles of Imperative Computation
Frank Pfenning
December 14, 2012
Name:
Andrew ID:
Section:
Instructions
This exam is closed-book with one sheet of notes permitted.
You have 180 minutes to complete the exam.
There are 6 problems o
Lecture 9
Stacks & Queues
15-122: Principles of Imperative Computation (Spring 2017)
Frank Pfenning, Andr Platzer, Rob Simmons
1
Introduction
In this lecture we introduce queues and stacks as data structures, e.g., for
managing tasks. They follow similar