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/1beliefs, regardless of the argument value and the source of the belief. -
.abolish(c(_,t)): remove allc/2beliefs where the second argument ist. -
.abolish(c(_,_)[source(ag1)]): remove allc/2beliefs that haveag1as source. -
.abolish(_[source(ag1)]): remove any beliefs that haveag1as source.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckArguments(Term[] args) execute(TransitionSystem ts, Unifier un, Term[] args) Executes the internal action.intintMethods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, destroy, prepareArguments, suspendIntention
-
Constructor Details
-
abolish
public abolish()
-
-
Method Details
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgsin classDefaultInternalAction
-
getMaxArgs
public int getMaxArgs()- Overrides:
getMaxArgsin classDefaultInternalAction
-
checkArguments
- Overrides:
checkArgumentsin classDefaultInternalAction- Throws:
JasonException
-
execute
Description copied from interface:InternalActionExecutes 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:
executein interfaceInternalAction- Overrides:
executein classDefaultInternalAction- Throws:
Exception
-