Package jason.stdlib

Class member

All Implemented Interfaces:
InternalAction, Serializable

@Manual(literal=".member(item,list)", hint="checks if a given term is in a list. If the term is a free variable, backtracks all possible values", argsHint={"the term to be checked","the list where the term should be in"}, argsType={"term","list"}, examples={".member(c,[a,b,c]): true",".member(3,[a,b,c]): false",".member(X,[a,b,c]): unifies X with any member of the list"}, seeAlso={"jason.stdlib.concat","jason.stdlib.delete","jason.stdlib.length","jason.stdlib.sort","jason.stdlib.nth","jason.stdlib.max","jason.stdlib.min","jason.stdlib.reverse","jason.stdlib.difference","jason.stdlib.intersection","jason.stdlib.union"}) public class member extends DefaultInternalAction

Internal action: .member(T,L).

Description: checks if some term T is in a list L. If T is a free variable, this internal action backtracks all possible values for T.

Parameters:

  • +/- member (term): the term to be checked.
  • + list (list): the list where the term should be in.

Examples:

  • .member(c,[a,b,c]): true.
  • .member(3,[a,b,c]): false.
  • .member(X,[a,b,c]): unifies X with any member of the list.
See Also: