Page 1 of 1

Definition of property as a predicate

Posted: 19 Feb 2015 12:25
by Peter Muraya

Code: Select all

 /* interface test     domains          optimum_function = (real*)->real.       properties          optimum:optimum_function. end interface   class test:test end class   implement test     facts          optimum:optimum_function:=erroneous. end implement */     interface test     properties          optimum:(real*)->real. end interface   class test:test end class   implement test     facts          optimum:(real*)->real:=erroneous. end implement     implement main      clauses      run():-           console::init(),           succeed(). % place your own code here end implement main   goal     mainExe::run(main::run).

Posted: 19 Feb 2015 16:09
by Thomas Linder Puls
I believe there was a reason, but I have forgotten which. So we may change this in future releases.

Posted: 19 Feb 2015 17:52
by Martin Meyer
I suppose, such syntax cannot be allowed, because that leads to semantic ambiguity:

When a fact, which has a function type, could be declared in the way

Code: Select all

facts     optimum : (real*) -> real.
then it should work in the same way to declare a fact having a predicate type by

Code: Select all

facts     optimum : (real*).
The later fact declaration is indeed legal, but it has already an other meaning than a fact having a predicate type.

Regards
Martin

Definition of property as a predicate

Posted: 20 Feb 2015 10:58
by Peter Muraya
The point a semantic ambiguity makes sense. Thanks.

Posted: 20 Feb 2015 12:13
by Thomas Linder Puls
Yes, I believe that was in deed the reason.