Download Ciao Manual - The Ciao System

Transcript
Chapter 80: Term manipulation utilities
451
atom_concat(X,Y)
− Description: atom concat that generates several solutions.
− If the following properties should hold at call time:
term basic:X=[a,B|C]
(term basic:= /2)
term basic:Y=abcde
(term basic:= /2)
then the following properties should hold globally:
Goal
atom_concat(X,Y)
produces
the
solutions
listed
in
[atom_concat([a,,b,c,d,e],abcde),atom_concat([a,,b,c,de],abcde),atom_
concat([a,,b,cd,e],abcde),atom_concat([a,,b,cde],abcde),atom_
concat([a,,bc,d,e],abcde),atom_concat([a,,bc,de],abcde),atom_
concat([a,,bcd,e],abcde),atom_concat([a,,bcde],abcde),atom_
concat([a,b,c,d,e],abcde),atom_concat([a,b,c,de],abcde),atom_
concat([a,b,cd,e],abcde),atom_concat([a,b,cde],abcde),atom_
concat([a,bc,d,e],abcde),atom_concat([a,bc,de],abcde),atom_
concat([a,bcd,e],abcde),atom_concat([a,bcde],abcde)].
(native props:solutions/2)
atom_concat(X,Y)
− If the following properties should hold at call time:
term basic:X=[A,b,C]
term basic:Y=abc
then the following properties should hold upon exit:
The terms A and a are strictly identical.
The terms C and c are strictly identical.
atom_concat(X,Y)
− If the following properties should hold at call time:
term basic:X=[A,b,]
term basic:Y=ab
then the following properties should hold upon exit:
term basic:A=a
Usage 1: atom_concat(Atms,Atm)
− The following properties should hold at call time:
Atms is a list of atms.
− The following properties should hold upon exit:
Atm is an atom.
Usage 2: atom_concat(Atms,Atm)
− Call and exit should be compatible with:
Atms is a list of atms.
− The following properties should hold at call time:
Atm is an atom.
− The following properties should hold upon exit:
Atms is a list of atms.
(term basic:= /2)
(term basic:= /2)
(term compare:== /2)
(term compare:== /2)
(term basic:= /2)
(term basic:= /2)
(term basic:= /2)
(basic props:list/2)
(basic props:atm/1)
(basic props:list/2)
(basic props:atm/1)
(basic props:list/2)