predicate 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +2 -0
  3. data/LICENSE.md +22 -0
  4. data/Rakefile +11 -0
  5. data/lib/predicate/factory.rb +107 -0
  6. data/lib/predicate/grammar.rb +33 -0
  7. data/lib/predicate/grammar.sexp.yml +58 -0
  8. data/lib/predicate/nodes/and.rb +23 -0
  9. data/lib/predicate/nodes/contradiction.rb +34 -0
  10. data/lib/predicate/nodes/dyadic_comp.rb +26 -0
  11. data/lib/predicate/nodes/eq.rb +15 -0
  12. data/lib/predicate/nodes/expr.rb +68 -0
  13. data/lib/predicate/nodes/gt.rb +10 -0
  14. data/lib/predicate/nodes/gte.rb +10 -0
  15. data/lib/predicate/nodes/identifier.rb +18 -0
  16. data/lib/predicate/nodes/in.rb +26 -0
  17. data/lib/predicate/nodes/literal.rb +18 -0
  18. data/lib/predicate/nodes/lt.rb +10 -0
  19. data/lib/predicate/nodes/lte.rb +10 -0
  20. data/lib/predicate/nodes/nadic_bool.rb +16 -0
  21. data/lib/predicate/nodes/native.rb +30 -0
  22. data/lib/predicate/nodes/neq.rb +10 -0
  23. data/lib/predicate/nodes/not.rb +22 -0
  24. data/lib/predicate/nodes/or.rb +10 -0
  25. data/lib/predicate/nodes/qualified_identifier.rb +22 -0
  26. data/lib/predicate/nodes/tautology.rb +30 -0
  27. data/lib/predicate/processors/qualifier.rb +23 -0
  28. data/lib/predicate/processors/renamer.rb +25 -0
  29. data/lib/predicate/processors/to_ruby_code.rb +71 -0
  30. data/lib/predicate/processors.rb +3 -0
  31. data/lib/predicate/version.rb +8 -0
  32. data/lib/predicate.rb +113 -0
  33. data/spec/expr/test_to_proc.rb +16 -0
  34. data/spec/expr/test_to_ruby_code.rb +152 -0
  35. data/spec/factory/shared/a_comparison_factory_method.rb +35 -0
  36. data/spec/factory/shared/a_predicate_ast_node.rb +20 -0
  37. data/spec/factory/test_and.rb +13 -0
  38. data/spec/factory/test_between.rb +12 -0
  39. data/spec/factory/test_comp.rb +35 -0
  40. data/spec/factory/test_contradiction.rb +11 -0
  41. data/spec/factory/test_eq.rb +9 -0
  42. data/spec/factory/test_factor_predicate.rb +50 -0
  43. data/spec/factory/test_gt.rb +9 -0
  44. data/spec/factory/test_gte.rb +9 -0
  45. data/spec/factory/test_identifier.rb +13 -0
  46. data/spec/factory/test_in.rb +12 -0
  47. data/spec/factory/test_literal.rb +13 -0
  48. data/spec/factory/test_lt.rb +9 -0
  49. data/spec/factory/test_lte.rb +9 -0
  50. data/spec/factory/test_native.rb +19 -0
  51. data/spec/factory/test_neq.rb +9 -0
  52. data/spec/factory/test_not.rb +13 -0
  53. data/spec/factory/test_or.rb +13 -0
  54. data/spec/factory/test_qualified_identifier.rb +15 -0
  55. data/spec/factory/test_tautology.rb +12 -0
  56. data/spec/grammar/test_match.rb +93 -0
  57. data/spec/grammar/test_sexpr.rb +103 -0
  58. data/spec/nodes/and/test_and_split.rb +66 -0
  59. data/spec/nodes/dyadic_comp/test_and_split.rb +45 -0
  60. data/spec/nodes/identifier/test_and_split.rb +23 -0
  61. data/spec/nodes/identifier/test_free_variables.rb +12 -0
  62. data/spec/nodes/identifier/test_name.rb +12 -0
  63. data/spec/nodes/nadic_bool/test_free_variables.rb +14 -0
  64. data/spec/nodes/qualified_identifier/test_and_split.rb +23 -0
  65. data/spec/nodes/qualified_identifier/test_free_variables.rb +12 -0
  66. data/spec/nodes/qualified_identifier/test_name.rb +12 -0
  67. data/spec/nodes/qualified_identifier/test_qualifier.rb +12 -0
  68. data/spec/predicate/test_and_split.rb +57 -0
  69. data/spec/predicate/test_bool_and.rb +34 -0
  70. data/spec/predicate/test_bool_not.rb +68 -0
  71. data/spec/predicate/test_bool_or.rb +34 -0
  72. data/spec/predicate/test_coerce.rb +75 -0
  73. data/spec/predicate/test_constant_variables.rb +52 -0
  74. data/spec/predicate/test_contradiction.rb +24 -0
  75. data/spec/predicate/test_evaluate.rb +66 -0
  76. data/spec/predicate/test_factory_methods.rb +77 -0
  77. data/spec/predicate/test_free_variables.rb +14 -0
  78. data/spec/predicate/test_hash_and_equal.rb +26 -0
  79. data/spec/predicate/test_qualify.rb +34 -0
  80. data/spec/predicate/test_rename.rb +76 -0
  81. data/spec/predicate/test_tautology.rb +24 -0
  82. data/spec/predicate/test_to_proc.rb +14 -0
  83. data/spec/predicate/test_to_ruby_code.rb +20 -0
  84. data/spec/spec_helper.rb +12 -0
  85. data/spec/test_predicate.rb +127 -0
  86. data/tasks/test.rake +11 -0
  87. metadata +186 -0
