CSE 2231 – Statement

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/14

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:44 AM on 3/13/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

15 Terms

1
New cards

Your implementation must follow all rules in STATEMENT_MODEL. If your code breaks any rule, the implementation is wrong.

What does StatementKernel modeled by STATEMENT_MODEL mean?

2
New cards

A default BLOCK statement with an empty body: compose((BLOCK, ?, ?), <>)

What does the no-argument constructor new Statement1() create?

3
New cards

STATEMENT_MODEL says test and call are irrelevant when kind is BLOCK — we don't know or care about their values.

Why are the 2nd and 3rd tuple components ? when kind is BLOCK?

4
New cards

Returns the kind/label of the current statement (e.g. BLOCK, IF, WHILE, CALL).

What does this.kind() do?

5
New cards

Inserts statement s at position pos inside a BLOCK statement.

What does addToBlock(int pos, Statement s) do?

6
New cards

Removes and returns the statement at position pos from a BLOCK statement.

What does removeFromBlock(int pos) do?

7
New cards

The number of statements currently inside a BLOCK statement.

What does lengthOfBlock() return?

8
New cards

Builds an IF statement from condition c and body block s. Result: compose((IF, c, ?), )

What does assembleIf(Condition c, Statement s) do?

9
New cards

Breaks apart an IF statement — returns the condition and puts the body block into s. Opposite of assembleIf.

What does disassembleIf(Statement s) do?

10
New cards

addToBlock, removeFromBlock, and lengthOfBlock. Using them on non-BLOCK statements violates STATEMENT_MODEL.

Which methods only work on BLOCK statements?

11
New cards

The abstract mathematical rulebook your implementation must satisfy — defines what each method must do.

What is STATEMENT_MODEL in simple terms?

12
New cards

1st = kind (IF), 2nd = test (condition), 3rd = call (associated call). Body statements are in .

In compose((IF, test, call), ) what do the 3 tuple components represent?

13
New cards

BLOCK is the simplest blank state — IF and WHILE require meaningful test and call values to be valid.

Why does the no-argument constructor default to BLOCK and not IF or WHILE?

14
New cards

s gets replaced with the body block of the IF statement that was disassembled.

What happens to s after calling disassembleIf(Statement s)?

15
New cards

They are inverses — assembleIf builds an IF statement from parts, disassembleIf breaks it back into those parts.

What is the relationship between assembleIf and disassembleIf?

Explore top notes

note
Gases and Solutions
Updated 1206d ago
0.0(0)
note
Chapter 3: Federalism
Updated 1019d ago
0.0(0)
note
apush 5.1-5.3
Updated 464d ago
0.0(0)
note
Español 3H Repaso vocabulario
Updated 1060d ago
0.0(0)
note
Cranial Nerves
Updated 392d ago
0.0(0)
note
Gases and Solutions
Updated 1206d ago
0.0(0)
note
Chapter 3: Federalism
Updated 1019d ago
0.0(0)
note
apush 5.1-5.3
Updated 464d ago
0.0(0)
note
Español 3H Repaso vocabulario
Updated 1060d ago
0.0(0)
note
Cranial Nerves
Updated 392d ago
0.0(0)

Explore top flashcards

flashcards
Bio Lecture Final
276
Updated 690d ago
0.0(0)
flashcards
Microbiology Exam 4 Part 2
108
Updated 1062d ago
0.0(0)
flashcards
industrialization study guide
20
Updated 913d ago
0.0(0)
flashcards
Mesopotamia vocab
37
Updated 123d ago
0.0(0)
flashcards
bio practical 3
82
Updated 1077d ago
0.0(0)
flashcards
AD 227 Exam 3 Key Works
33
Updated 315d ago
0.0(0)
flashcards
Bio Lecture Final
276
Updated 690d ago
0.0(0)
flashcards
Microbiology Exam 4 Part 2
108
Updated 1062d ago
0.0(0)
flashcards
industrialization study guide
20
Updated 913d ago
0.0(0)
flashcards
Mesopotamia vocab
37
Updated 123d ago
0.0(0)
flashcards
bio practical 3
82
Updated 1077d ago
0.0(0)
flashcards
AD 227 Exam 3 Key Works
33
Updated 315d ago
0.0(0)