CoC- declaration and definition

2018-05-30  本文已影响0人  SteveW_775f

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).

上一篇下一篇

猜你喜欢

热点阅读