Are there any languages that perform compile-time optimisation using arbitrary logic programming?
I'm looking for an example of a language that will enable you to do something like:
- Define an arbitrary predicate, e.g.
is-idempotent? - Tell the compiler that
f(f(x))is equal tof(x)if theis-idempotent?function is true forf - Specify
is-idempotent?for various functions (possibly indirectly, e.g. implied by other logic statements) - Have the compiler perform optimisations based on the predicates / optimisations that it is aware of
MBaseframework is using an embedded Prolog for some analysis and optimisation passes.