Skip to main content

Map SubMap

rascal-0.34.0

Synopsis

Submap operator on map values.

Syntax

Exp₁ <= Exp₂

Types

Exp₁Exp₂Exp₁ <= Exp₂
map[TK₁,TV₂]map[TK₂, TV₂]bool

Description

Yields true if all key/value pairs in the map value of Exp₁ occur in the map value Exp₂ or the values of Exp₁ and Exp₂ are equal, and false otherwise.

Examples

rascal>("apple": 1, "pear": 2) <= ("pear": 2, "apple": 1);
bool: true
rascal>("apple": 1, "pear": 2) <= ("pear": 2, "apple": 1, "banana" : 3);
bool: true
rascal>("apple": 1, "pear": 2) <= ("apple": 1, "banana" : 3);
bool: false