Project

General

Profile

« Previous | Next » 

Revision a6974c82

Added by Pierre-Loïc Garoche about 5 years ago

[Horn] Workaround to prevent the use of declared keywords as node name

View differences:

src/backends/Horn/horn_backend_common.ml
47 47

  
48 48

  
49 49

  
50
(********************************************************************************************)
51
(*                    Workaround to prevent the use of declared keywords as node name       *)
52
(********************************************************************************************)
53
let registered_keywords = ["implies"]
54

  
55
let protect_kwd s = 
56
  if List.mem s registered_keywords then
57
    "__" ^ s
58
  else
59
    s
60

  
61
let node_name n =
62
  let name = node_name n in
63
  protect_kwd name
64

  
65

  
50 66
let concat prefix x = if prefix = "" then x else prefix ^ "." ^ x
51 67
let rename f = (fun v -> {v with var_id = f v.var_id } )
52 68
let rename_machine p = rename (fun n -> concat p n)

Also available in: Unified diff