>>> "SIGOURE" == SIGOURE Benoit <sigoure.benoit(a)lrde.epita.fr> writes:
> https://svn.lrde.epita.fr/svn/xrm/trunk
> Index: ChangeLog
> from SIGOURE Benoit <sigoure.benoit(a)lrde.epita.fr>
> Add meta-if at Expression level.
> So basically, it is now possible to have a meta-if statement everywhere
> we can find an Expression. /!\ NOTE: meta-if statements at Expression
> level are restricted to one single expressions in the then-part and
> else-part. eg:
> if some-condition then
> exp1
> exp2
> end
> is *invalid* at Expression level because neither the base language
> nor the extended language provide real statements/sequences of
> expressions.
> Other improvements: PRISM-If statements (cond ? then-part : else-part)
> are now evaluated by prism-desugar when possible. It is also possible
> to reduce the condition of a meta-if statement down to a simple
> Int(_) or Double(_). If that Int(_) or Double(_) is zero, the
> condition will evaluate as False() otherwise True() [like in C].
> NOTE: for Double(_) all tests are performed with a precision of 10^-7
> in other words if 0.000000001 then ... else /*executed*/ end will be
> false.
This is nice!
Vcs est malade chez moi [1]:
brasilia ~/src/oln % svn status
/usr/lib/ruby/gems/1.8/gems/core_ex-0.5.6.2/lib/core_ex/lazy_loading.rb:120:in `result': uninitialized constant Commands::Runners::Runner::Datas (NameError)
from /usr/lib/ruby/gems/1.8/gems/core_ex-0.5.6.2/lib/core_ex/lazy_loading.rb:71:in `load'
from /usr/lib/ruby/gems/1.8/gems/core_ex-0.5.6.2/lib/core_ex/lazy_loading.rb:133:in `load'
from /usr/lib/ruby/gems/1.8/gems/core_ex-0.5.6.2/lib/core_ex/lazy_loading.rb:149:in `const_missing'
from /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/binding_of_caller.rb:80:in `of_caller'
from /usr/lib/ruby/gems/1.8/gems/core_ex-0.5.6.2/lib/core_ex/lazy_loading.rb:147:in `const_missing'
from /usr/lib/ruby/gems/1.8/gems/ruby_ex-0.4.6.2/lib/commands/runners/runner.rb:42:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/ruby_ex-0.4.6.2/lib/concrete.rb:18:in `new'
from /usr/lib/ruby/gems/1.8/gems/ruby_ex-0.4.6.2/lib/uri/generic_ex.rb:37
... 29 levels...
from /usr/lib/ruby/gems/1.8/gems/vcs-0.5.2.4/bin/../lib/vcs/app.rb:17
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
from /usr/lib/ruby/gems/1.8/gems/vcs-0.5.2.4/bin/vcs-svn:7
from /usr/bin/vcs-svn:18
brasilia ~/src/oln % which svn
svn: aliased to vcs-svn
brasilia ~/src/oln % gem list
*** LOCAL GEMS ***
activesupport (1.3.1, 1.2.5, 1.1.1, 1.0.4)
Support and utility classes used by the Rails framework.
core_ex (0.5.6.2, 0.5.5.0, 0.4.0, 0.3.1, 0.1.3)
CoreEx is a proposal for a standard library extension.
highline (1.2.0, 1.0.1)
HighLine is a high-level command-line IO library.
ruby_ex (0.4.6.2, 0.4.5.0, 0.3.0, 0.2.0, 0.1.2)
RubyEx contains general purpose Ruby extensions.
rubygems-update (0.8.11)
RubyGems Update GEM
sources (0.0.1)
This package provides download sources for remote gem installation
ttk (0.2.1)
TTK is an extensible framework for dynamic testing.
vcs (0.5.2.4, 0.4.1, 0.4.0, 0.3.0, 0.2.148, 0.1)
A wrapper over Version Control Systems
C'est peut-être une mise à jour de Ruby (dans Debian unstable) qui a
cassé Vcs. C'est grave docteur ?
Notes:
[1] Encore une satanée allergie printanière, sans doute ! :)
https://svn.lrde.epita.fr/svn/xrm/trunk
Index: ChangeLog
from SIGOURE Benoit <sigoure.benoit(a)lrde.epita.fr>
Fix (almost completely) the PCTL/CSL grammar.
Most of the PCTL files in the test suite are now parsed correctly (95
out of 103). The remaining failing PCTL files fail because of a
problem illustrated in the new test longuest-exp-match.pctl:
1 + 2 + 3<=4
must be parsed as: (1 + 2 + 3)<=4
However the current grammar yields the following extra possibilities:
(1) (+2 + 3)<=4
(1) (+2) (+3)<=4
(1 + 2) (+3)<=4
...
So basically we need a way to match the longuest Expression possible
around binary operators. Besides that, our implementation of the PCTL
grammar seems to be correct.
* src/syn/pctl/PCTL-Property.sdf: Fix priorities.
* src/syn/pctl/PCTL-Reward.sdf: Import PCTL-Formula.
* THANKS: Bring up to date.
* tests/pctl/longuest-exp-match.pctl: New.
THANKS | 15 ++++++++++--
src/syn/pctl/PCTL-Property.sdf | 44 ++++++++++++++++++++++++++++---------
src/syn/pctl/PCTL-Reward.sdf | 1
tests/pctl/longuest-exp-match.pctl | 16 +++++++++++++
4 files changed, 64 insertions(+), 12 deletions(-)
Index: src/syn/pctl/PCTL-Property.sdf
--- src/syn/pctl/PCTL-Property.sdf (revision 59)
+++ src/syn/pctl/PCTL-Property.sdf (working copy)
@@ -48,6 +48,8 @@
%% EBNF Grammar: PCTL Properties as in PRISM's parser
%%
+ %% PCTLImplies ::= PCTLOr ["=>" PCTLOr]
+ %%
%% PCTLOr ::= PCTLAnd ["|" PCTLAnd]
%%
%% PCTLAnd ::= PCTLNot ["&" PCTLNot]
@@ -139,10 +141,15 @@
%% The two following are inherited by Expression -> Property (see below)
%%"true" -> Property {cons("True")}
%%"false" -> Property {cons("False")}
- Property "=>" Property -> Property {cons("Implies")}
- Property "|" Property -> Property {cons("Or")}
- Property "&" Property -> Property {cons("And")}
- "!" Property -> Property {cons("Not")}
+ Property "=>" Property -> Property {left,cons("Implies")}
+ %% FIXME: This is a dirty hack. See the FIXME about it in the priorities
+ %% below...
+ Expression "=>" Expression -> Property {left,cons("Implies")}
+ Expression "=>" Property -> Property {left,cons("Implies")}
+ Property "=>" Expression -> Property {left,cons("Implies")}
+ Property "|" Property -> Property {left,cons("PropOr")}
+ Property "&" Property -> Property {left,cons("PropAnd")}
+ "!" Property -> Property {cons("PropNot")}
"P" "<" Expression "[" Path Filter? "]" -> Property {cons("ProbLt")}
"P" "<=" Expression "[" Path Filter? "]" -> Property {cons("ProbLtEq")}
@@ -172,32 +179,49 @@
"\"init\"" -> Property {cons("Init")}
"\"" Identifier "\"" -> Property {cons("Label")}
- Expression -> Property
+ Expression -> Property {cons("Exp2Prop")}
"(" Property ")" -> Property {bracket}
- %% FIXME: Some priorities are probably missing here
context-free priorities
- {
+ {left:
Property "=>" Property -> Property
+ %% FIXME: This is a dirty hack. See the next FIXME.
+ Expression "=>" Expression -> Property
+ Expression "=>" Property -> Property
+ Property "=>" Expression -> Property
}
- > {
+ > {left:
Property "|" Property -> Property
}
- > {
+ > {left:
Property "&" Property -> Property
}
> {
"!" Property -> Property
}
+ %% FIXME: The following priority will prevent things such as:
+ %% Expression "=>" Expression -> Property
+ %% Expression "=>" Property -> Property
+ %% Property "=>" Expression -> Property
+ %% It seems we can't easily work around this problem because SDF priorities
+ %% are transitive. Instead these problematic cases have been hard coded in
+ %% the grammar :(
> {
Expression -> Property
}
- %% FIXME: This looks a bit weird...
context-free priorities
{
"(" Formula ")" -> Formula
}
> {
+ Property -> Formula
+ }
+
+ context-free priorities
+ {
"(" Property ")" -> Property
}
+ > {
+ Expression -> Property
+ }
Index: src/syn/pctl/PCTL-Reward.sdf
--- src/syn/pctl/PCTL-Reward.sdf (revision 59)
+++ src/syn/pctl/PCTL-Reward.sdf (working copy)
@@ -1,6 +1,7 @@
module PCTL-Reward
imports
PRISM-Expression
+ PCTL-Formula
exports
%% EBNF Grammar: Rewards in PCTL
Index: THANKS
--- THANKS (revision 59)
+++ THANKS (working copy)
@@ -1,3 +1,14 @@
Martin Bravenboer <martin(a)cs.uu.nl>
- For his dedicated support on IRC and the time he took to understand and
- solve the problems.
+ For his dedicated support on IRC and the huge amount of time he took to
+ understand and solve so many problems.
+
+Eelco Visser <visser(a)acm.org>
+ For his support on IRC.
+
+Akim Demaille <akim(a)lrde.epita.fr>
+ For his precious comments and continuous review of the work done on XRM. He
+ is also the one who had first suggested to have a dedicated tool to solve
+ the problems that PRISM has, using program transformation.
+
+Michael Cadilhac <micha(a)lrde.epita.fr>
+ For his beta-testing, his suggestions and many (good) ideas.
Index: tests/pctl/longuest-exp-match.pctl
--- tests/pctl/longuest-exp-match.pctl (revision 0)
+++ tests/pctl/longuest-exp-match.pctl (revision 0)
@@ -0,0 +1,16 @@
+1 + 2 + 3<=4
+
+//good:
+// (1 + 2 + 3)<=4
+
+//baddies:
+
+// (1)
+// (+2 + 3)<=4
+
+// (1)
+// (+2)
+// (+3)<=4
+
+// (1 + 2)
+// (+3)<=4