axiom 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +37 -0
- data/.rspec +4 -0
- data/.rvmrc +1 -0
- data/.travis.yml +35 -0
- data/.yardopts +4 -0
- data/CONTRIBUTING.md +11 -0
- data/Gemfile +8 -0
- data/Gemfile.devtools +57 -0
- data/Guardfile +23 -0
- data/LICENSE +20 -0
- data/README.md +187 -0
- data/Rakefile +5 -0
- data/TODO +107 -0
- data/axiom.gemspec +28 -0
- data/benchmarks/memory.rb +173 -0
- data/benchmarks/speed.rb +100 -0
- data/config/flay.yml +3 -0
- data/config/flog.yml +2 -0
- data/config/mutant.yml +3 -0
- data/config/reek.yml +171 -0
- data/config/roodi.yml +18 -0
- data/config/yardstick.yml +2 -0
- data/lib/axiom.rb +216 -0
- data/lib/axiom/aggregate.rb +94 -0
- data/lib/axiom/aggregate/count.rb +58 -0
- data/lib/axiom/aggregate/maximum.rb +62 -0
- data/lib/axiom/aggregate/mean.rb +84 -0
- data/lib/axiom/aggregate/minimum.rb +62 -0
- data/lib/axiom/aggregate/standard_deviation.rb +61 -0
- data/lib/axiom/aggregate/sum.rb +83 -0
- data/lib/axiom/aggregate/variance.rb +84 -0
- data/lib/axiom/algebra/difference.rb +89 -0
- data/lib/axiom/algebra/extension.rb +174 -0
- data/lib/axiom/algebra/intersection.rb +83 -0
- data/lib/axiom/algebra/join.rb +204 -0
- data/lib/axiom/algebra/product.rb +124 -0
- data/lib/axiom/algebra/projection.rb +196 -0
- data/lib/axiom/algebra/rename.rb +115 -0
- data/lib/axiom/algebra/rename/aliases.rb +221 -0
- data/lib/axiom/algebra/restriction.rb +166 -0
- data/lib/axiom/algebra/summarization.rb +244 -0
- data/lib/axiom/algebra/summarization/summaries.rb +60 -0
- data/lib/axiom/algebra/summarization/summary.rb +83 -0
- data/lib/axiom/algebra/union.rb +85 -0
- data/lib/axiom/attribute.rb +207 -0
- data/lib/axiom/attribute/boolean.rb +41 -0
- data/lib/axiom/attribute/class.rb +23 -0
- data/lib/axiom/attribute/comparable.rb +44 -0
- data/lib/axiom/attribute/date.rb +38 -0
- data/lib/axiom/attribute/date_time.rb +38 -0
- data/lib/axiom/attribute/decimal.rb +23 -0
- data/lib/axiom/attribute/float.rb +25 -0
- data/lib/axiom/attribute/integer.rb +23 -0
- data/lib/axiom/attribute/numeric.rb +74 -0
- data/lib/axiom/attribute/object.rb +28 -0
- data/lib/axiom/attribute/string.rb +100 -0
- data/lib/axiom/attribute/time.rb +38 -0
- data/lib/axiom/core_ext/date.rb +20 -0
- data/lib/axiom/core_ext/range.rb +41 -0
- data/lib/axiom/core_ext/time.rb +20 -0
- data/lib/axiom/function.rb +46 -0
- data/lib/axiom/function/binary.rb +90 -0
- data/lib/axiom/function/comparable.rb +44 -0
- data/lib/axiom/function/connective.rb +21 -0
- data/lib/axiom/function/connective/conjunction.rb +78 -0
- data/lib/axiom/function/connective/disjunction.rb +78 -0
- data/lib/axiom/function/connective/negation.rb +103 -0
- data/lib/axiom/function/numeric.rb +11 -0
- data/lib/axiom/function/numeric/absolute.rb +48 -0
- data/lib/axiom/function/numeric/addition.rb +62 -0
- data/lib/axiom/function/numeric/binary.rb +26 -0
- data/lib/axiom/function/numeric/division.rb +71 -0
- data/lib/axiom/function/numeric/exponentiation.rb +69 -0
- data/lib/axiom/function/numeric/modulo.rb +53 -0
- data/lib/axiom/function/numeric/multiplication.rb +62 -0
- data/lib/axiom/function/numeric/square_root.rb +75 -0
- data/lib/axiom/function/numeric/subtraction.rb +62 -0
- data/lib/axiom/function/numeric/unary.rb +26 -0
- data/lib/axiom/function/numeric/unary_minus.rb +60 -0
- data/lib/axiom/function/numeric/unary_plus.rb +60 -0
- data/lib/axiom/function/predicate.rb +26 -0
- data/lib/axiom/function/predicate/enumerable.rb +57 -0
- data/lib/axiom/function/predicate/equality.rb +67 -0
- data/lib/axiom/function/predicate/exclusion.rb +60 -0
- data/lib/axiom/function/predicate/greater_than.rb +67 -0
- data/lib/axiom/function/predicate/greater_than_or_equal_to.rb +67 -0
- data/lib/axiom/function/predicate/inclusion.rb +60 -0
- data/lib/axiom/function/predicate/inequality.rb +82 -0
- data/lib/axiom/function/predicate/less_than.rb +67 -0
- data/lib/axiom/function/predicate/less_than_or_equal_to.rb +67 -0
- data/lib/axiom/function/predicate/match.rb +67 -0
- data/lib/axiom/function/predicate/no_match.rb +70 -0
- data/lib/axiom/function/proposition.rb +97 -0
- data/lib/axiom/function/proposition/contradiction.rb +66 -0
- data/lib/axiom/function/proposition/tautology.rb +66 -0
- data/lib/axiom/function/string/length.rb +55 -0
- data/lib/axiom/function/unary.rb +124 -0
- data/lib/axiom/relation.rb +268 -0
- data/lib/axiom/relation/base.rb +39 -0
- data/lib/axiom/relation/empty.rb +52 -0
- data/lib/axiom/relation/header.rb +349 -0
- data/lib/axiom/relation/keys.rb +282 -0
- data/lib/axiom/relation/materialized.rb +71 -0
- data/lib/axiom/relation/operation/binary.rb +77 -0
- data/lib/axiom/relation/operation/combination.rb +37 -0
- data/lib/axiom/relation/operation/deletion.rb +45 -0
- data/lib/axiom/relation/operation/insertion.rb +45 -0
- data/lib/axiom/relation/operation/limit.rb +211 -0
- data/lib/axiom/relation/operation/offset.rb +174 -0
- data/lib/axiom/relation/operation/order.rb +204 -0
- data/lib/axiom/relation/operation/order/direction.rb +182 -0
- data/lib/axiom/relation/operation/order/direction_set.rb +107 -0
- data/lib/axiom/relation/operation/reverse.rb +86 -0
- data/lib/axiom/relation/operation/set.rb +79 -0
- data/lib/axiom/relation/operation/unary.rb +24 -0
- data/lib/axiom/relation/proxy.rb +84 -0
- data/lib/axiom/support/aliasable.rb +44 -0
- data/lib/axiom/support/equalizer.rb +22 -0
- data/lib/axiom/support/evaluator.rb +122 -0
- data/lib/axiom/support/operation/binary.rb +45 -0
- data/lib/axiom/support/operation/unary.rb +32 -0
- data/lib/axiom/support/visitable.rb +25 -0
- data/lib/axiom/tuple.rb +161 -0
- data/lib/axiom/version.rb +8 -0
- data/spec/integration/axiom/algebra/join_spec.rb +16 -0
- data/spec/integration/axiom/algebra/product_spec.rb +16 -0
- data/spec/integration/axiom/algebra/projection_spec.rb +18 -0
- data/spec/integration/axiom/algebra/summarization_spec.rb +35 -0
- data/spec/integration/axiom/relation/efficient_enumerable_spec.rb +83 -0
- data/spec/integration/axiom/relation/writable_relations_spec.rb +68 -0
- data/spec/shared/invertible_method_behaviour.rb +9 -0
- data/spec/spec_helper.rb +46 -0
- data/spec/support/config_alias.rb +3 -0
- data/spec/support/ice_nine_config.rb +6 -0
- data/spec/support/lazy_enumerable.rb +18 -0
- data/spec/unit/axiom/aggregate/call_spec.rb +43 -0
- data/spec/unit/axiom/aggregate/class_methods/call_spec.rb +11 -0
- data/spec/unit/axiom/aggregate/class_methods/default_spec.rb +11 -0
- data/spec/unit/axiom/aggregate/class_methods/finalize_spec.rb +12 -0
- data/spec/unit/axiom/aggregate/count/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/aggregate/count/class_methods/default_spec.rb +13 -0
- data/spec/unit/axiom/aggregate/count/methods/count_spec.rb +14 -0
- data/spec/unit/axiom/aggregate/count/type_spec.rb +12 -0
- data/spec/unit/axiom/aggregate/default_spec.rb +17 -0
- data/spec/unit/axiom/aggregate/equality_operator_spec.rb +52 -0
- data/spec/unit/axiom/aggregate/finalize_spec.rb +18 -0
- data/spec/unit/axiom/aggregate/hash_spec.rb +15 -0
- data/spec/unit/axiom/aggregate/maximum/class_methods/call_spec.rb +36 -0
- data/spec/unit/axiom/aggregate/maximum/class_methods/default_spec.rb +13 -0
- data/spec/unit/axiom/aggregate/maximum/methods/maximum_spec.rb +16 -0
- data/spec/unit/axiom/aggregate/maximum/type_spec.rb +20 -0
- data/spec/unit/axiom/aggregate/mean/class_methods/call_spec.rb +38 -0
- data/spec/unit/axiom/aggregate/mean/class_methods/default_spec.rb +15 -0
- data/spec/unit/axiom/aggregate/mean/class_methods/finalize_spec.rb +16 -0
- data/spec/unit/axiom/aggregate/mean/methods/mean_spec.rb +16 -0
- data/spec/unit/axiom/aggregate/mean/type_spec.rb +12 -0
- data/spec/unit/axiom/aggregate/minimum/class_methods/call_spec.rb +36 -0
- data/spec/unit/axiom/aggregate/minimum/class_methods/default_spec.rb +13 -0
- data/spec/unit/axiom/aggregate/minimum/methods/minimum_spec.rb +16 -0
- data/spec/unit/axiom/aggregate/minimum/type_spec.rb +20 -0
- data/spec/unit/axiom/aggregate/standard_deviation/class_methods/finalize_spec.rb +34 -0
- data/spec/unit/axiom/aggregate/standard_deviation/methods/standard_deviation_spec.rb +16 -0
- data/spec/unit/axiom/aggregate/standard_deviation/type_spec.rb +12 -0
- data/spec/unit/axiom/aggregate/sum/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/aggregate/sum/class_methods/default_spec.rb +13 -0
- data/spec/unit/axiom/aggregate/sum/default_spec.rb +33 -0
- data/spec/unit/axiom/aggregate/sum/methods/sum_spec.rb +14 -0
- data/spec/unit/axiom/aggregate/sum/type_spec.rb +20 -0
- data/spec/unit/axiom/aggregate/type_spec.rb +13 -0
- data/spec/unit/axiom/aggregate/variance/class_methods/call_spec.rb +52 -0
- data/spec/unit/axiom/aggregate/variance/class_methods/default_spec.rb +15 -0
- data/spec/unit/axiom/aggregate/variance/class_methods/finalize_spec.rb +26 -0
- data/spec/unit/axiom/aggregate/variance/methods/variance_spec.rb +16 -0
- data/spec/unit/axiom/aggregate/variance/type_spec.rb +12 -0
- data/spec/unit/axiom/algebra/difference/delete_spec.rb +44 -0
- data/spec/unit/axiom/algebra/difference/each_spec.rb +45 -0
- data/spec/unit/axiom/algebra/difference/insert_spec.rb +44 -0
- data/spec/unit/axiom/algebra/difference/methods/difference_spec.rb +20 -0
- data/spec/unit/axiom/algebra/extension/class_methods/new_spec.rb +22 -0
- data/spec/unit/axiom/algebra/extension/delete_spec.rb +47 -0
- data/spec/unit/axiom/algebra/extension/each_spec.rb +30 -0
- data/spec/unit/axiom/algebra/extension/eql_spec.rb +65 -0
- data/spec/unit/axiom/algebra/extension/extensions_spec.rb +15 -0
- data/spec/unit/axiom/algebra/extension/hash_spec.rb +15 -0
- data/spec/unit/axiom/algebra/extension/header_spec.rb +17 -0
- data/spec/unit/axiom/algebra/extension/insert_spec.rb +47 -0
- data/spec/unit/axiom/algebra/extension/methods/extend_spec.rb +34 -0
- data/spec/unit/axiom/algebra/extension/operand_spec.rb +15 -0
- data/spec/unit/axiom/algebra/intersection/delete_spec.rb +44 -0
- data/spec/unit/axiom/algebra/intersection/each_spec.rb +45 -0
- data/spec/unit/axiom/algebra/intersection/insert_spec.rb +44 -0
- data/spec/unit/axiom/algebra/intersection/methods/intersect_spec.rb +20 -0
- data/spec/unit/axiom/algebra/join/class_methods/new_spec.rb +29 -0
- data/spec/unit/axiom/algebra/join/delete_spec.rb +43 -0
- data/spec/unit/axiom/algebra/join/each_spec.rb +77 -0
- data/spec/unit/axiom/algebra/join/insert_spec.rb +43 -0
- data/spec/unit/axiom/algebra/join/join_header_spec.rb +17 -0
- data/spec/unit/axiom/algebra/join/methods/join_spec.rb +35 -0
- data/spec/unit/axiom/algebra/product/class_methods/new_spec.rb +29 -0
- data/spec/unit/axiom/algebra/product/delete_spec.rb +14 -0
- data/spec/unit/axiom/algebra/product/each_spec.rb +31 -0
- data/spec/unit/axiom/algebra/product/insert_spec.rb +14 -0
- data/spec/unit/axiom/algebra/product/methods/product_spec.rb +15 -0
- data/spec/unit/axiom/algebra/projection/delete_spec.rb +58 -0
- data/spec/unit/axiom/algebra/projection/each_spec.rb +30 -0
- data/spec/unit/axiom/algebra/projection/eql_spec.rb +66 -0
- data/spec/unit/axiom/algebra/projection/hash_spec.rb +16 -0
- data/spec/unit/axiom/algebra/projection/header_spec.rb +16 -0
- data/spec/unit/axiom/algebra/projection/insert_spec.rb +66 -0
- data/spec/unit/axiom/algebra/projection/methods/project_spec.rb +19 -0
- data/spec/unit/axiom/algebra/projection/methods/remove_spec.rb +19 -0
- data/spec/unit/axiom/algebra/rename/aliases/class_methods/coerce_spec.rb +59 -0
- data/spec/unit/axiom/algebra/rename/aliases/class_methods/new_spec.rb +23 -0
- data/spec/unit/axiom/algebra/rename/aliases/each_spec.rb +20 -0
- data/spec/unit/axiom/algebra/rename/aliases/element_reader_spec.rb +23 -0
- data/spec/unit/axiom/algebra/rename/aliases/empty_predicate_spec.rb +22 -0
- data/spec/unit/axiom/algebra/rename/aliases/eql_spec.rb +52 -0
- data/spec/unit/axiom/algebra/rename/aliases/equality_operator_spec.rb +52 -0
- data/spec/unit/axiom/algebra/rename/aliases/hash_spec.rb +15 -0
- data/spec/unit/axiom/algebra/rename/aliases/inverse_spec.rb +30 -0
- data/spec/unit/axiom/algebra/rename/aliases/to_hash_spec.rb +32 -0
- data/spec/unit/axiom/algebra/rename/aliases/union_spec.rb +66 -0
- data/spec/unit/axiom/algebra/rename/aliases_spec.rb +13 -0
- data/spec/unit/axiom/algebra/rename/delete_spec.rb +45 -0
- data/spec/unit/axiom/algebra/rename/directions_spec.rb +30 -0
- data/spec/unit/axiom/algebra/rename/each_spec.rb +29 -0
- data/spec/unit/axiom/algebra/rename/eql_spec.rb +65 -0
- data/spec/unit/axiom/algebra/rename/hash_spec.rb +15 -0
- data/spec/unit/axiom/algebra/rename/header_spec.rb +16 -0
- data/spec/unit/axiom/algebra/rename/insert_spec.rb +45 -0
- data/spec/unit/axiom/algebra/rename/methods/rename_spec.rb +14 -0
- data/spec/unit/axiom/algebra/restriction/delete_spec.rb +50 -0
- data/spec/unit/axiom/algebra/restriction/each_spec.rb +88 -0
- data/spec/unit/axiom/algebra/restriction/eql_spec.rb +65 -0
- data/spec/unit/axiom/algebra/restriction/hash_spec.rb +15 -0
- data/spec/unit/axiom/algebra/restriction/insert_spec.rb +50 -0
- data/spec/unit/axiom/algebra/restriction/methods/restrict_spec.rb +78 -0
- data/spec/unit/axiom/algebra/restriction/predicate_spec.rb +15 -0
- data/spec/unit/axiom/algebra/summarization/class_methods/new_spec.rb +30 -0
- data/spec/unit/axiom/algebra/summarization/delete_spec.rb +15 -0
- data/spec/unit/axiom/algebra/summarization/each_spec.rb +30 -0
- data/spec/unit/axiom/algebra/summarization/eql_spec.rb +81 -0
- data/spec/unit/axiom/algebra/summarization/hash_spec.rb +16 -0
- data/spec/unit/axiom/algebra/summarization/header_spec.rb +17 -0
- data/spec/unit/axiom/algebra/summarization/insert_spec.rb +15 -0
- data/spec/unit/axiom/algebra/summarization/methods/summarize_spec.rb +81 -0
- data/spec/unit/axiom/algebra/summarization/summaries/summarize_by_spec.rb +28 -0
- data/spec/unit/axiom/algebra/summarization/summaries/to_hash_spec.rb +17 -0
- data/spec/unit/axiom/algebra/summarization/summarize_per_spec.rb +15 -0
- data/spec/unit/axiom/algebra/summarization/summarizers_spec.rb +15 -0
- data/spec/unit/axiom/algebra/summarization/summary/call_spec.rb +43 -0
- data/spec/unit/axiom/algebra/summarization/summary/summarize_by_spec.rb +20 -0
- data/spec/unit/axiom/algebra/union/delete_spec.rb +44 -0
- data/spec/unit/axiom/algebra/union/each_spec.rb +56 -0
- data/spec/unit/axiom/algebra/union/insert_spec.rb +44 -0
- data/spec/unit/axiom/algebra/union/methods/union_spec.rb +20 -0
- data/spec/unit/axiom/aliasable/fixtures/classes.rb +9 -0
- data/spec/unit/axiom/aliasable/inheritable_alias_spec.rb +50 -0
- data/spec/unit/axiom/attribute/boolean/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/boolean/valid_value_predicate_spec.rb +27 -0
- data/spec/unit/axiom/attribute/call_spec.rb +14 -0
- data/spec/unit/axiom/attribute/class/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/class_methods/coerce_spec.rb +91 -0
- data/spec/unit/axiom/attribute/class_methods/infer_type_spec.rb +121 -0
- data/spec/unit/axiom/attribute/class_methods/name_from_spec.rb +33 -0
- data/spec/unit/axiom/attribute/class_methods/new_spec.rb +41 -0
- data/spec/unit/axiom/attribute/comparable/asc_spec.rb +13 -0
- data/spec/unit/axiom/attribute/comparable/desc_spec.rb +13 -0
- data/spec/unit/axiom/attribute/comparable/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/attribute/date/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/date/range_spec.rb +11 -0
- data/spec/unit/axiom/attribute/date_time/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/date_time/range_spec.rb +11 -0
- data/spec/unit/axiom/attribute/decimal/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/eql_spec.rb +61 -0
- data/spec/unit/axiom/attribute/equality_operator_spec.rb +61 -0
- data/spec/unit/axiom/attribute/float/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/float/size_spec.rb +21 -0
- data/spec/unit/axiom/attribute/hash_spec.rb +17 -0
- data/spec/unit/axiom/attribute/integer/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/name_spec.rb +24 -0
- data/spec/unit/axiom/attribute/numeric/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/numeric/eql_spec.rb +71 -0
- data/spec/unit/axiom/attribute/numeric/equality_operator_spec.rb +71 -0
- data/spec/unit/axiom/attribute/numeric/hash_spec.rb +17 -0
- data/spec/unit/axiom/attribute/numeric/size_spec.rb +33 -0
- data/spec/unit/axiom/attribute/numeric/valid_value_predicate_spec.rb +35 -0
- data/spec/unit/axiom/attribute/object/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/rename_spec.rb +28 -0
- data/spec/unit/axiom/attribute/required_predicate_spec.rb +27 -0
- data/spec/unit/axiom/attribute/string/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/string/eql_spec.rb +81 -0
- data/spec/unit/axiom/attribute/string/equality_operator_spec.rb +81 -0
- data/spec/unit/axiom/attribute/string/hash_spec.rb +25 -0
- data/spec/unit/axiom/attribute/string/max_length_spec.rb +20 -0
- data/spec/unit/axiom/attribute/string/min_length_spec.rb +20 -0
- data/spec/unit/axiom/attribute/string/valid_value_predicate_spec.rb +35 -0
- data/spec/unit/axiom/attribute/time/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/time/range_spec.rb +11 -0
- data/spec/unit/axiom/attribute/type_spec.rb +12 -0
- data/spec/unit/axiom/attribute/valid_primitive_predicate_spec.rb +30 -0
- data/spec/unit/axiom/attribute/valid_value_predicate_spec.rb +47 -0
- data/spec/unit/axiom/equalizer/class_method/new_spec.rb +137 -0
- data/spec/unit/axiom/equalizer/methods/eql_spec.rb +49 -0
- data/spec/unit/axiom/equalizer/methods/equality_operator_spec.rb +85 -0
- data/spec/unit/axiom/evaluator/context/add_spec.rb +66 -0
- data/spec/unit/axiom/evaluator/context/element_reader_spec.rb +14 -0
- data/spec/unit/axiom/evaluator/context/functions_spec.rb +16 -0
- data/spec/unit/axiom/evaluator/context/method_missing_spec.rb +29 -0
- data/spec/unit/axiom/evaluator/context/respond_to_predicate_spec.rb +39 -0
- data/spec/unit/axiom/evaluator/context/send_spec.rb +28 -0
- data/spec/unit/axiom/evaluator/context/yield_spec.rb +14 -0
- data/spec/unit/axiom/function/binary/call_spec.rb +22 -0
- data/spec/unit/axiom/function/binary/equality_operator_spec.rb +67 -0
- data/spec/unit/axiom/function/binary/fixtures/classes.rb +12 -0
- data/spec/unit/axiom/function/binary/invertible/class_methods/included_spec.rb +29 -0
- data/spec/unit/axiom/function/binary/invertible/inverse_spec.rb +47 -0
- data/spec/unit/axiom/function/binary/rename_spec.rb +55 -0
- data/spec/unit/axiom/function/class_methods/call_spec.rb +11 -0
- data/spec/unit/axiom/function/class_methods/extract_value_spec.rb +23 -0
- data/spec/unit/axiom/function/class_methods/rename_attributes_spec.rb +29 -0
- data/spec/unit/axiom/function/comparable/class_methods/call_spec.rb +14 -0
- data/spec/unit/axiom/function/comparable/class_methods/included_spec.rb +26 -0
- data/spec/unit/axiom/function/comparable/fixtures/classes.rb +23 -0
- data/spec/unit/axiom/function/connective/conjunction/class_methods/call_spec.rb +37 -0
- data/spec/unit/axiom/function/connective/conjunction/inverse_spec.rb +20 -0
- data/spec/unit/axiom/function/connective/conjunction/methods/and_spec.rb +19 -0
- data/spec/unit/axiom/function/connective/conjunction/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/connective/disjunction/class_methods/call_spec.rb +37 -0
- data/spec/unit/axiom/function/connective/disjunction/inverse_spec.rb +20 -0
- data/spec/unit/axiom/function/connective/disjunction/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/connective/disjunction/methods/or_spec.rb +19 -0
- data/spec/unit/axiom/function/connective/negation/class_methods/call_spec.rb +21 -0
- data/spec/unit/axiom/function/connective/negation/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/connective/negation/inverse_spec.rb +21 -0
- data/spec/unit/axiom/function/connective/negation/methods/fixtures/classes.rb +8 -0
- data/spec/unit/axiom/function/connective/negation/methods/not_spec.rb +39 -0
- data/spec/unit/axiom/function/connective/type_spec.rb +12 -0
- data/spec/unit/axiom/function/fixtures/classes.rb +6 -0
- data/spec/unit/axiom/function/numeric/absolute/class_methods/call_spec.rb +21 -0
- data/spec/unit/axiom/function/numeric/absolute/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/absolute/methods/absolute_spec.rb +16 -0
- data/spec/unit/axiom/function/numeric/addition/class_methods/call_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/addition/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/addition/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/addition/methods/add_spec.rb +19 -0
- data/spec/unit/axiom/function/numeric/binary/type_spec.rb +33 -0
- data/spec/unit/axiom/function/numeric/division/class_methods/call_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/division/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/division/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/division/methods/divide_spec.rb +19 -0
- data/spec/unit/axiom/function/numeric/division/type_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/exponentiation/class_methods/call_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/exponentiation/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/exponentiation/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/numeric/exponentiation/methods/exponent_spec.rb +19 -0
- data/spec/unit/axiom/function/numeric/modulo/class_methods/call_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/modulo/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/modulo/methods/modulo_spec.rb +19 -0
- data/spec/unit/axiom/function/numeric/multiplication/class_methods/call_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/multiplication/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/multiplication/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/multiplication/methods/multiply_spec.rb +19 -0
- data/spec/unit/axiom/function/numeric/square_root/class_methods/call_spec.rb +12 -0
- data/spec/unit/axiom/function/numeric/square_root/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/numeric/square_root/methods/square_root_spec.rb +16 -0
- data/spec/unit/axiom/function/numeric/square_root/type_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/subtraction/class_methods/call_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/subtraction/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/subtraction/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/subtraction/methods/subtract_spec.rb +19 -0
- data/spec/unit/axiom/function/numeric/unary/type_spec.rb +21 -0
- data/spec/unit/axiom/function/numeric/unary_minus/class_methods/call_spec.rb +21 -0
- data/spec/unit/axiom/function/numeric/unary_minus/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/unary_minus/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/unary_minus/methods/unary_minus_spec.rb +16 -0
- data/spec/unit/axiom/function/numeric/unary_plus/class_methods/call_spec.rb +21 -0
- data/spec/unit/axiom/function/numeric/unary_plus/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/unary_plus/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/unary_plus/methods/unary_plus_spec.rb +16 -0
- data/spec/unit/axiom/function/predicate/call_spec.rb +18 -0
- data/spec/unit/axiom/function/predicate/class_methods/call_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/enumerable/call_spec.rb +36 -0
- data/spec/unit/axiom/function/predicate/enumerable/class_methods/compare_method_spec.rb +21 -0
- data/spec/unit/axiom/function/predicate/eql_spec.rb +66 -0
- data/spec/unit/axiom/function/predicate/equality/class_methods/call_spec.rb +23 -0
- data/spec/unit/axiom/function/predicate/equality/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/equality/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/equality/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/equality/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/predicate/equality/methods/eq_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/equality/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/exclusion/class_methods/call_spec.rb +23 -0
- data/spec/unit/axiom/function/predicate/exclusion/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/exclusion/inverse_spec.rb +19 -0
- data/spec/unit/axiom/function/predicate/exclusion/methods/exclude_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/exclusion/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/fixtures/classes.rb +10 -0
- data/spec/unit/axiom/function/predicate/greater_than/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/function/predicate/greater_than/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/greater_than/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/greater_than/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/greater_than/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/predicate/greater_than/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/greater_than/methods/gt_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/methods/gte_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/hash_spec.rb +16 -0
- data/spec/unit/axiom/function/predicate/inclusion/class_methods/call_spec.rb +23 -0
- data/spec/unit/axiom/function/predicate/inclusion/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/inclusion/inverse_spec.rb +19 -0
- data/spec/unit/axiom/function/predicate/inclusion/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/inclusion/methods/include_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/inequality/class_methods/call_spec.rb +23 -0
- data/spec/unit/axiom/function/predicate/inequality/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/inequality/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/inequality/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/inequality/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/predicate/inequality/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/inequality/methods/ne_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/inverse_spec.rb +17 -0
- data/spec/unit/axiom/function/predicate/less_than/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/function/predicate/less_than/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/less_than/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/less_than/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/less_than/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/predicate/less_than/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/less_than/methods/lt_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/methods/lte_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/match/class_methods/call_spec.rb +23 -0
- data/spec/unit/axiom/function/predicate/match/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/match/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/match/inverse_spec.rb +19 -0
- data/spec/unit/axiom/function/predicate/match/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/match/methods/match_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/no_match/class_methods/call_spec.rb +23 -0
- data/spec/unit/axiom/function/predicate/no_match/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/no_match/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/no_match/inverse_spec.rb +19 -0
- data/spec/unit/axiom/function/predicate/no_match/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/no_match/methods/no_match_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/type_spec.rb +14 -0
- data/spec/unit/axiom/function/proposition/call_spec.rb +16 -0
- data/spec/unit/axiom/function/proposition/class_methods/call_spec.rb +11 -0
- data/spec/unit/axiom/function/proposition/class_methods/new_spec.rb +45 -0
- data/spec/unit/axiom/function/proposition/contradiction/and_spec.rb +12 -0
- data/spec/unit/axiom/function/proposition/contradiction/class_methods/call_spec.rb +11 -0
- data/spec/unit/axiom/function/proposition/contradiction/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/proposition/contradiction/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/proposition/contradiction/or_spec.rb +12 -0
- data/spec/unit/axiom/function/proposition/eql_spec.rb +40 -0
- data/spec/unit/axiom/function/proposition/equality_operator_spec.rb +40 -0
- data/spec/unit/axiom/function/proposition/hash_spec.rb +14 -0
- data/spec/unit/axiom/function/proposition/inverse_spec.rb +28 -0
- data/spec/unit/axiom/function/proposition/rename_spec.rb +16 -0
- data/spec/unit/axiom/function/proposition/tautology/and_spec.rb +12 -0
- data/spec/unit/axiom/function/proposition/tautology/class_methods/call_spec.rb +11 -0
- data/spec/unit/axiom/function/proposition/tautology/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/proposition/tautology/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/proposition/tautology/or_spec.rb +12 -0
- data/spec/unit/axiom/function/proposition/type_spec.rb +12 -0
- data/spec/unit/axiom/function/rename_spec.rb +14 -0
- data/spec/unit/axiom/function/string/length/class_methods/call_spec.rb +12 -0
- data/spec/unit/axiom/function/string/length/methods/length_spec.rb +14 -0
- data/spec/unit/axiom/function/string/length/type_spec.rb +11 -0
- data/spec/unit/axiom/function/type_spec.rb +13 -0
- data/spec/unit/axiom/function/unary/call_spec.rb +21 -0
- data/spec/unit/axiom/function/unary/callable/call_spec.rb +23 -0
- data/spec/unit/axiom/function/unary/callable/included_spec.rb +23 -0
- data/spec/unit/axiom/function/unary/equality_operator_spec.rb +55 -0
- data/spec/unit/axiom/function/unary/fixtures/classes.rb +12 -0
- data/spec/unit/axiom/function/unary/hash_spec.rb +18 -0
- data/spec/unit/axiom/function/unary/invertible/class_methods/included_spec.rb +29 -0
- data/spec/unit/axiom/function/unary/invertible/inverse_spec.rb +45 -0
- data/spec/unit/axiom/function/unary/rename_spec.rb +29 -0
- data/spec/unit/axiom/operation/binary/eql_spec.rb +66 -0
- data/spec/unit/axiom/operation/binary/hash_spec.rb +16 -0
- data/spec/unit/axiom/operation/binary/left_spec.rb +27 -0
- data/spec/unit/axiom/operation/binary/right_spec.rb +27 -0
- data/spec/unit/axiom/operation/unary/eql_spec.rb +52 -0
- data/spec/unit/axiom/operation/unary/hash_spec.rb +15 -0
- data/spec/unit/axiom/operation/unary/operand_spec.rb +26 -0
- data/spec/unit/axiom/relation/base/class_methods/new_spec.rb +35 -0
- data/spec/unit/axiom/relation/base/eql_spec.rb +100 -0
- data/spec/unit/axiom/relation/base/hash_spec.rb +16 -0
- data/spec/unit/axiom/relation/base/name_spec.rb +45 -0
- data/spec/unit/axiom/relation/class_methods/coerce_spec.rb +23 -0
- data/spec/unit/axiom/relation/class_methods/new_spec.rb +69 -0
- data/spec/unit/axiom/relation/directions_spec.rb +20 -0
- data/spec/unit/axiom/relation/each_spec.rb +52 -0
- data/spec/unit/axiom/relation/element_reader_spec.rb +17 -0
- data/spec/unit/axiom/relation/empty/class_methods/new_spec.rb +30 -0
- data/spec/unit/axiom/relation/empty/each_spec.rb +33 -0
- data/spec/unit/axiom/relation/empty/empty_predicate_spec.rb +11 -0
- data/spec/unit/axiom/relation/empty/header_spec.rb +14 -0
- data/spec/unit/axiom/relation/empty/size_spec.rb +11 -0
- data/spec/unit/axiom/relation/empty_predicate_spec.rb +26 -0
- data/spec/unit/axiom/relation/eql_spec.rb +84 -0
- data/spec/unit/axiom/relation/equality_operator_spec.rb +118 -0
- data/spec/unit/axiom/relation/hash_spec.rb +19 -0
- data/spec/unit/axiom/relation/header/call_spec.rb +36 -0
- data/spec/unit/axiom/relation/header/class_methods/coerce_spec.rb +101 -0
- data/spec/unit/axiom/relation/header/class_methods/new_spec.rb +66 -0
- data/spec/unit/axiom/relation/header/difference_spec.rb +100 -0
- data/spec/unit/axiom/relation/header/each_spec.rb +36 -0
- data/spec/unit/axiom/relation/header/empty_predicate_spec.rb +21 -0
- data/spec/unit/axiom/relation/header/eql_spec.rb +64 -0
- data/spec/unit/axiom/relation/header/equality_operator_spec.rb +94 -0
- data/spec/unit/axiom/relation/header/extend_spec.rb +35 -0
- data/spec/unit/axiom/relation/header/hash_spec.rb +15 -0
- data/spec/unit/axiom/relation/header/intersect_spec.rb +100 -0
- data/spec/unit/axiom/relation/header/keys_spec.rb +35 -0
- data/spec/unit/axiom/relation/header/project_spec.rb +46 -0
- data/spec/unit/axiom/relation/header/rename_spec.rb +19 -0
- data/spec/unit/axiom/relation/header/to_ary_spec.rb +16 -0
- data/spec/unit/axiom/relation/header/union_spec.rb +100 -0
- data/spec/unit/axiom/relation/header_spec.rb +18 -0
- data/spec/unit/axiom/relation/include_predicate_spec.rb +22 -0
- data/spec/unit/axiom/relation/keys/class_methods/coerce_spec.rb +29 -0
- data/spec/unit/axiom/relation/keys/class_methods/new_spec.rb +46 -0
- data/spec/unit/axiom/relation/keys/difference_spec.rb +27 -0
- data/spec/unit/axiom/relation/keys/each_spec.rb +36 -0
- data/spec/unit/axiom/relation/keys/empty_predicate_spec.rb +21 -0
- data/spec/unit/axiom/relation/keys/extend_spec.rb +33 -0
- data/spec/unit/axiom/relation/keys/intersect_spec.rb +27 -0
- data/spec/unit/axiom/relation/keys/project_spec.rb +34 -0
- data/spec/unit/axiom/relation/keys/rename_spec.rb +16 -0
- data/spec/unit/axiom/relation/keys/to_ary_spec.rb +16 -0
- data/spec/unit/axiom/relation/keys/union_spec.rb +27 -0
- data/spec/unit/axiom/relation/materialize_spec.rb +24 -0
- data/spec/unit/axiom/relation/materialized/class_methods/new_spec.rb +38 -0
- data/spec/unit/axiom/relation/materialized/directions_spec.rb +27 -0
- data/spec/unit/axiom/relation/materialized/empty_predicate_spec.rb +22 -0
- data/spec/unit/axiom/relation/materialized/materialize_spec.rb +11 -0
- data/spec/unit/axiom/relation/materialized/materialized_predicate_spec.rb +15 -0
- data/spec/unit/axiom/relation/materialized/size_spec.rb +13 -0
- data/spec/unit/axiom/relation/materialized_predicate_spec.rb +15 -0
- data/spec/unit/axiom/relation/one_spec.rb +36 -0
- data/spec/unit/axiom/relation/operation/binary/class_methods/included_spec.rb +26 -0
- data/spec/unit/axiom/relation/operation/binary/class_methods/new_spec.rb +40 -0
- data/spec/unit/axiom/relation/operation/binary/fixtures/classes.rb +14 -0
- data/spec/unit/axiom/relation/operation/binary/header_spec.rb +19 -0
- data/spec/unit/axiom/relation/operation/combination/class_methods/combine_tuples_spec.rb +21 -0
- data/spec/unit/axiom/relation/operation/combination/fixtures/classes.rb +14 -0
- data/spec/unit/axiom/relation/operation/combination/header_spec.rb +21 -0
- data/spec/unit/axiom/relation/operation/deletion/initialize_spec.rb +16 -0
- data/spec/unit/axiom/relation/operation/deletion/methods/delete_spec.rb +42 -0
- data/spec/unit/axiom/relation/operation/insertion/initialize_spec.rb +16 -0
- data/spec/unit/axiom/relation/operation/insertion/methods/insert_spec.rb +42 -0
- data/spec/unit/axiom/relation/operation/limit/class_methods/new_spec.rb +45 -0
- data/spec/unit/axiom/relation/operation/limit/delete_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/limit/directions_spec.rb +15 -0
- data/spec/unit/axiom/relation/operation/limit/each_spec.rb +30 -0
- data/spec/unit/axiom/relation/operation/limit/eql_spec.rb +65 -0
- data/spec/unit/axiom/relation/operation/limit/hash_spec.rb +16 -0
- data/spec/unit/axiom/relation/operation/limit/insert_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/limit/limit_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/limit/methods/first_spec.rb +43 -0
- data/spec/unit/axiom/relation/operation/limit/methods/last_spec.rb +39 -0
- data/spec/unit/axiom/relation/operation/limit/methods/take_spec.rb +20 -0
- data/spec/unit/axiom/relation/operation/offset/class_methods/new_spec.rb +45 -0
- data/spec/unit/axiom/relation/operation/offset/delete_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/offset/directions_spec.rb +15 -0
- data/spec/unit/axiom/relation/operation/offset/each_spec.rb +30 -0
- data/spec/unit/axiom/relation/operation/offset/eql_spec.rb +65 -0
- data/spec/unit/axiom/relation/operation/offset/hash_spec.rb +16 -0
- data/spec/unit/axiom/relation/operation/offset/insert_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/offset/methods/drop_spec.rb +20 -0
- data/spec/unit/axiom/relation/operation/offset/offset_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/order/ascending/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/relation/operation/order/ascending/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/relation/operation/order/ascending/reverse_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/order/class_methods/new_spec.rb +34 -0
- data/spec/unit/axiom/relation/operation/order/delete_spec.rb +45 -0
- data/spec/unit/axiom/relation/operation/order/descending/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/relation/operation/order/descending/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/relation/operation/order/descending/reverse_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/order/direction/attribute_spec.rb +13 -0
- data/spec/unit/axiom/relation/operation/order/direction/call_spec.rb +19 -0
- data/spec/unit/axiom/relation/operation/order/direction/class_methods/coerce_spec.rb +32 -0
- data/spec/unit/axiom/relation/operation/order/direction/eql_predicate_spec.rb +54 -0
- data/spec/unit/axiom/relation/operation/order/direction/hash_spec.rb +15 -0
- data/spec/unit/axiom/relation/operation/order/direction/name_spec.rb +13 -0
- data/spec/unit/axiom/relation/operation/order/direction/rename_spec.rb +28 -0
- data/spec/unit/axiom/relation/operation/order/direction/reverse_spec.rb +29 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/attributes_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/class_methods/coerce_spec.rb +76 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/class_methods/new_spec.rb +26 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/eql_spec.rb +51 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/equality_operator_spec.rb +84 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/hash_spec.rb +15 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/project_spec.rb +17 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/rename_spec.rb +18 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/reverse_spec.rb +23 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/sort_tuples_spec.rb +44 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/to_ary_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/order/directions_spec.rb +15 -0
- data/spec/unit/axiom/relation/operation/order/each_spec.rb +30 -0
- data/spec/unit/axiom/relation/operation/order/eql_spec.rb +65 -0
- data/spec/unit/axiom/relation/operation/order/hash_spec.rb +15 -0
- data/spec/unit/axiom/relation/operation/order/header_spec.rb +15 -0
- data/spec/unit/axiom/relation/operation/order/insert_spec.rb +45 -0
- data/spec/unit/axiom/relation/operation/order/methods/sort_by_spec.rb +42 -0
- data/spec/unit/axiom/relation/operation/reverse/class_methods/new_spec.rb +36 -0
- data/spec/unit/axiom/relation/operation/reverse/directions_spec.rb +17 -0
- data/spec/unit/axiom/relation/operation/reverse/each_spec.rb +30 -0
- data/spec/unit/axiom/relation/operation/reverse/methods/reverse_spec.rb +17 -0
- data/spec/unit/axiom/relation/operation/set/class_methods/included_spec.rb +26 -0
- data/spec/unit/axiom/relation/operation/set/class_methods/new_spec.rb +30 -0
- data/spec/unit/axiom/relation/operation/set/fixtures/classes.rb +14 -0
- data/spec/unit/axiom/relation/operation/set/header_spec.rb +17 -0
- data/spec/unit/axiom/relation/operation/unary/fixtures/classes.rb +17 -0
- data/spec/unit/axiom/relation/operation/unary/header_spec.rb +17 -0
- data/spec/unit/axiom/relation/proxy/each_spec.rb +41 -0
- data/spec/unit/axiom/relation/proxy/hash_spec.rb +26 -0
- data/spec/unit/axiom/relation/proxy/method_missing_spec.rb +24 -0
- data/spec/unit/axiom/relation/proxy/respond_to_predicate_spec.rb +40 -0
- data/spec/unit/axiom/relation/replace_spec.rb +55 -0
- data/spec/unit/axiom/tuple/call_spec.rb +25 -0
- data/spec/unit/axiom/tuple/class_methods/coerce_spec.rb +31 -0
- data/spec/unit/axiom/tuple/data_spec.rb +16 -0
- data/spec/unit/axiom/tuple/eql_spec.rb +65 -0
- data/spec/unit/axiom/tuple/equality_operator_spec.rb +85 -0
- data/spec/unit/axiom/tuple/extend_spec.rb +41 -0
- data/spec/unit/axiom/tuple/hash_spec.rb +15 -0
- data/spec/unit/axiom/tuple/header_spec.rb +14 -0
- data/spec/unit/axiom/tuple/join_spec.rb +18 -0
- data/spec/unit/axiom/tuple/predicate_spec.rb +44 -0
- data/spec/unit/axiom/tuple/project_spec.rb +17 -0
- data/spec/unit/axiom/tuple/to_ary_spec.rb +18 -0
- data/spec/unit/axiom/visitable/accept_spec.rb +18 -0
- data/spec/unit/date/pred_spec.rb +19 -0
- data/spec/unit/range/overlaps_spec.rb +192 -0
- data/spec/unit/range/to_inclusive_spec.rb +41 -0
- data/spec/unit/time/pred_spec.rb +19 -0
- metadata +1327 -0
@@ -0,0 +1,84 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Axiom
|
4
|
+
class Aggregate
|
5
|
+
|
6
|
+
# The mean of a sequence of numbers
|
7
|
+
class Mean < Aggregate
|
8
|
+
|
9
|
+
DEFAULT = [ 0, nil ].freeze
|
10
|
+
|
11
|
+
# Return the count and mean for a sequence of numbers
|
12
|
+
#
|
13
|
+
# @example
|
14
|
+
# count, mean = Mean.call([ count, mean ], value)
|
15
|
+
#
|
16
|
+
# @param [Array(Integer, Numeric)] accumulator
|
17
|
+
#
|
18
|
+
# @param [Numeric] value
|
19
|
+
#
|
20
|
+
# @return [Array(Integer, Numeric)]
|
21
|
+
#
|
22
|
+
# @api public
|
23
|
+
def self.call(accumulator, value)
|
24
|
+
return accumulator if value.nil?
|
25
|
+
count, mean = accumulator
|
26
|
+
count = Count.call(count, value)
|
27
|
+
[ count, mean.nil? ? value.to_f : mean + ((value - mean) / count) ]
|
28
|
+
end
|
29
|
+
|
30
|
+
# Extract the mean from the accumulator
|
31
|
+
#
|
32
|
+
# @example
|
33
|
+
# mean = Mean.finalize(accumulator)
|
34
|
+
#
|
35
|
+
# @param [Array(Integer, Numeric)] accumulator
|
36
|
+
#
|
37
|
+
# @return [Float]
|
38
|
+
# returned for a non-empty set
|
39
|
+
# @return [nil]
|
40
|
+
# returned for an empty set
|
41
|
+
#
|
42
|
+
# @api public
|
43
|
+
def self.finalize(accumulator)
|
44
|
+
accumulator.last
|
45
|
+
end
|
46
|
+
|
47
|
+
# Return the type returned from #call
|
48
|
+
#
|
49
|
+
# @example
|
50
|
+
# type = Axiom::Aggregate::Mean.type
|
51
|
+
#
|
52
|
+
# @return [Class<Attribute::Float>]
|
53
|
+
#
|
54
|
+
# @api public
|
55
|
+
def type
|
56
|
+
Attribute::Float
|
57
|
+
end
|
58
|
+
|
59
|
+
module Methods
|
60
|
+
extend Aliasable
|
61
|
+
|
62
|
+
inheritable_alias(
|
63
|
+
:average => :mean,
|
64
|
+
:avg => :mean
|
65
|
+
)
|
66
|
+
|
67
|
+
# Return a mean aggregate function
|
68
|
+
#
|
69
|
+
# @example
|
70
|
+
# mean = attribute.mean
|
71
|
+
#
|
72
|
+
# @param [Attribute]
|
73
|
+
#
|
74
|
+
# @return [Mean]
|
75
|
+
#
|
76
|
+
# @api public
|
77
|
+
def mean
|
78
|
+
Mean.new(self)
|
79
|
+
end
|
80
|
+
|
81
|
+
end # module Methods
|
82
|
+
end # class Mean
|
83
|
+
end # class Aggregate
|
84
|
+
end # module Axiom
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Axiom
|
4
|
+
class Aggregate
|
5
|
+
|
6
|
+
# The maximum value in a sequence of numbers
|
7
|
+
class Minimum < Aggregate
|
8
|
+
|
9
|
+
DEFAULT = Float::INFINITY
|
10
|
+
|
11
|
+
# Return the minimum value for a sequence of numbers
|
12
|
+
#
|
13
|
+
# @example
|
14
|
+
# minimum = Minimum.call(minimum, value)
|
15
|
+
#
|
16
|
+
# @param [Numeric] minimum
|
17
|
+
#
|
18
|
+
# @param [Numeric] value
|
19
|
+
#
|
20
|
+
# @return [Numeric]
|
21
|
+
#
|
22
|
+
# @api public
|
23
|
+
def self.call(minimum, value)
|
24
|
+
return minimum if value.nil?
|
25
|
+
value < minimum ? value : minimum
|
26
|
+
end
|
27
|
+
|
28
|
+
# Return the type returned from #call
|
29
|
+
#
|
30
|
+
# @example
|
31
|
+
# type = Axiom::Aggregate::Minimum.type
|
32
|
+
#
|
33
|
+
# @return [Class<Attribute::Numeric>]
|
34
|
+
#
|
35
|
+
# @api public
|
36
|
+
def type
|
37
|
+
Attribute.infer_type(operand)
|
38
|
+
end
|
39
|
+
|
40
|
+
module Methods
|
41
|
+
extend Aliasable
|
42
|
+
|
43
|
+
inheritable_alias(:min => :minimum)
|
44
|
+
|
45
|
+
# Return a minimum aggregate function
|
46
|
+
#
|
47
|
+
# @example
|
48
|
+
# minimum = attribute.minimum
|
49
|
+
#
|
50
|
+
# @param [Attribute]
|
51
|
+
#
|
52
|
+
# @return [Minimum]
|
53
|
+
#
|
54
|
+
# @api public
|
55
|
+
def minimum
|
56
|
+
Minimum.new(self)
|
57
|
+
end
|
58
|
+
|
59
|
+
end # module Methods
|
60
|
+
end # class Minimum
|
61
|
+
end # class Aggregate
|
62
|
+
end # module Axiom
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Axiom
|
4
|
+
class Aggregate
|
5
|
+
|
6
|
+
# The standard deviation of a sequence of numbers
|
7
|
+
class StandardDeviation < Variance
|
8
|
+
|
9
|
+
# Calculate the standard deviation from the accumulator
|
10
|
+
#
|
11
|
+
# @example
|
12
|
+
# standard_deviation = StandardDeviation.finalize(accumulator)
|
13
|
+
#
|
14
|
+
# @param [Array(Numeric, Integer, Numeric)] _accumulator
|
15
|
+
#
|
16
|
+
# @return [Float]
|
17
|
+
# returned for a non-empty set
|
18
|
+
# @return [nil]
|
19
|
+
# returned for an empty set
|
20
|
+
#
|
21
|
+
# @api public
|
22
|
+
def self.finalize(_accumulator)
|
23
|
+
variance = super
|
24
|
+
Math.sqrt(variance) if variance
|
25
|
+
end
|
26
|
+
|
27
|
+
# Return the type returned from #call
|
28
|
+
#
|
29
|
+
# @example
|
30
|
+
# type = Axiom::Aggregate::StandardDeviation.type
|
31
|
+
#
|
32
|
+
# @return [Class<Attribute::Float>]
|
33
|
+
#
|
34
|
+
# @api public
|
35
|
+
def type
|
36
|
+
Attribute::Float
|
37
|
+
end
|
38
|
+
|
39
|
+
module Methods
|
40
|
+
extend Aliasable
|
41
|
+
|
42
|
+
inheritable_alias(:stddev => :standard_deviation)
|
43
|
+
|
44
|
+
# Return a standard deviation aggregate function
|
45
|
+
#
|
46
|
+
# @example
|
47
|
+
# standard_deviation = attribute.standard_deviation
|
48
|
+
#
|
49
|
+
# @param [Attribute]
|
50
|
+
#
|
51
|
+
# @return [StandardDeviation]
|
52
|
+
#
|
53
|
+
# @api public
|
54
|
+
def standard_deviation
|
55
|
+
StandardDeviation.new(self)
|
56
|
+
end
|
57
|
+
|
58
|
+
end # module Methods
|
59
|
+
end # class StandardDeviation
|
60
|
+
end # class Aggregate
|
61
|
+
end # module Axiom
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Axiom
|
4
|
+
class Aggregate
|
5
|
+
|
6
|
+
# The sum of a sequence of numbers
|
7
|
+
class Sum < Aggregate
|
8
|
+
|
9
|
+
DEFAULT = 0
|
10
|
+
|
11
|
+
# Return the sum for a sequence of numbers
|
12
|
+
#
|
13
|
+
# @example
|
14
|
+
# sum = Sum.call(sum, value)
|
15
|
+
#
|
16
|
+
# @param [Numeric] sum
|
17
|
+
#
|
18
|
+
# @param [Object] value
|
19
|
+
#
|
20
|
+
# @return [Numeric]
|
21
|
+
#
|
22
|
+
# @api public
|
23
|
+
def self.call(sum, value)
|
24
|
+
return sum if value.nil?
|
25
|
+
sum + value
|
26
|
+
end
|
27
|
+
|
28
|
+
# Return the default sum
|
29
|
+
#
|
30
|
+
# @example when the operand is a float
|
31
|
+
# default = sum.default # => 0.0
|
32
|
+
#
|
33
|
+
# @example when the operand is a decimal
|
34
|
+
# default = sum.default # => BigDecimal('0.0')
|
35
|
+
#
|
36
|
+
# @example when the operand is an integer
|
37
|
+
# default = sum.default # => 0
|
38
|
+
#
|
39
|
+
# @return [Numeric]
|
40
|
+
#
|
41
|
+
# @todo refactor once functions know their return types
|
42
|
+
#
|
43
|
+
# @api public
|
44
|
+
def default
|
45
|
+
if type.equal?(Attribute::Float) then super.to_f
|
46
|
+
elsif type.equal?(Attribute::Decimal) then BigDecimal(super.to_s)
|
47
|
+
else
|
48
|
+
super
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# Return the type returned from #call
|
53
|
+
#
|
54
|
+
# @example
|
55
|
+
# type = Axiom::Aggregate::Sum.type
|
56
|
+
#
|
57
|
+
# @return [Class<Attribute::Numeric>]
|
58
|
+
#
|
59
|
+
# @api public
|
60
|
+
def type
|
61
|
+
Attribute.infer_type(operand)
|
62
|
+
end
|
63
|
+
|
64
|
+
module Methods
|
65
|
+
|
66
|
+
# Return a sum aggregate function
|
67
|
+
#
|
68
|
+
# @example
|
69
|
+
# sum = attribute.sum
|
70
|
+
#
|
71
|
+
# @param [Attribute]
|
72
|
+
#
|
73
|
+
# @return [Sum]
|
74
|
+
#
|
75
|
+
# @api public
|
76
|
+
def sum
|
77
|
+
Sum.new(self)
|
78
|
+
end
|
79
|
+
|
80
|
+
end # module Methods
|
81
|
+
end # class Sum
|
82
|
+
end # class Aggregate
|
83
|
+
end # module Axiom
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Axiom
|
4
|
+
class Aggregate
|
5
|
+
|
6
|
+
# The variance of a sequence of numbers
|
7
|
+
class Variance < Aggregate
|
8
|
+
|
9
|
+
DEFAULT = [ 0, nil, 0.0 ].freeze
|
10
|
+
|
11
|
+
# Return the count, mean, and sum of squares for a sequence of numbers
|
12
|
+
#
|
13
|
+
# @example
|
14
|
+
# count, mean, sum_of_squares = Variance.call(accumulator, value)
|
15
|
+
#
|
16
|
+
# @param [Array(Integer, Numeric, Float)] accumulator
|
17
|
+
#
|
18
|
+
# @param [Numeric] value
|
19
|
+
#
|
20
|
+
# @return [Array(Integer, Numeric, Numeric)]
|
21
|
+
#
|
22
|
+
# @api public
|
23
|
+
def self.call(accumulator, value)
|
24
|
+
return accumulator if value.nil?
|
25
|
+
mean, sum_of_squares = accumulator.last(2)
|
26
|
+
delta = mean.nil? ? value : value - mean
|
27
|
+
count, new_mean = Mean.call(accumulator, value)
|
28
|
+
sum_of_squares += delta * (value - new_mean)
|
29
|
+
[ count, new_mean, sum_of_squares ]
|
30
|
+
end
|
31
|
+
|
32
|
+
# Calculate the variance from the accumulator
|
33
|
+
#
|
34
|
+
# @example
|
35
|
+
# variance = Variance.finalize(accumulator)
|
36
|
+
#
|
37
|
+
# @param [Array(Numeric, Integer, Float)] accumulator
|
38
|
+
#
|
39
|
+
# @return [Float]
|
40
|
+
# returned for a non-empty set
|
41
|
+
# @return [nil]
|
42
|
+
# returned for an empty set
|
43
|
+
#
|
44
|
+
# @api public
|
45
|
+
def self.finalize(accumulator)
|
46
|
+
sum_of_squares, count = accumulator.values_at(2, 0)
|
47
|
+
sum_of_squares / count unless count.zero?
|
48
|
+
end
|
49
|
+
|
50
|
+
# Return the type returned from #call
|
51
|
+
#
|
52
|
+
# @example
|
53
|
+
# type = Axiom::Aggregate::Variance.type
|
54
|
+
#
|
55
|
+
# @return [Class<Attribute::Float>]
|
56
|
+
#
|
57
|
+
# @api public
|
58
|
+
def type
|
59
|
+
Attribute::Float
|
60
|
+
end
|
61
|
+
|
62
|
+
module Methods
|
63
|
+
extend Aliasable
|
64
|
+
|
65
|
+
inheritable_alias(:var => :variance)
|
66
|
+
|
67
|
+
# Return a variance aggregate function
|
68
|
+
#
|
69
|
+
# @example
|
70
|
+
# variance = attribute.variance
|
71
|
+
#
|
72
|
+
# @param [Attribute]
|
73
|
+
#
|
74
|
+
# @return [Variance]
|
75
|
+
#
|
76
|
+
# @api public
|
77
|
+
def variance
|
78
|
+
Variance.new(self)
|
79
|
+
end
|
80
|
+
|
81
|
+
end # module Methods
|
82
|
+
end # class Variance
|
83
|
+
end # class Aggregate
|
84
|
+
end # module Axiom
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Axiom
|
4
|
+
module Algebra
|
5
|
+
|
6
|
+
# The difference between relations
|
7
|
+
class Difference < Relation
|
8
|
+
include Relation::Operation::Set
|
9
|
+
|
10
|
+
# Iterate over each tuple in the set
|
11
|
+
#
|
12
|
+
# @example
|
13
|
+
# difference = Difference.new(left, right)
|
14
|
+
# difference.each { |tuple| ... }
|
15
|
+
#
|
16
|
+
# @yield [tuple]
|
17
|
+
#
|
18
|
+
# @yieldparam [Tuple] tuple
|
19
|
+
# each tuple in the set
|
20
|
+
#
|
21
|
+
# @return [self]
|
22
|
+
#
|
23
|
+
# @api public
|
24
|
+
def each
|
25
|
+
return to_enum unless block_given?
|
26
|
+
left.each { |tuple| yield tuple unless right.include?(tuple) }
|
27
|
+
self
|
28
|
+
end
|
29
|
+
|
30
|
+
# Insert a relation into the Difference
|
31
|
+
#
|
32
|
+
# Add the relation to the left operand, and remove from the right operand
|
33
|
+
# so that it not removed by the difference operation.
|
34
|
+
#
|
35
|
+
# @example
|
36
|
+
# new_relation = difference.insert(other)
|
37
|
+
#
|
38
|
+
# @param [Relation] other
|
39
|
+
#
|
40
|
+
# @return [Difference]
|
41
|
+
#
|
42
|
+
# @api public
|
43
|
+
def insert(other)
|
44
|
+
left.insert(coerce(other).difference(right)).difference(right)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Delete a relation from the Difference
|
48
|
+
#
|
49
|
+
# Remove the relation from the left operand, and add it to the right
|
50
|
+
# operand so that it is removed by the difference operation.
|
51
|
+
#
|
52
|
+
# @example
|
53
|
+
# new_relation = difference.delete(other)
|
54
|
+
#
|
55
|
+
# @param [Relation] other
|
56
|
+
#
|
57
|
+
# @return [Difference]
|
58
|
+
#
|
59
|
+
# @api public
|
60
|
+
def delete(other)
|
61
|
+
left.delete(coerce(other).difference(right)).difference(right)
|
62
|
+
end
|
63
|
+
|
64
|
+
module Methods
|
65
|
+
extend Aliasable
|
66
|
+
|
67
|
+
inheritable_alias(:- => :difference)
|
68
|
+
|
69
|
+
# Return the difference between relations
|
70
|
+
#
|
71
|
+
# @example
|
72
|
+
# difference = relation.difference(other)
|
73
|
+
#
|
74
|
+
# @param [Relation] other
|
75
|
+
#
|
76
|
+
# @return [Difference]
|
77
|
+
#
|
78
|
+
# @api public
|
79
|
+
def difference(other)
|
80
|
+
Difference.new(self, other)
|
81
|
+
end
|
82
|
+
|
83
|
+
end # module Methods
|
84
|
+
|
85
|
+
Relation.class_eval { include Methods }
|
86
|
+
|
87
|
+
end # class Difference
|
88
|
+
end # module Algebra
|
89
|
+
end # module Axiom
|