CoC- declaration and definition

Require Import ZArith.

Open Scope Z_scope.

Reset binomial_def.

Section binomial_def.

  Variables a b:Z.

  Definition binomial (z:Z):= a*z + b.

  Section trinomial_def.

  Variable c : Z.

  Definition trinomial (z:Z) := (binomial z) * z + c.

  End trinomial_def.

End binomial_def.

Print binomial.

Definition p1 : Z->Z := binomial 5 (-3).

Print p1.

Definition polynomial (x:Z) : Z := 2*x*x + 3*x +3.

Compute polynomial (-6).

你可能感兴趣的:(CoC- declaration and definition)