Code Monkey home page Code Monkey logo

Comments (2)

andrejbauer avatar andrejbauer commented on June 30, 2024

Yes, you can use derived rules. These are like rules, but you derive them from existing rules. They take the form derive P1 ... P2 -> C where Pi are premisess (written as in a rule) and C is a computation that computes a judgement (from the premises), the conclusion.

let mycong =
  derive (A type) ({x : A} B type) (a : A) (b : A) (a ≡ b : A as ξ) ->
    congruence B{a} B{b} ξ
;;

rule A type
rule B (x : A) type
rule C (x : A) (y : A) type
rule a : A
rule b : A
rule ξ : a ≡ b : A ;;

mycong A ({x:A} B x) a b ξ ;;

mycong A ({x:A} A) a b ξ ;;

mycong A ({x:A} C x a) a b ξ ;;

from andromeda.

mikeshulman avatar mikeshulman commented on June 30, 2024

Sorry, I think my example was too simple to get the point across. I had figured out how to write derived rules by reading tests/nucleus/derive.m31. Right now the AML function I'm trying to write cannot itself be replaced by a derived rule, but somewhere inside of it I need to apply a congruence rule where the "head" is an abstracted metavariable supplied by the user, and I was surprised to discover that using congruence was unstable because the form of what the user supplied would change the number of arguments required by congruence. But based on your answer I guess that the solution I had thought of is the intended one, so I'll go that way.

from andromeda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.