Vec

Pure constraint operations over an inductive sequence of integers. Concrete sequence spines may contain symbolic numeric holes: -s ortools unfolds pattern matching and structural recursion while preserving the holes.
Table of Contents

Types

Vec

(inductive)
Pure constraint operations over an inductive sequence of integers. Concrete sequence spines may contain symbolic numeric holes: -s ortools unfolds pattern matching and structural recursion while preserving the holes.
inductive Vec a

Constructors

For each type in this module: inductive types list their declared constructors; opaque types list any local function whose name starts with mk and which returns a value of that type.

Vec (inductive)

nil

constructor
Vec a

cons

constructor
Vec a

Functions

length

def length (xs : Vec a) : Int

sum

def sum (xs : Vec Int) : Int

absolute

def absolute (x : Int) : Int

contains

def contains (value : Int) (xs : Vec Int) : Bool

differentFrom

def differentFrom (value : Int) (xs : Vec Int) : Bool

allDifferent

def allDifferent (xs : Vec Int) : Bool

differentExceptZero

def differentExceptZero (value : Int) (xs : Vec Int) : Bool

allDifferentExceptZero

def allDifferentExceptZero (xs : Vec Int) : Bool

equalTo

def equalTo (value : Int) (xs : Vec Int) : Bool

allEqual

def allEqual (xs : Vec Int) : Bool

count

def count (value : Int) (xs : Vec Int) : Int

amongCount

def amongCount (allowed : Vec Int) (xs : Vec Int) : Int

dot

def dot (coefficients : Vec Int) (xs : Vec Int) : Int

element

element uses zero-based indexing. Its caller should require 0 <= index and index < length xs. Out-of-range access has the explicit default value zero.
def element (index : Int) (xs : Vec Int) : Int

increasingFrom

def increasingFrom (previous : Int) (xs : Vec Int) : Bool

increasing

def increasing (xs : Vec Int) : Bool

strictlyIncreasingFrom

def strictlyIncreasingFrom (previous : Int) (xs : Vec Int) : Bool

strictlyIncreasing

def strictlyIncreasing (xs : Vec Int) : Bool

toFloat

Scalar conversion is the only numeric FFI primitive in this module.
def toFloat (value : Int) : Float

sumFloat

def sumFloat (xs : Vec Float) : Float

allTrue

def allTrue (xs : Vec Bool) : Bool

anyTrue

def anyTrue (xs : Vec Bool) : Bool

setLexLe

Lexicographic order of the sorted elements of finite sets. The vectors are membership masks over the same increasing universe.
def setLexLe (left : Vec Bool) (right : Vec Bool) : Bool