Open langston-barrett opened 3 years ago
The main purpose for AST/RAM outputs was mainly debugging, but it would be nice if they correspond with the input.
Could you fix this? The printing of these operators happen here: https://github.com/souffle-lang/souffle/blob/cd687c9fcf303bd13f32db1d2652694e50fb1d62/src/ast/IntrinsicFunctor.cpp#L21
The translation is happening in the files FunctorsOps.cpp
and FunctorOps.h
.
The reason is because we inherited this awful mess where some infix operators have are symbolic and others are identifiers. It's awful. Internally they're mapped onto their 'canonical' name (if you've done Haskell and the like this should be familiar):
-
prefix op is canonically named negate
)This convention is used to automatically deduce how to pretty print operations.
RAM, on the other hand, didn't need to support this (stupid and) ugly identifier infix operator stuff, so it just uses symbolic ops instead. It's inconsistent w/ AST, but it's less code to impl, and shorter and to read (IMO). Nvm, actually read the RAM. It's nuts. Honestly it should either match AST or use canonical naming.
If I had it my way we'd've ditched these ugly identifier infix operators, but hey, we inherited what was already there.
Consider the following program:
When I use
--show=transformed-datalog
, I see:When I use
--show=transformed-ram
, I see:A similar thing happens with
bshl
/bshr
.