Skip to content

Support for Boolean Operations and Relations

Frederik Hennig requested to merge fhennig/relationals into backend-rework

This MR adds support for boolean operations and relations to the backend.

  • AST Nodes: Introduce AST nodes for boolean operators and relations
  • Freeze: Add freeze support for sp.Rels and sp.logic.boolalg.BooleanFunctions
  • Typifier: Add typifier support for relations and booleans
  • Printing: Add printing support for boolean operators and relations
  • Constant Folding: Extend EliminateConstants to fold booleans and relations
  • Branch Elimination: Add a pass to eliminate branches

Condition analysis w.r.t loop counters is reserved for future work.

Changes on the side:

  • Add traits PsNumericOpTrait, PsIntOpTrait and PsBoolOpTrait to simplify typification of unary and binary operators
  • Fix behaviour of EliminateConstants on unary negation
  • Refactor the printer's precedence table to exactly reflect cppreference.com
Edited by Frederik Hennig

Merge request reports