|
definition: |
applyPrimDTerm :: String -> [DTerm] -> Maybe DTerm
applyPrimDTerm f args
| f `elem` allStrictOps
= if DBot `elem` args
then Just DBot -- these primitive operations are strict in all arguments
else Just CutVar -- otherwise we do not know anything
| f `elem` fstP2StrictOps
= if head args == DBot
then Just DBot -- strict in first argument
else Just (args!!1) -- otherwise it is as most defined as second argument
| f == "failed"
= Just DBot -- result of failed is always undefined
| otherwise = Nothing
where
-- operations strict in all arguments
allStrictOps = ["+","-","*","mod","div","<","<=",">",">=","==","/=",
"=:=","show","isEmpty"]
-- operations strict in first argument and projection on second argument
fstP2StrictOps = ["cond","set1"]
|
|
demand: |
no demanded arguments |
|
deterministic: |
deterministic operation |
|
documentation: |
Abstract application of a primitive operation to abstract terms. The result is Nothing if this application is not defined, e.g., becuase the operation is not a primitive one. |
|
failfree: |
<FAILING> |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_) |-> {Just,Nothing}}
|
|
name: |
applyPrimDTerm |
|
precedence: |
no precedence defined |
|
result-values: |
{Just,Nothing}
|
|
signature: |
String -> [DTerm] -> Prelude.Maybe DTerm |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |