# tiny - / CC / PP / EE let EQ : : : x C P E y -> s -> s ->...

This preview shows pages 1–2. Sign up to view the full content.

// CC : C -> s -> s // PP : P -> input ->output // EE : E -> s -> (v, s) let EQ x y = Istruthvalue x & Istruthvalue y | Isstring x or Isinteger x | false in let COMP f g x = let R = f x in R @EQ 'error' -> 'error' | g R in let PIPE x f = x @EQ 'error' -> 'error' | (f x) in let Return v s = (v,s) in let Check Dom (v,s) = Dom eq 'Num' -> Isinteger v -> (v,s) | 'error' | Dom eq 'Bool' -> Istruthvalue v -> (v,s) | 'error' | 'error' in let Dummy s = s in let Cond F1 F2 (v,s) = s @PIPE (v -> F1 | F2) in let Replace m i v x = x @EQ i -> v | m x in let Head i = i 1 in let Tail T = Rtail T (Order T) where rec Rtail T N = N eq 1 -> nil | (Rtail T (N-1) aug (T N)) in //let Last T = T (Order T) //in let rec EE E (m,i,o) = Isinteger E -> Return E (m,i,o) | Isstring E -> ( E eq 'true' -> Return true (m,i,o) | E eq 'false' -> Return false (m,i,o) | E eq 'read' -> Null i -> 'error' | (Head i,(m,Tail i,o)) | (let R = m E in R @EQ 'undef' -> 'error'

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 11/09/2011 for the course COP 5555 taught by Professor Staff during the Fall '08 term at University of Florida.

### Page1 / 2

tiny - / CC / PP / EE let EQ : : : x C P E y -> s -> s ->...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online