@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
28 lines • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProductDomain = void 0;
const record_1 = require("../../util/record");
const partial_product_domain_1 = require("./partial-product-domain");
/**
* A product abstract domain as named Cartesian product of sub abstract domains.
* The sub abstract domains are represented by a record mapping property names to abstract domains.
* The Bottom element is defined as mapping every sub abstract domain to Bottom and the Top element is defined as mapping every sub abstract domain to Top.
* @template Product - Type of the abstract product of the product domain mapping property names to abstract domains
*/
class ProductDomain extends partial_product_domain_1.PartialProductDomain {
constructor(value) {
super(value, value);
}
top() {
const result = this.create(this.domain);
for (const key in result.value) {
result.value[key] = result.value[key]?.top();
}
return result;
}
isTop() {
return record_1.Record.values(this.value).every(value => value.isTop());
}
}
exports.ProductDomain = ProductDomain;
//# sourceMappingURL=product-domain.js.map