Class: AdLint::Cc1::ValueDomain

Inherits:
Object
  • Object
show all
Extended by:
ValueDomainFactory
Defined in:
lib/adlint/cc1/domain.rb

Overview

DESCRIPTION

ValueDomain class hierarchy

ValueDomain <------------------------------+
  <-- NilValueDomain                       |
  <-- UnlimitedValueDomain                 |
        <-- NaN                            |
  <-- EqualToValueDomain                   |
  <-- LessThanValueDomain                  |
  <-- GreaterThanValueDomain               |
  <-- CompositeValueDomain <>--------------+
        <-- IntersectionValueDomain <------+
        <-- UnionValueDomain               |
  <-- UndefinedValueDomain <>--------------+
  <-- AmbiguousValueDomain

Instance Method Summary collapse

Methods included from ValueDomainFactory

_create_intersection, _create_union, clear_memos, equal_to, greater_than, greater_than_or_equal_to, less_than, less_than_or_equal_to, not_equal_to, of_ambiguous, of_false, of_intersection, of_nan, of_nil, of_true, of_undefined, of_union, of_unlimited

Constructor Details

#initialize(logical_shr) ⇒ ValueDomain

Returns a new instance of ValueDomain.



296
297
298
# File 'lib/adlint/cc1/domain.rb', line 296

def initialize(logical_shr)
  @logical_shr = logical_shr
end

Instance Method Details

#!Object



776
777
778
# File 'lib/adlint/cc1/domain.rb', line 776

def !
  subclass_responsibility
end

#!=(rhs_dom) ⇒ Object



840
841
842
843
844
845
846
# File 'lib/adlint/cc1/domain.rb', line 840

def !=(rhs_dom)
  # NOTE: Operator != cannot be defined by `!(LHS == RHS)'.
  #       When the value domain of the left hand side or the right hand
  #       side is NilValueDomain, `LHS == RHS' should make `false'.
  #       But `LHS != RHS' should make `false', too.
  subclass_responsibility
end

#%(rhs_dom) ⇒ Object



652
653
654
# File 'lib/adlint/cc1/domain.rb', line 652

def %(rhs_dom)
  self - rhs_dom * (self / rhs_dom).coerce_to_integer
end

#&(rhs_dom) ⇒ Object



656
657
658
# File 'lib/adlint/cc1/domain.rb', line 656

def &(rhs_dom)
  subclass_responsibility
end

#*(rhs_dom) ⇒ Object



601
602
603
604
605
606
# File 'lib/adlint/cc1/domain.rb', line 601

def *(rhs_dom)
  # NOTE: Operator * cannot be defined by `LHS / (1.0 / RHS)'.
  #       Because `1.0 / RHS' will make NaN, when the value domain of the
  #       right hand side contains 0.
  subclass_responsibility
end

#+(rhs_dom) ⇒ Object



573
574
575
# File 'lib/adlint/cc1/domain.rb', line 573

def +(rhs_dom)
  subclass_responsibility
end

#+@Object



565
566
567
# File 'lib/adlint/cc1/domain.rb', line 565

def +@
  subclass_responsibility
end

#-(rhs_dom) ⇒ Object



597
598
599
# File 'lib/adlint/cc1/domain.rb', line 597

def -(rhs_dom)
  self + -rhs_dom
end

#-@Object



569
570
571
# File 'lib/adlint/cc1/domain.rb', line 569

def -@
  subclass_responsibility
end

#/(rhs_dom) ⇒ Object



628
629
630
# File 'lib/adlint/cc1/domain.rb', line 628

def /(rhs_dom)
  subclass_responsibility
end

#<(rhs_dom) ⇒ Object



780
781
782
# File 'lib/adlint/cc1/domain.rb', line 780

def <(rhs_dom)
  subclass_responsibility
end

#<<(rhs_dom) ⇒ Object



728
729
730
# File 'lib/adlint/cc1/domain.rb', line 728

def <<(rhs_dom)
  subclass_responsibility
end

#<=(rhs_dom) ⇒ Object



868
869
870
# File 'lib/adlint/cc1/domain.rb', line 868

