Knowledge

Strict function

Source 📝

22: 253:
in languages inspired by C, may be thought of as a function of three parameters. This function is strict in its first parameter, since the function must know whether its first argument evaluates to true or to false before it can return; but it is non-strict in its second parameter, because (for
213:, denotes an expression that does not return a normal value, either because it loops endlessly or because it aborts due to an error such as division by zero. A function that is not strict is called 236:; a non-strict function is one that might not evaluate some of its arguments. Functions having more than one parameter can be strict or non-strict in each parameter independently, as well as 185: 425: 405: 385: 362: 342: 322: 298: 274: 205: 442:
refers to any algorithm used to prove the strictness of a function with respect to one or more of its arguments. Such functions can be
105: 39: 528: 432: 127: 86: 43: 58: 533: 65: 218: 443: 156: 72: 473: 523: 54: 32: 435: 147: 139: 143: 123: 439: 447: 225: 79: 463: 410: 390: 370: 347: 327: 307: 283: 259: 190: 119: 468: 517: 451: 493: 209: 134:
if, when applied to a non-terminating expression, it also fails to terminate. A
21: 233: 302:. However, it is jointly strict in its second and third parameters, since 229: 278:, as well as non-strict in its third parameter, because (for example) 249: 15: 221:
is one in which user-defined functions are always strict.
454:, without changing the meaning of the enclosing program. 228:. Operationally, a strict function is one that always 413: 393: 373: 350: 330: 310: 286: 262: 193: 159: 46:. Unsourced material may be challenged and removed. 419: 399: 379: 356: 336: 316: 292: 268: 199: 179: 247:expression of many programming languages, called 224:Intuitively, non-strict functions correspond to 494:"A Gentle Introduction to Haskell: Functions" 8: 180:{\displaystyle f\left(\perp \right)=\perp } 412: 392: 372: 349: 329: 309: 285: 261: 192: 158: 106:Learn how and when to remove this message 485: 240:in several parameters simultaneously. 7: 44:adding citations to reliable sources 14: 20: 31:needs additional citations for 1: 219:strict programming language 550: 474:Short-circuit evaluation 529:Denotational semantics 436:functional programming 421: 420:{\displaystyle \perp } 401: 400:{\displaystyle \perp } 381: 380:{\displaystyle \perp } 358: 357:{\displaystyle \perp } 338: 337:{\displaystyle \perp } 318: 317:{\displaystyle \perp } 294: 293:{\displaystyle \perp } 270: 269:{\displaystyle \perp } 201: 200:{\displaystyle \perp } 181: 140:denotational semantics 422: 402: 382: 359: 339: 319: 295: 271: 202: 182: 144:programming languages 446:to a more efficient 411: 391: 371: 348: 328: 308: 284: 260: 191: 157: 124:computer programming 40:improve this article 534:Evaluation strategy 440:strictness analysis 243:As an example, the 448:calling convention 417: 397: 377: 354: 334: 314: 290: 266: 226:control structures 197: 177: 116: 115: 108: 90: 55:"Strict function" 541: 508: 507: 505: 504: 490: 464:Eager evaluation 427: 426: 424: 423: 418: 406: 404: 403: 398: 386: 384: 383: 378: 364: 363: 361: 360: 355: 343: 341: 340: 335: 323: 321: 320: 315: 301: 299: 297: 296: 291: 277: 275: 273: 272: 267: 252: 246: 206: 204: 203: 198: 186: 184: 183: 178: 173: 130:f is said to be 120:computer science 111: 104: 100: 97: 91: 89: 48: 24: 16: 549: 548: 544: 543: 542: 540: 539: 538: 514: 513: 512: 511: 502: 500: 498:www.haskell.org 492: 491: 487: 482: 469:Lazy evaluation 460: 409: 408: 389: 388: 369: 368: 366: 346: 345: 326: 325: 306: 305: 303: 282: 281: 279: 258: 257: 255: 248: 244: 189: 188: 163: 155: 154: 136:strict function 112: 101: 95: 92: 49: 47: 37: 25: 12: 11: 5: 547: 545: 537: 536: 531: 526: 524:Formal methods 516: 515: 510: 509: 484: 483: 481: 478: 477: 476: 471: 466: 459: 456: 416: 396: 376: 353: 333: 313: 289: 265: 238:jointly strict 196: 187:. The entity 176: 172: 169: 166: 162: 114: 113: 28: 26: 19: 13: 10: 9: 6: 4: 3: 2: 546: 535: 532: 530: 527: 525: 522: 521: 519: 499: 495: 489: 486: 479: 475: 472: 470: 467: 465: 462: 461: 457: 455: 453: 452:call by value 449: 445: 441: 437: 434: 429: 414: 394: 374: 351: 331: 311: 287: 263: 251: 241: 239: 235: 231: 227: 222: 220: 216: 212: 211: 194: 174: 170: 167: 164: 160: 152: 149: 145: 141: 137: 133: 129: 125: 121: 110: 107: 99: 88: 85: 81: 78: 74: 71: 67: 64: 60: 57: –  56: 52: 51:Find sources: 45: 41: 35: 34: 29:This article 27: 23: 18: 17: 501:. Retrieved 497: 488: 430: 245:if-then-else 242: 237: 223: 214: 208: 150: 135: 131: 117: 102: 93: 83: 76: 69: 62: 50: 38:Please help 33:verification 30: 518:Categories 503:2016-06-23 480:References 450:, such as 438:language, 433:non-strict 280:if(true,2, 215:non-strict 175:=⊥ 66:newspapers 415:⊥ 395:⊥ 375:⊥ 367:if(false, 352:⊥ 332:⊥ 312:⊥ 288:⊥ 264:⊥ 256:if(false, 254:example) 230:evaluates 207:, called 195:⊥ 168:⊥ 96:July 2016 458:See also 444:compiled 304:if(true, 234:argument 148:function 128:function 276:,1) = 1 138:in the 80:scholar 210:bottom 153:where 132:strict 82:  75:  68:  61:  53:  431:In a 300:) = 2 146:is a 87:JSTOR 73:books 407:) = 365:and 344:) = 232:its 217:. A 126:, a 122:and 59:news 142:of 118:In 42:by 520:: 496:. 428:. 250:?: 506:. 387:, 324:, 171:) 165:( 161:f 151:f 109:) 103:( 98:) 94:( 84:· 77:· 70:· 63:· 36:.

Index


verification
improve this article
adding citations to reliable sources
"Strict function"
news
newspapers
books
scholar
JSTOR
Learn how and when to remove this message
computer science
computer programming
function
denotational semantics
programming languages
function
bottom
strict programming language
control structures
evaluates
argument
?:
non-strict
functional programming
strictness analysis
compiled
calling convention
call by value
Eager evaluation

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.