Package jason.stdlib

Class difference

java.lang.Object
All Implemented Interfaces:
InternalAction, java.io.Serializable
Direct Known Subclasses:
intersection, union

@Manual(literal=".difference(arg0,arg1,arg2)",
        hint="the difference between two sets",
        argsHint={"the first list","the list to be compared with the first","the resulting list with the difference of the comparison"},
        argsType={"list","list","list"},
        examples={".difference(\"[a,b,c]\",\"[b,e]\",X): X unifies with \"[a,c]\"",".difference(\"[a,b,a,c]\",\"[f,e,a,c]\",X): X unifies with \"[b]\""},
        seeAlso={"jason.stdlib.concat","jason.stdlib.delete","jason.stdlib.length","jason.stdlib.member","jason.stdlib.sort","jason.stdlib.shuffle","jason.stdlib.substring","jason.stdlib.prefix","jason.stdlib.suffix","jason.stdlib.nth","jason.stdlib.max","jason.stdlib.min","jason.stdlib.reverse","jason.stdlib.difference","jason.stdlib.intersection","jason.stdlib.union"})
public class difference
extends DefaultInternalAction

Internal action: .difference(S1,S2,S3).

Description: S3 is the difference between the sets S1 and S2 (represented by lists). The result set is sorted.

Parameters:

  • + arg[0] (a list).
  • + arg[1] (a list).
  • +/- arg[2]: the difference.

Examples:

  • .difference("[a,b,c]","[b,e]",X): X unifies with "[a,c]".
  • .difference("[a,b,a,c]","[f,e,a,c]",X): X unifies with "[b]".
See Also:
concat, delete, length, member, sort, substring, nth, max, min, reverse, intersection, union, Serialized Form