runtimeverification / haskell-backend

The symbolic execution engine powering the K Framework
BSD 3-Clause "New" or "Revised" License
208 stars 41 forks source link

Discussion: Definedness analysis in rewrite rules and equations #3770

Open jberthold opened 1 year ago

jberthold commented 1 year ago

While discussing "argument predicates" for function rules, some questions about definedness in rule/equation side conditions came up. This issue persists aspects of this discussion for posterity and further development.

ana-pantilie commented 1 year ago

syntax Int ::= f(Int) [function] | g(Int) [function]

rule f(g(X)) => X +Int X

Error: illegal function symbol g on the LHS; consider it a simplification rule if that's what you wanted


syntax A ::= f(Map) [function] | blabla

rule f(K |-> V M:Map) => blabla

Question: is (K |-> V M) defined? if it's undefined, then the rule above is unsound (writing Bottom to something non-Bottom)

    rule f(K |-> V K |-> V) => blabla

<=> rule #Bottom => blabla