-
Notifications
You must be signed in to change notification settings - Fork 30
FMsetC
The definitions below are mechanized in Problems/FMsetC.v
.
Elements e
are defined as e β πΌ ::= 0 | h (e)
.
πΌ
is mechanized as nat
.
A constraint has the shape either x β [0]
, x β y β z
, or x β h (y)
, where x β π
ranges over multiset variables.
Constraints are mechanized as msetc
, where π
is mechanized as nat
.
A valuation Ο : π β list πΌ
satisfies a constraint c
if either
-
c
isx β [0]
andΟ(x) β‘ [0]
-
c
isx β y β z
andΟ(x) β‘ Ο(y) ++ Ο(z)
-
c
isx β h (y)
andΟ(x) β‘ map h Ο(y)
where β‘
denotes equality up to permutation (multiset equality).
The above is mechanized as msetc_sem
, where β‘
is mechanized as mset_eq
.
An instance of finite multiset constraint solvability is a list of constraints.
Given a list L
of constraints, is there a valuation that satisfies each constraint in L
?
Undecidability of finite multiset constraint solvability is obtained by reduction from
uniform Diophantine constraint solvability (H10UC_SAT
in Problems/H10UC.v
).
The reduction is mechanized in Reductions/H10UC_to_FMsetC.v
as
Theorem H10UC_to_FMsetC : H10UC_SAT βͺ― FMsetC_SAT.
and
Theorem FMsetC_undec : Halt βͺ― FMsetC_SAT.
For n β β
let repeat 0 n = [0, β¦, 0]
of length n
and seq 0 n = [0, h (0), β¦, h^(n-1) (0)]
.
A natural number n β β
is encoded as the list repeat 0 n
.
Natural number addition is encoded as list concatenation.
For natural number squaring we observe the following.
- For multisets
A
,B
such thatA ++ B β‘ [0] ++ (map h A)
we necessarily haveA β‘ seq 0 n
andB β‘ [h^n (0)]
for somen β β
. - For a multiset
A
such that(seq 0 n) ++ A β‘ (repeat 0 n) ++ (map h A)
we necessarily havelength A + length A = n * n - n
.
AC1h unification is term unification modulo associativity (A), commutativity (C) of a binary symbol +
having 0
as the identity element (1), and a homomorphism h
such that h (t + u) = h(t) + h(u)
and h(0) = 0
.
Finite multisets satisfy (A), (C), and (1), when considered as multiset sums of their elements with the empty multiset as identity.
Therefore, finite multiset constraint solvability, including h
that is interpreted as homomorphic wrt. multiset sum, is an equivalent presentation of AC1h unification.
[1] Paliath Narendran: Solving Linear Equations over Polynomial Semirings. LICS 1996: 466-472, doi: 10.1109/LICS.1996.561463