Prolog

23 views
Skip to first unread message

Soe Thiha Tun

unread,
Dec 12, 2017, 1:54:38 PM12/12/17
to SWI-Prolog
Please Help Me. I am in trouble with this problem. In the list of symbols S1, S2, ..., SN each specified character sequence to replace another specified sequence.

Barb Knox

unread,
Dec 12, 2017, 5:11:56 PM12/12/17
to SWI-Prolog
On 13/12/2017, at 07:54, Soe Thiha Tun <227201621394...@gmail.com> wrote:

Please Help Me. I am in trouble with this problem.

In the list of symbols S1, S2, ..., SN each specified character sequence to replace another specified sequence.

The problem’s specification is not clear.
Is it:

    homework(ListOfAtoms, TargetAtom, ReplacementAtom, ResultList)

where the ResultList is a copy of the ListOfAtoms with every instance of the TargetAtom replaced by ReplacementAtom? This would be a suitable problem for Prolog beginners.

Or is every *part* of of an atom which matches TargetAtom replaced (e.g., this_atom matches is_a)?  If so, there are then further specification issues involving multiple matching parts and rescanning after a change.

Tip:  Precise specifications are really really important, really.  Note that every syntactically correct program, no matter how awful, is the fully correct implementation of *some* specification.  (Reread that a few times until you understand it and believe it.)

-- 
---------------------------
|  BBB                b    \    Barbara at LivingHistory stop co stop uk
|  B  B   aa     rrr  b     |
|  BBB   a  a   r     bbb   |   ,008015L080180,022036,029037
|  B  B  a  a   r     b  b  |   ,047045,L014114L4.
|  BBB    aa a  r     bbb   |
-----------------------------

Reply all
Reply to author
Forward
0 new messages