Skip to content
scrambled
Programming Language Theory Flashcard

What is the untyped calculus of booleans and numbers?

Question

What is the untyped calculus of booleans and numbers?

Answer

A simple language with only natural numbers and booleans as primitives.

Terms:

t:=tru |fls |if t then t else t |0 |succ t |pred t |iszero t

Values:

v:=tru |fls |nvnv:=0 |succ nv

Evaluation relation:

t1→t1′if t1 then t2 else t3→if t1′ then t2 else t3if tru then t1 else t2→t1if fls then t1 else t2→t2t→t′succ t→succ t′pred 0→0pred (succ t)→tt→t′iszero t→iszero t′iszero 0→truiszero (succ nv)→fls