|
definition: |
limitSearchTree :: Int -> SearchTree a -> SearchTree a
limitSearchTree _ v@(Value _) = v
limitSearchTree _ f@(Fail _) = f
limitSearchTree n (Or t1 t2) =
if n<0 then Fail (-1)
else Or (limitSearchTree (n-1) t1) (limitSearchTree (n-1) t2)
|
|
demand: |
argument 2 |
|
deterministic: |
deterministic operation |
|
documentation: |
| Limit the depth of a search tree. Branches which a depth larger than the first argument are replace by `Fail (-1)`. |
|
failfree: |
(_, _) |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,{Value}) |-> {Value} || (_,{Fail}) |-> {Fail} || (_,{Or}) |-> {Fail,Or}}
|
|
name: |
limitSearchTree |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
Prelude.Int -> SearchTree a -> SearchTree a |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |