FormalADL / kAADL

1 stars 1 forks source link

Researchful Question 04 #13

Closed suweining closed 9 years ago

suweining commented 10 years ago

I still remember the Error02 6) clearly. It is about AmbInverseOfUniFetGroupTypeRef which is an ambiguity non-terminal and did not directly deduced to a terminal product. We discuss the solution and decided to unfold AmbInverseOfUniFetGroupTypeRef to terminal products.

But in Error03 1),I try to solve it by imports:

syntax AmbCmpCategoryUniCmpClassifierRef ::= CmpCategory UniCmpClassifierRef

And it is clear that AmbCmpCategoryUniCmpClassifierRef must be a terminal product.

I thought this easily imports would not solve the ambiguity beacuase it same to Error02 6).

However,kompile and krun ,then the answer is :

[0, 2.782 ms]

package TypeExample public system File_System features root : requires data access FileSystem :: Directory . hashed ; end File_System ; process Application features result : out data port App :: result_type ; home : requires data access FileSystem :: Directory . hashed ; end Application ; thread Calculate prototypes data_type : data ; features input : in data port data_type ; result : out data port data_type ; end Calculate ; thread Compute_Distance extends Calculate ( data_type => data App :: Distance ) end Compute_Distance ; end TypeExample ;

[Warning] Inner Parser: Parsing ambiguity. Arbitrarily choosing the first. 1: UniCmpTypeRef ::= PkgName MDoubleColon Id App :: result_type 2: UniCmpImplRef ::= PkgName MDoubleColon CmpImplName App :: result_type File: ../tests/unit/ComponentTypes.aadl Location: (10,26,10,42) Compilation Phase: Ambiguity filter [Warning] Inner Parser: Parsing ambiguity. Arbitrarily choosing the first. 1: UniCmpTypeRef ::= PkgName MDoubleColon Id App :: Distance 2: UniCmpImplRef ::= PkgName MDoubleColon CmpImplName App :: Distance File: ../tests/unit/ComponentTypes.aadl Location: (22,62,22,75) Compilation Phase: Ambiguity filter

This is researchful !