def <=(rhs_dom)
  (self < rhs_dom).logical_or(self == rhs_dom)
end

#<=>(rhs_dom) ⇒ Object



998
999
1000
# File 'lib/adlint/cc1/domain.rb', line 998

def <=>(rhs_dom)
  to_s <=> rhs_dom.to_s
end

#==(rhs_dom) ⇒ Object



808
809
810
811
812
813
814
815
816
817
818
# File 'lib/adlint/cc1/domain.rb', line 808

def ==(rhs_dom)
  # NOTE: Operator == cannot be defined by `!(LHS < RHS || LHS > RHS)'.
  #       When the value domain of the left hand side is (--<===>-<===>--),
  #       and the value domain of the right hand side is (-------|-------).
  #       `LHS < RHS' should make `true or false' because values in the
  #       left hand side may be less than or greater than the value in
  #       the right hand side.
  #       `LHS > RHS' should make `true or false', too.
  #       So, `!(LHS < RHS) && !(LHS > RHS)' will make `true or false'.
  subclass_responsibility
end

#>(rhs_dom) ⇒ Object



804
805
806
# File 'lib/adlint/cc1/domain.rb', line 804

def >(rhs_dom)
  rhs_dom < self
end

#>=(rhs_dom) ⇒ Object



872
873
874
# File 'lib/adlint/cc1/domain.rb', line 872

def >=(rhs_dom)
  (self > rhs_dom).logical_or(self == rhs_dom)
end

#>>(rhs_dom) ⇒ Object



752
753
754
# File 'lib/adlint/cc1/domain.rb', line 752

def >>(rhs_dom)
  subclass_responsibility
end

#^(rhs_dom) ⇒ Object



704
705
706
# File 'lib/adlint/cc1/domain.rb', line 704

def ^(rhs_dom)
  subclass_responsibility
end

#_add_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



585
586
587
# File 'lib/adlint/cc1/domain.rb', line 585

def _add_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_add_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



593
594
595
# File 'lib/adlint/cc1/domain.rb', line 593

def _add_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_add_less_than(lhs_dom, rhs_dom = self) ⇒ Object



589
590
591
# File 'lib/adlint/cc1/domain.rb', line 589

def _add_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_add_nil(lhs_dom, rhs_dom = self) ⇒ Object



577
578
579
# File 'lib/adlint/cc1/domain.rb', line 577

def _add_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_add_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



581
582
583
# File 'lib/adlint/cc1/domain.rb', line 581

def _add_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_and_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



668
669
670
# File 'lib/adlint/cc1/domain.rb', line 668

def _and_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_and_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



676
677
678
# File 'lib/adlint/cc1/domain.rb', line 676

def _and_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_and_less_than(lhs_dom, rhs_dom = self) ⇒ Object



672
673
674
# File 'lib/adlint/cc1/domain.rb', line 672

def _and_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_and_nil(lhs_dom, rhs_dom = self) ⇒ Object



660
661
662
# File 'lib/adlint/cc1/domain.rb', line 660

def _and_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_and_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



664
665
666
# File 'lib/adlint/cc1/domain.rb', line 664

def _and_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_contain_equal_to?(lhs_dom, rhs_dom = self) ⇒ Boolean

Returns:

  • (Boolean)


345
346
347
# File 'lib/adlint/cc1/domain.rb', line 345

