Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] What does this mean?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-13 (04:26)
From: skaller <skaller@u...>
Subject: [Caml-list] What does this mean?
Can someone explain what this means .. 

Invalid_argument("equal: abstract value")

The code is below. I am fairly sure the problem
occurs in 'assoc' trying to compare two terms
for equality.

This piece of code unravels a Felix expression term
into a three-address-code, the equality comparison
is used to eliminate common subexpressions.

let unravel syms e =
  let sube = ref [] in
  let get e = 
    try assoc e !sube 
    with Not_found ->
      let n = !(syms.counter) in incr (syms.counter);
      let name = "_tmp" ^ si n in
      sube := (e,name) :: !sube;
  let refer ((_,t) as e) = 
    `BEXPR_expr (get e,t),t
  let idt t = t in
  let e' = 
    let rec aux e = 
      match e with
      | `BEXPR_apply ((`BEXPR_name _,_) as f, b),t
      | `BEXPR_apply ((`BEXPR_closure _,_) as f, b),t ->
        `BEXPR_apply (f, aux b),t
      | `BEXPR_apply (f,b),t -> `BEXPR_apply(aux f, aux b),t
      | `BEXPR_tuple ls,t -> `BEXPR_tuple (map aux ls),t
      | (`BEXPR_name _,t) as x -> x
      | x -> refer x
      aux e
 in !sube,e

John Skaller,
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: