nhatminhle / cofoja

Contracts for Java
GNU Lesser General Public License v3.0
151 stars 18 forks source link

How to write assertion of type A implies B? #34

Closed nhatminhle closed 9 years ago

nhatminhle commented 9 years ago

From sagarf...@gmail.com on August 07, 2011 21:51:00

What steps will reproduce the problem? 1. In a contract I need to mention that @Ensures("isEmpty() implies result== null")

  1. how can I write such type of assertion A implies B in cofoja.
  2. Which is latest jar file of cofoja? What is the expected output? What do you see instead? Getting error for "implies" keyword What version of the product are you using? On what operating system? cofoja-current.jar, vista os. Please provide any additional information below. Is there any tutorial or details available about different types of conditions (pre/post) i.e assertions that we can write using cofoja?

Original issue: http://code.google.com/p/cofoja/issues/detail?id=32

nhatminhle commented 9 years ago

From leochat...@gmail.com on August 08, 2011 06:09:53

Hi Sagar, please use the discussion group for questions ( https://groups.google.com/forum/#!forum/cofoja )

there's no imply operator (we removed it a while ago, please see discussion here https://groups.google.com/forum/#!topic/cofoja/gSnC3iV3Zes )

To write A -> B, you can write !A || B, which has the same logical value.

The latest jar file is the latest file on the downloads section. You can find information about how to use cofoja on the wiki (check AddContracts , QuickReference and HowToWriteGoodContracts). Thanks

Status: Invalid

nhatminhle commented 9 years ago

From leochat...@gmail.com on August 08, 2011 06:10:07

Issue 31 has been merged into this issue.