-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Labels
Milestone
Description
The translation of K function rules as equalities in Kore is unsound if the left-hand side of a function rule may be undefined. Consider this K definition,
syntax Int ::= unsound ( Map ) [function]
rule unsound ( K |-> V M ) => 1
This definition is translated to the following Kore (approximately):
symbol unsound(Map) : Int [function]
axiom ∀ K V M. ⊤ → unsound(K |-> V M) = 1
(I am misusing the Kore syntax slightly; there is no syntax for maps, nor infix operators, but I hope the meaning is clear.)
Note the universal quantification of the rule variables! I can instantiate this rule at M = K |-> V, yielding:
axiom ⊤ → unsound(K |-> V K |-> V) = 1
The concatenation of two maps with the same key is undefined, so that
axiom ⊤ → unsound(⊥) = 1
axiom ⊤ → ⊥ = 1
axiom ⊤ → ⊥
axiom ⊥
This is not an immediate problem for the backend because we would never choose to instantiate the rule that way, but nevertheless it is unsound and we should decide how to fix the frontend's translation of this rule.