Changeset 98


Ignore:
Timestamp:
Sep 21, 2010, 2:21:25 PM (9 years ago)
Author:
mulligan
Message:

preliminary pretty-printing function (no usable output)

Location:
Deliverables/D4.1
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D4.1/BitVectors.ml

    r97 r98  
    6262let map2_bits = List.map2
    6363
    64 let string_of_vect l =
    65  String.concat "" (List.map (function false -> "0" | true -> "1") l)
     64let string_of_bit = function false -> "0" | true -> "1"
     65let string_of_vect l = String.concat "" (List.map string_of_bit l)
    6666
    6767let full_add l r c = List.fold_right2 (fun b1 b2 (c,r) -> b1 & b2 || c & (b1 || b2),xor (xor b1 b2) c::r) l r (c,[])
     
    100100  in
    101101    aux 1 (List.rev v)
     102
     103let string_of_vect v =
     104 String.concat "" (List.map (function false -> "0" | _ -> "1") v)
    102105
    103106let size_lookup =
  • Deliverables/D4.1/BitVectors.mli

    r97 r98  
    2929val int_of_vect: 'a vect -> int
    3030val vect_of_int: int -> ([< sizes] as 'a) -> 'a vect
     31val string_of_vect: 'a vect -> string
     32val string_of_bit: bit -> string
    3133
    3234val (-&-): 'a vect -> 'a vect -> 'a vect
Note: See TracChangeset for help on using the changeset viewer.