def _contain_equal_to?(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_contain_greater_than?(lhs_dom, rhs_dom = self) ⇒ Boolean

Returns:

  • (Boolean)


353
354
355
# File 'lib/adlint/cc1/domain.rb', line 353

def _contain_greater_than?(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_contain_intersection?(lhs_dom, rhs_dom = self) ⇒ Boolean

Returns:

  • (Boolean)


357
358
359
# File 'lib/adlint/cc1/domain.rb', line 357

def _contain_intersection?(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_contain_less_than?(lhs_dom, rhs_dom = self) ⇒ Boolean

Returns:

  • (Boolean)


349
350
351
# File 'lib/adlint/cc1/domain.rb', line 349

def _contain_less_than?(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_contain_nil?(lhs_dom, rhs_dom = self) ⇒ Boolean

Returns:

  • (Boolean)


337
338
339
# File 'lib/adlint/cc1/domain.rb', line 337

def _contain_nil?(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_contain_union?(lhs_dom, rhs_dom = self) ⇒ Boolean

Returns:

  • (Boolean)


361
362
363
# File 'lib/adlint/cc1/domain.rb', line 361

def _contain_union?(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_contain_unlimited?(lhs_dom, rhs_dom = self) ⇒ Boolean

Returns:

  • (Boolean)


341
342
343
# File 'lib/adlint/cc1/domain.rb', line 341

def _contain_unlimited?(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_div_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



640
641
642
# File 'lib/adlint/cc1/domain.rb', line 640

def _div_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_div_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



648
649
650
# File 'lib/adlint/cc1/domain.rb', line 648

def _div_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_div_less_than(lhs_dom, rhs_dom = self) ⇒ Object



644
645
646
# File 'lib/adlint/cc1/domain.rb', line 644

def _div_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_div_nil(lhs_dom, rhs_dom = self) ⇒ Object



632
633
634
# File 'lib/adlint/cc1/domain.rb', line 632

def _div_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_div_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



636
637
638
# File 'lib/adlint/cc1/domain.rb', line 636

def _div_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_equal_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



828
829
830
# File 'lib/adlint/cc1/domain.rb', line 828

def _equal_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_equal_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



836
837
838
# File 'lib/adlint/cc1/domain.rb', line 836

def _equal_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_equal_less_than(lhs_dom, rhs_dom = self) ⇒ Object



832
833
834
# File 'lib/adlint/cc1/domain.rb', line 832

def _equal_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_equal_nil(lhs_dom, rhs_dom = self) ⇒ Object



820
821
822
# File 'lib/adlint/cc1/domain.rb', line 820

def _equal_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_equal_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



824
825
826
# File 'lib/adlint/cc1/domain.rb', line 824

def _equal_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_intersect_equal_to?(lhs_dom, rhs_dom = self) ⇒ Boolean

Returns:

  • (Boolean)


377
378
379
# File 'lib/adlint/cc1/domain.rb', line 377

def _intersect_equal_to?(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_intersect_greater_than?(lhs_dom, rhs_dom = self) ⇒ Boolean

Returns:

  • (Boolean)


385
386
387
# File 'lib/adlint/cc1/domain.rb', line 385

def _intersect_greater_than?(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_intersect_less_than?(lhs_dom, rhs_dom = self) ⇒ Boolean

Returns:

  • (Boolean)


381
382
383
# File 'lib/adlint/cc1/domain.rb', line 381

def _intersect_less_than?(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_intersect_nil?(lhs_dom, rhs_dom = self) ⇒ Boolean

Returns:

  • (Boolean)


369
370
371
# File 'lib/adlint/cc1/domain.rb', line 369

def _intersect_nil?(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_intersect_unlimited?(lhs_dom, rhs_dom = self) ⇒ Boolean

Returns:

  • (Boolean)


373
374
375
# File 'lib/adlint/cc1/domain.rb', line 373

def _intersect_unlimited?(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_intersection_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



938
939
940
# File 'lib/adlint/cc1/domain.rb', line 938

def _intersection_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_intersection_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



946
947
948
# File 'lib/adlint/cc1/domain.rb', line 946

def _intersection_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_intersection_less_than(lhs_dom, rhs_dom = self) ⇒ Object



942
943
944
# File 'lib/adlint/cc1/domain.rb', line 942

def _intersection_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_intersection_nil(lhs_dom, rhs_dom = self) ⇒ Object



930
931
932
# File 'lib/adlint/cc1/domain.rb', line 930

def _intersection_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_intersection_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



934
935
936
# File 'lib/adlint/cc1/domain.rb', line 934

def _intersection_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_less_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



792
793
794
# File 'lib/adlint/cc1/domain.rb', line 792

def _less_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_less_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



800
801
802
# File 'lib/adlint/cc1/domain.rb', line 800

def _less_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_less_less_than(lhs_dom, rhs_dom = self) ⇒ Object



796
797
798
# File 'lib/adlint/cc1/domain.rb', line 796

def _less_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_less_nil(lhs_dom, rhs_dom = self) ⇒ Object



784
785
786
# File 'lib/adlint/cc1/domain.rb', line 784

def _less_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_less_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



788
789
790
# File 'lib/adlint/cc1/domain.rb', line 788

def _less_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_logical_and_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



889
890
891
# File 'lib/adlint/cc1/domain.rb', line 889

def _logical_and_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_logical_and_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



897
898
899
# File 'lib/adlint/cc1/domain.rb', line 897

def _logical_and_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_logical_and_less_than(lhs_dom, rhs_dom = self) ⇒ Object



893
894
895
# File 'lib/adlint/cc1/domain.rb', line 893

def _logical_and_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_logical_and_nil(lhs_dom, rhs_dom = self) ⇒ Object



881
882
883
# File 'lib/adlint/cc1/domain.rb', line 881

def _logical_and_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_logical_and_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



885
886
887
# File 'lib/adlint/cc1/domain.rb', line 885

def _logical_and_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_logical_or_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



914
915
916
# File 'lib/adlint/cc1/domain.rb', line 914

def _logical_or_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_logical_or_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



922
923
924
# File 'lib/adlint/cc1/domain.rb', line 922

def _logical_or_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_logical_or_less_than(lhs_dom, rhs_dom = self) ⇒ Object



918
919
920
# File 'lib/adlint/cc1/domain.rb', line 918

def _logical_or_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_logical_or_nil(lhs_dom, rhs_dom = self) ⇒ Object



906
907
908
# File 'lib/adlint/cc1/domain.rb', line 906

def _logical_or_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_logical_or_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



910
911
912
# File 'lib/adlint/cc1/domain.rb', line 910

def _logical_or_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_mul_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



616
617
618
# File 'lib/adlint/cc1/domain.rb', line 616

def _mul_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_mul_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



624
625
626
# File 'lib/adlint/cc1/domain.rb', line 624

def _mul_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_mul_less_than(lhs_dom, rhs_dom = self) ⇒ Object



620
621
622
# File 'lib/adlint/cc1/domain.rb', line 620

def _mul_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_mul_nil(lhs_dom, rhs_dom = self) ⇒ Object



608
609
610
# File 'lib/adlint/cc1/domain.rb', line 608

def _mul_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_mul_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



612
613
614
# File 'lib/adlint/cc1/domain.rb', line 612

def _mul_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_by_eq(rhs_dom, lhs_dom = self) ⇒ Object



408
409
410
# File 'lib/adlint/cc1/domain.rb', line 408

def _narrow_by_eq(rhs_dom, lhs_dom = self)
  subclass_responsibility
end

#_narrow_by_ge(rhs_dom, lhs_dom = self) ⇒ Object



508
509
510
# File 'lib/adlint/cc1/domain.rb', line 508

def _narrow_by_ge(rhs_dom, lhs_dom = self)
  _narrow_by_gt(rhs_dom).union(_narrow_by_eq(rhs_dom))
end

#_narrow_by_gt(rhs_dom, lhs_dom = self) ⇒ Object



480
481
482
# File 'lib/adlint/cc1/domain.rb', line 480

def _narrow_by_gt(rhs_dom, lhs_dom = self)
  subclass_responsibility
end

#_narrow_by_le(rhs_dom, lhs_dom = self) ⇒ Object



504
505
506
# File 'lib/adlint/cc1/domain.rb', line 504

def _narrow_by_le(rhs_dom, lhs_dom = self)
  _narrow_by_lt(rhs_dom).union(_narrow_by_eq(rhs_dom))
end

#_narrow_by_lt(rhs_dom, lhs_dom = self) ⇒ Object



456
457
458
# File 'lib/adlint/cc1/domain.rb', line 456

def _narrow_by_lt(rhs_dom, lhs_dom = self)
  subclass_responsibility
end

#_narrow_by_ne(rhs_dom, lhs_dom = self) ⇒ Object



432
433
434
# File 'lib/adlint/cc1/domain.rb', line 432

def _narrow_by_ne(rhs_dom, lhs_dom = self)
  subclass_responsibility
end

#_narrow_equal_to_by_eq(lhs_dom, rhs_dom = self) ⇒ Object



420
421
422
# File 'lib/adlint/cc1/domain.rb', line 420

def _narrow_equal_to_by_eq(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_equal_to_by_gt(lhs_dom, rhs_dom = self) ⇒ Object



492
493
494
# File 'lib/adlint/cc1/domain.rb', line 492

def _narrow_equal_to_by_gt(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_equal_to_by_lt(lhs_dom, rhs_dom = self) ⇒ Object



468
469
470
# File 'lib/adlint/cc1/domain.rb', line 468

def _narrow_equal_to_by_lt(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_equal_to_by_ne(lhs_dom, rhs_dom = self) ⇒ Object



444
445
446
# File 'lib/adlint/cc1/domain.rb', line 444

def _narrow_equal_to_by_ne(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_greater_than_by_eq(lhs_dom, rhs_dom = self) ⇒ Object



428
429
430
# File 'lib/adlint/cc1/domain.rb', line 428

def _narrow_greater_than_by_eq(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_greater_than_by_gt(lhs_dom, rhs_dom = self) ⇒ Object



500
501
502
# File 'lib/adlint/cc1/domain.rb', line 500

def _narrow_greater_than_by_gt(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_greater_than_by_lt(lhs_dom, rhs_dom = self) ⇒ Object



476
477
478
# File 'lib/adlint/cc1/domain.rb', line 476

def _narrow_greater_than_by_lt(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_greater_than_by_ne(lhs_dom, rhs_dom = self) ⇒ Object



452
453
454
# File 'lib/adlint/cc1/domain.rb', line 452

def _narrow_greater_than_by_ne(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_less_than_by_eq(lhs_dom, rhs_dom = self) ⇒ Object



424
425
426
# File 'lib/adlint/cc1/domain.rb', line 424

def _narrow_less_than_by_eq(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_less_than_by_gt(lhs_dom, rhs_dom = self) ⇒ Object



496
497
498
# File 'lib/adlint/cc1/domain.rb', line 496

def _narrow_less_than_by_gt(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_less_than_by_lt(lhs_dom, rhs_dom = self) ⇒ Object



472
473
474
# File 'lib/adlint/cc1/domain.rb', line 472

def _narrow_less_than_by_lt(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_less_than_by_ne(lhs_dom, rhs_dom = self) ⇒ Object



448
449
450
# File 'lib/adlint/cc1/domain.rb', line 448

def _narrow_less_than_by_ne(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_nil_by_eq(lhs_dom, rhs_dom = self) ⇒ Object



412
413
414
# File 'lib/adlint/cc1/domain.rb', line 412

def _narrow_nil_by_eq(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_nil_by_gt(lhs_dom, rhs_dom = self) ⇒ Object



484
485
486
# File 'lib/adlint/cc1/domain.rb', line 484

def _narrow_nil_by_gt(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_nil_by_lt(lhs_dom, rhs_dom = self) ⇒ Object



460
461
462
# File 'lib/adlint/cc1/domain.rb', line 460

def _narrow_nil_by_lt(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_nil_by_ne(lhs_dom, rhs_dom = self) ⇒ Object



436
437
438
# File 'lib/adlint/cc1/domain.rb', line 436

def _narrow_nil_by_ne(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_unlimited_by_eq(lhs_dom, rhs_dom = self) ⇒ Object



416
417
418
# File 'lib/adlint/cc1/domain.rb', line 416

def _narrow_unlimited_by_eq(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_unlimited_by_gt(lhs_dom, rhs_dom = self) ⇒ Object



488
489
490
# File 'lib/adlint/cc1/domain.rb', line 488

def _narrow_unlimited_by_gt(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_unlimited_by_lt(lhs_dom, rhs_dom = self) ⇒ Object



464
465
466
# File 'lib/adlint/cc1/domain.rb', line 464

def _narrow_unlimited_by_lt(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_narrow_unlimited_by_ne(lhs_dom, rhs_dom = self) ⇒ Object



440
441
442
# File 'lib/adlint/cc1/domain.rb', line 440

def _narrow_unlimited_by_ne(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_not_equal_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



856
857
858
# File 'lib/adlint/cc1/domain.rb', line 856

def _not_equal_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_not_equal_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



864
865
866
# File 'lib/adlint/cc1/domain.rb', line 864

def _not_equal_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_not_equal_less_than(lhs_dom, rhs_dom = self) ⇒ Object



860
861
862
# File 'lib/adlint/cc1/domain.rb', line 860

def _not_equal_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_not_equal_nil(lhs_dom, rhs_dom = self) ⇒ Object



848
849
850
# File 'lib/adlint/cc1/domain.rb', line 848

def _not_equal_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_not_equal_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



852
853
854
# File 'lib/adlint/cc1/domain.rb', line 852

def _not_equal_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_or_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



692
693
694
# File 'lib/adlint/cc1/domain.rb', line 692

def _or_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_or_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



700
701
702
# File 'lib/adlint/cc1/domain.rb', line 700

def _or_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_or_less_than(lhs_dom, rhs_dom = self) ⇒ Object



696
697
698
# File 'lib/adlint/cc1/domain.rb', line 696

def _or_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_or_nil(lhs_dom, rhs_dom = self) ⇒ Object



684
685
686
# File 'lib/adlint/cc1/domain.rb', line 684

def _or_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_or_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



688
689
690
# File 'lib/adlint/cc1/domain.rb', line 688

def _or_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_shl_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



740
741
742
# File 'lib/adlint/cc1/domain.rb', line 740

def _shl_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_shl_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



748
749
750
# File 'lib/adlint/cc1/domain.rb', line 748

def _shl_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_shl_less_than(lhs_dom, rhs_dom = self) ⇒ Object



744
745
746
# File 'lib/adlint/cc1/domain.rb', line 744

def _shl_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_shl_nil(lhs_dom, rhs_dom = self) ⇒ Object



732
733
734
# File 'lib/adlint/cc1/domain.rb', line 732

def _shl_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_shl_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



736
737
738
# File 'lib/adlint/cc1/domain.rb', line 736

def _shl_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_shr_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



764
765
766
# File 'lib/adlint/cc1/domain.rb', line 764

def _shr_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_shr_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



772
773
774
# File 'lib/adlint/cc1/domain.rb', line 772

def _shr_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_shr_less_than(lhs_dom, rhs_dom = self) ⇒ Object



768
769
770
# File 'lib/adlint/cc1/domain.rb', line 768

def _shr_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_shr_nil(lhs_dom, rhs_dom = self) ⇒ Object



756
757
758
# File 'lib/adlint/cc1/domain.rb', line 756

def _shr_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_shr_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



760
761
762
# File 'lib/adlint/cc1/domain.rb', line 760

def _shr_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_union_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



962
963
964
# File 'lib/adlint/cc1/domain.rb', line 962

def _union_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_union_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



970
971
972
# File 'lib/adlint/cc1/domain.rb', line 970

def _union_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_union_less_than(lhs_dom, rhs_dom = self) ⇒ Object



966
967
968
# File 'lib/adlint/cc1/domain.rb', line 966

def _union_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_union_nil(lhs_dom, rhs_dom = self) ⇒ Object



954
955
956
# File 'lib/adlint/cc1/domain.rb', line 954

def _union_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_union_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



958
959
960
# File 'lib/adlint/cc1/domain.rb', line 958

def _union_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_widen_by_eq(rhs_dom, lhs_dom = self) ⇒ Object



531
532
533
# File 'lib/adlint/cc1/domain.rb', line 531

def _widen_by_eq(rhs_dom, lhs_dom = self)
  lhs_dom.union(rhs_dom)
end

#_widen_by_ge(rhs_dom, lhs_dom = self) ⇒ Object



553
554
555
# File 'lib/adlint/cc1/domain.rb', line 553

def _widen_by_ge(rhs_dom, lhs_dom = self)
  _widen_by_gt(rhs_dom).union(_widen_by_eq(rhs_dom))
end

#_widen_by_gt(rhs_dom, lhs_dom = self) ⇒ Object



544
545
546
547
# File 'lib/adlint/cc1/domain.rb', line 544

def _widen_by_gt(rhs_dom, lhs_dom = self)
  lhs_dom.union(ValueDomain.of_unlimited(logical_shr?).narrow(
    Operator::GT, rhs_dom))
end

#_widen_by_le(rhs_dom, lhs_dom = self) ⇒ Object



549
550
551
# File 'lib/adlint/cc1/domain.rb', line 549

def _widen_by_le(rhs_dom, lhs_dom = self)
  _widen_by_lt(rhs_dom).union(_widen_by_eq(rhs_dom))
end

#_widen_by_lt(rhs_dom, lhs_dom = self) ⇒ Object



539
540
541
542
# File 'lib/adlint/cc1/domain.rb', line 539

def _widen_by_lt(rhs_dom, lhs_dom = self)
  lhs_dom.union(ValueDomain.of_unlimited(logical_shr?).narrow(
    Operator::LT, rhs_dom))
end

#_widen_by_ne(rhs_dom, lhs_dom = self) ⇒ Object



535
536
537
# File 'lib/adlint/cc1/domain.rb', line 535

def _widen_by_ne(rhs_dom, lhs_dom = self)
  lhs_dom.union(rhs_dom.inversion)
end

#_xor_equal_to(lhs_dom, rhs_dom = self) ⇒ Object



716
717
718
# File 'lib/adlint/cc1/domain.rb', line 716

def _xor_equal_to(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_xor_greater_than(lhs_dom, rhs_dom = self) ⇒ Object



724
725
726
# File 'lib/adlint/cc1/domain.rb', line 724

def _xor_greater_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_xor_less_than(lhs_dom, rhs_dom = self) ⇒ Object



720
721
722
# File 'lib/adlint/cc1/domain.rb', line 720

def _xor_less_than(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_xor_nil(lhs_dom, rhs_dom = self) ⇒ Object



708
709
710
# File 'lib/adlint/cc1/domain.rb', line 708

def _xor_nil(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#_xor_unlimited(lhs_dom, rhs_dom = self) ⇒ Object



712
713
714
# File 'lib/adlint/cc1/domain.rb', line 712

def _xor_unlimited(lhs_dom, rhs_dom = self)
  subclass_responsibility
end

#ambiguous?Boolean

Returns:

  • (Boolean)


312
313
314
# File 'lib/adlint/cc1/domain.rb', line 312

def ambiguous?
  subclass_responsibility
end

#coerce_to_integerObject



974
975
976
# File 'lib/adlint/cc1/domain.rb', line 974

def coerce_to_integer
  subclass_responsibility
end

#coerce_to_realObject



978
979
980
# File 'lib/adlint/cc1/domain.rb', line 978

def coerce_to_real
  subclass_responsibility
end

#complexityObject



1015
1016
1017
# File 'lib/adlint/cc1/domain.rb', line 1015

def complexity
  subclass_responsibility
end

#contain?(domain_or_numeric) ⇒ Boolean

Returns:

  • (Boolean)


320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/adlint/cc1/domain.rb', line 320

def contain?(domain_or_numeric)
  case domain_or_numeric
  when ValueDomain
    contain_value_domain?(domain_or_numeric)
  when Numeric
    dom = ValueDomain.equal_to(domain_or_numeric, logical_shr?)
    contain_value_domain?(dom)
  else
    raise TypeError, "`#{domain_or_numeric.inspect}' " +
      "must be kind of ValueDomain or Numeric."
  end
end

#contain_value_domain?(rhs_dom) ⇒ Boolean

Returns:

  • (Boolean)


333
334
335
# File 'lib/adlint/cc1/domain.rb', line 333

def contain_value_domain?(rhs_dom)
  subclass_responsibility
end

#each_sampleObject



990
991
992
# File 'lib/adlint/cc1/domain.rb', line 990

def each_sample
  subclass_responsibility
end

#empty?Boolean

Returns:

  • (Boolean)


300
301
302
# File 'lib/adlint/cc1/domain.rb', line 300

def empty?
  subclass_responsibility
end

#eql?(rhs_dom) ⇒ Boolean

Returns:

  • (Boolean)


1002
1003
1004
# File 'lib/adlint/cc1/domain.rb', line 1002

def eql?(rhs_dom)
  to_s.eql?(rhs_dom.to_s)
end

#hashObject



1006
1007
1008
# File 'lib/adlint/cc1/domain.rb', line 1006

def hash
  to_s.hash
end

#intersect?(rhs_dom) ⇒ Boolean

Returns:

  • (Boolean)


365
366
367
# File 'lib/adlint/cc1/domain.rb', line 365

def intersect?(rhs_dom)
  subclass_responsibility
end

#intersection(rhs_dom) ⇒ Object



926
927
928
# File 'lib/adlint/cc1/domain.rb', line 926

def intersection(rhs_dom)
  subclass_responsibility
end

#inversionObject



557
558
559
# File 'lib/adlint/cc1/domain.rb', line 557

def inversion
  subclass_responsibility
end

#logical_and(rhs_dom) ⇒ Object



876
877
878
879
# File 'lib/adlint/cc1/domain.rb', line 876

def logical_and(rhs_dom)
  # NOTE: Operator && cannot be defined as a method in Ruby.
  subclass_responsibility
end

#logical_or(rhs_dom) ⇒ Object



901
902
903
904
# File 'lib/adlint/cc1/domain.rb', line 901

def logical_or(rhs_dom)
  # NOTE: Operator || cannot be defined as a method in Ruby.
  subclass_responsibility
end

#logical_shr?Boolean

Returns:

  • (Boolean)


316
317
318
# File 'lib/adlint/cc1/domain.rb', line 316

def logical_shr?
  @logical_shr
end

#max_valueObject



986
987
988
# File 'lib/adlint/cc1/domain.rb', line 986

def max_value
  subclass_responsibility
end

#min_valueObject



982
983
984
# File 'lib/adlint/cc1/domain.rb', line 982

def min_value
  subclass_responsibility
end

#nan?Boolean

Returns:

  • (Boolean)


304
305
306
# File 'lib/adlint/cc1/domain.rb', line 304

def nan?
  subclass_responsibility
end

#narrow(op, ope_dom) ⇒ Object



389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/adlint/cc1/domain.rb', line 389

def narrow(op, ope_dom)
  case op
  when Operator::EQ
    _narrow_by_eq(ope_dom)
  when Operator::NE
    _narrow_by_ne(ope_dom)
  when Operator::LT
    _narrow_by_lt(ope_dom)
  when Operator::GT
    _narrow_by_gt(ope_dom)
  when Operator::LE
    _narrow_by_le(ope_dom)
  when Operator::GE
    _narrow_by_ge(ope_dom)
  else
    __NOTREACHED__
  end
end

#to_defined_domainObject



994
995
996
# File 'lib/adlint/cc1/domain.rb', line 994

def to_defined_domain
  subclass_responsibility
end

#to_sObject



1011
1012
1013
# File 'lib/adlint/cc1/domain.rb', line 1011

def to_s
  subclass_responsibility
end

#undefined?Boolean

Returns:

  • (Boolean)


308
309
310
# File 'lib/adlint/cc1/domain.rb', line 308

def undefined?
  subclass_responsibility
end

#union(rhs_dom) ⇒ Object



950
951
952
# File 'lib/adlint/cc1/domain.rb', line 950

def union(rhs_dom)
  subclass_responsibility
end

#widen(op, ope_dom) ⇒ Object



512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/adlint/cc1/domain.rb', line 512

def widen(op, ope_dom)
  case op
  when Operator::EQ
    _widen_by_eq(ope_dom)
  when Operator::NE
    _widen_by_ne(ope_dom)
  when Operator::LT
    _widen_by_lt(ope_dom)
  when Operator::GT
    _widen_by_gt(ope_dom)
  when Operator::LE
    _widen_by_le(ope_dom)
  when Operator::GE
    _widen_by_ge(ope_dom)
  else
    __NOTREACHED__
  end
end

#|(rhs_dom) ⇒ Object



680
681
682
# File 'lib/adlint/cc1/domain.rb', line 680

def |(rhs_dom)
  subclass_responsibility
end

#~Object



561
562
563
# File 'lib/adlint/cc1/domain.rb', line 561

def ~
  subclass_responsibility
end