7 resultados para Recursive programming

em Nottingham eTheses


Relevância:

20.00% 20.00%

Publicador:

Resumo:

This paper is a tutorial on defining recursive descent parsers in Haskell. In the spirit of one-stop shopping, the paper combines material from three areas into a single source. The three areas are functional parsers, the use of monads to structure functional programs, and the use of special syntax for monadic programs in Haskell. More specifically, the paper shows how to define monadic parsers using do notation in Haskell. The paper is targeted at the level of a good undergraduate student who is familiar with Haskell, and has completed a grammars and parsing course. Some knowledge of functional parsers would be useful, but no experience with monads is assumed.

Relevância:

20.00% 20.00%

Publicador:

Resumo:

In functional programming, fold is a standard operator that encapsulates a simple pattern of recursion for processing lists. This article is a tutorial on two key aspects of the fold operator for lists. First of all, we emphasize the use of the universal property of fold both as a proof principle that avoids the need for inductive proofs, and as a definition principle that guides the transformation of recursive functions into definitions using fold. Secondly, we show that even though the pattern of recursion encapsulated by fold is simple, in a language with tuples and functions as first-class values the fold operator has greater expressive power than might first be expected.

Relevância:

20.00% 20.00%

Publicador:

Resumo:

Corecursive programs produce values of greatest fixpoint types, in contrast to recursive programs, which consume values of least fixpoint types. There are a number of widely used methods for proving properties of corecursive programs, including fixpoint induction, the take lemma, and coinduction. However, these methods are all rather low level, in that they do not exploit the common structure that is often present in corecursive definitions. We argue for a more structured approach to proving properties of corecursive programs. In particular, we show that by writing corecursive programs using a simple operator that encapsulates a common pattern of corecursive definition, we can then use high-level algebraic properties of this operator to conduct proofs in a purely calculational style that avoids the use of inductive or coinductive methods.

Relevância:

20.00% 20.00%

Publicador:

Resumo:

While programming in a relational framework has much to offer over the functional style in terms of expressiveness, computing with relations is less efficient, and more semantically troublesome. In this paper we propose a novel blend of the functional and relational styles. We identify a class of "causal relations", which inherit some of the bi-directionality properties of relations, but retain the efficiency and semantic foundations of the functional style.

Relevância:

20.00% 20.00%

Publicador:

Resumo:

This paper reports the use of proof planning to diagnose errors in program code. In particular it looks at the errors that arise in the base cases of recursive programs produced by undergraduates. It describes two classes of error that arise in this situation. The use of test cases would catch these errors but would fail to distinguish between them. The system adapts proof critics, commonly used to patch faulty proofs, to diagnose such errors and distinguish between the two classes. It has been implemented in Lambda-clam, a proof planning system, and applied successfully to a small set of examples.

Relevância:

20.00% 20.00%

Publicador:

Resumo:

The liver is an important metabolic and endocrine organ in the fetus but the extent to which its hormone receptor (R) sensitivity is developmentally regulated in early life is not fully established. We, therefore, examined developmental changes in mRNA abundance for the growth hormone (GH) and prolactin (PRL) receptors (R) plus insulin-like growth factor (IGF)-I and –II and their receptors. Fetal and postnatal sheep were sampled at either 80, or 140 days gestation, 1, 30 days or six months of age. The effect of maternal nutrient restriction between early to mid (i.e. 28 to 80 days gestation, the time of early liver growth) gestation on gene expression was also examined in the fetus and juvenile offspring. Gene expression for the GHR, PRLR and IGF-IR increased through gestation peaking at birth, whereas IGF-I was maximal near to term. In contrast, IGF-II mRNA decreased between mid and late gestation to increase after birth whereas IGF-IIR remained unchanged. A substantial decline in mRNA abundance for GHR, PRLR and IGF-IR then occurred up to six months. Maternal nutrient restriction reduced GHR and IGF-IIR mRNA abundance in the fetus, but caused a precocious increase in the PRLR. Gene expression for IGF-I and –II were increased in juvenile offspring born to nutrient restricted mothers. In conclusion, there are marked differences in the developmental ontogeny and nutritional programming of specific hormones and their receptors involved in hepatic growth and development in the fetus. These could contribute to changes in liver function during adult life.

Relevância:

20.00% 20.00%

Publicador:

Resumo:

This study investigated the developmental and nutritional programming of two important mitochondrial proteins, namely voltage dependent anion channel (VDAC) and cytochrome c in the sheep kidney, liver and lung. The effect of maternal nutrient restriction between early to mid gestation (i.e. 28 to 80 days gestation, the period of maximal placental growth) on the abundance of these proteins was also examined in fetal and juvenile offspring. Fetuses were sampled at 80 and 140 days gestation (term ~147 days), and postnatal animals at 1 and 30 days and 6 months of age. The abundance of VDAC peaked at 140 days gestation in the lung, compared with 1 day after birth in the kidney and liver, whereas cytochrome c abundance was greatest at 140 days gestation in the liver, 1 day after birth in the kidney and 6 months of age in lungs. This differential ontogeny in mitochondrial protein abundance between tissues was accompanied with very different tissue specific responses to changes in maternal food intake. In the liver, maternal nutrient restriction only increased mitochondrial protein abundance at 80 days gestation, compared with no effect in the kidney. In contrast, in the lung mitochondrial protein abundance was raised near to term, whereas VDAC abundance was decreased by 6 months of age. These findings demonstrate the tissue specific nature of mitochondrial protein development that reflects differences in functional adaptation after birth. The divergence in mitochondrial response between tissues to maternal nutrient restriction early in pregnancy further reflects these differential ontogeny’s.