I’m looking for the library which can evaluate simple Lisp like S-expressions. Specifically, I have simple function definitions produced by solvers like cvc5, e.g.:
(define-fun f ((color Int) (sortAsc Int) (sortDesc Int)) Int (ite (<= 1 sortAsc) (ite (<= 1 sortDesc) 0 2) 3))
where ite stands for if-then-else. I can do a simple preprocessing to match Lisp or another syntax. What I need is the value of f with specific arguments. I prefer something off-the-shelf rather than writing yet another prefix notation calculator in Python.
I wonder if this would be a good moment to try your hand at writing a very simple Lisp interpreter in Python? It shouldn’t be too hard to design a simplistic parser that supports a subset of Lisp functionality, and it’s an excellent exercise.
Maybe, but I have too much work to do. As I wrote in my post: “I prefer something off-the-shelf rather than writing yet another prefix notation calculator in Python.”