I’m attempting to find or create a set of predicates that would allow prolog to reason directly in hexadecimal without having to convert back and forth to integers. Specifically I’m creating an application that will be reasoning over the properties of crash dumps, and thus walking stacks and working with memory locations constantly and it would probably be optimal to simply work in hex directly for a number of reasons namely; endianness, efficiency, and to build a foundation of predicates I won’t have to rewrite for trivial reasons past a certain point of maturity.
a trivial example predicate would be something like
top_of_stack(MemLoc)
where MemLoc is simply a hex value
checking hex values against facts like stack frames, pointers, etc, these are going to be the bread and butter of my application.
To be clear I will need conversion predicates/operators/whatever but I’d rather not have to build them in from the beginning and have to change that almost immediately.
I searched both the swi-prolog documentation and this forum but didn’t really find anything that directly addressed my question, thank you for your time.
EDIT: I am waiting to work through these responses and apply them to my code before I mark one (or any) as a solution. I sincerely appreciate all who took the time to respond to this question and I look forward to posting more in this forum, thank you again.