ruby-prolog 0.0.5 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/NOTICE +5 -0
- data/README.md +50 -0
- data/Rakefile +12 -10
- data/{examples/acls.rb → bin/ruby-prolog-acls} +10 -2
- data/{examples/hanoi.rb → bin/ruby-prolog-hanoi} +5 -3
- data/lib/ruby-prolog.rb +2 -47
- data/lib/ruby-prolog/ruby-prolog.rb +3 -4
- data/lib/ruby-prolog/version.rb +5 -0
- data/ruby-prolog.gemspec +20 -27
- data/{spec/ruby-prolog_spec.rb → test/lib/ruby-prolog/ruby-prolog_test.rb} +15 -22
- data/test/test_helper.rb +3 -0
- metadata +87 -54
- data/History.txt +0 -19
- data/Manifest +0 -10
- data/README.txt +0 -57
- data/spec/spec_helper.rb +0 -16
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 95ccd423807966099f72796cd208b6f6f3a67e04
|
4
|
+
data.tar.gz: e7466c847b517b701e7af1e7ed0d3a475e0120fb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 12038b878dd73582ed9dd113145f87a1275a1b6ce754ce8c7a802c4a68f0e3eb44e6fc3b0c91d0ab167fa929155b3bf8801ea671fb12d1ada5caa4f3b9d05f1f
|
7
|
+
data.tar.gz: bbaa1e1e15f8a851760b82178fa2b19ff66a68f0d1b0e7c57a9b74e9762415c6f6651fcb30f1dbd2e136689e8161c6f5f17c25df85373834f71503d5772399b3
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/NOTICE
ADDED
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
ruby_prolog
|
2
|
+
====
|
3
|
+
|
4
|
+
An object-oriented pure Ruby implementation of a Prolog-like DSL for easy AI and logical programming. It should work under all popular Ruby interpreters. Please report compatibility problems.
|
5
|
+
|
6
|
+
The core engine is largely based on tiny_prolog, though numerous additional enhancements have been made
|
7
|
+
such as object-oriented refactorings and integration of ideas from the interwebs. Unfortunately I cannot
|
8
|
+
read Japanese and cannot give proper attribution to the original tiny_prolog author. (If *you* can, let
|
9
|
+
me know and I'll update this document!)
|
10
|
+
|
11
|
+
|
12
|
+
Usage
|
13
|
+
----
|
14
|
+
|
15
|
+
Two runnable examples are included in the 'bin' directory. The first..
|
16
|
+
|
17
|
+
ruby-prolog-hanoi
|
18
|
+
|
19
|
+
..is a ruby-prolog solution to the well-known "Towers of Hanoi" problem in computer science. The second..
|
20
|
+
|
21
|
+
ruby-prolog-acls
|
22
|
+
|
23
|
+
..shows the ruby-prolog DSL can be trivially used to implement an access control system. If you have some other useful or clever examples, please contribute them!
|
24
|
+
|
25
|
+
|
26
|
+
Features
|
27
|
+
----
|
28
|
+
|
29
|
+
* Pure Ruby.
|
30
|
+
* Tested with Ruby 2.0.0!
|
31
|
+
* Object-oriented.
|
32
|
+
* Multiple Prolog environments can be created and manipulated simultaneously.
|
33
|
+
* Concurrent access to different core instances should be safe.
|
34
|
+
* Concurrent access to a single core instance might probably explode in odd ways.
|
35
|
+
|
36
|
+
|
37
|
+
Installation
|
38
|
+
----
|
39
|
+
|
40
|
+
gem install ruby_prolog
|
41
|
+
|
42
|
+
See ruby_prolog_spec.rb for usage examples.
|
43
|
+
|
44
|
+
|
45
|
+
License
|
46
|
+
----
|
47
|
+
|
48
|
+
Released under the Apache 2 license.
|
49
|
+
|
50
|
+
Copyright (c) 2013 Preston Lee. All rights reserved. http://prestonlee.com
|
data/Rakefile
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require "bundler/gem_tasks"
|
3
|
+
|
4
|
+
require 'rake/testtask'
|
5
|
+
|
6
|
+
Rake::TestTask.new do |t|
|
7
|
+
t.libs << 'lib/ruby-prolog'
|
8
|
+
t.test_files = FileList['test/lib/ruby-prolog/*_test.rb']
|
9
|
+
t.verbose = true
|
10
|
+
end
|
11
|
+
|
12
|
+
task :default => :test
|
@@ -1,4 +1,9 @@
|
|
1
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# By Preston Lee
|
4
|
+
#
|
5
|
+
|
6
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
2
7
|
require 'ruby-prolog'
|
3
8
|
|
4
9
|
c = RubyProlog::Core.new
|
@@ -48,7 +53,10 @@ c.instance_eval do
|
|
48
53
|
|
49
54
|
# can_read_on_project[:U, :P] <<= [assigned[:U, :P, :R], role_can[:R, 'read']]
|
50
55
|
can_on_project[:U, :X, :P] <<= [assigned[:U, :P, :R], role_can[:R, :X]]
|
51
|
-
is_role_on_multiple_projects[:U, :R] <<= [
|
56
|
+
is_role_on_multiple_projects[:U, :R] <<= [
|
57
|
+
assigned[:U, :X, :R],
|
58
|
+
assigned[:U, :Y, :R],
|
59
|
+
noteq[:X, :Y]]
|
52
60
|
# , noteq[:P1, :P2]
|
53
61
|
|
54
62
|
puts 'Who does QA?'
|
@@ -1,12 +1,14 @@
|
|
1
|
-
|
2
|
-
require 'ruby-prolog'
|
1
|
+
#!/usr/bin/env ruby
|
3
2
|
|
4
|
-
|
3
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
4
|
+
require 'ruby-prolog'
|
5
5
|
|
6
6
|
# Inspired by..
|
7
7
|
# http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/2_3.html
|
8
8
|
# http://eigenclass.org/hiki.rb?tiny+prolog+in+ruby
|
9
9
|
|
10
|
+
# Adapted by Preston Lee.
|
11
|
+
|
10
12
|
c = RubyProlog::Core.new
|
11
13
|
c.instance_eval do
|
12
14
|
|
data/lib/ruby-prolog.rb
CHANGED
@@ -1,49 +1,4 @@
|
|
1
|
+
require_relative 'ruby-prolog/ruby-prolog.rb'
|
1
2
|
|
2
3
|
module RubyProlog
|
3
|
-
|
4
|
-
# :stopdoc:
|
5
|
-
VERSION = '0.0.5'
|
6
|
-
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
7
|
-
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
8
|
-
# :startdoc:
|
9
|
-
|
10
|
-
# Returns the version string for the library.
|
11
|
-
#
|
12
|
-
def self.version
|
13
|
-
VERSION
|
14
|
-
end
|
15
|
-
|
16
|
-
# Returns the library path for the module. If any arguments are given,
|
17
|
-
# they will be joined to the end of the libray path using
|
18
|
-
# <tt>File.join</tt>.
|
19
|
-
#
|
20
|
-
def self.libpath( *args )
|
21
|
-
args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
|
22
|
-
end
|
23
|
-
|
24
|
-
# Returns the lpath for the module. If any arguments are given,
|
25
|
-
# they will be joined to the end of the path using
|
26
|
-
# <tt>File.join</tt>.
|
27
|
-
#
|
28
|
-
def self.path( *args )
|
29
|
-
args.empty? ? PATH : ::File.join(PATH, args.flatten)
|
30
|
-
end
|
31
|
-
|
32
|
-
# Utility method used to rquire all files ending in .rb that lie in the
|
33
|
-
# directory below this file that has the same name as the filename passed
|
34
|
-
# in. Optionally, a specific _directory_ name can be passed in such that
|
35
|
-
# the _filename_ does not have to be equivalent to the directory.
|
36
|
-
#
|
37
|
-
def self.require_all_libs_relative_to( fname, dir = nil )
|
38
|
-
dir ||= ::File.basename(fname, '.*')
|
39
|
-
search_me = ::File.expand_path(
|
40
|
-
::File.join(::File.dirname(fname), dir, '**', '*.rb'))
|
41
|
-
|
42
|
-
Dir.glob(search_me).sort.each {|rb| require rb}
|
43
|
-
end
|
44
|
-
|
45
|
-
end # module RubyProlog
|
46
|
-
|
47
|
-
RubyProlog.require_all_libs_relative_to(__FILE__)
|
48
|
-
|
49
|
-
# EOF
|
4
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Based on tiny_prolog h18.9/8
|
2
|
-
|
2
|
+
# Fuglied by Preston Lee.
|
3
3
|
module RubyProlog
|
4
4
|
|
5
5
|
|
@@ -39,7 +39,7 @@ module RubyProlog
|
|
39
39
|
@pred, @args = pred, args
|
40
40
|
end
|
41
41
|
|
42
|
-
def si(*rhs)
|
42
|
+
def si(*rhs)
|
43
43
|
@pred.defs << [self, list(*rhs)]
|
44
44
|
end
|
45
45
|
|
@@ -67,7 +67,7 @@ module RubyProlog
|
|
67
67
|
end
|
68
68
|
|
69
69
|
|
70
|
-
# Lisp
|
70
|
+
# Lisp
|
71
71
|
class Cons < Array
|
72
72
|
|
73
73
|
def initialize(car, cdr)
|
@@ -89,7 +89,6 @@ module RubyProlog
|
|
89
89
|
end
|
90
90
|
|
91
91
|
|
92
|
-
|
93
92
|
class Environment
|
94
93
|
|
95
94
|
def initialize
|
data/ruby-prolog.gemspec
CHANGED
@@ -1,31 +1,24 @@
|
|
1
|
-
#
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'ruby-prolog/version'
|
2
5
|
|
3
|
-
Gem::Specification.new do |
|
4
|
-
|
5
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "ruby-prolog"
|
8
|
+
spec.version = RubyProlog::VERSION
|
9
|
+
spec.authors = ["Preston Lee"]
|
10
|
+
spec.email = ["preston.lee@prestonlee.com"]
|
11
|
+
spec.description = "A Prolog-ish Ruby DSL."
|
12
|
+
spec.summary = "A Prolog-ish Ruby DSL."
|
13
|
+
spec.homepage = "http://github.com/preston/ruby-prolog"
|
14
|
+
spec.license = "Apache 2"
|
6
15
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
s.email = %q{preston.lee@openrain.com}
|
12
|
-
s.extra_rdoc_files = ["lib/ruby-prolog/ruby-prolog.rb", "lib/ruby-prolog.rb", "README.txt"]
|
13
|
-
s.files = ["examples/acls.rb", "examples/hanoi.rb", "History.txt", "lib/ruby-prolog/ruby-prolog.rb", "lib/ruby-prolog.rb", "Manifest", "Rakefile", "README.txt", "spec/ruby-prolog_spec.rb", "spec/spec_helper.rb", "ruby-prolog.gemspec"]
|
14
|
-
s.has_rdoc = true
|
15
|
-
s.homepage = %q{http://www.openrain.com.com}
|
16
|
-
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Ruby-prolog", "--main", "README.txt"]
|
17
|
-
s.require_paths = ["lib"]
|
18
|
-
s.rubyforge_project = %q{ruby-prolog}
|
19
|
-
s.rubygems_version = %q{1.3.1}
|
20
|
-
s.summary = %q{A Prolog-ish Ruby DSL.}
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
27
|
-
else
|
28
|
-
end
|
29
|
-
else
|
30
|
-
end
|
21
|
+
spec.add_development_dependency "bundler"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "minitest"
|
31
24
|
end
|
@@ -1,35 +1,31 @@
|
|
1
1
|
|
2
|
-
|
2
|
+
require_relative '../../test_helper'
|
3
3
|
|
4
4
|
|
5
|
-
describe RubyProlog do
|
6
5
|
|
7
|
-
|
8
|
-
# before :each do
|
9
|
-
# end
|
10
|
-
|
6
|
+
describe RubyProlog do
|
11
7
|
|
12
8
|
it 'should not pollute the global namespace with predicates.' do
|
13
9
|
|
14
10
|
# We'll create numerous instances of the engine and assert they do not interfere with each other.
|
15
11
|
one = RubyProlog::Core.new
|
16
12
|
one.instance_eval do
|
17
|
-
query(male[:X]).length.
|
13
|
+
query(male[:X]).length.must_equal 0
|
18
14
|
end
|
19
15
|
|
20
16
|
two = RubyProlog::Core.new
|
21
17
|
two.instance_eval do
|
22
18
|
male[:preston].fact
|
23
|
-
query(male[:X]).length.
|
19
|
+
query(male[:X]).length.must_equal 1
|
24
20
|
end
|
25
21
|
|
26
22
|
three = RubyProlog::Core.new
|
27
23
|
three.instance_eval do
|
28
|
-
query(male[:X]).length.
|
24
|
+
query(male[:X]).length.must_equal 0
|
29
25
|
end
|
30
26
|
|
31
27
|
one.instance_eval do
|
32
|
-
query(male[:X]).length.
|
28
|
+
query(male[:X]).length.must_equal 0
|
33
29
|
end
|
34
30
|
|
35
31
|
end
|
@@ -118,34 +114,34 @@ describe RubyProlog do
|
|
118
114
|
# p "Who are Silas's parents?"
|
119
115
|
# Silas should have two parents: Matt and Julie.
|
120
116
|
r = query(parent[:P, 'Silas'])
|
121
|
-
r.length.
|
122
|
-
r[0][0].args[0].
|
123
|
-
r[1][0].args[0].
|
117
|
+
r.length.must_equal 2
|
118
|
+
r[0][0].args[0].must_equal 'Matt'
|
119
|
+
r[1][0].args[0].must_equal 'Julie'
|
124
120
|
|
125
121
|
# p "Who is married?"
|
126
122
|
# We defined 5 married facts.
|
127
|
-
query(married[:A, :B]).length.
|
123
|
+
query(married[:A, :B]).length.must_equal 5
|
128
124
|
|
129
125
|
# p 'Are Karen and Julie siblings?'
|
130
126
|
# Yes, through two parents.
|
131
|
-
query(sibling['Karen', 'Julie']).length.
|
127
|
+
query(sibling['Karen', 'Julie']).length.must_equal 2
|
132
128
|
|
133
129
|
|
134
130
|
# p "Who likes to play games?"
|
135
131
|
# Four people.
|
136
|
-
query(interest[:X, 'Games']).length.
|
132
|
+
query(interest[:X, 'Games']).length.must_equal 4
|
137
133
|
|
138
134
|
|
139
135
|
# p "Who likes to play checkers?"
|
140
136
|
# Nobody.
|
141
|
-
query(interest[:X, 'Checkers']).length.
|
137
|
+
query(interest[:X, 'Checkers']).length.must_equal 0
|
142
138
|
|
143
139
|
# p "Who are Karen's ancestors?"
|
144
140
|
# query(ancestor[:A, 'Karen'])
|
145
141
|
|
146
142
|
# p "What grandparents are also widowers?"
|
147
143
|
# Marge, twice, because of two grandchildren.
|
148
|
-
query(widower[:X], grandparent[:X, :G]).length.
|
144
|
+
query(widower[:X], grandparent[:X, :G]).length.must_equal 2
|
149
145
|
end
|
150
146
|
|
151
147
|
end
|
@@ -209,14 +205,11 @@ describe RubyProlog do
|
|
209
205
|
]
|
210
206
|
|
211
207
|
hanoi[:N] <<= move[:N,"left","right","center"]
|
212
|
-
query(hanoi[5]).length.
|
208
|
+
query(hanoi[5]).length.must_equal 1
|
213
209
|
|
214
210
|
# do_stuff[:STUFF].calls{|env| print env[:STUFF]; true}
|
215
211
|
|
216
212
|
end
|
217
213
|
|
218
214
|
end
|
219
|
-
|
220
|
-
|
221
|
-
|
222
215
|
end
|
data/test/test_helper.rb
ADDED
metadata
CHANGED
@@ -1,70 +1,103 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-prolog
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Preston Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
date: 2013-07-31 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
16
55
|
description: A Prolog-ish Ruby DSL.
|
17
|
-
email:
|
18
|
-
|
19
|
-
|
56
|
+
email:
|
57
|
+
- preston.lee@prestonlee.com
|
58
|
+
executables:
|
59
|
+
- ruby-prolog-acls
|
60
|
+
- ruby-prolog-hanoi
|
20
61
|
extensions: []
|
21
|
-
|
22
|
-
|
23
|
-
-
|
62
|
+
extra_rdoc_files: []
|
63
|
+
files:
|
64
|
+
- .gitignore
|
65
|
+
- Gemfile
|
66
|
+
- NOTICE
|
67
|
+
- README.md
|
68
|
+
- Rakefile
|
69
|
+
- bin/ruby-prolog-acls
|
70
|
+
- bin/ruby-prolog-hanoi
|
24
71
|
- lib/ruby-prolog.rb
|
25
|
-
- README.txt
|
26
|
-
files:
|
27
|
-
- examples/acls.rb
|
28
|
-
- examples/hanoi.rb
|
29
|
-
- History.txt
|
30
72
|
- lib/ruby-prolog/ruby-prolog.rb
|
31
|
-
- lib/ruby-prolog.rb
|
32
|
-
- Manifest
|
33
|
-
- Rakefile
|
34
|
-
- README.txt
|
35
|
-
- spec/ruby-prolog_spec.rb
|
36
|
-
- spec/spec_helper.rb
|
73
|
+
- lib/ruby-prolog/version.rb
|
37
74
|
- ruby-prolog.gemspec
|
38
|
-
|
39
|
-
|
75
|
+
- test/lib/ruby-prolog/ruby-prolog_test.rb
|
76
|
+
- test/test_helper.rb
|
77
|
+
homepage: http://github.com/preston/ruby-prolog
|
78
|
+
licenses:
|
79
|
+
- Apache 2
|
80
|
+
metadata: {}
|
40
81
|
post_install_message:
|
41
|
-
rdoc_options:
|
42
|
-
|
43
|
-
- --inline-source
|
44
|
-
- --title
|
45
|
-
- Ruby-prolog
|
46
|
-
- --main
|
47
|
-
- README.txt
|
48
|
-
require_paths:
|
82
|
+
rdoc_options: []
|
83
|
+
require_paths:
|
49
84
|
- lib
|
50
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version:
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
version: "1.2"
|
61
|
-
version:
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
62
95
|
requirements: []
|
63
|
-
|
64
|
-
|
65
|
-
rubygems_version: 1.3.1
|
96
|
+
rubyforge_project:
|
97
|
+
rubygems_version: 2.0.3
|
66
98
|
signing_key:
|
67
|
-
specification_version:
|
99
|
+
specification_version: 4
|
68
100
|
summary: A Prolog-ish Ruby DSL.
|
69
|
-
test_files:
|
70
|
-
|
101
|
+
test_files:
|
102
|
+
- test/lib/ruby-prolog/ruby-prolog_test.rb
|
103
|
+
- test/test_helper.rb
|
data/History.txt
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
== 0.0.4 / 2009-02-09
|
2
|
-
|
3
|
-
* Fixing packaging error from previous build.
|
4
|
-
|
5
|
-
== 0.0.3 / 2009-02-09
|
6
|
-
|
7
|
-
* Renaming files due to RubyForge stupidity.
|
8
|
-
* Adding usage examples.
|
9
|
-
|
10
|
-
== 0.0.2 / 2009-02-04
|
11
|
-
|
12
|
-
* Refactored the code into an object-oriented state.
|
13
|
-
* Changed #query to not print results and return goals.
|
14
|
-
* Made spec tests more meaningful.
|
15
|
-
* Addressed small TODO items.
|
16
|
-
|
17
|
-
== 0.0.1 / 2009-01-14
|
18
|
-
|
19
|
-
* First release. Basically a glorified packaging of tiny_prolog and various extensions.
|
data/Manifest
DELETED
data/README.txt
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
ruby_prolog
|
2
|
-
by Preston Lee
|
3
|
-
http://openrain.com
|
4
|
-
The core engine is largely based on tiny_prolog, though numerous additional enhancements have been made
|
5
|
-
such as object-oriented refactorings and integration of ideas from the interwebs. Unfortunately I cannot
|
6
|
-
read Japanese and cannot give proper attribution to the original tiny_prolog author. If *you* can, let
|
7
|
-
me know and I'll update this document!
|
8
|
-
|
9
|
-
== DESCRIPTION:
|
10
|
-
|
11
|
-
An object-oriented pure Ruby implementation of a Prolog-like DSL for easy AI and logical programming.
|
12
|
-
|
13
|
-
== FEATURES/PROBLEMS:
|
14
|
-
|
15
|
-
* Pure Ruby.
|
16
|
-
* Tested with Ruby 1.8.7 (MRI).
|
17
|
-
* Object-oriented.
|
18
|
-
* Multiple Prolog environments can be created and manipulated simultaneously.
|
19
|
-
* Concurrent access to different core instances should be safe.
|
20
|
-
* Concurrent access to a single core instance might probably explode in odd ways.
|
21
|
-
|
22
|
-
== SYNOPSIS:
|
23
|
-
|
24
|
-
See ruby_prolog_spec.rb for usage examples.
|
25
|
-
|
26
|
-
== REQUIREMENTS:
|
27
|
-
|
28
|
-
* Should work under all popular Ruby interpreters. Please report compatibility problems.
|
29
|
-
|
30
|
-
== INSTALL:
|
31
|
-
|
32
|
-
* sudo gem install ruby_prolog
|
33
|
-
|
34
|
-
== LICENSE:
|
35
|
-
|
36
|
-
(The MIT License)
|
37
|
-
|
38
|
-
Copyright (c) 2008 OpenRain, LLC
|
39
|
-
|
40
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
41
|
-
a copy of this software and associated documentation files (the
|
42
|
-
'Software'), to deal in the Software without restriction, including
|
43
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
44
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
45
|
-
permit persons to whom the Software is furnished to do so, subject to
|
46
|
-
the following conditions:
|
47
|
-
|
48
|
-
The above copyright notice and this permission notice shall be
|
49
|
-
included in all copies or substantial portions of the Software.
|
50
|
-
|
51
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
52
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
53
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
54
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
55
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
56
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
57
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/spec/spec_helper.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'spec'
|
3
|
-
require File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib ruby-prolog]))
|
4
|
-
|
5
|
-
Spec::Runner.configure do |config|
|
6
|
-
# == Mock Framework
|
7
|
-
#
|
8
|
-
# RSpec uses it's own mocking framework by default. If you prefer to
|
9
|
-
# use mocha, flexmock or RR, uncomment the appropriate line:
|
10
|
-
#
|
11
|
-
# config.mock_with :mocha
|
12
|
-
# config.mock_with :flexmock
|
13
|
-
# config.mock_with :rr
|
14
|
-
end
|
15
|
-
|
16
|
-
# EOF
|