Package jason.stdlib
Class max
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.min
jason.stdlib.max
- All Implemented Interfaces:
InternalAction
,java.io.Serializable
@Manual(literal=".max(list,maximum)", hint="gets the maximum value within a list of terms, using the \"natural\" order. For different types, the order is: numbers < atoms < structures < lists", argsHint={"the list where to find the maximum term","the resulting maximum"}, argsType={"list","term"}, examples={".max([c,a,b],X): X unifies with c",".max([b,c,10,g,f(10),5,f(4)],X): X unifies with f(10)",".max([3,2,5],2]): false",".max([3,2,5],5): true",".max([],X): false"}, seeAlso={"jason.stdlib.concat","jason.stdlib.delete","jason.stdlib.length","jason.stdlib.member","jason.stdlib.sort","jason.stdlib.nth","jason.stdlib.min","jason.stdlib.reverse","jason.stdlib.difference","jason.stdlib.intersection","jason.stdlib.union"}) public class max extends min
Internal action: .max
.
Description: gets the maximum value within a list of terms,
using the "natural" order for each type of term. Between
different types of terms, the following order is
used:
numbers < atoms < structures < lists
Parameters:
- + list (list): the list where to find the maximum term.
- +/- maximum (term).
Examples:
-
.max([c,a,b],X)
:X
unifies withc
. -
.max([b,c,10,g,f(10),5,f(4)],X)
:X
unifies withf(10)
. -
.max([3,2,5],2])
: false. -
.max([3,2,5],5)
: true. -
.max([],X)
: false.
- See Also:
concat
,delete
,length
,member
,nth
,sort
,min
,reverse
,difference
,intersection
,union
, Serialized Form
-
Field Summary
Fields Modifier and Type Field Description private static InternalAction
singleton
-
Constructor Summary
Constructors Constructor Description max()
-
Method Summary
Modifier and Type Method Description protected boolean
compare(Term a, Term t)
static InternalAction
create()
Methods inherited from class jason.stdlib.min
checkArguments, execute, getMaxArgs, getMinArgs
Methods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, destroy, prepareArguments, suspendIntention
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait