Deutsch English Français Italiano |
<035b9e2186f9dc6467806e27a76d98525c104e54.camel@gmail.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: wij <wyniijj5@gmail.com> Newsgroups: comp.lang.c++ Subject: Re: Is this program OOP? Date: Tue, 10 Dec 2024 06:35:08 +0800 Organization: A noiseless patient Spider Lines: 90 Message-ID: <035b9e2186f9dc6467806e27a76d98525c104e54.camel@gmail.com> References: <63cd41709a703e4ac6d76427d53fe06d7ee8b8b1.camel@gmail.com> <86plm0iwtj.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Date: Mon, 09 Dec 2024 23:35:09 +0100 (CET) Injection-Info: dont-email.me; posting-host="d21130fcf26d215eec62e322955e4662"; logging-data="649931"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19KXEuIwzjDU0CqmdEom7MT" User-Agent: Evolution 3.50.2 (3.50.2-1.fc39) Cancel-Lock: sha1:e3N9wEScApjecSPUyq+r1/VGRc8= In-Reply-To: <86plm0iwtj.fsf@linuxsc.com> Bytes: 4211 On Mon, 2024-12-09 at 09:35 -0800, Tim Rentsch wrote: > wij <wyniijj5@gmail.com> writes: >=20 > > Because I said:=C2=A0 C++ is the best language to model general > > problems.=C2=A0 So it is. > >=20 > > Almost all are logical propositions.=C2=A0 Except those few keywords, > > such programwon't be recognized as a C++ program, instead of some > > kind of declarative language. > >=20 > > Zebra puzzle is an interesting programing exercise because it is > > not too easy and also not too difficult. > >=20 > > ------------ > > /* Copyright is licensed by GNU LGPL, see file COPYING.=C2=A0=C2=A0 by = I.J.Wang 2023 > >=20 > > =C2=A0 Example of solving the zebra puzzle by using propositional logic= .. > > =C2=A0 Zebra Puzzle https://en.wikipedia.org/wiki/Zebra_Puzzle > >=20 > > [...] > > */ > > #include <Wy.stdio.h> > > #include <Sc/PropExpr.h> > >=20 > > using namespace Wy; > > using namespace Sc; > >=20 > > [...] >=20 > You're asking a question that cannot be answered because much or > most of the program is in the two include files, which are not > shown. >=20 > As a general rule, when posting code there should be enough posted > so that readers can at least compile it.=C2=A0 In cases like the program > asked about here, what is posted should be enough to both compile > the program and run the generated executable. I thought nobody will be interested with the implement, and what is shown should be enough for the moment. The include files refer to two separate=C2= =A0 libraries. I had just updated libsc to save 'unupdate' explanations. https://sourceforge.net/projects/cscall/ https://sourceforge.net/projects/symbcomp/ The Zebra Puzzle program has two version, a_puzzle_21.cpp (has shown) takes= too long to complete. a_puzzle_2.cpp (736 lines, too long to post, I thought) i= s the realistic one written in way I feel just solving the prolem is enough. ------------------- []$ make a_puzzle_p2 []$ ./a_puzzle_p2 ..... (3,Red,Englishman,Milk,OldGold,Snails) (0,Green,Japanese,Coffee,Parliament,Zebra) (1,Yellow,Norwegian,-,Kools,Fox) (0,Ivory,Spaniard,OrangeJuice,LuckyStrike,Dog) (2,Blue,Ukrainian,Tea,Chesterfield,Horse) ..... Repeatedly dumping the same thing says there is only one answer. Ans: Japanese owns the Zebra. Norwegian drinks water (only one possibility left) --------------------- My whole point is that C++(and other programing languages, but less optimal= ,IMO) could be a languge of mathmatics/logic, nearly the base of formal knowledge= s (so don't make it too arbitrarily like a commercial product. Anyway, C++ is cre= ated 'for fun', a mathmatician's fun). In short and roughly, inference is a kind of manipulation of model (I did n= ot predict what anyone's brain can do, human brain can create model) We already use simulators to predict things, simulation is a kind of infere= nce based on all the 'pure' theories we presumed must be correct or 'tautologic= ' ( olcott's word). [Snippet from README_en] 3. Theory is 'fabricated' after-events, starting entirely from current theory totally misplaces the goal and the problem. ...