metadata ADDED
@@ -0,0 +1,186 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: predicate
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Bernard Lambeau
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-07-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sexpr
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.6.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.6.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: path
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.6'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.6'
69
+ description: Predicate provides a simple class and processors to encode and manipulate
70
+ (tuple) predicates
71
+ email: blambeau@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - Gemfile
77
+ - LICENSE.md
78
+ - Rakefile
79
+ - lib/predicate.rb
80
+ - lib/predicate/factory.rb
81
+ - lib/predicate/grammar.rb
82
+ - lib/predicate/grammar.sexp.yml
83
+ - lib/predicate/nodes/and.rb
84
+ - lib/predicate/nodes/contradiction.rb
85
+ - lib/predicate/nodes/dyadic_comp.rb
86
+ - lib/predicate/nodes/eq.rb
87
+ - lib/predicate/nodes/expr.rb
88
+ - lib/predicate/nodes/gt.rb
89
+ - lib/predicate/nodes/gte.rb
90
+ - lib/predicate/nodes/identifier.rb
91
+ - lib/predicate/nodes/in.rb
92
+ - lib/predicate/nodes/literal.rb
93
+ - lib/predicate/nodes/lt.rb
94
+ - lib/predicate/nodes/lte.rb
95
+ - lib/predicate/nodes/nadic_bool.rb
96
+ - lib/predicate/nodes/native.rb
97
+ - lib/predicate/nodes/neq.rb
98
+ - lib/predicate/nodes/not.rb
99
+ - lib/predicate/nodes/or.rb
100
+ - lib/predicate/nodes/qualified_identifier.rb
101
+ - lib/predicate/nodes/tautology.rb
102
+ - lib/predicate/processors.rb
103
+ - lib/predicate/processors/qualifier.rb
104
+ - lib/predicate/processors/renamer.rb
105
+ - lib/predicate/processors/to_ruby_code.rb
106
+ - lib/predicate/version.rb
107
+ - spec/expr/test_to_proc.rb
108
+ - spec/expr/test_to_ruby_code.rb
109
+ - spec/factory/shared/a_comparison_factory_method.rb
110
+ - spec/factory/shared/a_predicate_ast_node.rb
111
+ - spec/factory/test_and.rb
112
+ - spec/factory/test_between.rb
113
+ - spec/factory/test_comp.rb
114
+ - spec/factory/test_contradiction.rb
115
+ - spec/factory/test_eq.rb
116
+ - spec/factory/test_factor_predicate.rb
117
+ - spec/factory/test_gt.rb
118
+ - spec/factory/test_gte.rb
119
+ - spec/factory/test_identifier.rb
120
+ - spec/factory/test_in.rb
121
+ - spec/factory/test_literal.rb
122
+ - spec/factory/test_lt.rb
123
+ - spec/factory/test_lte.rb
124
+ - spec/factory/test_native.rb
125
+ - spec/factory/test_neq.rb
126
+ - spec/factory/test_not.rb
127
+ - spec/factory/test_or.rb
128
+ - spec/factory/test_qualified_identifier.rb
129
+ - spec/factory/test_tautology.rb
130
+ - spec/grammar/test_match.rb
131
+ - spec/grammar/test_sexpr.rb
132
+ - spec/nodes/and/test_and_split.rb
133
+ - spec/nodes/dyadic_comp/test_and_split.rb
134
+ - spec/nodes/identifier/test_and_split.rb
135
+ - spec/nodes/identifier/test_free_variables.rb
136
+ - spec/nodes/identifier/test_name.rb
137
+ - spec/nodes/nadic_bool/test_free_variables.rb
138
+ - spec/nodes/qualified_identifier/test_and_split.rb
139
+ - spec/nodes/qualified_identifier/test_free_variables.rb
140
+ - spec/nodes/qualified_identifier/test_name.rb
141
+ - spec/nodes/qualified_identifier/test_qualifier.rb
142
+ - spec/predicate/test_and_split.rb
143
+ - spec/predicate/test_bool_and.rb
144
+ - spec/predicate/test_bool_not.rb
145
+ - spec/predicate/test_bool_or.rb
146
+ - spec/predicate/test_coerce.rb
147
+ - spec/predicate/test_constant_variables.rb
148
+ - spec/predicate/test_contradiction.rb
149
+ - spec/predicate/test_evaluate.rb
150
+ - spec/predicate/test_factory_methods.rb
151
+ - spec/predicate/test_free_variables.rb
152
+ - spec/predicate/test_hash_and_equal.rb
153
+ - spec/predicate/test_qualify.rb
154
+ - spec/predicate/test_rename.rb
155
+ - spec/predicate/test_tautology.rb
156
+ - spec/predicate/test_to_proc.rb
157
+ - spec/predicate/test_to_ruby_code.rb
158
+ - spec/spec_helper.rb
159
+ - spec/test_predicate.rb
160
+ - tasks/test.rake
161
+ homepage: http://github.com/enspirit/predicate
162
+ licenses:
163
+ - MIT
164
+ metadata: {}
165
+ post_install_message:
166
+ rdoc_options: []
167
+ require_paths:
168
+ - lib
169
+ required_ruby_version: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ required_rubygems_version: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
179
+ requirements: []
180
+ rubyforge_project:
181
+ rubygems_version: 2.5.2
182
+ signing_key:
183
+ specification_version: 4
184
+ summary: Predicate provides a simple class and processors to encode and manipulate
185
+ (tuple) predicates
186
+ test_files: []