Liste des Groupes | Revenir à cl prolog |
Ok Confluence does indeed ring a bell. Lets show
Declarative (What) versus Procedural (How) in
@emiruz example, as a rewriting problem.
Lets permit that we write the input as [1,2,a,4,5,
b,c,8,9,10] and then have rewriting rules [a->3,b->6,
c->7,d->8] applied, by this little Declarative (What) code:
step(L,R) :- nth1(K,L,a,H), nth1(K,R,3,H).
step(L,R) :- nth1(K,L,b,H), nth1(K,R,6,H).
step(L,R) :- nth1(K,L,c,H), nth1(K,R,7,H).
step(L,R) :- nth1(K,L,d,H), nth1(K,R,8,H).
find(L,L) :- \+ step(L,_).
find(L,R) :- step(L,H), find(H,R).
Each derivation is a Procedural (How) execution:
?- find([1,2,a,4,5,b,c,8,9,10],X).
X = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
X = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
X = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Etc..
Can we count the number of Hows to solve the What?
?- aggregate_all(count, find([1,2,a,4,5,b,c,8,9,10],X), C).
C = 6.
So there are 6 different Procedures that tell
us which steps to exactly use when, to solve the
Declaratively given problem which leaves open
when to use each step.
Mild Shock schrieb:A Timeless Confluence
>
By the banks of thought where rivers entwine,
Emmy Noether walked through a realm divine.
Her algebra wove the fabric of laws,
While echoes of logic gave her pause.
>
There stood Michael Kohlhase, a seeker of form,
Shaping machines through a digital storm.
“Madame,” he began, with respect in his tone,
“Your ideals still guide what we’ve come to own.
>
Noetherian rings, your towering art,
Anchor the systems of which I’m a part.
In rewriting paths, your truth remains,
Simplifying chaos, dissolving chains.”
>
Emmy smiled, her brilliance aglow,
"Through eras, the seeds of knowledge grow.
Yet tell me, dear traveler, in your machine’s frame,
Do ideals endure, or fade like a flame?”
>
Michael replied, “Your vision holds,
In logic’s rewrite, it gently unfolds.
Past meets the present where structures align,
A confluence of thought, eternal, divine.”
>
And so they stood, two eras combined,
Bound by the currents of the infinite mind.
>
https://en.m.wikipedia.org/wiki/Emmy_Noether
>
https://en.m.wikipedia.org/wiki/Michael_Kohlhase
>
Julio Di Egidio schrieb:On 09/12/2024 16:47, Julio Di Egidio wrote:>
>term rewriting also can do the trick and quite more simply so...>
I take that back, too. I cannot find a way out of ancestral cuts in the recursive case. Some term rewriting could rather be useful *in conjunction* with that `scut`, since that as written messes up with the stack trace... Anyway, that's another story.
>
-Julio
>
Les messages affichés proviennent d'usenet.