Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7602565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:26:35+00:00 2026-05-30T23:26:35+00:00

I have a question about the: Record and Definition I have this definition: Definition

  • 0

I have a question about the: Record and Definition

I have this definition:

Definition rule := term -> term.

and I write a boolean function for it.

Definition beq_rule a b := beq_term a && beq_term b.

where beq_term : term -> term -> bool.

so my definition of beq_rule actually return exactly type of beq_term which is not what I want here. I want it return for me a type: rule -> rule -> bool.

So I changed a definition of rule by Record:

Record rule := mkRule {lhs : term; rhs : term}.

and

Definition beq_rule (a b : rule) : bool :=
 beq_term (lhs a) (lhs b) && beq_term (rhs a) (rhs b).

My question is that:

1) What is the different between my first defined rule used Definition and another used Record?

2) If I want to define rule by Definition can I give an alias lhs and rhs likes in Record definition?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:26:36+00:00Added an answer on May 30, 2026 at 11:26 pm

    Your two definitions of rule are saying totally different things

    Definition rule := term -> term
    

    is defining rule as a type (or Prop) alias of the function type term -> term. Hence

    Definition not_what_you_meant : rule := fun t => t.
    

    will happily compile.

    As to the relation between Record and Definition. Record is just a macro that converts into an Inductive. So

    Record rule := mkRule {lhs : term; rhs : term}.
    

    is the same as

    Inductive rule := mkRule : term -> term -> rule.
    

    plus accessor functions

    Definition lhs (r : rule) : term := 
     match r with
      mkRule l _ => l
     end.
    
    etc.
    

    You should think of Inductive as being fundamentally different from Definition. Definition defines an alias. Another way f saying this is Definitions are “referentially transparent”, you can (up to variable renaming) always substitute the right hand side of a definition for any occurrence of its name.

    Inductive on the other hand defines type (elements of Coqs universes) by listing off a set of constructors. In more logical way of thinking, Inductive defines a logical proposition in terms of its elimination/introduction rules in a way that ensures “harmony”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question about locking. This doesn't have to be only about record
I have a binary file with variable length record that looks about like this:
I have a question about the auto number, for example, I insert a record
I have a strange question about Linq. I have this query: var results =
I have a question about MySQL. I have this table structure: ID Name ------
hi all i have a question about hiding records in crystal report and i
I have question about normalization. Suppose I have an applications dealing with songs. First
I have question about interpreting strings as packed binary data in C++. In python,
i have question about YAJLiOS parser... I have next json data : {{ body
I have a question about whether or not a specific way of applying of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.