Skip to content

Commit 235c62d

Browse files
authored
Merge pull request #1406 from herbie-fp/egglog-vars
Make variable prefixes in egglog encoding unique in all cases.
2 parents c7785e8 + c954473 commit 235c62d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/egglog-herbie.rkt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@
617617
(cond
618618
[(hash-has-key? vars x)
619619
(if spec?
620-
(string->symbol (format "?~a" (hash-ref vars x)))
620+
(string->symbol (format "?s~a" (hash-ref vars x)))
621621
(string->symbol (format "?t~a" (hash-ref vars x))))]
622622
[else (vector-ref mappings x)]))
623623

@@ -726,7 +726,7 @@
726726
; ; Var-spec-bindings
727727
(for ([var (in-list (context-vars ctx))])
728728
; Get the binding names for the program
729-
(define binding-name (string->symbol (format "?~a" var)))
729+
(define binding-name (string->symbol (format "?s~a" var)))
730730
(define constructor-name (string->symbol (format "const~a" constructor-num)))
731731
(hash-set! binding->constructor binding-name constructor-name)
732732

@@ -802,7 +802,7 @@
802802
(define curr-binding-name
803803
(if (hash-has-key? vars root)
804804
(if (spec? brf)
805-
(string->symbol (format "?~a" (hash-ref vars root)))
805+
(string->symbol (format "?s~a" (hash-ref vars root)))
806806
(string->symbol (format "?t~a" (hash-ref vars root))))
807807
(string->symbol (format "?r~a" root))))
808808

0 commit comments

Comments
 (0)