美文网首页
CoC- declaration and definition

CoC- declaration and definition

作者: SteveW_775f | 来源:发表于2018-05-30 10:14 被阅读0次

    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

          本文链接:https://www.haomeiwen.com/subject/fdktsftx.html