match method
Implementation
@override
Map<Variable, Node>? match(Node other) {
if (other is Term) {
if (name != other.name) {
return null;
}
if (arguments.length != other.arguments.length) {
return null;
}
return [arguments, other.arguments]
.zip()
.map((arg) => arg[0].match(arg[1]))
.fold(newBindings(), mergeBindings);
}
return other.match(this);
}