From 6869828e7a25045ff93d40ace07abf5b8d2f361a Mon Sep 17 00:00:00 2001 From: Andrew Tran Date: Tue, 17 Jul 2018 14:50:38 -0700 Subject: [PATCH] Removed ops from cost model test_regression41 --- tests/cost_model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/cost_model.py b/tests/cost_model.py index 041f0602..4cbf3c4b 100644 --- a/tests/cost_model.py +++ b/tests/cost_model.py @@ -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)