unifies by backtracing one atom with all substrings of another atom....
Move to
=> <=
Darueber Spitze
See also
atom_chars/2
atom_codes/2
atom_concat/3
atom_concat/2
atom_length/2
atom_number/2
atom_lower/2
atom_upper/2
char_code/2
number_chars/2
number_codes/2
parse_atom/2/3
sub_atom/5
write_atom/2
writeq_atom/2
IF Computer > MINERVA > Manual > Reference > Predicates > Atomic term processing > sub_atom/5

sub_atom/5

unifies by backtracing one atom with all substrings of another atom.

sub_atom(+Atom, ?LeftLength, ?Length, ?RightLength, ?SubAtom)

sub_atom/5 unifies by backtracking SubAtom with all substrings of Atom where
Length is the length of SubAtom,
LeftLength is the length of the substring of Atom on the left side of SubAtom and
RightLength is the length of the substring of Atom on the right side of SubAtom.

Arguments

Atom                   atom
LeftLength             integer or an expression with substitution integer
Length                 integer or an expression with substitution integer
RightLength            integer or an expression with substitution integer
SubAtom                atom

Examples

sub_atom(text, LL, 3, RL, S). Succeeds with substitutions
{LL <- 0, RL <- 2, S <- 'te'}
{LL <- 1, RL <- 1, S <- 'ex'}
{LL <- 2, RL <- 0, S <- 'xt'}
sub_atom(abcabd, LL, 2, RL, ab). Succeeds with substitutions
{LL <- 0, RL <- 4}
{LL <- 3, RL <- 1}
sub_atom(hello, 0, 3, _, Prefix). Succeeds with substitution
{Prefix <- hel}
sub_atom(hello, _, 3, 0, Suffix). Succeeds with substitution
{Suffix <- llo}
sub_atom(hello, 1, 3, _, Infix). Succeeds with substitution
{Infix <- ell}

Standard

This predicate is part of the ISO-Prolog Standard.

See also

atom_chars/2, atom_codes/2, atom_concat/3, atom_length/2, atom_number/2, char_code/2, number_chars/2, number_codes/2, parse_atom/2/3.

read on...
MINERVA
ifcomputer logo
f
Expert Services on the Web
Sprache
English
Japanese
Server
USA
Japan
Site Access
Local Index
Local Contents
Site Contents
Site Index
Printer Friendly
For imode
For PDA
Search
document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/atomic_term/sub_atom/home_de.html
published 2008/10/13 update 2003/7/8 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 start (AT) ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS