From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DA942139083 for ; Sun, 4 Jun 2017 08:59:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 562BC21C104; Sun, 4 Jun 2017 08:59:45 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0E49F21C0F4 for ; Sun, 4 Jun 2017 08:59:44 +0000 (UTC) Received: from localhost (unknown [IPv6:2a01:e34:eeaa:6bd0:4ecc:6aff:fe03:1cfc]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aballier) by smtp.gentoo.org (Postfix) with ESMTPSA id 7D25E34185F for ; Sun, 4 Jun 2017 08:59:43 +0000 (UTC) Date: Sun, 4 Jun 2017 10:59:38 +0200 From: Alexis Ballier To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [RFC] Forced/automatic USE flag constraints (codename: ENFORCED_USE) Message-ID: <20170604105938.2b40157f@gentoo.org> In-Reply-To: <20170603185835.57741ff0@gentoo.org> References: <1496071993.31087.1.camel@gentoo.org> <20170530094245.40e1cf64@gentoo.org> <20170530092245.681d4aeb@snowblower> <20170530104654.31b89e10@gentoo.org> <20170530095607.1adbc0b8@snowblower> <20170530112518.65b4f9e9@gentoo.org> <22829.24276.295.969060@a1i15.kph.uni-mainz.de> <1496154812.1238.5.camel@gentoo.org> <20170530173340.0b575526@gentoo.org> <1496167898.1335.1.camel@gentoo.org> <20170530204614.61e8e42c@gentoo.org> <1496213717.1164.1.camel@gentoo.org> <20170531093257.23b66f88@gentoo.org> <1496217792.1164.5.camel@gentoo.org> <20170531103819.417c2420@gentoo.org> <1496235892.25038.1.camel@gentoo.org> <20170531193922.477245bb@gentoo.org> <1496257344.25758.1.camel@gentoo.org> <20170601105523.08a9234e@gentoo.org> <1496352685.30502.4.camel@gentoo.org> <20170602132758.50a5f734@gentoo.org> <1496411717.29233.5.camel@gentoo.org> <20170603130000.4f88fb14@gentoo.org> <1496503989.15351.1.camel@gentoo.org> <20170603185835.57741ff0@gentoo.org> Organization: Gentoo X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archives-Salt: fd3a5047-146b-4a52-bf96-45237a4b973d X-Archives-Hash: 5b601078a689bc0de18013f2f482331e Here's a quick n dirty code to play with, based on yours: https://github.com/aballier/required-use On Sat, 3 Jun 2017 18:58:35 +0200 Alexis Ballier wrote: > > 1. ^^ ( pst1 pst2 pst3.. ) pst1? ( pt1 ) pst2? ( pt2 ) pst3? ( pt3 > > ).. $ python3 ./nsolve.py '^^ ( pst1 pst2 pst3 ) pst1? ( pt1 ) pst2? ( pt2 ) pst3? ( pt3 )' [[!pst1, !pst2, !pst3]? => [pst1], [pst1]? => [!pst2], [pst1]? => [!pst3], [!pst1, pst2]? => [!pst3], [pst1]? => [pt1], [pst2]? => [pt2], [pst3]? => [pt3]] > > 2. ^^ ( pst1 pst2.. ) pst1? ( pt1 ) pst2? ( pt2 ).. ^^ ( pt1 pt2 ) $ python3 ./nsolve.py '^^ ( pst1 pst2 ) pst1? ( pt1 ) pst2? ( pt2 ) ^^ ( pt1 pt2 )' [[!pst1, !pst2]? => [pst1], [pst1]? => [!pst2], [pst1]? => [pt1], [pst2]? => [pt2], [!pt1, !pt2]? => [pt1], [pt1]? => [!pt2]] [[pt1]? => [!pt2]] can break [[pst2]? => [pt2]] > ^^ ( pst1 pst2.. ) pst1? ( pt1 !pt2 ... ) pst2? ( !pt1 pt2 ... ).. $ python3 ./nsolve.py '^^ ( pst1 pst2 ) pst1? ( pt1 !pt2 ) pst2? ( !pt1 pt2 )' [[!pst1, !pst2]? => [pst1], [pst1]? => [!pst2], [pst1]? => [pt1], [pst1]? => [!pt2], [pst2]? => [!pt1], [pst2]? => [pt2]] [[pst2]? => [!pt1]] can break [[pst1]? => [pt1]] [[pst2]? => [pt2]] can break [[pst1]? => [!pt2]] > pst1? ( pt1 !pt2 ... ) > pst2? ( !pt1? ( pt2 !pt3 ... ) ) > pst3? ( !pt1? ( !pt2? ( pt3 !pt4 ... ) ) ) $ python3 ./nsolve.py '^^ ( pst1 pst2 ) pst1? ( pt1 !pt2 ) pst2? ( !pst1? ( !pt1 pt2 ) )' [[!pst1, !pst2]? => [pst1], [pst1]? => [!pst2], [pst1]? => [pt1], [pst1]? => [!pt2], [pst2, !pst1]? => [!pt1], [pst2, !pst1]? => [pt2]] All good. > > 3. doc? ( || ( pt3 pt4 ) ) || ( pt1 pt2 pt3 pt4 ) $ python3 ./nsolve.py 'doc? ( || ( pt3 pt4 ) ) || ( pt1 pt2 pt3 pt4 )' [[doc, !pt3, !pt4]? => [pt3], [!pt1, !pt2, !pt3, !pt4]? => [pt1]] Note: the code only reports errors if a clause can break another clause left to it. It doesn't do topological sorting nor cycle reporting yet. Alexis.