1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: math math.order math.intervals assocs combinators ;
4 IN: compiler.tree.comparisons
6 ! Some utilities for working with comparison operations.
8 CONSTANT: comparison-ops { < > <= >= }
10 CONSTANT: generic-comparison-ops { before? after? before=? after=? }
12 : assumption ( i1 i2 op -- i3 )
20 : interval-comparison ( i1 i2 op -- result )
24 { \ <= [ interval<= ] }
25 { \ >= [ interval>= ] }
28 : swap-comparison ( op -- op' )
36 : negate-comparison ( op -- op' )
44 : specific-comparison ( op -- op' )