Subject: Ssreflect Users Discussion List
List archive
- From: Erik Martin-Dorel <>
- To:
- Cc: Marc Pasqualetto <>
- Subject: [ssreflect] The irreflexive transitive closure
- Date: Fri, 18 May 2018 20:08:03 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=None ; spf=None
- Ironport-phdr: 9a23:x1G9vBVIG3Qb5gTRfoe3TfPQDPjV8LGtZVwlr6E/grcLSJyIuqrYbRWHt8tkgFKBZ4jH8fUM07OQ7/i7HzRYqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba98IRmssQndqtQdjJd/JKo21hbHuGZDdf5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2Ao/8LrrgXMTRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VDK/5KpwVhTmlDkIOCI48GHPi8x/kqRboA66pxdix4LYeZyZOOZicq/Ye94VQnZPUMZPWiBYG4+xcpEAAPcdMOlFqYnzu0cBrQWjCgWyGejjzj9FimLz0aA8zu8vExzJ3BY4EtwAsHrassj7OqQdXu+p0abGwjvMYuhK2Tr+8oXEbgwtrOuOUL92bMHfyVMvFwTAjliIpoLlJTKV1ucQuGac9eVgT/6vi28hqw1orDavwd0shZfNhokIzV3L6z95wIc2JdGiTU50e8SkEIdRtyGcLod5X8QiQ3t2tyY+0bAGuIS7fCkWyJg9yR7fceWKfo6V6RztU+aRJC13hHNjeL+niBay8FSgyu3hVsavylpFsi1FktzUunAMzRzT69SHRuFz/ke73zuEygPd6vlcLEwpkafWK4QtzqAumpYPq0jOESH7lF/rgKOIeUgo4vWk5uv6brn8u5OQKo95hhvgPqkhgMCzH+I1ORUUUWeB4+Szzrjj8FX5QLpUiv02lbHUsIvfJcQHvq61HhVZ0psl6xa+ETeqycgYnX0cLF1bdh+LlYbpO0vWLPD5C/ewnUisnS92y/3CPrDtGIvBImbfnLv7crtw5VRQxBctwd1Q/55UD6sOIPP3Wk//rtzYCRo5PhSqzOb9CdV91ZkSWWeVDa+DLKPSsFmI6vsyLOmLfo8apjL9JuMk5/70jH85hUURfaez3ZcPcnC3AuxmI1mFYXrrmtoBCnwKvhAgQ+zkjF2NTyJcZ2qpUqIn5jA7DZqmAp3ZSoCshryBxia7EYdMamBIEFDfWUvvIp6fQfoCbC+ZPudkiSZBVL67SoZn1Be0tQa8xaA0APDT/3g1r5PgnP18/fHSk1Qe8iZ5C4zJ3nuMTCdxl3kURjlz0KdlrEhVy02Cze52maoLRpRo+/pVX1JiZtbnxOtgBoW3BlOYL4W5DW2+S9DjOgkfC9c4wtsAeUF4SoejlBHfmSSwUedMy+67Qacs+6eZ5EDfYt5nwieU1bMgkx8oWJkXbDD0tutE7wHWQrXxvQCZmqKtL/1OxyvR7D7F0GyPogREVBV9CuPLRyJHaw==
Dear MathComp developers,
We recently explored the fingraph.v formalization (for reusing its
definition of transitive closure that comes for free with a
decidability proof of the obtained order…), and we noticed after a
while that this definition "connect" was reflexive (cf. the presence
of the "connect0" lemma).
It seems to us that the usual definition of the transitive closure
(such as the one that can be found in Wikipedia articles) does not
perform the reflexive closure at the same time.
So our question is twofold:
1. Would you agree to change the documentation of fingraph to account
for that? basically by replacing [1] with
(* connect e == the reflexive transitive closure of e (computed by dfs). *)
[1]
https://github.com/math-comp/math-comp/blob/mathcomp-1.7.0/mathcomp/ssreflect/fingraph.v#L17
2. Would it be interesting for some users to provide a separate
definition of the usual transitive closure in that file?
(If yes, maybe we could also refactor the current lemmas about the
reflexive-transitive closure to depend on the new definition? but of
course that latter refactoring effort is maybe not worth it…)
I give below a tentative definition for the transitive closure that we
have started exploring (proving a few lemmas that are ommitted here).
--8<---------------cut here---------------start------------->8---
(* The transitive closure is defined by "strict_connect".
"dfs_excl" could be removed and inlined in this definition… *)
Definition dfs_excl' (g : T->seq T) (n:nat) (v:seq T) (x:T) :=
if x \in v then v else
match n with
| 0 => v
| n'.+1 => foldl (dfs g n') v (g x)
end.
Definition dfs_excl (g : T->seq T) (x:T) :=
dfs_excl' g (#|T|.+1) [::] x.
Definition strict_connect (e : rel T) : rel T :=
fun x y => y \in dfs_excl (rgraph e) x.
--8<---------------cut here---------------end--------------->8---
Feel free to comment if you think that another definition would be
more appropriate.
Kind regards,
Erik and Marc
--
Érik Martin-Dorel, PhD
Maître de Conférences, Lab. IRIT, Univ. Toulouse 3
https://www.irit.fr/~Erik.Martin-Dorel
- [ssreflect] The irreflexive transitive closure, Erik Martin-Dorel, 05/18/2018
- Re: [ssreflect] The irreflexive transitive closure, Christian Doczkal, 05/18/2018
Archive powered by MHonArc 2.6.18.