Class maude
java.lang.Object
es.ucm.maude.bindings.maude
- All Implemented Interfaces:
es.ucm.maude.bindings.maudeConstants
-
Field Summary
Fields inherited from interface es.ucm.maude.bindings.maudeConstants
MAUDE_VERSION, UNBOUNDED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
connectEqHook
(String name, Hook hook) Connect a callback for the reduction of a special operator declared with
theSpecialHubSymbol
id-hook.
static boolean
connectRlHook
(String name, Hook hook) Connect a callback for rule rewriting a special operator declared with
theSpecialHubSymbol
id-hook.
static Module
downModule
(Term term) Get a module object from its metarepresentation in this
module, which must include theMETA-LEVEL
module.
static Module
Get the current module (the last module inserted or explicitly selected,
like in the Maude interpreter).static Module
Get a module or theory by name.
static ModuleHeaderVector
Get the list of loaded modules.
static View
Get a view by name.
static ViewVector
getViews()
Get the list of loaded views.static boolean
init()
Init Maude.
This function must be called before anything else.
static boolean
init
(boolean loadPrelude) Init Maude.
This function must be called before anything else.
static boolean
init
(boolean loadPrelude, int randomSeed) Init Maude.
This function must be called before anything else.
static boolean
init
(boolean loadPrelude, int randomSeed, boolean advise) Init Maude.
This function must be called before anything else.
static boolean
init
(boolean loadPrelude, int randomSeed, boolean advise, boolean handleInterrupts) Init Maude.
This function must be called before anything else.
static boolean
Process the given text as direct input to Maude.
static boolean
Load the file with the given name.
static void
setAllowDir
(boolean flag) Allow or disallow operations on directories from Maude code.
static void
setAllowFiles
(boolean flag) Allow or disallow operations on files from Maude code.
static void
setAllowProcesses
(boolean flag) Allow or disallow running arbitrary executables from Maude code.
static boolean
setAssocUnifDepth
(float m) Set depth multiplier for associative unification.
static void
setRandomSeed
(int randomSeed) Set the pseudorandom number generator seed.
static TokenVector
Tokenize a string according to Maude lexer rules.
-
Constructor Details
-
maude
public maude()
-
-
Method Details
-
init
public static boolean init(boolean loadPrelude, int randomSeed, boolean advise, boolean handleInterrupts) Init Maude.
This function must be called before anything else.
- Parameters:
loadPrelude
- Whether the Maude prelude should be loaded.randomSeed
- Seed for the pseudorandom number generator in
theRANDOM
module.advise
- Whether debug messages should be printed.handleInterrupts
- Whether interrupts are handled by Maude.
-
init
public static boolean init(boolean loadPrelude, int randomSeed, boolean advise) Init Maude.
This function must be called before anything else.
- Parameters:
loadPrelude
- Whether the Maude prelude should be loaded.randomSeed
- Seed for the pseudorandom number generator in
theRANDOM
module.advise
- Whether debug messages should be printed.
-
init
public static boolean init(boolean loadPrelude, int randomSeed) Init Maude.
This function must be called before anything else.
- Parameters:
loadPrelude
- Whether the Maude prelude should be loaded.randomSeed
- Seed for the pseudorandom number generator in
theRANDOM
module.
-
init
public static boolean init(boolean loadPrelude) Init Maude.
This function must be called before anything else.
- Parameters:
loadPrelude
- Whether the Maude prelude should be loaded.
-
init
public static boolean init()Init Maude.
This function must be called before anything else.
-
load
Load the file with the given name.
- Parameters:
name
- The name of the file (absolute or relative to the current
working directory orMAUDE_LIB)
.
-
input
Process the given text as direct input to Maude.
- Parameters:
text
- Maude modules or commands.
-
getCurrentModule
Get the current module (the last module inserted or explicitly selected,
like in the Maude interpreter). -
getModule
-
downModule
Get a module object from its metarepresentation in this
module, which must include theMETA-LEVEL
module.
- Parameters:
term
- The metarepresentation of a module, that is,
a valid element of theModule
sort inMETA-MODULE
.
The term will be reduced.
- Returns:
- The module object or null if the given term was not
a valid module metarepresentation.
-
tokenize
Tokenize a string according to Maude lexer rules.
- Returns:
- A vector of tokens.
-
getModules
Get the list of loaded modules.
- Returns:
- A list of module headers (this may change).
-
getView
-
getViews
Get the list of loaded views. -
setAllowProcesses
public static void setAllowProcesses(boolean flag) Allow or disallow running arbitrary executables from Maude code.
- Parameters:
flag
- Whether process creation should be allowed.
-
setAllowFiles
public static void setAllowFiles(boolean flag) Allow or disallow operations on files from Maude code.
- Parameters:
flag
- Whether file access should be allowed.
-
setAllowDir
public static void setAllowDir(boolean flag) Allow or disallow operations on directories from Maude code.
- Parameters:
flag
- Whether directory access should be allowed.
-
setRandomSeed
public static void setRandomSeed(int randomSeed) Set the pseudorandom number generator seed.
-
setAssocUnifDepth
public static boolean setAssocUnifDepth(float m) Set depth multiplier for associative unification.
-
connectEqHook
Connect a callback for the reduction of a special operator declared with
theSpecialHubSymbol
id-hook.
- Parameters:
name
- The name of the operator to be bound to this callback.
In case the id-hook contains arguments, the name is instead the first
of these. A null value may be passed to assign a default callback for
those operators without an explicitly associated one.hook
- An instance of a subclass of Hook defining its run method.
The object must be alive as long as the binding is active. A null value
can be passed to disconnect the current one.
- Returns:
- Whether this call overwrites a previous binding.
-
connectRlHook
Connect a callback for rule rewriting a special operator declared with
theSpecialHubSymbol
id-hook.
- Parameters:
name
- The name of the operator to be bound to this callback.
In case the id-hook contains arguments, the name is instead the first
of these. A null value may be passed to assign a default callback for
those operators without an explicitly associated one.hook
- An instance of a subclass of Hook defining its run method.
The object must be alive as long as the binding is active. A null value
can be passed to disconnect the current one.
- Returns:
- Whether this call overwrites a previous binding.
-