Skip to content

Commit 04c8864

Browse files
authored
MathOCL with finance library
1 parent 748f529 commit 04c8864

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

cg/mathocl2ocl.cstl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ definesToAttributes::
9797
Define _1 = _2 |-->\n attribute _1 : double := _2;<when> _1`isIdentifier true
9898
Define _1 |-->\n attribute _1 : double;
9999
Define _1 ~ _2 |-->\n attribute _1 : OclRandom := OclRandom.newOclRandom_2`randomParameters;
100+
Define _1 : _2 |-->\n attribute _1 : _2;
100101

101102
_1 |-->_1`definesToAttributes<when> _1 formula
102103
Constraint on _1 | _2 |-->
@@ -371,7 +372,10 @@ var ( _1 ) |-->_1.variance()
371372
Date ( _1 ) |-->OclDate.newOclDate_String(_1)
372373
Time ( _1 ) |-->OclDate.newOclDate_Time(_1)
373374

375+
accumulatedInterest ( _1 ) |-->FinanceLib.accumulatedInterest(_1)
374376
Binomial ( _1 ) |-->Excel.Binom_Dist_Range(_1`third,_1`last,_1`first,_1`third)
377+
bondPrice ( _1 ) |-->FinanceLib.bondPrice(_1)
378+
bondPriceClean ( _1 ) |-->FinanceLib.bondPriceClean(_1)
375379

376380
_1 ( _2 ) |-->_1(_2)
377381
_1 ( ) |-->_1()

cg/simplify.cstl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ Define _1 |--> Define _1
7272
Define g { _1 } |--> Define g{_1}
7373
Define _1 = _2 |--> Define _1 = _2<action> _1`value _2
7474
Define _1 ~ _2 |--> Define _1 ~ _2<action> _1`distribution _2`distributionName, _1`mean _2`distributionMean, _1`variance _2`distributionVariance
75+
Define _1 : _2 |--> Define _1 : _2
76+
7577

7678
instruction::
7779
_1 |-->_1

0 commit comments

Comments
 (0)