Open ana-pantilie opened 2 years ago
I think the first pass should just be the frontend inserting th edefinedness check @ana-pantilie , so that we don't have to worry about intergrating a new tool. That first version can be very simple, just "is the RHS all constructors and total functions, and there are no set variablse, then #Ceil(RHS) is #Top
". If that is provable, that's a very quick frontend pass and we can see how much that improves performance before doing something more complicated which involves invoking the backend.
That also allows us to enable this preserves-definedness
attribute much quicker, while the backend can work on a more advanced checker (if it's needed after profiling with the simple one in the frontend).
@ehildenb alright, let's give that a try.
@radumereuta How hard would it be to write a check like that? Like Everett said, if a semantic/rewrite rule has a RHS term which only contains constructors, functional symbols and element variables the frontend should add the preserves-definedness
attribute to the rule.
With this visitor should be straightforward, but I imagine it would take a while until we manage to iron out all the kinks.
Related: https://github.com/runtimeverification/k/issues/1938 We can apply this idea for simplification rules as well.
Blocked on https://github.com/runtimeverification/haskell-backend/issues/3799 for now.
@ehildenb suggested a while ago we try https://github.com/runtimeverification/haskell-backend/issues/3175, and after the discussion here it looks like it's the way to go, especially for semantics which contain large maps/sets.
I think we need to do the following:
preserves-definedness
attribute for semantic rules.kore-rule-definedness
which computes#Ceil(RHS)
without any of the conditions present in#Ceil(LHS)
(which has to be computed as well).kore-rule-definedness
intokompile
#Ceil(term)
(and of all of its subterms) can be simplified to#Top
.I've been thinking what the best way to integrate
kore-rule-definedness
and the frontend would be, and I think thatkore-rule-definedness
should be part of thekore-rpc-server
. The reason is that this way we can avoid having to re-load the definition in the backend every call.kompile
could spawn a kore server and run the command for every rule in definition, and add the appropriate information to each rule. Thoughts?