Package jason.stdlib
Class abolish
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.abolish
- All Implemented Interfaces:
InternalAction
,Serializable
@Manual(literal=".abolish(argument)",
hint="removes all beliefs that match the argument.",
argsHint="the \"pattern\" for what should be removed.",
argsType="literal or variable",
examples={".abolish(b(_)): remove all b/1 beliefs, regardless of the argument value and the source of the belief",".abolish(c(_,t)): remove all c/2 beliefs where the second argument is t",".abolish(c(_,_)[source(ag1)]): remove all c/2 beliefs that have ag1 as source",".abolish(_[source(ag1)]): remove any beliefs that have ag1 as source"},
seeAlso={"jason.stdlib.asserta","jason.stdlib.assertz"})
public class abolish
extends DefaultInternalAction
Internal action: .abolish
.
Description: removes all beliefs that match the argument. As for the "-" operator, an event will be generated for each deletion. Different from the "-" operator, which consider "self" as the default source, .abolish will ignore the source if not informed.
Parameters:
- + pattern (literal or variable): the "pattern" for what should be removed.
Examples:
-
.abolish(b(_))
: remove allb/1
beliefs, regardless of the argument value and the source of the belief. -
.abolish(c(_,t))
: remove allc/2
beliefs where the second argument ist
. -
.abolish(c(_,_)[source(ag1)])
: remove allc/2
beliefs that haveag1
as source. -
.abolish(_[source(ag1)])
: remove any beliefs that haveag1
as source.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkArguments
(Term[] args) execute
(TransitionSystem ts, Unifier un, Term[] args) Executes the internal action.int
int
Methods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, destroy, prepareArguments, suspendIntention
-
Constructor Details
-
abolish
public abolish()
-
-
Method Details
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgs
in classDefaultInternalAction
-
getMaxArgs
public int getMaxArgs()- Overrides:
getMaxArgs
in classDefaultInternalAction
-
checkArguments
- Overrides:
checkArguments
in classDefaultInternalAction
- Throws:
JasonException
-
execute
Description copied from interface:InternalAction
Executes the internal action. It should return a Boolean or an Iterator. A true boolean return means that the IA was successfully executed. An Iterator result means that there is more than one answer for this IA (e.g. see member internal action). - Specified by:
execute
in interfaceInternalAction
- Overrides:
execute
in classDefaultInternalAction
- Throws:
Exception
-