P icon indicating copy to clipboard operation
P copied to clipboard

Is it possible to check refinement?

Open nano-o opened this issue 3 years ago • 2 comments

Hello, in the Client Server example of the P tutorial, AbstractBankServer is supposed to be an abstraction of the composition of BankServer and Database. Is it possible to test whether every behavior produced by the composition of BankServer and Database is also a behavior of AbstractBankServer?

In the ModP paper, there is a refines keyword. So, I tried the following:

test tcSingleClientRefinement [main=TestWithSingleClient]:
  (union Client, Bank, { TestWithSingleClient }) refines (union Client, AbstractBank, { TestWithSingleClient });

Which fails with:

Parsing ..
Type checking ...
<Internal Error>:
 The method or operation is not implemented.
<Please report to the P team ([email protected]) or create an issue on GitHub, Thanks!>
   at Plang.Compiler.TypeChecker.ModuleSystemTypeChecker.CheckRefinementTest(RefinementTest test) in /home/runner/work/P/P/Src/PCompiler/CompilerCore/TypeChecker/ModuleSystemTypeChecker.cs:line 176
   at Plang.Compiler.TypeChecker.Analyzer.AnalyzeCompilationUnit(ITranslationErrorHandler handler, ProgramContext[] programUnits) in /home/runner/work/P/P/Src/PCompiler/CompilerCore/TypeChecker/Analyzer.cs:line 94
   at Plang.Compiler.Compiler.Compile(ICompilationJob job) in /home/runner/work/P/P/Src/PCompiler/CompilerCore/Compiler.cs:line 30
   at Plang.Compiler.CommandLine.Main(String[] args) in /home/runner/work/P/P/Src/PCompiler/CommandLine/CommandLine.cs:line 25

nano-o avatar May 19 '22 14:05 nano-o

In the most recent version of P, we have disabled refinement checking. We will be soon releasing an upgraded version of the refinement checker.

ankushdesai avatar May 20 '22 18:05 ankushdesai

Okay, thanks. Looking forward to the new release!

nano-o avatar May 20 '22 22:05 nano-o