\r
(* FIXME *)\r
let mk_var' (bound, free) x =\r
- if List.mem x bound\r
+ if x <> "@" && List.mem x bound\r
then free, mk_var (Util.index_of x bound)\r
- else if List.mem x free\r
+ else if x <> "@" && List.mem x free\r
then free, mk_var (List.length bound + Util.index_of x free)\r
else (free @ [x]), mk_var (List.length bound + List.length free)\r
;;\r
let read_var s =\r
let rec aux = function\r
| [] -> None, []\r
- | c::cs as x -> if isAlphaNum c\r
+ | c::cs as x ->\r
+ if c = '@' then\r
+ (if cs <> [] && (let hd = List.hd cs in hd = '@' || isAlphaNum hd)\r
+ then raise (ParsingError ("Unexpected `"^String.make 1 (List.hd cs)^"` after `@`."))\r
+ else Some['@'], cs)\r
+ else if isAlphaNum c\r
then match aux cs with\r
| (Some x), cs' -> Some (c :: x), cs'\r
| None, cs' -> (Some [c]), cs'\r
| Some varname, cs ->\r
let free, v = mk_var' vars varname in\r
Some [v], cs, (bound, free)\r
- | _, _ -> raise (ParsingError ("Can't read variable"))\r
+ | None, _ -> raise (ParsingError ("Can't read variable"))\r
;;\r
\r
let rec read_smt vars =\r