Skip to content

Function rules with partial heads are unsound #1146

@ttuegel

Description

@ttuegel

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.

Attn: @traiansf @yzhang90

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions