FunctionItem function

Function Items

Function Items

Create Independent functions (that are not part of any other items) in a MiniZinc model

Super class

rminizinc::Item -> FunctionItem

Public fields

  • .id: name of the function

  • .e: expression in the function

  • .decls: parameter declarations

  • .ann: annotation

  • .ti: return type of the function

  • .delete_flag: used to delete items

Active bindings

  • .id: name of the function

  • .e: expression in the function

  • .decls: parameter declarations

  • .ann: annotation

  • .ti: return type of the function

  • .delete_flag: used to delete items

Methods

Public methods

Method new()

constructor

Usage

FunctionItem$new(
  name = NULL,
  decls = NULL,
  rt = NULL,
  ann = NULL,
  body = NULL,
  mzn_str = NULL
)

Arguments

  • name: name of the function

  • decls: variable declarations

  • rt: the return type ("bool par", "bool var" or other)

  • ann: annotation

  • body: body of the function

  • mzn_str: string representation of Function Item

Method name()

get the name of the function

Usage

FunctionItem$name()

Method getDecls()

get the list of declarations

Usage

FunctionItem$getDecls()

Method getBody()

get the function body

Usage

FunctionItem$getBody()

Method getAnn()

get the function annotation

Usage

FunctionItem$getAnn()

Method setDecls()

set the list of declarations

Usage

FunctionItem$setDecls(decls)

Arguments

  • decls: list of declarations to be set

Method setBody()

set the function body

Usage

FunctionItem$setBody()

Arguments

  • body: function expression to set or NULL

Method setAnn()

set the function annotation

Usage

FunctionItem$setAnn()

Arguments

  • ann: annotation to be set or NULL

Method rtype()

get if the function is a test, predicate or a function call itself.

Usage

FunctionItem$rtype()

Method c_str()

get the MiniZinc representation

Usage

FunctionItem$c_str()

Method getDeleteFlag()

delete flag for internal use

Usage

FunctionItem$getDeleteFlag()

Method delete()

delete the variable item

Usage

FunctionItem$delete()

Method clone()

The objects of this class are cloneable with this method.

Usage

FunctionItem$clone(deep = FALSE)

Arguments

  • deep: Whether to make a deep clone.

  • Maintainer: Akshit Achara
  • License: Mozilla Public License Version 2.0
  • Last published: 2021-10-15