Skip to content

Commit

Permalink
Removed ops from cost model test_regression41
Browse files Browse the repository at this point in the history
  • Loading branch information
anhnamtran committed Jul 17, 2018
1 parent 17a0eb0 commit 6869828
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/cost_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ def test_regression41(self):
xs.add(h);
"""
)
ops = []
e1 = ECond(EBinOp(EMapGet(EStateVar(EMakeMap2(EMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var3821').with_type(THandle('H', TNative('Value'))), EGetField(EVar('_var3821').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value')))).with_type(TBag(TNative('Value'))), ELambda(EVar('_var3818').with_type(TNative('Value')), EUnaryOp('len', EFilter(EMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var3821').with_type(THandle('H', TNative('Value'))), EGetField(EVar('_var3821').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value')))).with_type(TBag(TNative('Value'))), ELambda(EVar('_var3819').with_type(TNative('Value')), EBinOp(EVar('_var3818').with_type(TNative('Value')), '==', EVar('_var3819').with_type(TNative('Value'))).with_type(TBool()))).with_type(TBag(TNative('Value')))).with_type(TInt()))).with_type(TMap(TNative('Value'), TInt()))).with_type(TMap(TNative('Value'), TInt())), EGetField(EVar('x').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value'))).with_type(TInt()), '>', ENum(1).with_type(TInt())).with_type(TBool()), EEmptyList().with_type(TBag(TNative('Value'))), ESingleton(EGetField(EVar('x').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value'))).with_type(TBag(TNative('Value')))).with_type(TBag(TNative('Value')))
e2 = ECond(EBinOp(EMapGet(EStateVar(EMakeMap2(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var3821').with_type(THandle('H', TNative('Value'))), EMapGet(EMakeMap2(EMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var3821').with_type(THandle('H', TNative('Value'))), EGetField(EVar('_var3821').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value')))).with_type(TBag(TNative('Value'))), ELambda(EVar('_var3818').with_type(TNative('Value')), EUnaryOp('len', EFilter(EMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var3821').with_type(THandle('H', TNative('Value'))), EGetField(EVar('_var3821').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value')))).with_type(TBag(TNative('Value'))), ELambda(EVar('_var3819').with_type(TNative('Value')), EBinOp(EVar('_var3818').with_type(TNative('Value')), '==', EVar('_var3819').with_type(TNative('Value'))).with_type(TBool()))).with_type(TBag(TNative('Value')))).with_type(TInt()))).with_type(TMap(TNative('Value'), TInt())), EGetField(EVar('_var3821').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value'))).with_type(TInt()))).with_type(TMap(THandle('H', TNative('Value')), TInt()))).with_type(TMap(THandle('H', TNative('Value')), TInt())), EVar('x').with_type(THandle('H', TNative('Value')))).with_type(TInt()), '>', ENum(1).with_type(TInt())).with_type(TBool()), EEmptyList().with_type(TBag(TNative('Value'))), ESingleton(EGetField(EVar('x').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value'))).with_type(TBag(TNative('Value')))).with_type(TBag(TNative('Value')))
assert_cmp(e1, cost_of(e1), e2, cost_of(e2), Cost.BETTER, assumptions=EBinOp(EBinOp(EUnaryOp('unique', EVar('xs').with_type(TBag(THandle('H', TNative('Value'))))).with_type(TBool()), 'and', EBinOp(EVar('x').with_type(THandle('H', TNative('Value'))), 'in', EVar('xs').with_type(TBag(THandle('H', TNative('Value'))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var19').with_type(THandle('H', TNative('Value'))), ESingleton(EVar('_var19').with_type(THandle('H', TNative('Value')))).with_type(TBag(THandle('H', TNative('Value')))))).with_type(TBag(THandle('H', TNative('Value')))), '+', ESingleton(EVar('x').with_type(THandle('H', TNative('Value')))).with_type(TBag(THandle('H', TNative('Value'))))).with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var20').with_type(THandle('H', TNative('Value'))), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var19').with_type(THandle('H', TNative('Value'))), ESingleton(EVar('_var19').with_type(THandle('H', TNative('Value')))).with_type(TBag(THandle('H', TNative('Value')))))).with_type(TBag(THandle('H', TNative('Value')))), '+', ESingleton(EVar('x').with_type(THandle('H', TNative('Value')))).with_type(TBag(THandle('H', TNative('Value'))))).with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var21').with_type(THandle('H', TNative('Value'))), EBinOp(EUnaryOp('not', EBinOp(EVar('_var20').with_type(THandle('H', TNative('Value'))), '==', EVar('_var21').with_type(THandle('H', TNative('Value')))).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EGetField(EVar('_var20').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value')), '==', EGetField(EVar('_var21').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value'))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var3097').with_type(THandle('H', TNative('Value'))), ESingleton(EVar('_var3097').with_type(THandle('H', TNative('Value')))).with_type(TBag(THandle('H', TNative('Value')))))).with_type(TBag(THandle('H', TNative('Value')))), '+', ESingleton(EVar('x').with_type(THandle('H', TNative('Value')))).with_type(TBag(THandle('H', TNative('Value'))))).with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var3098').with_type(THandle('H', TNative('Value'))), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('xs').with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var3097').with_type(THandle('H', TNative('Value'))), ESingleton(EVar('_var3097').with_type(THandle('H', TNative('Value')))).with_type(TBag(THandle('H', TNative('Value')))))).with_type(TBag(THandle('H', TNative('Value')))), '+', ESingleton(EVar('x').with_type(THandle('H', TNative('Value')))).with_type(TBag(THandle('H', TNative('Value'))))).with_type(TBag(THandle('H', TNative('Value')))), ELambda(EVar('_var3099').with_type(THandle('H', TNative('Value'))), EBinOp(EUnaryOp('not', EBinOp(EVar('_var3098').with_type(THandle('H', TNative('Value'))), '==', EVar('_var3099').with_type(THandle('H', TNative('Value')))).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EGetField(EVar('_var3098').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value')), '==', EGetField(EVar('_var3099').with_type(THandle('H', TNative('Value'))), 'val').with_type(TNative('Value'))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool()), ops=ops)
Expand Down

0 comments on commit 6869828

Please sign in to comment.