OSDN Git Service

remove four_arithmetic generator
[mint/mint-lib.git] / README.rdoc
1 = mint-lib
2
3 == Description:
4
5 An utilities that is used by Mint.
6
7 == Classes:
8
9 == Mint::Expression
10 This class represents an expression.
11
12   expression = Mint::Expression.new('5 div 4', expression_tree)
13   p expression.to_s #=> '5 div 4'
14   p expression.to_maxima #=> '5 / 4'
15   p expression.to_latex #=> '5 \div 4'
16   p expression.normalize #=> '5 div 4'
17
18 === Mint::Builder
19 This class builds expression from string.
20
21   input = Readline.readline('>')
22   begine
23     answer = Mint::Builder.build(input)
24     p answer.class
25     #=> Mint::Expression
26   rescue
27     puts 'Please check your answer.'
28   end
29
30 === Mint::Factory
31 Factory generates problem generator.
32
33   Mint::Factory.create(:arithmetic)
34   #=> #<Mint::Generator::Arithmetic>
35
36 === Mint::Generator
37 Problem generator.
38
39 ==== Base
40 You must inheritance this class.
41 and over wirte #generate_problem method.
42
43 ==== Arithmetic
44 ==== HighOrderExpression
45
46 === Mint::Solver
47 Problem solver.
48
49   Mint::Solver.set_engine Mint::Solver::Engine::Arithmetic
50   Mint::Solver.solve('1 + 1')
51   #=> 2
52
53 ==== Engines
54 Solver engine
55
56 ===== Base
57 You must inheritance this class.
58 to make original engine.
59 and over write #solve method.
60
61 ===== Arithmetic
62 ===== Factorization
63 ===== Expantion
64
65 == TODO:
66 Move description to code.
67