CS 135 (Module 5: Semantics)

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

1/25

flashcard set

Earn XP

Last updated 3:59 PM on 11/7/22
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

26 Terms

1
New cards
What are identifiers?
They are the names of constants, parameters, and user-defined functions.
2
New cards
What is a syntax?
The way we are allowed to say things.
3
New cards
What are semantics?
The meaning of what we say.
4
New cards
What is ambiguity?
Valid sentences have exactly one meaning.
5
New cards
What do we do to enforce syntax and avoid ambiguity?
We can use grammars.
6
New cards
How do we solve sematics?
We solve it with a semantic model.
7
New cards
What does a semantic model do?
It provides a method of predicting the result of running any program.
8
New cards
How does a sematic model simplify the program?
Via substitution
9
New cards
What are ellipses and what are they used for?
An ellipsis is (...) and it is used to show a patterm. For example: (f v1 ... vn) -> v where v is the value of f(v_1, ..., v_n)
10
New cards
A Racket program is read
top-to-bottom and left-to-right
11
New cards
(cond [false exp] ...) ->
(cond ...)
12
New cards
(cond [true exp] ...) ->
exp
13
New cards
(cond [else exp]) ->
exp
14
New cards
These ellipses are showing an
omission
15
New cards
(and false ...) ->
false
16
New cards
(and true ...) ->
(and ...)
17
New cards
(and) ->
true
18
New cards
(or true ...) ->
true
19
New cards
(or false ...) ->
(or ...)
20
New cards
(or) ->
false
21
New cards
Apply functions only when all arguments are ___
values
22
New cards
When given a choice, evaluate the ____ first
leftmost expression
23
New cards
(f v1...vn) ->
v when f is built-in
24
New cards
(f v1...vn) ->
exp' when (define (f x1...xn) exp) occurs to the left..
25
New cards
id -> val when
(define id val) occurs to the left
26
New cards
What is tracing a program?
Doing a step-by-step reduction according to these rules we have learned.